query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return this entity as an array
public function getArrayCopy() { return $this->object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray()\n {\n return $this->getEntity()->toArray();\n\t}", "public function toEntityArray()\n {\n $return = [];\n foreach ($this as $row) {\n $return[] = $row;\n }\n return $return;\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "public function toArray() {\n return $this->getData();\n }", "public function toArray()\n {\n if ($this->_checkRecordInstance()) {\n return $this->_entity->toArray();\n } else {\n return false;\n }\n }", "function asArray(){\n\t\t\t$array = $this->toArray( $this );\n\t\t\treturn $array;\n\t\t}", "public function toArray() {\n return json_decode(json_encode($this), true);\n }", "public function toArray() {\n return (array)$this;\n }", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function toArray() {\n return $this->array;\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "public function toArray()\r\n {\r\n return $this->data;\r\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray() {\n return $this->data;\n }", "public function toArray() {\n return $this->data;\n }", "public function __toArray()\n {\n return $this->toArray();\n }", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray() {\n\t\treturn $this->data;\n\t}", "public function toArray()\n {\n return $this->transform();\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->data;\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray() {\n\t\treturn $this->array;\n\t}", "public function toArray()\n {\n\n\n return $this->data;\n }", "public function asArray()\r\n {\r\n return $this->data;\r\n }", "public function toArray()\r\n\t{\r\n\t\treturn $this->m_data;\r\n\t}", "public function toArray()\n {\n return $this->getContent();\n }", "public function asArray(){\n return $this->data;\n }", "public function asArray()\n {\n return $this->data;\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray()\r\n {\r\n return $this->all()->toArray();\r\n }", "public function toArray() : array\n {\n return $this->data;\n }", "public /*array*/ function toArray()\n\t{\n\t\treturn $this->_data;\n\t}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray()\n {\n return $this->fetchData;\n }", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function __toArray ( )\n {\n return $this->toArray();\n }", "public function toArray() : array\n {\n return $this->all();\n }", "public function toArray()\n {\n return array_map(\n function ($value) {\n return $value instanceof Entity ? $value->toArray() : $value;\n\n }, $this->items\n );\n }", "public function getAsArray();", "public function toArray(): array\n {\n return $this->data;\n }", "public function toArray(): array\n {\n return $this->data;\n }", "public function toArray() {\n\t\treturn [\n\t\t\t'id' => $this->getId(),\n\t\t\t'name' => $this->getName()\n\t\t];\n\t}", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function toArray()\n {\n $a = parent::toArray();\n return $a;\n }", "public function toArray(): array\n {\n return (array) $this->result();\n }", "function to_array() {\n\t\tif ($this->id_field) {\n\t\t\t$return = array_merge($this->data, array($this->id_field=>$this->id));\n\t\t} else {\n\t\t\t$return = $this->data;\n\t\t}\n\n\t\treturn $return;\n\t}", "public function toArray()\n {\n\n }", "public function toArray(){\n\t\treturn json_decode(json_encode($this->rows), true);\n\t}", "function toArray()\n {\n $retorno = array();\n foreach ($this as $key => $value) {\n array_push($retorno, $value);\n }\n return $retorno;\n }", "public function as_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray()\n\t{\n\t\treturn array();\n\t}", "public function & toArray()\n\t{\n\t\t$x = new ArrayObject($this->data);\n\t\treturn $x;\n\t}", "public function toArray()\n {\n return iterator_to_array($this);\n }", "public function toArray()\n {\n return $this->toArrayRecursive($this);\n }", "public function toArray()\n {\n return $this->attributesToArray();\n }", "public function toArray()\n {\n return $this->attributesToArray();\n }", "public function toArray()\n {\n return ['rows' => $this->rows] + parent::toArray();\n }", "public function toArray()\n {\n return $this->getList()->toArray();\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return (array)$this->properties;\n }", "public function toArray()\n {\n return [\n 'id' => $this->getId(),\n 'userId' => $this->getUserId(),\n 'hash' => $this->getHash()\n ];\n }", "public function to_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray(): array {\n\t\treturn $this->array;\n\t}", "public function data()\n {\n return static::toArray($this);\n }", "public function toArray()\n {\n $a = parent::toArray();\n $a['data'] = $this->data;\n\n return $a;\n }", "public function toArray()\n\t{\n\t\treturn $this->_d;\n\t}", "public function toArray()\n {\n return [\n 'id' => $this->id,\n 'data' => $this->data,\n 'name' => $this->name,\n 'checksum' => $this->checksum,\n 'children' => $this->children,\n 'events' => $this->events,\n ];\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return $this->query->findAll();\n }", "public function toArray()\n {\n return [\n 'id' => $this->getId(),\n 'amount' => [\n 'total' => $this->getTotal(),\n 'currency' => $this->getCurrency(),\n ],\n 'create_time' => $this->getCreateTime(),\n 'custom' => $this->getCustom(),\n 'state' => $this->getState(),\n 'invoice_number' => $this->getInvoiceNumber(),\n 'billing_agreement_id' => $this->getBillingAgreementId(),\n ];\n }", "public function toArray(): array {\n return $this->attributes()->toArray();\n }", "public function toArray($entity) {\n\t\treturn $this->_serializeEntity ( $entity );\n\t}", "public function toArray(): array\n\t{\n\t\treturn\n\t\t\t[\n\t\t\t\t\"id\" => $this->getId(),\n\t\t\t\t\"name\" => $this->name,\n\t\t\t\t\"completable\" => $this->completable,\n\t\t\t\t\"classes\" => $this->classes\n\t\t\t];\n\t}", "public function toArray()\n {\n return get_object_vars($this);\n }" ]
[ "0.8581495", "0.82213646", "0.7969703", "0.7914131", "0.7910198", "0.78909916", "0.7886248", "0.78718346", "0.7840867", "0.7840867", "0.78338456", "0.78039896", "0.7792743", "0.7789145", "0.7789145", "0.7789145", "0.778582", "0.778582", "0.7779249", "0.7772105", "0.77651167", "0.77575487", "0.77572596", "0.77572596", "0.77572596", "0.77572596", "0.77572596", "0.77572596", "0.7740941", "0.7740941", "0.77291024", "0.77221864", "0.771519", "0.7714717", "0.7682006", "0.7680544", "0.76666534", "0.7656588", "0.7642263", "0.7591414", "0.7580515", "0.7557252", "0.7557252", "0.7556691", "0.7556691", "0.7556691", "0.7556691", "0.75563025", "0.75563025", "0.75563025", "0.75563025", "0.75563025", "0.75563025", "0.75563025", "0.75563025", "0.75563025", "0.75563025", "0.7555263", "0.755467", "0.755467", "0.754236", "0.7537236", "0.7534811", "0.75216997", "0.7501111", "0.7501111", "0.74976", "0.74771065", "0.7469974", "0.7462713", "0.7438162", "0.74351215", "0.7431976", "0.7422692", "0.74193126", "0.741319", "0.7408901", "0.74008155", "0.7382915", "0.73772097", "0.73772097", "0.7365279", "0.73587465", "0.73512834", "0.7342487", "0.73417157", "0.73348165", "0.73297095", "0.73280424", "0.73120457", "0.7309627", "0.7308294", "0.7299013", "0.7299013", "0.72966176", "0.7292022", "0.7289906", "0.7280358", "0.72802466", "0.72771007", "0.72719496" ]
0.0
-1
Return the method name for the setter of a given variable Example: Converts 'user_id' to 'setUserId'
protected function getSetter($key) { $key = str_replace('_', ' ', $key); $key = ucwords($key); $key = str_replace(' ', '', $key); return 'set'.$key; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSetterName()\n {\n return \"set\" . self::underscoreToCamelCase($this->name,true);\n }", "function setter(string $property): string\n{\n return 'set' . Str::studly($property);\n}", "private function setterMethodName($parameter)\n {\n return 'set' . studly_case($parameter);\n }", "public function getMethodName($dbField)\n {\n return 'set' . ucfirst($this->convertToCamelCase($dbField));\n }", "public function getMutatorMethod($key)\n {\n $attribute = ucfirst(Str::camel($key));\n\n return \"set{$attribute}Value\";\n }", "protected function getColumnSetter($column) {\n return 'set' . $this->getColumnForParameter($column)->getPhpName();\n }", "protected static function columnToSetterFunc()\n {\n return function ($tableName, $columnName) {\n $words = explode('_', $columnName);\n\n if (count($words) <= 1) { // no table prefix\n $name = 'set' . ucfirst($columnName);\n } else {\n $tablePrefix = array_shift($words);\n $name = 'set' . implode('', array_map('ucfirst', $words));\n }\n\n return $name;\n };\n }", "protected function getServiceSetterName()\n {\n return 'setLogger';\n }", "public function setMethodName( $value ) {\r\n\t\t$this->method_name = $value;\r\n\t}", "function __set($attr_name, $value) {\n // in $attr_name, replace _ with \" \"\n $attr_name = str_replace('_', ' ', $attr_name);\n $attr_name = ucwords($attr_name);\n $attr_name = str_replace(' ', '', $attr_name);\n $function = \"set$attr_name\";\n //var_dump($function);\n $this->$function($value);\n }", "function setMethod($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }", "protected function variableToMethodString($variable_name) {\n $var_split = preg_split(\"/_/\", $variable_name);\n $return_string = \"\";\n foreach ($var_split as $var) {\n $return_string .= ucFirst($var);\n }\n return $return_string;\n }", "protected function smartyPropertyToSetter($property)\n {\n $words = explode('_', strtolower($property));\n\n $setter = 'set';\n foreach ($words as $word) {\n $setter .= ucfirst(trim($word));\n }\n\n return $setter;\n }", "function getter(string $property): string\n{\n return 'get' . Str::studly($property);\n}", "private function getPropertyName($methodName)\n {\n $pattern = implode('|', array_merge(self::$accessorPrefixes, self::$mutatorPrefixes));\n\n if (preg_match('/^('.$pattern.')(.+)$/i', $methodName, $matches)) {\n return $matches[2];\n }\n }", "protected function getMutatorName($value)\n {\n $value = ucwords(str_replace(['-', '_'], ' ', $value));\n\n return lcfirst(str_replace(' ', '', $value));\n }", "public function setterIze($offset)\n {\n return 'set' . str_replace(' ', '', ucwords(strtr($offset, '_-', ' ')));\n }", "public function getGetterName()\n {\n return \"get\" . self::underscoreToCamelCase($this->name,true);\n }", "final protected function createMutatorName(string $prefix, string $field): string\n {\n return ($prefix . \\str_replace('_', '', \\ucwords($field, '_')));\n }", "public function setName($value);", "public function stringtoMethod($string = null, $prefix = 'set')\n {\n if(empty($string) || is_numeric($string) || !strlen($string) > 2) {\n return false;\n }\n\n return $prefix.ucfirst($string);\n }", "public function getName(): string\n {\n if (!$this->useAlternateName) {\n return 'get' . $this->getPropertyName();\n } else {\n $methodName = 'get' . $this->getPropertyName() . 'By';\n\n $camelizedColumns = array_map([TDBMDaoGenerator::class, 'toCamelCase'], $this->foreignKey->getUnquotedLocalColumns());\n\n $methodName .= implode('And', $camelizedColumns);\n\n return $methodName;\n }\n }", "protected function getColumnSetter($name = 'version_column')\n {\n return 'set' . $this->getColumnPhpName($name);\n }", "private function getFieldNameFromMethodName($methodName)\n {\n $str = substr($methodName, 3); // removing 'get'\n $str = $this->lcfirst($str);\n $str = preg_replace('/([A-Z])/', '_$1', $str);\n return strtolower($str);\n }", "public static function set($varname, $varvalue, $method = null){\n \n self::load();\n \n if(is_null($method)){\n $method = self::method();\n }\n \n switch ( strtoupper($method) ) {\n \n case 'GET':\n self::$request->query->set($varname, $varvalue);\n break;\n \n case 'POST':\n self::$request->request->set($varname, $varvalue);\n break;\n }\n }", "function propertyName( $id );", "public function __set($_name, $_value);", "public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }", "public function __set($var, $value) { $this->{$this->_parameterMap[$var]} = $value; }", "public function __set ($variableName, $value) {\n // write\n }", "public function getSetName() {\r\n\t\treturn $this -> setname;\r\n\t}", "private function getMethodName($property)\n {\n $parts = explode('_', $property);\n $first = strtolower(array_shift($parts));\n\n $name = array_map(function($n) { return ucfirst(strtolower($n)); }, $parts);\n array_unshift($name, $first);\n\n return implode('', $name);\n }", "private function _generateSetter($columnName, array $column)\n {\n $method = new Zend_CodeGenerator_Php_Method();\n\n $method->setName('set' . ucfirst($columnName));\n $method->setBody('$this->_' . $columnName . ' = $' . $columnName . ';');\n\n $method->setParameter(\n array(\n 'name' => $columnName\n )\n );\n\n $docReturnTag = new Zend_CodeGenerator_Php_Docblock_Tag_Return(\n array(\n 'datatype' => 'void'\n )\n );\n\n $docParamTag = new Zend_CodeGenerator_Php_Docblock_Tag_Param(\n array(\n 'name' \t\t => $columnName,\n 'description'\t => 'Description.',\n 'datatype' => $this->_transformType($column['type'])\n )\n );\n\n $docblock = new Zend_CodeGenerator_Php_Docblock(\n array(\n 'shortDescription' => 'Sets ' . $columnName,\n 'tags' => array($docParamTag, $docReturnTag)\n )\n );\n\n $method->setDocblock($docblock);\n\n return $method;\n }", "public function set($variable, $value);", "private function setMethod(){\n\t\tif(!is_array($this->rawData) or !isset($this->rawData[1])){\n\t\t\treturn 'index';\n\t\t} else {\n\t\t\treturn $this->rawData[1];\n\t\t}\n\t}", "function getPropertyName() ;", "protected function getValueGeneratorMethodName($fieldName)\n {\n return 'get' . Str::studly($fieldName) . 'FakeValue';\n }", "public static function set()\n\t{\n\t\treturn static::$set_prefix . static::$set;\n\t}", "private function __set($name, $value)\n {\n// \tprint(\"Property set for [$name]<br/>\");\n if (method_exists($this, ($method = 'set_'.$name)))\n {\n $this->$method($value);\n }\n }", "abstract protected function handle_set($name,$value);", "function setName($value) \n {\n return $this->instance->setName($value);\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value) {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($name, $value ) {\r\n \r\n // first check whether the given name is valid attribute or not\r\n // for that we are gonna use a switch statement\r\n switch($name) {\r\n \r\n case \"username\" :\r\n $this -> first_name = $value;\r\n break;\r\n default : return \"Invalid\"; // when the passes attribute doesnt exist\r\n }\r\n }", "protected function getPseudodataMethodName($key) {\n return '_pseudo_' . $key;\n }", "function readable_name($variable){\n\t$variable = ucfirst($variable);\n\t$variable = str_replace('_',' ',$variable);\n\t$variable = preg_replace('/[0-9]+/','',$variable);\n\treturn $variable;\n}", "public function setValues(){\n if($this->getType() == \"var\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"int\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"bool\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"string\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"nil\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"label\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"type\"){\n $this->setValue($this->getArg());\n }else{\n $this->setValue(\"CHYBA\");\n }\n }", "public function setterForField($fieldName, $entity = null)\n {\n if (is_null($entity)) {\n $entity = $this->createEntity();\n } else if (is_string($entity)) {\n $entity = $this->createEntity($entity);\n }\n\n $fieldName = $this->getFieldName($fieldName, $entity);\n\n if ($fieldName) {\n $setterName = 'set' . ucfirst($fieldName);\n if (method_exists($entity, $setterName)) {\n return $setterName;\n }\n }\n\n return null;\n }", "public static function getMutator($property)\n {\n $class = get_called_class();\n\n $k = $class.':'.$property;\n if (!array_key_exists($k, self::$mutators)) {\n $inflector = Inflector::get();\n $method = 'set'.$inflector->camelize($property).'Value';\n\n if (!method_exists($class, $method)) {\n $method = false;\n }\n\n self::$mutators[$k] = $method;\n }\n\n return self::$mutators[$k];\n }", "public function __set($var, $value)\n {\n $this->{$this->parameterMap[$var]} = $value;\n }", "public function __set($var, $value)\n {\n $this->{$this->parameterMap[$var]} = $value;\n }", "public function __set($varName, $val)\n\t{\n\t\t$this->$varName = $val;\n\t\treturn $val;\n\t}", "public function testMethodSetName()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setName(\"One\");\n\n $name = $scorebox->getName();\n\n $expName = \"One\";\n\n $this->assertEquals($name, $expName);\n }", "public function getMethodName();", "public function getMethodName();", "public function getMethodName();", "public function createSetterMethodDeclaration($arg1) \n\t{\n\t\t$str = \"\";\n\t\t$str .= \"public function \".$arg1.\"(\\$\".$arg1.\")\\n{\\r\";\n\t\t$str .= \"\\t\\$this->\".$arg1.\" = \\$\".$arg1.\";\";\n\t\t$str .= \"\\n}\\n\\r\";\n\t\treturn $str;\n\t}", "static public function set($name, $value) {}", "function doGetterSetter() {\n\tglobal $description_obj;\n\tglobal $table_name, $class_name;\n\tglobal $tabs, $tab2, $tab3;\n\n\tfComment($tabs,\"Getters and Setters\");\n\tforeach($description_obj as $obj) {\n\t\t//print_r($obj);\n\n\t\techo $tabs,\"/// getter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function get_{$obj->Field}()\\t\\t{return \\$this->$obj->Field;}\\n\",\n\t\t\t $tabs,\"/// setter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function set_{$obj->Field}(\\$val)\\t{\\$this->$obj->Field = \",assignEscape($obj),\";}\\n\",\n\t\t\t \"\\n\";\n\t}\n\techo $tabs,\"public function get_last_error()\\t\\t{return \\$this->_last_error;}\\n\";\n\techo \"\\n\\n\";\n}", "protected function _setName($name, $value) {}", "protected function _getMethodNameForType($type = null) {\n\t\t$result = '_getValueForString';\n\t\tif (empty($type)) {\n\t\t\treturn $result;\n\t\t}\n\n\t\t$type = mb_strtolower($type);\n\t\t$methodName = '_getValueFor' . Inflector::camelize($type);\n\t\tif (method_exists($this, $methodName)) {\n\t\t\t$result = $methodName;\n\t\t}\n\n\t\treturn $result;\n\t}", "public function setProperty(string $property, $value) : InflectorInterface;", "public function __set($var, $val)\n\t{\n\t\tif(\"_\"==$var[0]) return;\n\t\t\n\t\t$this->$var = $val;\n\t}", "public static function var2member($var)\n {\n return self::camel2id(self::variablize($var));\n }", "function setName();", "function set_property(){\n }", "protected static function columnToGetterFunc()\n {\n return function ($tableName, $columnName) {\n $words = explode('_', $columnName);\n\n if (count($words) <= 1) { // no table prefix\n $name = 'get' . ucfirst($columnName);\n } else {\n $tablePrefix = array_shift($words);\n $name = 'get' . implode('', array_map('ucfirst', $words));\n }\n\n return $name;\n };\n }", "public static function setters();", "public function __set($var, $value)\n {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "private static function checkMagicGetterOrSetterProperty(\n StatementsAnalyzer $statements_analyzer,\n PhpParser\\Node\\Expr\\MethodCall $stmt,\n $fq_class_name\n ) {\n if (!$stmt->name instanceof PhpParser\\Node\\Identifier) {\n return true;\n }\n\n $method_name = strtolower($stmt->name->name);\n if (!in_array($method_name, ['__get', '__set'], true)) {\n return true;\n }\n\n $first_arg_value = $stmt->args[0]->value;\n if (!$first_arg_value instanceof PhpParser\\Node\\Scalar\\String_) {\n return true;\n }\n\n $prop_name = $first_arg_value->value;\n $property_id = $fq_class_name . '::$' . $prop_name;\n $codebase = $statements_analyzer->getCodebase();\n $class_storage = $codebase->classlike_storage_provider->get($fq_class_name);\n\n switch ($method_name) {\n case '__set':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_set_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyAssignment(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n // If a `@property` annotation is set, the type of the value passed to the\n // magic setter must match the annotation.\n $second_arg_type = isset($stmt->args[1]->value->inferredType)\n ? $stmt->args[1]->value->inferredType\n : null;\n\n if (isset($class_storage->pseudo_property_set_types['$' . $prop_name]) && $second_arg_type) {\n $pseudo_set_type = ExpressionAnalyzer::fleshOutType(\n $codebase,\n $class_storage->pseudo_property_set_types['$' . $prop_name],\n $fq_class_name,\n new Type\\Atomic\\TNamedObject($fq_class_name)\n );\n\n $type_match_found = TypeAnalyzer::isContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type,\n $second_arg_type->ignore_nullable_issues,\n $second_arg_type->ignore_falsable_issues,\n $has_scalar_match,\n $type_coerced,\n $type_coerced_from_mixed,\n $to_string_cast\n );\n\n if ($type_coerced) {\n if ($type_coerced_from_mixed) {\n if (IssueBuffer::accepts(\n new MixedTypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n } else {\n if (IssueBuffer::accepts(\n new TypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n }\n }\n\n if (!$type_match_found && !$type_coerced_from_mixed) {\n if (TypeAnalyzer::canBeContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type\n )) {\n if (IssueBuffer::accepts(\n new PossiblyInvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned possibly different type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n } else {\n if (IssueBuffer::accepts(\n new InvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n }\n }\n }\n break;\n\n case '__get':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_get_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyFetch(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n if (isset($class_storage->pseudo_property_get_types['$' . $prop_name])) {\n $stmt->inferredType = clone $class_storage->pseudo_property_get_types['$' . $prop_name];\n }\n\n break;\n }\n\n return true;\n }", "private function set_name($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"string\");\n\t\t$this->m_name = $v;\n\t\t$this->n_name = true;\n\t\treturn $this->m_name;\n\t}", "private function set_name($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"string\");\n\t\t$this->m_name = $v;\n\t\t$this->n_name = true;\n\t\treturn $this->m_name;\n\t}", "public function set($name, $value){}", "public function getPropertyName();", "public function getPropertyName();", "protected function _setNameValue($key, $name) {}", "public function __set($var, $value)\n {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function __set($var, $value)\n {\n $this->{$this->_parameterMap[$var]} = $value;\n }", "public function set(string $variableName, $value): void;", "function switching($var = \"\", $val = \"\") {\n\n $this->$var = $val;\n\n }", "public function __get($varName) {\n return $this->$varName;\n }", "private function _set($name, $value) {\n $methodName = 'set' . ucfirst($name);\n if(method_exists($this, $methodName)) {\n $this->$methodName($value);\n } else {\n $property = $name;\n $this->$property = $value;\n }\n }", "public function __set($var, $value)\n {\n $propertyName = $this->getPropertyName($var);\n if ($var != $propertyName) {\n // Also set the relevant fXX (ie. DeputyField) to match the alias supplied in $var (ie. ApiFieldname)\n $this->$propertyName = $value;\n }\n\n return parent::__set($var, $value);\n }", "private static function forgeMethodName($node, $prefix, $column)\n {\n $method_name = sprintf('%s%s', $prefix,\n $node->getPeer()->translateFieldName(self::getColumnConstant(get_class($node), $column),\n BasePeer::TYPE_COLNAME,\n BasePeer::TYPE_PHPNAME));\n return $method_name;\n }", "function getColumnSetter($column, $value, $singleQuotes = false, $prefix = 'this->')\n {\n if ($singleQuotes)\n {\n $value = sprintf(\"'%s'\", $value);\n }\n\n return sprintf('$%s%s->set(\\'%s\\', %s)', $prefix, $this->getSingularName(), $column->getName(), $value);\n }", "public function getVariableName(): string\n {\n return $this->var ?? $this->getValue();\n }", "function __set ( $name , $value )\n {\n $this->$name=$value;\n }", "function processMethods( &$method, $key )\r\n{\r\n $method = $method->name;\r\n}", "function set_user_notification_setting($user_guid, $method, $value) {\n\t$user_guid = (int)$user_guid;\n\t$method = sanitise_string($method);\n\n\t$user = get_entity($user_guid);\n\tif (!$user) {\n\t\t$user = elgg_get_logged_in_user_entity();\n\t}\n\n\tif (($user) && ($user instanceof ElggUser)) {\n\t\t$prefix = \"notification:method:$method\";\n\t\t$user->$prefix = $value;\n\t\t$user->save();\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "protected function assignVar($var) {\n\t\textract($this->vars, EXTR_OVERWRITE);\n\n\t\t$var = stripslashes($var);\n\t\t$command = explode('|', $var);\n\t\t$var = array_shift($command);\n\t\t$var = eval(\"return $\".$var.\";\");\n\n\t\tforeach ($command as $c) {\n\t\t\t$attr = explode('=', $c);\n\n\t\t\tswitch ($attr[0]) {\n\t\t\t\tcase 'capitalize':\n\t\t\t\t\t$var = strToUpper(substr($var, 0, 1)).substr($var, 1).\" \";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ($this->is_addon($attr[0])) {\n\t\t\t\t\t\t$var = $this->call_addon($var, self);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn $var;\n\t}", "function setMethod( $val){\n\t$this->_method = $val;\n\t}", "protected function getMethodName($key){\n\t\t$method = $this->getMethod($key);\n\t\t\n\t\treturn $method->getName();\n\t}", "function setName($value) {\n $this->name = $value;\n }" ]
[ "0.77010584", "0.7133158", "0.67792386", "0.6497578", "0.6461078", "0.64607704", "0.632203", "0.61418223", "0.6036828", "0.5963286", "0.5763751", "0.5756819", "0.5698017", "0.56674814", "0.5553794", "0.55533886", "0.55370986", "0.55077225", "0.54966855", "0.54821616", "0.54574376", "0.54147255", "0.5398416", "0.5393512", "0.53584313", "0.5349467", "0.5314528", "0.53093785", "0.53093785", "0.5299027", "0.52441275", "0.52378345", "0.51964915", "0.5191279", "0.5178766", "0.51604795", "0.51364285", "0.51358503", "0.51268315", "0.51254416", "0.511884", "0.5092579", "0.5092579", "0.5092579", "0.5092579", "0.5092579", "0.5092579", "0.5092579", "0.5092579", "0.5092579", "0.508685", "0.5080908", "0.5076963", "0.5075734", "0.5073519", "0.5067491", "0.5065885", "0.5065885", "0.50637376", "0.5055501", "0.5053786", "0.5053786", "0.5053786", "0.50365996", "0.50344133", "0.5028378", "0.501819", "0.5018188", "0.5016946", "0.5010483", "0.5003214", "0.49993306", "0.49986744", "0.49959546", "0.49920377", "0.49878892", "0.4986107", "0.49782014", "0.49782014", "0.49759358", "0.49750143", "0.49750143", "0.49633658", "0.49596", "0.49596", "0.49542907", "0.49537927", "0.49527204", "0.4948939", "0.4946836", "0.49396905", "0.49341786", "0.49243414", "0.49227142", "0.48922563", "0.48922306", "0.48890483", "0.48829126", "0.4880487", "0.48760813" ]
0.7297386
1
Determine whether the method being called is a getter or setter
protected function getMagicMethodType($method) { // If the method name is less than or equal to four characters // then it's not a getter or a setter if (strlen($method) <= 3) { throw new BadMethodCallException('Method not found'); } // Whether we are setting or getting $type = substr($method, 0, 3); if ($type !== 'get' and $type !== 'set') { throw new BadMethodCallException('Method not found'); } return $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_get() {\n return $this->method == 'get';\n }", "public static function isGet(): bool {\r\n return static :: isMethod('get');\r\n }", "public function isGet();", "public function isGet(): bool {}", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . studly_case($key) . 'Attribute');\n }", "private static function checkMagicGetterOrSetterProperty(\n StatementsAnalyzer $statements_analyzer,\n PhpParser\\Node\\Expr\\MethodCall $stmt,\n $fq_class_name\n ) {\n if (!$stmt->name instanceof PhpParser\\Node\\Identifier) {\n return true;\n }\n\n $method_name = strtolower($stmt->name->name);\n if (!in_array($method_name, ['__get', '__set'], true)) {\n return true;\n }\n\n $first_arg_value = $stmt->args[0]->value;\n if (!$first_arg_value instanceof PhpParser\\Node\\Scalar\\String_) {\n return true;\n }\n\n $prop_name = $first_arg_value->value;\n $property_id = $fq_class_name . '::$' . $prop_name;\n $codebase = $statements_analyzer->getCodebase();\n $class_storage = $codebase->classlike_storage_provider->get($fq_class_name);\n\n switch ($method_name) {\n case '__set':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_set_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyAssignment(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n // If a `@property` annotation is set, the type of the value passed to the\n // magic setter must match the annotation.\n $second_arg_type = isset($stmt->args[1]->value->inferredType)\n ? $stmt->args[1]->value->inferredType\n : null;\n\n if (isset($class_storage->pseudo_property_set_types['$' . $prop_name]) && $second_arg_type) {\n $pseudo_set_type = ExpressionAnalyzer::fleshOutType(\n $codebase,\n $class_storage->pseudo_property_set_types['$' . $prop_name],\n $fq_class_name,\n new Type\\Atomic\\TNamedObject($fq_class_name)\n );\n\n $type_match_found = TypeAnalyzer::isContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type,\n $second_arg_type->ignore_nullable_issues,\n $second_arg_type->ignore_falsable_issues,\n $has_scalar_match,\n $type_coerced,\n $type_coerced_from_mixed,\n $to_string_cast\n );\n\n if ($type_coerced) {\n if ($type_coerced_from_mixed) {\n if (IssueBuffer::accepts(\n new MixedTypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n } else {\n if (IssueBuffer::accepts(\n new TypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n }\n }\n\n if (!$type_match_found && !$type_coerced_from_mixed) {\n if (TypeAnalyzer::canBeContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type\n )) {\n if (IssueBuffer::accepts(\n new PossiblyInvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned possibly different type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n } else {\n if (IssueBuffer::accepts(\n new InvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n }\n }\n }\n break;\n\n case '__get':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_get_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyFetch(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n if (isset($class_storage->pseudo_property_get_types['$' . $prop_name])) {\n $stmt->inferredType = clone $class_storage->pseudo_property_get_types['$' . $prop_name];\n }\n\n break;\n }\n\n return true;\n }", "protected function hasGetMutator($key)\n {\n return method_exists($this, 'set' . $this->getMutatorName($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get' . Str::studly($key) . 'Attribute');\n }", "public function hasGetMutator($key)\n {\n return $this->methodExists('get'.Str::studly($key).'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }", "public function hasGetMutator($key)\n {\n return method_exists($this, 'get'.Str::studly($key).'Attribute');\n }", "public function hasGetMutator($key)\n {\n return $this->hasField($key);\n }", "public function getIsGet()\n {\n return $this->getMethod() === 'GET';\n }", "public function getIsGet()\n {\n return $this->getMethod() === 'GET';\n }", "public static function isGetMethod() {\n return isset($_SERVER['REQUEST_METHOD']) && self::GET == $_SERVER['REQUEST_METHOD'];\n }", "public function isGet()\n {\n return $this->getMethod() === self::METHOD_GET;\n }", "protected function isMutatorMethod($callable)\n {\n return method_exists($this, $callable) || static::hasMacro($callable);\n }", "private function existsGetterAndSetter($object, $propertyName){\r\n if(method_exists($object, 'set' . $propertyName) &&\r\n method_exists($object, 'get' . $propertyName)) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function hasGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasGetMutator($key);\n }", "public function isGet(): bool\n {\n return $this->getMethod() === self::METHOD_GET;\n }", "public function hasAttributeGetMutator($key)\n {\n if ($this->isMutatorWhitelisted($key) === false) {\n return false;\n }\n\n return parent::hasAttributeGetMutator($key);\n }", "public function isGet()\n {\n return ($this->getMethod() == 'GET') ? true : false;\n }", "public function isGet()\n {\n return $this->getMethod() == 'GET';\n }", "public function isGet()\n {\n return $this->getMethod() === 'GET';\n }", "public function isGet()\n {\n return $this->getMethod() === 'GET';\n }", "protected function isObjectAccessorMode() {}", "public function isGet(): bool \r\n {\r\n return $this -> method() === 'GET' ? true : false;\r\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . studly_case($key) . 'Attribute');\n }", "public function isGet() {\n\t\tif ('GET' == $this->getMethod())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set' . Str::studly($key) . 'Attribute');\n }", "private function isMethodOrProperty($method)\n\t{\n\t\tif(method_exists($this, $method))\n\t\t\treturn 'method';\n\n\t\tif(property_exists($this, $method))\n\t\t\treturn 'property';\n\n\t\treturn 'toArray';\n\t}", "public function isGet()\n\t{\n\t\treturn $this->httpMethod() == self::MethodGet;\n\t}", "public function hasSetMutator($key)\n {\n return $this->methodExists('set'.Str::studly($key).'Attribute');\n }", "public function isGet()\n {\n if ('GET' == $this->getMethod()) {\n return true;\n }\n\n return false;\n }", "public function isGet()\n {\n return $this->method === self::METHOD_GET;\n }", "public function isGet() {\n return $this->method == self::METHOD_GET;\n }", "public function isGet() {\n return $this->method == 'GET';\n }", "public function canGetProperty($name) {\r\n return parent::canGetProperty($name)||$this->__isset($name);\r\n }", "public function method_exists($method)\n {\n if (!is_string($method)) {\n return false;\n }\n \n if (method_exists($this, $method)) {\n return true;\n }\n \n if ((substr($method, 0, 3) == 'get' || substr($method, 0, 3) == 'set')\n && property_exists($this, lcfirst(substr($method, 3)))\n ) {\n return true;\n }\n \n return false;\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }", "public function hasSetMutator($key)\n {\n return method_exists($this, 'set'.Str::studly($key).'Attribute');\n }", "public function isGet() :bool\n {\n return $this->getMethod() === 'GET';\n }", "public function isGet(): bool\n {\n return $this->method === self::GET;\n }", "public function isAccessor(CComponent $object, $type)\n {\n $accessor = property_exists($object, $this->name);\n if ($object instanceof CActiveRecord)\n {\n if ($object->hasAttribute($this->name))\n {\n return true;\n }\n }\n if (!$accessor && $object->{'can' . ucfirst($type) . 'Property'}($this->name))\n {\n $m = new ReflectionMethod($object, $type . $this->name);\n if ($m->getNumberOfRequiredParameters() <= ($type == 'set' ? 1 : 0))\n {\n $accessor = true;\n }\n else\n {\n return false;\n }\n }\n\n if (!$accessor)\n {\n $accessor = $object->hasEvent($this->name);\n }\n if (!$accessor && $object instanceof CActiveRecord)\n {\n $rels = $object->relations();\n $accessor = isset($rels[$this->name]);\n }\n return $accessor;\n }", "public static function isPut(): bool {\r\n return static :: isMethod('put');\r\n }", "public function isGet()\n {\n return ($this->_array['method'] == \"GET\");\n }", "public function __isset($name)\n\t{\n\t\t$key = ucfirst($name);\n\t\treturn isset(self::$reflectionMethods[$this->reflectionType]['get' . $key]) || isset(self::$reflectionMethods[$this->reflectionType]['is' . $key]) || $this->reflection->__isset($name);\n\t}", "public function isGet()\n {\n return $this->isMethod('GET');\n }", "public function isGet()\n {\n return $this->isMethod('GET');\n }", "public function __isset($key)\n {\n return ($this->tinydb_getset_is_table_field($key) || $this->tinydb_getset_is_method(\"get_$key\") ||\n $this->tinydb_getset_is_foreign($key));\n }", "public function isGet() {\n return strtoupper($this->requestMethod) == \"GET\";\n }", "public function isGet()\n {\n return $this->getRequestMethod() === 'GET';\n }", "public function isGet()\n {\n return $this->_getMethod() === \\Yana\\Http\\Requests\\MethodEnumeration::GET;\n }", "abstract protected function getDirectGetters();", "static public function IsMethodGET() {\n return (self::$method == \"GET\");\n }", "protected function hasAccessor(string $key, ?string &$accessor = null): bool\n {\n $studly_key = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $key)));\n $accessor = 'get' . $studly_key . 'Property';\n\n return method_exists($this, $accessor);\n }", "public function isMethods() {}", "public function isMethodGet(): bool\n {\n return $this->isMethod(self::HTTP_GET);\n }", "private function isGetMethod(\\ReflectionMethod $method)\n {\n return (\n 0 === strpos($method->name, 'get') &&\n 3 < strlen($method->name) &&\n 0 === $method->getNumberOfRequiredParameters()\n );\n }", "static public function hasGetter ($phpClassName, $property) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:106: characters 3-29\n\t\tif (!class_exists($phpClassName)) {\n\t\t\tinterface_exists($phpClassName);\n\t\t}\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:108: characters 3-19\n\t\t$has = false;\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:109: characters 3-71\n\t\t$phpClassName1 = $phpClassName;\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:110: lines 110-113\n\t\twhile (true) {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:111: characters 4-55\n\t\t\t$has = isset(Boot::$getters[$phpClassName1][$property]);\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:112: characters 4-56\n\t\t\t$phpClassName1 = get_parent_class($phpClassName1);\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:110: lines 110-113\n\t\t\tif (!(!$has && ($phpClassName1 !== false) && class_exists($phpClassName1))) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:115: characters 3-13\n\t\treturn $has;\n\t}", "public function getIsPut()\n {\n return $this->getMethod() === 'PUT';\n }", "function inspiry_is_edit_property() {\n\t\tif ( isset( $_GET['edit_property'] ) && ! empty( $_GET['edit_property'] ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function hasProperties() {\n if ($this->hasProperties !== null) {\n return $this->hasProperties;\n }\n\n try {\n new ReflectionMethod($this, self::METHOD_PROPERTIES);\n $this->hasProperties = true;\n } catch (ReflectionException $exception) {\n $this->hasProperties = false;\n }\n\n return $this->hasProperties;\n }", "public static function isGet(){\n return self::isRequestMethod('GET');\n }", "protected function isMethod() : bool\n {\n return $this->reflector instanceof \\ReflectionMethod;\n }", "public static function isGet() {\n\n if (empty(self::$_requestType))\n self::_initRequestType();\n\n return (self::$_requestType == 'GET');\n }", "public function willGenerateGet(): bool;", "public function __isset(string $name): bool\n\t{\n\t\t$class = static::class;\n\t\t$name = ucfirst($name);\n\n\t\t// Tests for possible getters\n\t\tstatic $types = ['get', 'is'];\n\n\t\tforeach ($types as $type) {\n\t\t\t$getter = $type . $name;\n\n\t\t\tif (self::hasMethod($class, $getter)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function setGetterAccessor($getter = null): void\n {\n }", "function __get($value) {\n return false;\n }", "public static function isGet()\n {\n return $_SERVER['REQUEST_METHOD'] === 'GET';\n }", "abstract protected function setRequiredGetters();", "public function testMagicMethodIssetThrowsException()\n\t{\n\t\t$stub = new \\Orchestra\\Support\\Form\\Fieldset(function ($f) {});\n\n\t\t$invalid = isset($stub->invalid_property) ? true : false;\n\t}", "public function __isset($name)\n {\n if (!isset($this->_exposedProperties[$name])) {\n return false;\n }\n $key = $this->_exposedProperties[$name];\n if (substr($key, 0, 4) === '_get') {\n $val = $this->{$key}();\n\n return $val !== null;\n }\n\n return isset($this->{$key});\n }", "public function isGet() : bool {\n return 'GET' === $_SERVER['REQUEST_METHOD'];\n }", "function ifItIsMethod($method=null) {\n\n\t// making all the input UPPERCASE\n\t//if its post, if its get...\n\tif($_SERVER['REQUEST_METHOD'] == strtoupper($method)) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}", "function is($prop){\n \treturn $this->get_property($prop)==1?true:false;\n }", "public static function isWriteMethod($method);", "function request_is_get() {\n\treturn $_SERVER['REQUEST_METHOD'] === 'GET';\n}", "public function testMagicMethodGetThrowsException()\n\t{\n\t\t$stub = new \\Orchestra\\Support\\Form\\Fieldset(function ($f) {});\n\n\t\t$invalid = $stub->invalid_property;\n\t}", "public function hasGet(string $name): bool {}", "function ajan_is_get_request() {\n\treturn (bool) ( 'GET' === strtoupper( $_SERVER['REQUEST_METHOD'] ) );\n}", "static public function hasSetter ($phpClassName, $property) {\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:122: characters 3-29\n\t\tif (!class_exists($phpClassName)) {\n\t\t\tinterface_exists($phpClassName);\n\t\t}\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:124: characters 3-19\n\t\t$has = false;\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:125: characters 3-71\n\t\t$phpClassName1 = $phpClassName;\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:126: lines 126-129\n\t\twhile (true) {\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:127: characters 4-55\n\t\t\t$has = isset(Boot::$setters[$phpClassName1][$property]);\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:128: characters 4-56\n\t\t\t$phpClassName1 = get_parent_class($phpClassName1);\n\t\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:126: lines 126-129\n\t\t\tif (!(!$has && ($phpClassName1 !== false) && class_exists($phpClassName1))) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t#/Users/ut/haxe/versions/4.0.0-rc.1/std/php/Boot.hx:131: characters 3-13\n\t\treturn $has;\n\t}", "public function isMethod()\n {\n if (!isset($this->class))\n {\n return false;\n }\n\n return method_exists($this->class, $this->function);\n }", "public function __isset($name)\n {\n $getter = $this->toCamel('get', $name);\n if (method_exists($this, $getter)) {\n return null !== $this->$getter();\n }\n\n return false;\n }", "public function setMethod($method) {\n if(preg_match('|(post|get)|i', $method)) {\n $this->method = $method;\n return TRUE;\n } else {\n return FALSE;\n }\n }", "protected function handleGetMutatorColumn($method, $label)\n {\n if ($this->model()->eloquent()->hasGetMutator($method)) {\n return $this->addColumn($method, $label);\n }\n\n return false;\n }", "public function isPut(){\n\t\treturn (strtoupper($this->getHeader('REQUEST_METHOD'))=='PUT')? true : false;\n\t}", "public function __isset($property) {\n\t\t$bean = $this->unbox();\n\t\tif (strpos($property, 'source') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\treturn isset($this->bean->source);\n\t\t\t} else {\n\t\t\t\t$sourceInstance = $this->getSourceInstance();\n\t\t\t\t$sourceServer = $this->getSourceServer();\n\t\t\t\tif ($sourceInstance !== null && $sourceServer !== null) {\n\t\t\t\t\treturn (isset($sourceInstance->$property) || isset($sourceServer->$property));\n\t\t\t\t} elseif ($sourceInstance !== null) {\n\t\t\t\t\treturn (isset($sourceInstance->$property));\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (strpos($property, 'remote') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\treturn isset($this->bean->target);\n\t\t\t} else {\n\t\t\t\t$targetInstance = $this->getTargetInstance();\n\t\t\t\t$targetServer = $this->getTargetServer();\n\t\t\t\tif ($targetInstance !== null && $targetServer !== null) {\n\t\t\t\t\treturn (isset($targetInstance->$property) || isset($targetServer->$property));\n\t\t\t\t} elseif ($targetInstance !== null) {\n\t\t\t\t\treturn (isset($targetInstance->$property));\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Temporary properties are kept in the object, and not written to the database.\n\t\t} elseif (strpos($property, 'temp') === 0) {\n\t\t\t$property = lcfirst(substr($property, 4));\n\t\t\treturn isset($this->tempProperties[$property]);\n\t\t} elseif (isset($this->bean->$property)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tif ($this->loadedProperties === false) {\n\t\t\t\t$this->loadProperties();\n\t\t\t}\n\t\t\treturn isset($this->properties[$property]);\n\t\t}\n\t}", "public function __get(string $method);", "public function __isset($property) {}", "public function __isset($name)\n {\n $getter = 'get' . $name;\n if (method_exists($this, $getter)) {\n return $this->$getter() !== null;\n }\n\n\n return false;\n }", "public function hasMethods() {\n return $this->_has(12);\n }", "public function __isset($prop)\r\n {\r\n return isset($this->wrappedObj->$prop);\r\n }", "public function isPut() {\n return $this->method == 'PUT';\n }", "public function __call($methodName, $args)\n {\n\n if (strlen($methodName) > 3) {\n $propertyName = CodeUtils::instance()->normalisePropertyName(substr($methodName, 3));\n if (strtolower(substr($methodName, 0, 3) == \"set\") && sizeof($args) == 1) {\n if (!$this->__strictMode || is_numeric(array_search($propertyName, $this->__dynamicPropertyKeys)))\n $this->__dynamicPropertyMap [$propertyName] = $args [0];\n else\n throw new PropertyNotWritableException (get_class($this), $propertyName);\n return;\n } else if (strtolower(substr($methodName, 0, 3) == \"get\") && sizeof($args) == 0) {\n if (!$this->__strictMode || is_numeric(array_search($propertyName, $this->__dynamicPropertyKeys)))\n return array_key_exists($propertyName, $this->__dynamicPropertyMap) ? $this->__dynamicPropertyMap [$propertyName] : null;\n else\n throw new PropertyNotReadableException (get_class($this), $propertyName);\n }\n }\n\n if ($methodName == \"__toString\") {\n return \"\";\n }\n\n\n // If we haven't returned yet, we throw none existent method.\n throw new NoneExistentMethodException (get_class($this), $methodName);\n\n }", "public function isUncacheableRequestMethod()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n if (!empty($_POST)) {\n return $is = true;\n } elseif (!empty($_SERVER['REQUEST_METHOD']) && mb_strtoupper($_SERVER['REQUEST_METHOD']) !== 'GET') {\n return $is = true;\n }\n return $is = false;\n }", "private function tinydb_getset_is_method($name, $no_visibility_check = false)\n {\n if ($this->tinydb_get_reflector()->hasMethod($name)) {\n $method = $this->tinydb_get_reflector()->getMethod($name);\n\n $current_scope = $this->tinydb_get_calling_scope(1);\n $visibility = T_PUBLIC;\n if ($method->isProtected()) {\n $visibility = T_PROTECTED;\n } else if ($method->isPrivate()) {\n $visibility = T_PRIVATE;\n }\n\n if (!$no_visibility_check && $current_scope < $visibility) {\n return false;\n }\n\n return true;\n } else {\n return false;\n }\n }", "public function __isset($name)\n {\n $getter = 'get' . $name;\n if (method_exists($this, $getter)) {\n return $this->$getter() !== null;\n } else {\n return false;\n }\n }", "function doGetterSetter() {\n\tglobal $description_obj;\n\tglobal $table_name, $class_name;\n\tglobal $tabs, $tab2, $tab3;\n\n\tfComment($tabs,\"Getters and Setters\");\n\tforeach($description_obj as $obj) {\n\t\t//print_r($obj);\n\n\t\techo $tabs,\"/// getter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function get_{$obj->Field}()\\t\\t{return \\$this->$obj->Field;}\\n\",\n\t\t\t $tabs,\"/// setter for '$obj->Field'\\n\",\n\t\t\t $tabs,\"public function set_{$obj->Field}(\\$val)\\t{\\$this->$obj->Field = \",assignEscape($obj),\";}\\n\",\n\t\t\t \"\\n\";\n\t}\n\techo $tabs,\"public function get_last_error()\\t\\t{return \\$this->_last_error;}\\n\";\n\techo \"\\n\\n\";\n}", "private function isHiddenMethod()\n\t{\n\t\t\n\t\t$method = null;\n\t\t\n\t\tif( isset($_GET['_method']) )\n\t\t{\n\t\t\t$method = $_GET['_method'];\n\t\t}\n\t\t\n\t\tif( isset($_POST['_method']) )\n\t\t{\n\t\t\t$method = $_POST['_method'];\n\t\t}\n\t\t\n\t\treturn $method;\n\t\t\n\t}" ]
[ "0.6847381", "0.67964673", "0.65327173", "0.6525216", "0.64758706", "0.6430532", "0.6416168", "0.6382736", "0.6346902", "0.62943053", "0.62943053", "0.6241868", "0.62277293", "0.62277293", "0.6205084", "0.6175118", "0.6128303", "0.6125739", "0.6110702", "0.6090799", "0.6059034", "0.60528404", "0.60514855", "0.6041529", "0.6041529", "0.6022065", "0.60096395", "0.6009034", "0.59903955", "0.5987103", "0.5972464", "0.5964648", "0.59616834", "0.5951423", "0.59473497", "0.59471196", "0.5944289", "0.59108514", "0.5882538", "0.58812016", "0.58812016", "0.58706886", "0.58464485", "0.58210194", "0.5815838", "0.58035165", "0.5800981", "0.5799266", "0.5799266", "0.5798112", "0.578919", "0.5785535", "0.57718194", "0.57685465", "0.57433826", "0.5732169", "0.57099575", "0.56940967", "0.5682523", "0.5654002", "0.5643272", "0.5637354", "0.5633148", "0.5633065", "0.56292415", "0.5628893", "0.5618262", "0.56053627", "0.5588424", "0.5583847", "0.5560832", "0.55496216", "0.5546697", "0.55449164", "0.5540858", "0.55342853", "0.55258787", "0.55255324", "0.5516133", "0.5514735", "0.54947484", "0.545677", "0.5448531", "0.54179054", "0.54125005", "0.54092115", "0.54059523", "0.5395458", "0.5393268", "0.5388799", "0.5387614", "0.5385651", "0.53783906", "0.5376796", "0.5373184", "0.53719467", "0.5367877", "0.5360908", "0.53533727", "0.53528166", "0.53527206" ]
0.0
-1
Determine the property that is being set or get
protected function getMagicMethodProperty($method) { // Get the property name $property = lcfirst(substr($method, 3)); $transform = function ($letters) { $letter = array_shift($letters); return '_' . strtolower($letter); }; $property = preg_replace_callback('/([A-Z])/', $transform, $property); // Make sure the property exists if (! array_key_exists($property, $this->object)) { throw new InvalidArgumentException('Property, '.$property.', not found'); } return $property; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPropertyValue() {}", "public function getPropertyValue() {\n\t\t$propertyValue = parent::getPropertyValue();\n\t\tif ($propertyValue === NULL)\n\t\t\treturn FALSE;\n\t\treturn $propertyValue;\n\t}", "public function __get($prop) {}", "abstract protected function propertyGet($name);", "function __get($property)\n {\n return $this->value;\n }", "public function isInPropertyBehavior() {\n return $this->isInPropertyBehavior;\n }", "public function getProperty();", "public function __isset($property) {\n\t\t$bean = $this->unbox();\n\t\tif (strpos($property, 'source') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\treturn isset($this->bean->source);\n\t\t\t} else {\n\t\t\t\t$sourceInstance = $this->getSourceInstance();\n\t\t\t\t$sourceServer = $this->getSourceServer();\n\t\t\t\tif ($sourceInstance !== null && $sourceServer !== null) {\n\t\t\t\t\treturn (isset($sourceInstance->$property) || isset($sourceServer->$property));\n\t\t\t\t} elseif ($sourceInstance !== null) {\n\t\t\t\t\treturn (isset($sourceInstance->$property));\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (strpos($property, 'remote') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\treturn isset($this->bean->target);\n\t\t\t} else {\n\t\t\t\t$targetInstance = $this->getTargetInstance();\n\t\t\t\t$targetServer = $this->getTargetServer();\n\t\t\t\tif ($targetInstance !== null && $targetServer !== null) {\n\t\t\t\t\treturn (isset($targetInstance->$property) || isset($targetServer->$property));\n\t\t\t\t} elseif ($targetInstance !== null) {\n\t\t\t\t\treturn (isset($targetInstance->$property));\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Temporary properties are kept in the object, and not written to the database.\n\t\t} elseif (strpos($property, 'temp') === 0) {\n\t\t\t$property = lcfirst(substr($property, 4));\n\t\t\treturn isset($this->tempProperties[$property]);\n\t\t} elseif (isset($this->bean->$property)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tif ($this->loadedProperties === false) {\n\t\t\t\t$this->loadProperties();\n\t\t\t}\n\t\t\treturn isset($this->properties[$property]);\n\t\t}\n\t}", "function __isset($property){\n return isset($this->DATA[$property]);\n }", "public function __isset($prop)\r\n {\r\n return isset($this->wrappedObj->$prop);\r\n }", "public function __get ( $property ) {\n return isset( $this->{$property} ) ? $this->{$property} : NULL;\n }", "public function __isset($property) {}", "public function __get($prop){\n\t\treturn $this->$prop;\n\t}", "function __get($prop)\n {\n if (isset($this->$prop)){\n return $this->$prop;\n }\n if (isset($this->_data[$prop])) {\n return $this->_data[$prop];\n }\n else try {\n return $this->__call($prop, array());\n } catch (Exception $e) {\n throw new Exception(sprintf('Property \"%s\" not available', $prop));\n }\n }", "public function __get($property) {}", "function prop($prop)\n {\n \treturn $this->get_property($prop);\n }", "public function __get($prop) {\n\t\treturn in_array($prop, $this->applyTransformer) ? $this->transform($this->$prop, $prop) : $this->$prop;\n\t}", "public function getProperty() {\n return $this->property;\n }", "public function __get($prop)\r\n {\r\n return $this->$prop;\r\n }", "function _getProp($key)\n {\n return $this->_props[$key];\n }", "public function targetProperty(): ?string\n {\n return $this->_targetProperty;\n }", "public function __get($property){\n /*if(method_exists($this,'get'.ucfirst($property))){\n\n }*/\n return $this->$property;\n }", "public function canGetProperty($name) {\r\n return parent::canGetProperty($name)||$this->__isset($name);\r\n }", "public function __get($property){\n\t\tif (property_exists($this, $property)) {\n\t \treturn $this->$property;\n\t }\n\t}", "public function __get($property) {\n\n if (property_exists($this, $property)){\n return $this->$property;\n }\n\n }", "protected function getPropertyValue(/**\n * If a confirmation page is set and a fileupload was done before\n * there is no incoming data if the process action is called.\n * The data is only in the session at this time.\n * This results in a negative validation (if a validation is set).\n * Therefore, look first in the session.\n */\n\\TYPO3\\CMS\\Form\\Domain\\Model\\ValidationElement $validationElement, /**\n * If a confirmation page is set and a fileupload was done before\n * there is no incoming data if the process action is called.\n * The data is only in the session at this time.\n * This results in a negative validation (if a validation is set).\n * Therefore, look first in the session.\n */\n$propertyName) {}", "public function __get($prop)\r\n {\r\n return $this->wrappedObj->$prop;\r\n }", "public function __get( $property ) {\n\t\tif (!isset($this->$property) || $this->$property==\"\") {\n\t\t\treturn NULL;\n\t\t}\n\t\treturn $this->$property;\n\t}", "public function getProperty()\n\t{\n\t\treturn empty($this->property) ? strtolower($this->getName()) : $this->property;\n\t}", "public function __get($propertyName){\n if(array_key_exists($propertyName, $this->properties)){\n\n return $this->properties[$propertyName];\n }\n \n }", "public function getProperty($key)\n\t{\n\t\tif(array_key_exists($key, $this->properties))\n\t\t{\n\t\t\treturn $this->properties[$key];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function __isset( $property ) {\n $this->__get($property);\n\t return isset( $this->$property );\n }", "public function __get($property) {\n\t\tif (strpos($property, 'source') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\treturn $this->getSourceInstance();\n\t\t\t} else {\n\t\t\t\t$sourceInstance = $this->getSourceInstance();\n\t\t\t\t$sourceServer = $this->getSourceServer();\n\t\t\t\tif ($sourceInstance !== null && isset($sourceInstance->$property)) {\n\t\t\t\t\treturn $sourceInstance->$property;\n\t\t\t\t} elseif ($sourceServer !== null && isset($sourceServer->$property)) {\n\t\t\t\t\treturn $sourceServer->$property;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (strpos($property, 'remote') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\treturn $this->getTargetInstance();\n\t\t\t} else {\n\t\t\t\t$targetInstance = $this->getTargetInstance();\n\t\t\t\t$targetServer = $this->getTargetServer();\n\t\t\t\tif ($targetInstance !== null && isset($targetInstance->$property)) {\n\t\t\t\t\treturn $targetInstance->$property;\n\t\t\t\t} elseif ($targetServer !== null && isset($targetServer->$property)) {\n\t\t\t\t\treturn $targetServer->$property;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Temporary properties are kept in the object, and not written to the database.\n\t\t} elseif (strpos($property, 'temp') === 0) {\n\t\t\t$property = lcfirst(substr($property, 4));\n\t\t\tif (isset($this->tempProperties[$property])) {\n\t\t\t\treturn $this->tempProperties[$property];\n\t\t\t}\n\t\t} elseif (isset($this->bean->$property)) {\n\t\t\treturn $this->bean->$property;\n\t\t} else{\n\t\t\tif ($this->loadedProperties === false) {\n\t\t\t\t$this->loadProperties();\n\t\t\t}\n\t\t\tif (isset($this->properties[$property])) {\n\t\t\t\treturn $this->properties[$property];\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}", "public function __get($key)\n {\n // First, check if its in the properties index.\n // This is so we can override the global setting.\n if ($meta = $this->getMeta($key)) {\n return $meta->value;\n }\n $meta = $this->getGlobal($key);\n return $meta ? $meta->value : null;\n\n }", "function is($prop){\n \treturn $this->get_property($prop)==1?true:false;\n }", "public function __get($property) {\n\t\tif(property_exists($this, $property))\n\t\t\treturn $this->$property;\n\t}", "function get($property) {\n if (!empty($this->{$property})) {\n return $this->{$property};\n }\n else {\n return false;\n }\n }", "public function __get($property) {\n try {\n if (!isset($this->_cache['_property__' . $property])) {\n $value_from_parent = parent::__get($property);\n $this->_cache['_property__' . $property] = $value_from_parent;\n }\n return $this->_cache['_property__' . $property];\n } catch (\\Exception $e) {}\n if (method_exists($this, $property)) {\n if (!isset($this->_cache['_property__' . $property])) {\n $this->_cache['_property__' . $property] = $this->$property();\n }\n return $this->_cache['_property__' . $property];\n }\n return parent::__get($property);\n }", "function getProperty($what)\n {\n $that = null;\n if (isset($this->$what)) {\n $that = $this->$what;\n }\n return $that;\n }", "public function __get($property) \n\t{\n\t if (property_exists($this, $property)) {\n\t \treturn $this->$property;\n\t }\n }", "public function getProperty(): string;", "public function __get($property)\n {\n return property_exists($this, $property)\n ? $this->$property : null;\n }", "private static function hasProperty($class, $name)\n\t{\n\t\t$prop = & self::$props[$class][$name];\n\t\tif ($prop === NULL) {\n\t\t\t$prop = FALSE;\n\t\t\ttry {\n\t\t\t\t$rp = new \\ReflectionProperty($class, $name);\n\t\t\t\tif ($name === $rp->getName() && $rp->isPublic() && !$rp->isStatic()) {\n\t\t\t\t\t$prop = preg_match('#^on[A-Z]#', $name) ? 'event' : TRUE;\n\t\t\t\t}\n\t\t\t} catch (\\ReflectionException $e) {}\n\t\t}\n\t\treturn $prop;\n\t}", "public function __get($property){\n\n if(property_exists($this, $property)){\n return $this->$property;\n }\n }", "public function getPropertyValue()\n\t{\n\t\t$property = $this->property;\n\t\treturn (isset($this->object) && ($property instanceof Reflection\\Reflection_Property))\n\t\t\t? $property->getValue($this->object)\n\t\t\t: null;\n\t}", "public function __isset($property)\n\t{\n\t\treturn isset($this->_data[$property]);\n\t}", "public function __isset($property) {\n return isset($this->_data[$property]);\n }", "public function formProperty()\n {\n if ($this->formProperty === null) {\n $this->formProperty = false;\n\n $objType = $this->objType();\n $propertyIdent = $this->propertyIdent();\n\n if ($objType && $propertyIdent) {\n $model = $this->modelFactory()->get($objType);\n\n if ($model->hasProperty($propertyIdent)) {\n $this->formProperty = $model->property($propertyIdent);\n }\n }\n }\n\n return $this->formProperty;\n }", "public function __isset($property) {\n return isset($this->$property);\n }", "public function __get($key)\n {\n return (array_key_exists($key, $this->props)) ? $this->props[$key] : false;\n }", "public function __get($property) {\n\t\t\tif (property_exists($this, $property)) {\n\t\t\t\treturn $this->$property;\n\t\t\t}\n\t\t}", "public function getProperty($property = null);", "public function props_changed()\n\t{\n\t\treturn $this->props_changed;\n\t}", "public function __isset($property) {\n\n return isset($this->$property);\n\n }", "public function __isset($property) {\n return isset($this->$property);\n }", "public function __isset($property){\n echo isset($this->$property);\n }", "public function __isset( $property ) {\n\t\t\treturn isset( $this->$property );\n\t\t}", "public function __get($property)\n {\n $info = build_properties_hint(reflect_properties($this));\n warning('Property \"'.$property.'\" doesn\\'t exist in a '.get_class($this).' object', $info);\n }", "public function __get($property) {\n if (property_exists($this, $property)) {\n return $this->$property;\n }\n }", "public function __get($property) {\n if (property_exists($this, $property)) {\n return $this->$property;\n }\n }", "public function __get($property) {\n if (property_exists($this, $property)) {\n return $this->$property;\n }\n }", "public function __get($property) {\n if (property_exists($this, $property)) {\n return $this->$property;\n }\n }", "function __get($name)\n {\n if(property_exists($this,$name))\n return $this->$name;\n\n return false;\n }", "public function __get($property) {\n\n\t\tif (property_exists($this, $property)) {\n\t\t\treturn $this->$property;\n\t\t}\n\t}", "function __isset($property){\n return isset($this->sections[$property]);\n }", "function __get($property)\n {\n return $this->$property;\n }", "public function __get($property) {\n\t\tswitch($property) {\n\t\t\tcase 'num':\n\t\t\t\treturn $this->num;\n\n\t\t\tcase 'view':\n\t\t\t\treturn $this->view;\n\n\t\t\tcase 'rubric':\n\t\t\t\treturn $this->rubric;\n\n\t\t\tcase 'parts':\n\t\t\t\treturn $this->parts;\n\n\t\t\tdefault:\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\ttrigger_error(\n\t\t\t\t\t'Undefined property ' . $property .\n\t\t\t\t\t' in ' . $trace[0]['file'] .\n\t\t\t\t\t' on line ' . $trace[0]['line'],\n\t\t\t\t\tE_USER_NOTICE);\n\t\t\t\treturn null;\n\t\t}\n\t}", "public function hasProperties() {\n if ($this->hasProperties !== null) {\n return $this->hasProperties;\n }\n\n try {\n new ReflectionMethod($this, self::METHOD_PROPERTIES);\n $this->hasProperties = true;\n } catch (ReflectionException $exception) {\n $this->hasProperties = false;\n }\n\n return $this->hasProperties;\n }", "private static function checkMagicGetterOrSetterProperty(\n StatementsAnalyzer $statements_analyzer,\n PhpParser\\Node\\Expr\\MethodCall $stmt,\n $fq_class_name\n ) {\n if (!$stmt->name instanceof PhpParser\\Node\\Identifier) {\n return true;\n }\n\n $method_name = strtolower($stmt->name->name);\n if (!in_array($method_name, ['__get', '__set'], true)) {\n return true;\n }\n\n $first_arg_value = $stmt->args[0]->value;\n if (!$first_arg_value instanceof PhpParser\\Node\\Scalar\\String_) {\n return true;\n }\n\n $prop_name = $first_arg_value->value;\n $property_id = $fq_class_name . '::$' . $prop_name;\n $codebase = $statements_analyzer->getCodebase();\n $class_storage = $codebase->classlike_storage_provider->get($fq_class_name);\n\n switch ($method_name) {\n case '__set':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_set_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyAssignment(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n // If a `@property` annotation is set, the type of the value passed to the\n // magic setter must match the annotation.\n $second_arg_type = isset($stmt->args[1]->value->inferredType)\n ? $stmt->args[1]->value->inferredType\n : null;\n\n if (isset($class_storage->pseudo_property_set_types['$' . $prop_name]) && $second_arg_type) {\n $pseudo_set_type = ExpressionAnalyzer::fleshOutType(\n $codebase,\n $class_storage->pseudo_property_set_types['$' . $prop_name],\n $fq_class_name,\n new Type\\Atomic\\TNamedObject($fq_class_name)\n );\n\n $type_match_found = TypeAnalyzer::isContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type,\n $second_arg_type->ignore_nullable_issues,\n $second_arg_type->ignore_falsable_issues,\n $has_scalar_match,\n $type_coerced,\n $type_coerced_from_mixed,\n $to_string_cast\n );\n\n if ($type_coerced) {\n if ($type_coerced_from_mixed) {\n if (IssueBuffer::accepts(\n new MixedTypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n } else {\n if (IssueBuffer::accepts(\n new TypeCoercion(\n $prop_name . ' expects \\'' . $pseudo_set_type . '\\', '\n . ' parent type `' . $second_arg_type . '` provided',\n new CodeLocation($statements_analyzer->getSource(), $stmt)\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // keep soldiering on\n }\n }\n }\n\n if (!$type_match_found && !$type_coerced_from_mixed) {\n if (TypeAnalyzer::canBeContainedBy(\n $codebase,\n $second_arg_type,\n $pseudo_set_type\n )) {\n if (IssueBuffer::accepts(\n new PossiblyInvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned possibly different type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n } else {\n if (IssueBuffer::accepts(\n new InvalidPropertyAssignmentValue(\n $prop_name . ' with declared type \\''\n . $pseudo_set_type\n . '\\' cannot be assigned type \\'' . $second_arg_type . '\\'',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )) {\n // fall through\n }\n }\n }\n }\n break;\n\n case '__get':\n // If `@psalm-seal-properties` is set, the property must be defined with\n // a `@property` annotation\n if ($class_storage->sealed_properties\n && !isset($class_storage->pseudo_property_get_types['$' . $prop_name])\n && IssueBuffer::accepts(\n new UndefinedThisPropertyFetch(\n 'Instance property ' . $property_id . ' is not defined',\n new CodeLocation($statements_analyzer->getSource(), $stmt),\n $property_id\n ),\n $statements_analyzer->getSuppressedIssues()\n )\n ) {\n // fall through\n }\n\n if (isset($class_storage->pseudo_property_get_types['$' . $prop_name])) {\n $stmt->inferredType = clone $class_storage->pseudo_property_get_types['$' . $prop_name];\n }\n\n break;\n }\n\n return true;\n }", "public function __get($property)\n {\n if(property_exists($this, $property)) {\n return $this->$property;\n }\n }", "public function __get($name)\n {\n // if the property is declared (automatically not public), we can take it\n if (property_exists($this, $name)) {\n return $this->$name;\n } else {\n // otherwise we indicate that we must go through the getter or attribute does not exist\n trigger_error(\"You are trying to read an existing protected or private attribute without going through its getter! (__get) or a non-existent attribute\", E_USER_NOTICE);\n }\n }", "public function __get($property) {\r\n\t\tswitch($property) {\r\n\t\t\tcase 'view':\r\n\t\t\t\treturn $this->view;\r\n\r\n\t\t\tdefault:\r\n return PropertyHelper::Error($property);\r\n\t\t}\r\n\t}", "public function __get($property) {\n\t\tif (property_exists($this, $property)) {\n\t\t\treturn $this->$property.\"<br>\";\n\t\t} else {\n\t\t\treturn $property.\" does not exist<br>\";\n\t\t}\n\t}", "private function getPropertyValue($property)\n {\n $value = null;\n $getter = 'get' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($property);\n\n if (method_exists($this, $getter)) {\n $value = $this->{$getter}();\n } elseif ($this->returnAdditionalSetting($property)) {\n $value = $this->returnAdditionalSetting($property);\n }\n\n return $value;\n }", "public function __get($property)\n {\n return property_exists($this, $property) ? $this->{$property} : null;\n }", "public function __get($prop)\n {\n return $this->assignee[$prop];\n }", "protected function _get($property): mixed {\n $property[0] = strtolower($property[0]);\n if (property_exists($this, $property)) {\n return $this->$property;\n } elseif(array_key_exists($property, $this->_properties)) {\n return $this->_properties[$property];\n } else {\n trigger_error('Method \"get' . ucfirst($property) . '()\" does not exist in \"' . get_class( $this ) . '\" class.');\n }\n }", "public function __get($property)\n\t{\n\t\t$getter = '__volatile_get_' . $property;\n\n\t\tif (method_exists($this, $getter))\n\t\t{\n\t\t\treturn $this->$getter();\n\t\t}\n\n\t\t$getter = '__get_' . $property;\n\n\t\tif (method_exists($this, $getter))\n\t\t{\n\t\t\treturn $this->$property = $this->$getter();\n\t\t}\n\n\t\t#\n\t\t# The object does not define any getter for the property, let's see if a getter is defined\n\t\t# in the methods.\n\t\t#\n\n\t\t$getter = $this->find_method_callback('__volatile_get_' . $property);\n\n\t\tif ($getter)\n\t\t{\n\t\t\treturn call_user_func($getter, $this, $property);\n\t\t}\n\n\t\t$getter = $this->find_method_callback('__get_' . $property);\n\n\t\tif ($getter)\n\t\t{\n\t\t\treturn $this->$property = call_user_func($getter, $this, $property);\n\t\t}\n\n\t\t#\n\t\t#\n\t\t#\n\n\t\t$rc = $this->__defer_get($property, $success);\n\n\t\tif ($success)\n\t\t{\n\t\t\treturn $this->$property = $rc;\n\t\t}\n\n\t\t$reflexion_class = new \\ReflectionClass($this);\n\n\t\ttry\n\t\t{\n\t\t\t$reflexion_property = $reflexion_class->getProperty($property);\n\n\t\t\tthrow new Exception\\PropertyNotReadable(array($property, $this));\n\t\t}\n\t\tcatch (\\ReflectionException $e) { }\n\n\t\t$properties = array_keys(get_object_vars($this));\n\n\t\tif ($properties)\n\t\t{\n\t\t\tthrow new Exception\\PropertyNotFound\n\t\t\t(\n\t\t\t\t\\ICanBoogie\\format\n\t\t\t\t(\n\t\t\t\t\t'Unknow or unaccessible property %property for object of class %class (available properties: :list).', array\n\t\t\t\t\t(\n\t\t\t\t\t\t'property' => $property,\n\t\t\t\t\t\t'class' => get_class($this),\n\t\t\t\t\t\t'list' => implode(', ', $properties)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tthrow new Exception\\PropertyNotFound(array($property, $this));\n\t}", "public function __get($property)\n\t{\n\t\tif (property_exists($this, $property))\n\t\t{\n\t\t\treturn $this->$property;\n\t\t}\n\t}", "public function __get($property)\n\t{\n\t\tif(isset($this->$property))\n\t\t{\n\t\t\treturn $this->$property;\n\t\t}\n\t\telse return null;\n\t}", "public function __get( $property ) {\n\t\t\tif ( property_exists( $this, $property ) ) {\n\t\t\t\treturn $this->$property;\n\t\t\t}\n\t\t\tif (\n\t\t\t\t$this->slplus->database->has_extended_data() &&\n\t\t\t\tisset( $this->exdata[ $property ] )\n\t\t\t) {\n\t\t\t\treturn $this->exdata[ $property ];\n\t\t\t}\n\n\t\t\tif ( ! empty( $this->temporary[ $property ] ) ) {\n\t\t\t\treturn $this->temporary[ $property ];\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "public function __isset($property) {\r\n return (array_key_exists($property, $this->relationships) || $this->orm->__isset($property) || method_exists($this, $method = 'get_'.$property) || method_exists($this, $method = 'missing_'.$property));\r\n }", "protected function get_prop( $prop, $context = 'view' ) {\n\n\t\tif ( 'switch_data' == $prop ) {\n\t\t\t$prop = 'subscription_switch_data';\n\t\t}\n\n\t\t// The requires manual renewal prop uses boolean values but is stored as a string so needs special handling, it also needs to be handled before the checks on $this->$prop to avoid triggering __isset() & __get() magic methods for $this->requires_manual_renewal\n\t\tif ( 'requires_manual_renewal' === $prop ) {\n\t\t\t$value = get_post_meta( $this->get_id(), '_' . $prop, true );\n\n\t\t\tif ( 'false' === $value || '' === $value ) {\n\t\t\t\t$value = false;\n\t\t\t} else {\n\t\t\t\t$value = true;\n\t\t\t}\n\t\t} elseif ( ! isset( $this->$prop ) || empty( $this->$prop ) ) {\n\t\t\t$value = get_post_meta( $this->get_id(), '_' . $prop, true );\n\t\t} else {\n\t\t\t$value = $this->$prop;\n\t\t}\n\n\t\treturn $value;\n\t}", "abstract function appliedOnProperty(mixed $value = null): null|string|bool;", "public function getp($property){\n if(property_exists($this, $property)){\n return $this->$property;\n }\n }", "public function __isset($key) {\n if (method_exists($this, 'get_'.$key)) {\n $val = $this->{'get_'.$key}();\n return !empty($val);\n }\n return !empty($this->properties->{$key});\n }", "public function getReferencedProperty(): string;", "public final function __isset ($prop = null) {\r\n $prop = strtolower ((string)($prop));\r\n return ( boolean ) (isset ($this->props [ $prop ]));\r\n }", "public function __get($name)\n {\n if (array_key_exists($name, $this->_properties)) {\n return $this->_properties[$name];\n }\n return false;\n }", "public function __get($key){\r\n\t\tif(array_key_exists($key, $this->_attributes)){\r\n\t\t\treturn $this->_attributes[$key];\r\n\t\t}\r\n\t\t/* else {\r\n\t\t\ttrigger_error(sprintf('Property %s does not exist in class %s.', $key, get_class($this)), E_USER_NOTICE);\r\n\t\t\treturn null;\r\n\t\t} */\r\n\t\t\r\n\t}", "public function __get($property) \n {\n return $this->$property;\n }", "public function __get($property) \n {\n return $this->$property;\n }", "public function __get($property) \n {\n return $this->$property;\n }", "public function __get($property) \n {\n return $this->$property;\n }", "public function __get($property) \n {\n return $this->$property;\n }", "public function propertyIdent()\n {\n return $this->propertyIdent;\n }", "public function getProperty(): ?string {\n $val = $this->getBackingStore()->get('property');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'property'\");\n }", "public function __get($property)\n\t{\n\t\tif (parent::handles_get_property($property))\n\t\t{\n\t\t\treturn parent::__get($property);\n\t\t}\n\n\t\tif (isset($this->__oauth[$property]))\n\t\t{\n\t\t\treturn $this->__oauth[$property];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "public function get($property);", "public function eventsGetProperty( $field ) {\r\n\t\tif (isset($this->{$field})) {\r\n\t\t\treturn( $this->{$field} );\r\n\t\t} else {\r\n\t\t\treturn( false );\r\n\t\t}\r\n\t}", "public function __isset($property_name)\n\t{\n\t\tif (in_array($property_name, $this->getModel()->getColumns()))\n\t\t{\n\t\t\treturn $this->getModel()->$property_name != NULL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn parent::__isset($property_name);\n\t\t}\n\t}" ]
[ "0.66135067", "0.6583385", "0.64881724", "0.63106054", "0.63025427", "0.62775683", "0.6258295", "0.6256835", "0.6186943", "0.6183001", "0.61755407", "0.6167791", "0.615699", "0.61569786", "0.61338425", "0.6133779", "0.61279", "0.61273175", "0.60902774", "0.60528404", "0.60487056", "0.60457647", "0.603886", "0.6033831", "0.60230666", "0.60131365", "0.5984923", "0.5967851", "0.59625524", "0.5957763", "0.5951023", "0.5949805", "0.5944348", "0.5941899", "0.5939766", "0.5935048", "0.5903606", "0.58999485", "0.5888659", "0.58595157", "0.58533067", "0.5852005", "0.5846453", "0.5845336", "0.58427036", "0.5833713", "0.58298314", "0.58295166", "0.58288443", "0.5825", "0.58151615", "0.5807308", "0.58036745", "0.57957816", "0.5795494", "0.5792922", "0.57844156", "0.578296", "0.5778267", "0.5778267", "0.5778267", "0.5778267", "0.5776468", "0.5776", "0.577312", "0.57650036", "0.57614684", "0.5760347", "0.5757389", "0.57567024", "0.5755047", "0.5754325", "0.57388395", "0.5735501", "0.5734455", "0.5726999", "0.57248896", "0.5723613", "0.5713303", "0.5709909", "0.5708815", "0.5705102", "0.57040614", "0.56924033", "0.56812286", "0.567945", "0.56786054", "0.5670326", "0.5664474", "0.5649305", "0.5649267", "0.5649267", "0.5649267", "0.5649267", "0.5649267", "0.56489295", "0.56376606", "0.56251305", "0.56199527", "0.5616603", "0.5614557" ]
0.0
-1
Set the given field with the given value typecasted as an integer
protected function setAsInteger($field, $value) { $this->object[$field] = (int) $value; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setValue(int $field, $value) : void;", "public function setValue($field, $value): int {\n if (in_array($field, static::fields, TRUE)){\n $this->{$field}->setValue($value);\n return 1;\n }\n return 0;\n }", "function o_castInt($value) {\n\t\t\treturn Obj::singleton()->castInt($value);\n\t\t}", "public function getInt(string $field): int\n {\n return intval($this->get($field));\n }", "public function wt_parse_int_field($value) {\n // Remove the ' prepended to fields that start with - if needed.\n//\t\t$value = $this->unescape_data( $value );\n\n return intval($value);\n }", "public function setInt32Field($value)\n {\n return $this->set(self::INT32_FIELD, $value);\n }", "function getValue(int $field);", "public function setValue($value) {\n\t\t$value = (int) $value;\n\t\treturn $value;\n\t}", "public function getInt32Field()\n {\n $value = $this->get(self::INT32_FIELD);\n return $value === null ? (integer)$value : $value;\n }", "function getIdAttribute ($val) { return (int) $val; }", "public function updateInteger( Inx_Api_Recipient_Attribute $attr, $iValue );", "static function integer($value){\n\t\treturn DBValue::decimal($value);\n\t}", "public function testIntegerFieldValidation()\n {\n $field = $this->table->getField('numberfour');\n\n $testVal = 1;\n $expected = 1;\n $this->assertEquals($expected, $field->getPHPValue($testVal));\n\n $testVal = 1.123;\n $this->assertEquals($expected, $field->getPHPValue($testVal));\n\n $testVal = 0;\n $expected = 0;\n $this->assertEquals($expected, $field->getPHPValue($testVal));\n }", "public function setValue($value)\n {\n if (is_int($value) === false) {\n throw new base_database_Exception(TMS(base_database_Exception::NO_INT_VALUE, array('value' => $value)));\n }\n $this->int = $value;\n }", "public function getInt64Field()\n {\n $value = $this->get(self::INT64_FIELD);\n return $value === null ? (integer)$value : $value;\n }", "public function setInt64Field($value)\n {\n return $this->set(self::INT64_FIELD, $value);\n }", "public function setValue($value)\n\t{\t\t\n\t\tif(!is_numeric($value))\n\t\t{\n\t\t\tthrow(new ArghException('IntegerParameter values must be numeric'));\n\t\t}\n\t\t\n\t\t$this->value = intval($value);\n\t}", "public static function _integer($value, $field) {\n\t\treturn (bool)preg_match('/^-?[0-9]+$/', $value);\n\t}", "private function newIntegerField(stdClass $fieldDef): DBTable\\Field\n {\n $field = new Fld\\Integer($fieldDef->column_name);\n $this->setProperties($field, $fieldDef);\n $field->setPrecision($fieldDef->numeric_precision);\n\n return $field;\n }", "public function toInt() : int\n {\n return intval($this->value);\n }", "function int($value)\n{\n return intval($value);\n}", "public function set($value)\n\t{\n\t\tif ($value)\n\t\t{\n\t\t\tif (is_numeric($value))\n\t\t\t{\n\t\t\t\treturn (int)$value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (string)$value;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Empty values should be null so \n\t\t\t// they are auto-incremented properly\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function setFieldValue(Field $field, $model, $value);", "protected function typeCast($value) {\n\t\t# Cast\n\t\treturn (int) $value;\n\t}", "public function setInt($key, $value)\n {\n if (empty($value)) {\n $value = 0;\n }\n\n $this->set($key, (int) $value);\n }", "public function setField($field);", "public function setField($field);", "function db_intval($int)\n{\n\treturn $int + 0;\n}", "public function load(Mage_Core_Model_Abstract $object, $value, $field = null)\n {\n if(!is_numeric($value) && is_null($field)) {\n $field = 'identifier';\n }\n\n return parent::load($object, $value, $field);\n }", "public function set($field, $value);", "public function set($field, $value);", "public function toNative()\n {\n $value = parent::toNative();\n\n return \\intval($value);\n }", "public static function intval($integer, ORM $object = NULL)\n {\n return intval($integer);\n }", "function sanitize_int( $value, $key, array $data ) {\n\treturn (int) $value;\n}", "public function toInt(): int\n {\n return (int) $this->getValue();\n }", "function post_int($integer_name) {\n\t$integer = $_POST[$integer_name];\n\tsettype($integer, \"integer\");\n\treturn $integer;\n}", "public function toInt()\n {\n return self::infer((int) $this->value);\n }", "private function adjust_field_types() {\n // Adjust int fields.\n $ft = array('id', 'course', 'context', 'file', 'cropx', 'cropy', 'scalex', 'scaley', 'height', 'width', 'rotate');\n foreach ($ft as $f) {\n $this->$f = ($this->$f === null) ? null : (int)$this->$f;\n }\n }", "function genesisawesome_intval( $new_val, $old_val ) {\n\t\n\treturn intval( $new_val );\n\n}", "public static function convertToNativeType($field, $value)\n {\n switch($field[\"type\"])\n {\n case \"number\":\n if(isset($field[\"field_options\"][\"integer_only\"]) && $field[\"field_options\"][\"integer_only\"])\n return intval($value);\n else\n return floatval($value);\n break; // defensive but not necessary\n case \"date\": // @todo: use a format attribute within field options accordig to date_parse_from_format function\n return $value;\n break;\n // @todo: file\n default:\n return $value;\n }\n }", "function _field_number($fval) \n {\n return $this->_field_text($fval);\n }", "public function setInteger(string $key, int $value): StoreInterface {\n $field = Field::autoFactory($key);\n $field->setIntegerField($key, $value);\n $field->save();\n\n return $this;\n }", "public static function integer(?string $valueType = null);", "public function cast()\n {\n $this->id = (int)$this->id;\n $this->onboarding_percentage = (int)$this->onboarding_percentage;\n $this->count_applications = (int)$this->count_applications;\n $this->count_accepted_applications = (int)$this->count_accepted_applications;\n }", "public function toInt()\n {\n return $this->cast('int');\n }", "private static function _intVal($int)\n {\n return $int + 0;\n }", "public function set(int $value): void {}", "function number_int( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_NUMBER,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_INTEGER\n );\n\t}", "public function testToValueMakeInteger()\n {\n $expected = Integer::class;\n\n $input = [\n 'type' => 'number.integer',\n 'value' => 12\n ];\n\n $sut = new Value();\n\n $result = $sut->toValue($input);\n\n $this->assertInstanceOf($expected, $result);\n }", "public function _typecastSaveField(Field $f, $value)\n {\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'boolean':\n // if enum is not set, then simply cast value to integer\n if (!isset($f->enum) || !$f->enum) {\n $v = (int) $v;\n break;\n }\n\n // if enum is set, first lets see if it matches one of those precisely\n if ($v === $f->enum[1]) {\n $v = true;\n } elseif ($v === $f->enum[0]) {\n $v = false;\n }\n\n // finally, convert into appropriate value\n $v = $v ? $f->enum[1] : $f->enum[0];\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if ($v instanceof $dt_class) {\n $format = ['date' => 'Y-m-d', 'datetime' => 'Y-m-d H:i:s', 'time' => 'H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set to persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v->setTimezone(new $tz_class($f->persist_timezone));\n }\n $v = $v->format($format);\n }\n break;\n case 'array':\n case 'object':\n // don't encode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonEncode($f, $v);\n break;\n }\n\n return $v;\n }", "private function numeric($field, $value) {\n if(!is_numeric($value)) {\n $this->errors[$field][] = self::ERROR_NUMERIC;\n }\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "public function asInt($key)\n {\n\n if (isset($this->data[$key]))\n return (int)$this->data[$key];\n else\n return 0;\n\n }", "public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}", "private function int ($param)\n {\n $this->type = 'int';\n $this->value = (int)$this->value;\n return true;\n }", "abstract public function convertField($field);", "public function toInteger(&$value = false)\n {\n try{\n $value = (int)$value;\n }\n catch(\\Exception $e){\n $value = 0;\n }\n }", "function setFieldID($iNewVale) {\n\t\t$this->iFieldID = $iNewValue;\n\t}", "public function setFieldValue($fieldSlug, $value);", "public function setValue($fieldname, $value);", "public static function cast($value)\n {\n if(strlen($value)) {\n return (int) $value;\n }\n return null;\n }", "public function setValue($field, $value){\n $this->values[$field] = $value;\n }", "public function SetInt(string $key, int $value) : void\r\n\t{\r\n\t\t$this->Set($key, $value);\r\n\t}", "private function integerValidation($field) {\r\n\t \t\t$sent = $this->getSentData($field);\r\n\t \t\tif ($sent == strval(intval($sent)))\r\n\t \t\t\treturn true;\r\n\t \t\telse\r\n\t \t\t\treturn false;\r\n\t \t}", "public static function sanitize_field( $field, $value ) {\n\t\tif ( in_array( $field, array( 'referral_id', 'affiliate_id' ) ) ) {\n\t\t\t$value = (int) $value;\n\t\t}\n\n\t\tif ( in_array( $field, array( 'rest_id' ) ) ) {\n\t\t\t$value = sanitize_text_field( $value );\n\t\t}\n\n\t\treturn $value;\n\t}", "function uwwtd_field_num($field) {\n// $field[0]['#markup'] = 'Not provided';\n return uwwtd_format_number($field[0]['#markup'], 1);\n}", "final protected function setColumnInteger($key, $value, $allowNull = false)\n\t\t{\n\t\t\t$col = $this->findColumn($key);\n\t\t\tif($col === null)\n\t\t\t\treturn;\n\n\t\t\t$col->setValue($allowNull && is_null($value) ? null : CDFDataHelper::AsInt($value));\n\t\t}", "public function setField($value) {\n\t\t$this->_field = $value;\n\t}", "public function & toInt()\n\t{\n\t\t$x = integer((int)$this->data);\n\t\treturn $x;\n\t}", "function set_post_field ($field, $value, $post_id) {\n\t\tglobal $wpdb;\n\n\t\t$post_id = absint($post_id);\n\t\t// sigh ... when FWP is active, I need to avoid avoid_kses_munge\n\t\t// $value = sanitize_post_field($field, $value, $post_id, 'db');\n\t\treturn $wpdb->update($wpdb->posts, array($field => $value), array('ID' => $post_id));\n\t}", "function vInt( $value )\r\n\t\t{\r\n\t\t\t#return filter_var($value, FILTER_VALIDATE_FLOAT); // float\r\n\t\t\treturn filter_var( $value, FILTER_VALIDATE_INT ); # int\r\n\t\t\t\r\n\t\t}", "public function setCustomField($field, $value, $type = 'TYPE_STRING') {\n\n $fieldObj = Doctrine::getTable('ArticleCustomField')->findOneByName($field);\n\n if(!$fieldObj) {\n // pole nie istnieje\n // to na przyszlosc, gdy dojdzie mozliwosc samodzielnego definiowania pol przez usera\n// $fieldObj = new ArticleCustomField();\n// $fieldObj->name = $field;\n// $fieldObj->type = $type;\n// $fieldObj->save();\n\n return;\n }\n\n if(!$article2customFieldValue = Doctrine::getTable('ArticleCustomFieldValue')->find(array('article_id' => $this->getPrimaryKey(),\n 'field_id' => $fieldObj->getPrimaryKey()))) {\n $article2customFieldValue = new ArticleCustomFieldValue();\n }\n\n $article2customFieldValue->article_id = $this->getPrimaryKey();\n $article2customFieldValue->field_id = $fieldObj->getPrimaryKey();\n\n if($fieldObj->type == 'TYPE_DATE') {\n //0 - rok, 1 - miesiac, 2 - dzien, 3 - godzina, 4 - minuty, 5 - sekundy\n $time = preg_split('/[\\s-:]+/', $value);\n $value = mktime($time[3], $time[4], $time[5], $time[1], $time[2], $time[0]);\n }\n\n $article2customFieldValue->value = $value;\n\n $article2customFieldValue->save();\n\n }", "protected function _setNumeric($name, $value) {}", "function cast($field, $value) {\n\t\t// if the column doesn't exist, don't cast the value\n\t\tif (!isset($this->columns[$field])) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t// precast arrays\n\t\tif (is_array($value)) {\n\t\t\t$value = $this->columns[$field]->array_to_type(array_values($value));\n\t\t}\n\n\t\t// cast value\n\t\t$value = $this->columns[$field]->type_cast($value);\n\n\t\treturn $value;\n\n\t}", "public function putInt(string $name, ?int $value): string;", "public function setValue($var)\n {\n GPBUtil::checkInt64($var);\n $this->value = $var;\n\n return $this;\n }", "public function setValue($var)\n {\n GPBUtil::checkInt64($var);\n $this->value = $var;\n\n return $this;\n }", "function acf_numval($value)\n{\n}", "public function set(string $field, int | float | bool | string | Expr $value): static\n {\n $this->what[$field] = $value;\n return $this;\n }", "public function scrubInt(int $data) : int;", "function nb_update_post_related_artist_id( $value, $object, $field_name ) {\n if ( ! $value || ! is_numeric( $value ) ) {\n echo (\"nb_update_post_related_artist_id failed\");\n return;\n }\n\n return update_post_meta( $object->ID, $field_name, (int) $value );\n}", "protected function normalize()\r\n\t{\r\n\t\tif ($this->isFetched())\r\n\t\t{\r\n\t\t\tif ($this->validationInfo)\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->validationInfo->normalize($this->taintValue);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->normalizedValue = $this->taintValue;\r\n\t\t\t}\t\r\n\t\t}\r\n\t}", "public function SetField($val, $field)\n {\n $this->{$field} = $val;\n //echo $field.'<br>';\n }", "public function set($key, $value)\n {\n $numeric = ['price', 'tax', 'quantity'];\n\n if ((in_array($key, $numeric)) && (! is_int($value))) {\n throw new CartPropertyNotIntegerException(\n sprintf('The [%s] property must be an integer', $key)\n );\n }\n\n $this->item[$key] = $value;\n }", "public function integerMethod($integer)\n {\n }", "public function integer($attribute, $label, $options = [])\n {\n $options['attributes']['step'] = 1;\n $options = static::defaults($options);\n return $this->addSingleField(\n $attribute,\n $options[self::OPTIONS_VALIDATION],\n Widget::getNumberWidget($attribute, $label, $options),\n function ($value)\n {\n // cast to int datatype, or null if blank\n return is_null($value) || $value === '' ? null : intval($value);\n }\n );\n }", "function nb_update_post_views( $value, $object, $field_name ) {\n if ( ! $value || ! is_numeric( $value ) ) {\n echo (\"nb_update_post_views failed\");\n return;\n }\n\n return update_post_meta( $object->ID, $field_name, (int) $value );\n}", "public function asNumber(): int\n {\n return $this->value;\n }", "function setField($field, $value)\n {\n $this->_data[$field] = $value;\n }", "public static function tryParseInt(&$fld, $default = false, $allowZero = false)\n\t{\n\t\t$fld = intval($fld);\n\t\tif(!$allowZero && !$fld && $default !== false)\n\t\t\t$fld = $default;\n\t\t\t\n\t\treturn $fld;\n\t}", "public function setField($field)\n {\n $this->_field = $field;\n }", "public static function tryParseInt(&$fld, $default, $allowZero = false)\n\t{\n\t\t$fld = intval($fld);\n\t\tif(!$allowZero && !$fld && isset($default))\n\t\t\t$fld = $default;\n\t\t\t\n\t\treturn $fld;\n\t}", "protected function isint($field, $err_msg){\n if(!is_numeric($field)){\n throw new Exception($err_msg);\n }\n }", "public function set_id_field_and_value($fieldname,$value) {\n $this->id_field=$fieldname;\n $this->id_field_value=$value;\n }", "public function setField(Field $field) {\n\t\t$this->field = $field; \n\t}", "#[@test]\n public function integerCast() {\n $this->assertSourcecodeEquals(\n '$i= (int)$str;',\n $this->emit('$i= (int)$str;')\n );\n }", "public function getSint64Field()\n {\n $value = $this->get(self::SINT64_FIELD);\n return $value === null ? (integer)$value : $value;\n }", "public function setField($field) {\n\t\t$this->_field = $field;\n\t}", "public function testSetCode() {\n\n $obj = new TestIntegerCodeTrait();\n\n $obj->setCode(1);\n $this->assertEquals(1, $obj->getCode());\n }", "public function set($field, $value) {\r\n\t\t$this -> fields[$field] = $value;\r\n\t}" ]
[ "0.7122519", "0.6866179", "0.6641615", "0.6443829", "0.6291112", "0.6191459", "0.6169387", "0.6167649", "0.6090318", "0.60780144", "0.6063863", "0.60432625", "0.6023284", "0.60185283", "0.59998816", "0.59918654", "0.5924552", "0.5913186", "0.59008855", "0.5897239", "0.58916587", "0.5890979", "0.587845", "0.58567035", "0.5829555", "0.58006006", "0.58006006", "0.5797158", "0.578889", "0.57745755", "0.57745755", "0.5766394", "0.5751209", "0.5735204", "0.5734941", "0.5675558", "0.5668717", "0.5665838", "0.5663953", "0.5648484", "0.56441164", "0.56402737", "0.5611308", "0.55791694", "0.5578924", "0.5549161", "0.5516268", "0.5514228", "0.5499904", "0.549055", "0.5485206", "0.54798865", "0.54796124", "0.5461109", "0.5460613", "0.5455858", "0.5455736", "0.54494363", "0.54481244", "0.5444682", "0.5442935", "0.5430616", "0.5430613", "0.5412276", "0.5405533", "0.540516", "0.5393156", "0.53920066", "0.5386471", "0.53837264", "0.53773737", "0.5366711", "0.5364137", "0.53584665", "0.5356721", "0.5347531", "0.5347531", "0.5344957", "0.5334602", "0.5318894", "0.53044945", "0.52963907", "0.5292227", "0.52836883", "0.52774525", "0.5277103", "0.527545", "0.5275391", "0.5268648", "0.52549773", "0.52536577", "0.52330154", "0.52079016", "0.5201998", "0.5183684", "0.51835686", "0.51835394", "0.51818305", "0.51802367", "0.5170572" ]
0.7137426
0
Set the given field with the given value typecasted as a float
protected function setAsFloat($field, $value) { $this->object[$field] = (float) $value; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setFloatField($value)\n {\n return $this->set(self::FLOAT_FIELD, $value);\n }", "function o_castFloat($value) {\n\t\t\treturn Obj::singleton()->castFloat($value);\n\t\t}", "public function set($value = null)\r\n {\r\n return parent::set((float)$value);\r\n }", "public function setValue($var)\n {\n GPBUtil::checkFloat($var);\n $this->value = $var;\n\n return $this;\n }", "public function getFloat(string $field): float\n {\n return floatval($this->get($field));\n }", "public function getFloatField()\n {\n $value = $this->get(self::FLOAT_FIELD);\n return $value === null ? (double)$value : $value;\n }", "public function SetFloat(string $key, float $value) : void\r\n\t{\r\n\t\t$this->Set($key, $value);\r\n\t}", "public static function float(?string $valueType = null);", "public function setFNumber(?float $value): void {\n $this->getBackingStore()->set('fNumber', $value);\n }", "private function float ($param)\n {\n $this->type = 'float';\n $this->value = (float)$this->value;\n return true;\n }", "public function putFloat(string $name, ?float $value): string;", "function floatval($var)\n{\n}", "private static function toFloat($value)\n {\n return (float) $value;\n }", "public function toFloat(): float\n {\n return (float) $this->getValue();\n }", "final protected function setColumnFloat($key, $value, $allowNull = false)\n\t\t{\n\t\t\t$col = $this->findColumn($key);\n\t\t\tif($col === null)\n\t\t\t\treturn;\n\n\t\t\t$col->setValue($allowNull && is_null($value) ? null : CDFDataHelper::AsFloat($value));\n\t\t}", "public function setFloat(string $key, int $value): StoreInterface {\n $field = Field::autoFactory($key);\n $field->setFloatField($key, $value);\n $field->save();\n\n return $this;\n }", "public function setFloat(string $key, float $value, int $ttl = 0): bool;", "public static function float() {}", "public function float()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertSame($floatFilter, $floatFilter->setDecimals(2));\n $this->assertEquals(156, $floatFilter->execute('1.564'));\n }", "public function getFloat() :float\n {\n return $this->value;\n }", "function &float(float $value, string $namespace = 'default'): float\n{\n $var = new Variable\\FloatVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "function toFloat ($value) {\n assert(count(func_get_args()) == 1);\n if (is_scalar($value)) {\n $convertedValue = filter_var($value, FILTER_VALIDATE_FLOAT, FILTER_NULL_ON_FAILURE);\n if ($convertedValue !== null)\n return $convertedValue;\n }\n if (is_object($value) && hasMember($value, 'toFloat'))\n return toFloat($value->toFloat());\n throw new RuntimeException('Unable to convert to float.');\n}", "public static function ensureFloat($value)\n\t{\n\t\treturn (float)$value;\n\t}", "public function floatValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "static public function Float($var, $flags = null) {\r\n\r\n\t\t$cleaned = filter_var($var, FILTER_SANITIZE_NUMBER_FLOAT, $flags);\r\n\t\treturn $cleaned == \"\" ? false : (float)$cleaned;\r\n\r\n\t}", "public function checkFloat(): float\n {\n if (!is_float($this->getValue())) {\n throw new TypeInvalidException('float', gettype($this->getValue()));\n }\n\n return $this->getValue();\n }", "function validate_float() {\n # Check if the value is a foat\n if (is_float($this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Value\n return $this->cur_val;\n }\n else {\n # Set Error Message\n $this->set_error( \"Validation for float ({$this->cur_val}) failed. This is type \" . gettype($this->cur_val));\n\n # Return Float Value\n return floatval($this->cur_val);\n }\n }", "public function scrubFloat(float $data) : float;", "function sanitize_float( $value, $key, array $data ) {\n\treturn (float) $value;\n}", "function o_isFloat($value) {\n\t\t\treturn Obj::singleton()->isFloat($value);\n\t\t}", "function ods_cell_set_val($cell, $p, $val, $options = array()) {\n\n if (is_numeric($val)) {\n $string_val = (string) $val;\n $p->nodeValue = str_replace('.', ',', $string_val);\n $cell->setAttribute('office:value-type', 'float');\n $cell->setAttribute('calcext:value-type', 'float');\n $cell->setAttribute('office:value', $val);\n } else {\n $p->nodeValue = $val;\n }\n }", "public function testFloat()\n {\n set_error_handler([$this->instance, 'handleError'], E_NOTICE);\n $float = $this->instance+.0;\n restore_error_handler();\n\n self::assertTrue(\n is_float($float),\n 'Instance cannot be typecast to a float'\n );\n }", "public function testFloat()\n {\n $float = (float) 13.54;\n $this->assertSame($float, $this->_filter->filter($float));\n }", "public function float($value)\n {\n $bytes = pack('f*', $value);\n if ($this->isBigEndian()) {\n $bytes = strrev($bytes);\n }\n $this->write($bytes, 4);\n }", "public function setValueAttribute($value)\n {\n $this->attributes['value'] = DataHelper::getReal2Float($value);\n }", "public function evaluateFieldValue($value, $is_in, &$set)\n {\n $floatValue = number_format((float)$value, 3);\n return $floatValue;\n }", "public function parseFloat()\n {\n if (is_string($this->value)) {\n $this->value = preg_replace('/\\s|`|\\'|,/', \"\", preg_replace('/,{1}/', '.', $this->value));\n }\n $this->value = (float)$this->value;\n return $this;\n }", "public function fromFloat($value)\n {\n switch ((string) $value) {\n case 'Infinity':\n return INF;\n case '-Infinity':\n return -INF;\n case 'NaN':\n return NAN;\n default:\n return (float) $value;\n }\n }", "function readFloat();", "public static function GetFloat($key)\n {\n return (float)self::Get($key);\n }", "#[@test]\n public function floatType() {\n $this->testType(new Float(0), 0, 0.0);\n }", "public static function aFloat($value)\n {\n return (is_float($value))?:false;\n }", "public function float()\n\t{\n\t\treturn $this->filter(FILTER_SANITIZE_NUMBER_FLOAT);\n\t}", "public static function filterFloat($attrValue)\n\t{\n\t\treturn filter_var($attrValue, FILTER_VALIDATE_FLOAT);\n\t}", "public function castType($value=null)\n {\n if (!is_null($value)) return (float)$value;\n return 0;\n }", "public function setFFloat($var)\n {\n GPBUtil::checkFloat($var);\n $this->f_float = $var;\n\n return $this;\n }", "public function toFloat()\n {\n if (is_array($this->value)) {\n throw new InvalidNotArrayException($this->name);\n } elseif (!empty($this->value) && !is_numeric($this->value)) {\n throw new InvalidNumericException($this->name, $this->value);\n }\n\n $this->value = (float) $this->value;\n\n return $this;\n }", "public function set(string $name, float $value, array $labels = []): void;", "public function getDataType()\n {\n return DField::DATA_TYPE_FLOAT;\n }", "public function getFloat(string $key): float\n {\n return floatval($this->get($key));\n }", "public function getFloat($prop) {\n\n\t\t\t// Get property\n\t\t\t$val = $this->get($prop);\n\n\t\t\t// Numeric?\n\t\t\tif (is_numeric($val)) {\n\n\t\t\t\treturn floatval($val);\n\n\t\t\t} else {\n\n\t\t\t\t// Not found\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}", "function isFloat($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\tif(!is_float($value)){\n\t\tif($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t\n\t\t}else{\n\t\treturn true;\n\t\t}\n\t}", "public function getFloat($name);", "function setValue( $value )\r\n {\r\n $newValue = number_format( $value, 4, \".\", \"\" );\r\n $value = (double) $newValue;\r\n $this->Value = $value;\r\n }", "function float_or_null($f) {\n return $f === null ? null : (float) $f;\n}", "private function toFloat($value)\n {\n return (float) str_replace(',', '.', $value);\n }", "public function getFFloat()\n {\n return $this->f_float;\n }", "public function & toFloat()\n\t{\n\t\t$x = float((int)$this->data);\n\t\treturn $x;\n\t}", "public function getFNumber(): ?float {\n $val = $this->getBackingStore()->get('fNumber');\n if (is_null($val) || is_float($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'fNumber'\");\n }", "public function postFloat(string $field, string $input_culture = 'pt-br', int $decimal_digits = 2)\n {\n return $this->field_float(INPUT_POST, $field, $decimal_digits, $input_culture);\n }", "public function toFloat()\n {\n eval('$var = ' . $this->value . ';');\n\n return $var;\n }", "public function floatValue($key, $default, $min = null, $max = null);", "function floatNum($value)\n{\n return floatval(str_replace(',', '.', $value));\n}", "abstract public function convertFromDb($value, Entity\\ScalarField $field);", "function setReal($real) {/*{{{*/\n $this->real = floatval($real);\n }", "public static function NASAtoFloat($val )\n {\n $a = unpack(\"N\",$val);\n $b = unpack(\"f\",pack( \"I\",$a[1]));\n return $b[1];\n }", "protected static function validate_float($field, $input, $param = NULL)\n\t{\n\t\tif(!isset($input[$field]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(!filter_var($input[$field], FILTER_VALIDATE_FLOAT))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'field' => $field,\n\t\t\t\t'value' => $input[$field],\n\t\t\t\t'rule'\t=> __FUNCTION__\n\t\t\t);\n\t\t}\n\t}", "public function float($value) : float|array\n\t{\n\t\treturn $this->handlers->map($value, function ($value) {\n\t\t\treturn (float)$value;\n\t\t});\n\t}", "public function setFieldValue(Field $field, $model, $value);", "public function testSetAndRetrieveFloat(): void\n {\n $key = \"A test key\";\n $expected = 7.234;\n $this->testNotStrict->set($key, $expected);\n $actual = $this->testNotStrict->get($key);\n $this->assertEquals($expected, $actual);\n }", "public function testSetAmountWithAnotherProblematicFloat()\n {\n $total = 114.9984;\n\n $this->assertSame(114, (int)$total);\n\n $this->slipData->setAmount($total);\n\n $this->assertSame(115, $this->slipData->getAmountFrancs());\n $this->assertSame('00', $this->slipData->getAmountCents());\n }", "private function mapStringToFloat($results)\n {\n return floatval($results);\n }", "public function convertValue($value) {\n $floatValue = floatval($value);\n if ($floatValue === 0.0 && $value !== '0' && $value !== '0.0') {\n throw new InvalidParameterValueException();\n }\n return $floatValue;\n }", "public function float()\n {\n if (!is_float($this->value)) {\n throw new InvalidFloatException($this->name, $this->value);\n }\n\n return $this;\n }", "public function _typecastSaveField(Field $f, $value)\n {\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'boolean':\n // if enum is not set, then simply cast value to integer\n if (!isset($f->enum) || !$f->enum) {\n $v = (int) $v;\n break;\n }\n\n // if enum is set, first lets see if it matches one of those precisely\n if ($v === $f->enum[1]) {\n $v = true;\n } elseif ($v === $f->enum[0]) {\n $v = false;\n }\n\n // finally, convert into appropriate value\n $v = $v ? $f->enum[1] : $f->enum[0];\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if ($v instanceof $dt_class) {\n $format = ['date' => 'Y-m-d', 'datetime' => 'Y-m-d H:i:s', 'time' => 'H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set to persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v->setTimezone(new $tz_class($f->persist_timezone));\n }\n $v = $v->format($format);\n }\n break;\n case 'array':\n case 'object':\n // don't encode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonEncode($f, $v);\n break;\n }\n\n return $v;\n }", "public static function formatToFixed($float) {}", "public function testCastToFloat($data) {\n\t\t$this->assertTrue(is_float(Convertor::cast($data)), \"[{$data}] is not Float\");\n\t\t$this->assertGreaterThan(0, Convertor::cast($data), \"[{$data}] is not greater than 0\");\n\t}", "public function writeFloat($num){ }", "public function _typecastLoadField(Field $f, $value)\n {\n // LOB fields return resource stream\n if (is_resource($value)) {\n $value = stream_get_contents($value);\n }\n\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'string':\n case 'text':\n // do nothing - it's ok as it is\n break;\n case 'integer':\n $v = (int) $v;\n break;\n case 'float':\n $v = (float) $v;\n break;\n case 'money':\n $v = round($v, 4);\n break;\n case 'boolean':\n if (isset($f->enum) && is_array($f->enum)) {\n if (isset($f->enum[0]) && $v == $f->enum[0]) {\n $v = false;\n } elseif (isset($f->enum[1]) && $v == $f->enum[1]) {\n $v = true;\n } else {\n $v = null;\n }\n } elseif ($v === '') {\n $v = null;\n } else {\n $v = (bool) $v;\n }\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if (is_numeric($v)) {\n $v = new $dt_class('@'.$v);\n } elseif (is_string($v)) {\n // ! symbol in date format is essential here to remove time part of DateTime - don't remove, this is not a bug\n $format = ['date' => '+!Y-m-d', 'datetime' => '+!Y-m-d H:i:s', 'time' => '+!H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set from persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v = $dt_class::createFromFormat($format, $v, new $tz_class($f->persist_timezone));\n if ($v === false) {\n throw new Exception(['Incorrectly formatted datetime', 'format' => $format, 'value' => $value, 'field' => $f]);\n }\n $v->setTimeZone(new $tz_class(date_default_timezone_get()));\n } else {\n $v = $dt_class::createFromFormat($format, $v);\n if ($v === false) {\n throw new Exception(['Incorrectly formatted date/time', 'format' => $format, 'value' => $value, 'field' => $f]);\n }\n }\n\n // need to cast here because DateTime::createFromFormat returns DateTime object not $dt_class\n // this is what Carbon::instance(DateTime $dt) method does for example\n if ($dt_class != 'DateTime') {\n $v = new $dt_class($v->format('Y-m-d H:i:s.u'), $v->getTimeZone());\n }\n }\n break;\n case 'array':\n // don't decode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonDecode($f, $v, true);\n break;\n case 'object':\n // don't decode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonDecode($f, $v, false);\n break;\n }\n\n return $v;\n }", "public function getFloat($index)\r\n\t{\r\n\t $this->_checkIndex($index);\r\n\t \r\n\t if(isset($this->row[$index]))\r\n {\r\n\t return floatval($this->row[$index]);\r\n\t }\r\n\t\r\n\t throw($this->_throwInvalidIndex($index));\r\n\t}", "public function value()\n {\n $floatFilter = new stubFloatFilter();\n $this->assertSame($floatFilter, $floatFilter->setDecimals(3));\n $this->assertEquals(8453, $floatFilter->execute('8.4533'));\n $this->assertEquals(8453, $floatFilter->execute('8.4538'));\n $this->assertEquals(8450, $floatFilter->execute('8.45'));\n $this->assertEquals(8000, $floatFilter->execute('8'));\n $this->assertEquals(8453, $floatFilter->execute(8.4533));\n $this->assertEquals(8453, $floatFilter->execute(8.4538));\n $this->assertEquals(8450, $floatFilter->execute(8.45));\n $this->assertEquals(8000, $floatFilter->execute(8));\n }", "function validFloat($value)\n {\n return filter_var($value, FILTER_VALIDATE_FLOAT);\n }", "protected function typeFloat(Fluent $column)\n {\n return 'float';\n }", "public static function static_parseFloat($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public static function converterMoedaParaFloat(string $valor){\n $val = str_replace(\",\",\".\",$valor);\n $val = preg_replace('/\\.(?=.*\\.)/', '', $val);\n return floatval($val);\n }", "function cleanFloat($name) {\n\t\tif (isset($this->getvars[$name])){\n\t\t\tif (is_array($this->getvars[$name])){\n\t\t\t\treturn Cgn::cleanFloatArray($this->getvars[$name]);\n\t\t\t}\n\t\t\treturn floatval($this->getvars[$name]);\n\t\t} else {\n\t\t\tif (@is_array($this->postvars[$name])){\n\t\t\t\treturn Cgn::cleanFloatArray($this->postvars[$name]);\n\t\t\t}\n\t\t\treturn floatval(@$this->postvars[$name]);\n\t\t}\n\t}", "public function setField($value) {\n\t\t$this->_field = $value;\n\t}", "function to_float($string_number){\n $number = floatval(str_replace('.', ',', str_replace(',', '', $string_number)));\n\n // At this point, $number is a \"natural\" float.\n return $number;\n }", "public function testIntToFloat()\n {\n $int = (int) 5;\n $this->assertSame((float) 5, $this->_filter->filter($int));\n }", "function _v( $str ) { return (float) substr($str,1); }", "public function getFloat($i);", "final protected function getColumnFloat($key, $allowNull = false)\n\t\t{\n\t\t\t$value = $this->getColumnValue($key, $allowNull);\n\t\t\tif(!is_null($value) && !is_float($value))\n\t\t\t\tthrow new CDFColumnDataException($key, 'Column is not a float');\n\t\t\treturn $value;\n\t\t}", "public function setValue($value) {\n // this is an improvise\n // detect the currency by symbol,\n $currencySign = mb_substr($value, 0, 1, 'utf-8');\n // seperated out amount from currecy symbol, although this is not \n // correct but since data is missing from csv\n $this->value = (float) mb_substr($value, 1, mb_strlen($value) - 1, 'utf-8');\n $this->detectCurrencyBySign($currencySign);\n }", "public function GetAsFloat(string $key, ?float $default = NULL) : float\r\n\t{\r\n\t\treturn (float)$this->Get($key, $default);\r\n\t}", "public static function convertToNativeType($field, $value)\n {\n switch($field[\"type\"])\n {\n case \"number\":\n if(isset($field[\"field_options\"][\"integer_only\"]) && $field[\"field_options\"][\"integer_only\"])\n return intval($value);\n else\n return floatval($value);\n break; // defensive but not necessary\n case \"date\": // @todo: use a format attribute within field options accordig to date_parse_from_format function\n return $value;\n break;\n // @todo: file\n default:\n return $value;\n }\n }", "public function getFloat(string $key, mixed $default = null): float\n {\n return (float) $this->get($key, $default);\n }", "public function float($error) {\n if ($this->_exist) {\n array_push($this->_constraints, ['type' => self::FLOAT, 'message' => $error]);\n }\n\n return $this;\n }", "public static function parseFloat($value)\n {\n // convert \",\" to \".\"\n $s = str_replace(',', '.', $value);\n\n // remove everything except numbers and dot \".\"\n $s = preg_replace(\"/[^0-9\\.]/\", '', $s);\n\n // remove all seperators from first part and keep the end\n $s = str_replace('.', '', substr($s, 0, -3)).substr($s, -3);\n\n // return float\n return (float) $s;\n }", "public function acceptSchemaVisitor(SchemaVisitor $visitor)\n {\n $visitor->visitFloatMember($this);\n }", "private static function renderFloat($value)\n {\n return Yii::$app->formatter->asDecimal($value);\n }" ]
[ "0.7726843", "0.7273483", "0.7042471", "0.7024189", "0.70025975", "0.6977175", "0.6860591", "0.6653839", "0.6648697", "0.6625575", "0.66055685", "0.6603513", "0.6565375", "0.6536551", "0.64959276", "0.64860475", "0.64772356", "0.63983834", "0.63973117", "0.6386981", "0.6345343", "0.63371074", "0.6325252", "0.63146216", "0.62908083", "0.6262286", "0.6262227", "0.6242015", "0.62031245", "0.6170686", "0.61583334", "0.61454314", "0.61369", "0.6113838", "0.61080366", "0.60985464", "0.60985196", "0.608448", "0.6081279", "0.60788447", "0.6078049", "0.6069234", "0.6051772", "0.6040392", "0.6039693", "0.6035873", "0.60105747", "0.6008327", "0.6001389", "0.6001156", "0.5996733", "0.59845144", "0.59614164", "0.5961247", "0.5932339", "0.5927896", "0.59275657", "0.5918434", "0.5911396", "0.59097624", "0.5907791", "0.5841852", "0.58293694", "0.58094233", "0.5792328", "0.5789806", "0.57801735", "0.577328", "0.5771349", "0.5764952", "0.5759256", "0.57573754", "0.57421017", "0.5737497", "0.5736695", "0.5734181", "0.57236546", "0.5722553", "0.5713456", "0.57073313", "0.569546", "0.5692675", "0.5683946", "0.56725305", "0.5671804", "0.56476814", "0.56417376", "0.56396705", "0.5633138", "0.56107265", "0.5606669", "0.5598541", "0.5595306", "0.55853176", "0.5582744", "0.5581532", "0.55566293", "0.5545514", "0.55404496", "0.553503" ]
0.77681315
0
Set the given field with the given value typecasted as a boolean
protected function setAsBoolean($field, $value) { $this->object[$field] = (bool) $value; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setBoolField($value)\n {\n return $this->set(self::BOOL_FIELD, $value);\n }", "public function castToBool($value);", "function to_boolean($val);", "function o_castBool($value) {\n\t\t\treturn Obj::singleton()->castBool($value);\n\t\t}", "public function set($value)\n\t{\n\t\treturn filter_var($value, FILTER_VALIDATE_BOOLEAN);\n\t}", "public function set($value)\n\t{\n\t\treturn filter_var($value, FILTER_VALIDATE_BOOLEAN);\n\t}", "protected function _setBoolean($name, $value) {}", "public function testBooleanField()\n {\n $field = $this->table->getField('trueorfalse'); // Boolean\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Boolean',\n $field);\n $this->assertEquals('trueorfalse', $field->getName());\n\n $this->assertTrue($field->getPHPValue(1));\n $this->assertFalse($field->getPHPValue(0));\n $this->assertNull($field->getPHPValue(null));\n\n $this->assertTrue($field->isNullOk());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('falsedef'); // Boolean, No Nulls, default False\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Boolean', $field);\n $this->assertEquals('falsedef', $field->getName());\n\n $this->assertFalse($field->getPHPValue(null));\n\n // Check for an exception when in strict\n $field->setStrictValues();\n $x = false;\n\n try\n {\n $field->getPHPValue(null);\n }\n catch ( RangeException )\n {\n $x = true;\n }\n\n $this->assertTrue($x);\n\n $field = $this->table->getField('truedef'); // Boolean, No Nulls, default true\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Boolean', $field);\n $this->assertEquals('truedef', $field->getName());\n\n $this->assertTrue($field->getPHPValue(null));\n $boundVal = $field->getSqlBoundValue(null);\n $valMarker = $boundVal->getValueMarker();\n\n $this->assertEquals('true', $boundVal->getBoundValues()[$valMarker]);\n }", "public function setBooleanType($key, $value)\n\t{\n\t\tif ($value == 'true' or $value === 1 or $value === true)\n\t\t{\n\t\t\treturn $this->set($key, 'true');\n\t\t}\n\t\t\n\t\treturn $this->set($key, 'false');\n\t}", "protected function _setBooleanValue($key, $value) {}", "public function testSpecifyingFieldNameSpecifyingBoolValues1()\n {\n $testName = 'MyField';\n $fieldSetting = array(\n 'label' => 'Label',\n 'footnote' => 'Footnote',\n 'hide' => false,\n 'readOnly' => false,\n 'recommended' => true);\n\n $field = new Application_Model_Field($testName, $fieldSetting);\n\n // Test all methods that don't have unmet preconditions.\n $this->assertSame($testName, $field->getDbFieldName());\n $this->assertFalse($field->isReadOnly());\n $this->assertTrue($field->isVisible());\n $this->assertSame(\"Label\", $field->getLabel());\n $this->assertSame(\"Footnote\", $field->getFieldFootnote());\n // Recommended will not be true because the field is not in the table\n $this->assertFalse($field->isRecommended());\n $this->assertFalse($field->isDiscouraged());\n $this->_assertNoMetaInfo($field);\n }", "public function getBoolField()\n {\n $value = $this->get(self::BOOL_FIELD);\n return $value === null ? (boolean)$value : $value;\n }", "private function convert_to_boolean_attributes() {\n foreach ($this->attributes() as $attr => $val) {\n if (preg_match('/^can_/', $attr) || preg_match('/^is_/', $attr)) {\n $this->$attr = ($val == '1');\n }\n }\n }", "public function setBoolean($trueFalse);", "public function testSpecifyingFieldNameSpecifyingBoolValues2()\n {\n $testName = 'MyField';\n $fieldSetting = array(\n 'label' => 'Label',\n 'footnote' => 'Footnote',\n 'hide' => true,\n 'readOnly' => true,\n 'recommended' => false,\n 'discouraged' => true);\n\n $field = new Application_Model_Field($testName, $fieldSetting);\n\n // Test all methods that don't have unmet preconditions.\n $this->assertSame($testName, $field->getDbFieldName());\n $this->assertTrue($field->isReadOnly());\n $this->assertFalse($field->isVisible());\n $this->assertSame(\"Label\", $field->getLabel());\n $this->assertSame(\"Footnote\", $field->getFieldFootnote());\n $this->assertFalse($field->isRecommended());\n // Discouraged will not be true because the field is not in the table\n $this->assertFalse($field->isDiscouraged());\n $this->_assertNoMetaInfo($field);\n }", "private function _convert_boolean(mixed $value): bool {\n\t\treturn Types::toBool($value);\n\t}", "function pdo_bool($value) {\n\tif (is_bool($value)) {\n\t\t$value = (int)$value;\n\t}\n\treturn $value;\n}", "function boolval( $val ) {\r\n\t\treturn (bool) $val;\r\n\t}", "public function toBool() : bool\n {\n return boolval($this->value);\n }", "public function wt_parse_bool_field($value) {\n if ('0' === $value) {\n return false;\n }\n\n if ('1' === $value) {\n return true;\n }\n\n // Don't return explicit true or false for empty fields or values like 'notify'.\n return wc_clean($value);\n }", "private function newBooleanField(stdClass $fieldDef): DBTable\\Field\n {\n $field = new Fld\\Boolean($fieldDef->column_name);\n $this->setProperties($field, $fieldDef);\n\n return $field;\n }", "public function updateBoolean( Inx_Api_Recipient_Attribute $attr, $blValue );", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "function converter(&$value, $key){\n if($value === \"true\") {\n $value = TRUE;\n } elseif ($value === \"false\") {\n $value = FALSE;\n }\n if ($key === \"not\") {\n if ($value === \"1\") {\n $value = TRUE;\n }\n if ($value === \"0\") {\n $value = FALSE;\n }\n }\n }", "public function toBool()\n {\n $this->value = (bool) $this->value;\n\n return $this;\n }", "private function fixTrueFalse(&$value, $key) {\r\n if ($value == 'false') {\r\n \t$value = false;\r\n } elseif ($value == 'true') {\r\n $value = true;\r\n }\r\n }", "private function bool($value)\n\t{\n\t\t// We do *not* follow the string 0 php casting rule.\n\t\t// {if field} should be true if the user entered\n\t\t// something. Doesn't matter what it is.\n\t\tif ($value === '0')\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn (bool) $value;\n\t}", "function rest_sanitize_boolean($value)\n {\n }", "#[@test]\n public function boolCast() {\n $this->assertSourcecodeEquals(\n '$s= (bool)$num;',\n $this->emit('$s= (bool)$num;')\n );\n }", "public function setBool($key, $value)\n {\n if (empty($value)) {\n $this->set($key, false);\n } else if (is_string($value)) {\n $this->set(\n $key,\n in_array(strtolower(trim($value)), self::$_booleans)\n );\n } else {\n $this->set($key, $value === true || $value === 1);\n }\n }", "private function __converter(&$value, $key) {\n\t\tif (is_bool($value)) {\n\t\t\t$value = ($value ? '1' : '0');\n\t\t}\n\t}", "public function postBool(string $field_name, string $true_value)\n {\n return $this->field_bool(INPUT_POST, $field_name, $true_value);\n }", "public function setUnique($val){ $this->field_map['is_unique'] = (bool)$val; }", "public static function tryParseBoolean(&$fld)\n\t{\n\t\t$fld = $fld == 'Y';\n\t\treturn $fld;\n\t}", "public function putBool(string $name, ?bool $value, bool $mandatory = false): string;", "function convertBooleanValues($table, $row)\n{\n global $db_lnk;\n $qry_val_arr = array(\n $table\n );\n $result = pg_query_params($db_lnk, 'SELECT * FROM information_schema.columns WHERE table_name = $1 ', $qry_val_arr);\n while ($field_details = pg_fetch_assoc($result)) {\n if ($field_details['data_type'] == 'boolean') {\n $row[$field_details['column_name']] = ($row[$field_details['column_name']] == 'f') ? 0 : 1;\n }\n }\n return $row;\n}", "public function convertFromSqlBoolean($value)\n {\n if ($value === null) {\n return null;\n }\n\n return (bool)$value;\n }", "public function setStore($value) { $this->_store = self::forceBool($value); }", "public static function setBoolean(string $key, $value) {\n\t\treturn self::$sessionInstance->set ( $key, UString::isBooleanTrue ( $value ) );\n\t}", "function mm_auto_update_make_bool( $value, $default = true ) {\n\tif ( 'false' === $value ) { $value = false; }\n\tif ( 'true' === $value ) { $value = true; }\n\tif ( true !== $value && false !== $value ) { $value = $default; }\n\treturn $value;\n}", "public function setBoolean(string $key, bool $value): StoreInterface {\n $field = Field::autoFactory($key);\n $field->setBooleanField($key, $value);\n $field->save();\n\n return $this;\n }", "private function SetValueBoolean($Ident, $value)\n {\n $id = $this->GetIDForIdent($Ident);\n SetValueBoolean($id, $value);\n }", "protected function addBoolProperty(\n SerializationVisitorInterface $visitor,\n string $prop,\n ?bool $value,\n bool $insertUnderscore = true): void\n {\n $visitor->visitProperty(\n new StaticPropertyMetadata('boolean', $this->propertyName($prop, $insertUnderscore), null),\n $value\n );\n }", "public function set(Jam_Validated $model, $value, $is_changed)\n\t{\n\t\tlist($value, $return) = $this->_default($model, $value);\n\n\t\tif ( ! $return)\n\t\t{\n\t\t\t$value = filter_var($value, FILTER_VALIDATE_BOOLEAN);\n\t\t}\n\n\t\treturn $value;\n\t}", "public function setValue($value = true)\n {\n $this->value = $value;\n }", "public function intToBool()\n {\n /** @var ActiveRecord $activeRecord */\n $activeRecord = $this->owner;\n\n foreach ($activeRecord->getTableSchema()->columns as $column) {\n if (\n is_int($activeRecord->{$column->name})\n && $column->size === 1\n ) {\n $activeRecord->{$column->name} = (bool)$activeRecord->{$column->name};\n }\n }\n }", "public function SetBool(string $key, bool $value) : void\r\n\t{\r\n\t\t$this->Set($key, $value);\r\n\t}", "public function __is ( $sField, $mValue )\n {\n return \"$sField = $mValue\";\n }", "public function appendBoolPackedField($value)\n {\n return $this->append(self::BOOL_PACKED_FIELD, $value);\n }", "function WPBC_acf_make_true_false_field($args,$is_registered_option=false){\n\tif(empty($args['name'])) return;\n\t$defaults = array (\n\t\t'key' => 'field_'.$args['name'],\n\t\t'label' => 'True False',\n\t\t'name' => 'true_false_field',\n\t\t'type' => 'true_false',\n\t\t'instructions' => '',\n\t\t'required' => 0,\n\t\t'conditional_logic' => 0,\n\t\t'wrapper' => array (\n\t\t\t'width' => '',\n\t\t\t'class' => 'wpbc-true_false-ui',\n\t\t\t'id' => '',\n\t\t),\n\t\t'message' => '',\n\t\t'default_value' => 1,\n\t\t'ui' => 1,\n\t\t'ui_on_text' => '',\n\t\t'ui_off_text' => '',\n\t);\n\t$field = array_merge($defaults, $args); \n\t$field = WPBC_acf_make_fields__filter($field, $args); \n\treturn $field;\n}", "function boolval($var) {\r\n if (is_bool($var)) { return $var; }\r\n switch ($var) {\r\n case 'true': return true;\r\n case 'false': return false;\r\n default: throw new InvalidArgumentException('Cannot parse value '.$var);\r\n }\r\n}", "final public function __set($field, $value)\n\t\t{\n\t\t\tswitch($field)\n\t\t\t{\n\t\t\t\tcase \"IsPersistent\":\n\t\t\t\t\t\n\t\t\t\t\tif($value == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->stored = true;\n\t\t\t\t\t\t$this->changedfields = array();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->stored = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\t$method = \"Set\".$field;\n\t\t\t\t\t$class = get_called_class();\n\t\t\t\t\t\n\t\t\t\t\t// Check if the current value (if any) equals the new value\n\t\t\t\t\t// If it doesn't, the field is to be declared as changed\n\t\t\t\t\t$currentValue = null;\n\t\t\t\t\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$currentValue = $this->__get($field);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(ValueCannotBeNullException $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t// ignore\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($currentValue <> $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->changedfields[] = $field;\n\t\t\t\t\t\t$this->stored = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!method_exists($this, $method))\n\t\t\t\t\t{\n\t\t\t\t\t\t$logcode = LogManager::_(\"No Setter defined in '\".$class.\"->\".$method.\"'\");\n\t\t\t\t\t\tthrow new SetterNotDeclaredException($logcode);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Check the parameters\n\t\t\t\t\tFunctionCheck::CheckMethodParameters($class.\"::\".$method, array($value));\n\t\t\t\t\t\n\t\t\t\t\t// Find the method\n\t\t\t\t\t$method = new \\ReflectionMethod($class, $method);\n\t\t\t\t\t\n\t\t\t\t\t$method->setAccessible(true);\n\t\t\t\t\t\n\t\t\t\t\t// And execute it\n\t\t\t\t\t$method->invokeArgs($this, array($value));\n\t\t\t\t\t$method->setAccessible(false);\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function setMixed(bool $value): void\n {\n $this->mixedAttr = $value;\n }", "public function setMixed(bool $value): void\n {\n $this->mixedAttr = $value;\n }", "public function toBoolean(): bool\n {\n return !!$this->getValue();\n }", "public static function valueOf($arg)\n {\n if ($arg instanceof self) {\n return $arg;\n } else {\n return new self((bool)$arg);\n }\n }", "public function setIsRefinable(?bool $value): void {\n $this->getBackingStore()->set('isRefinable', $value);\n }", "protected function _toBoolean($value)\n\t{\n\t\tif (is_bool($value)) {\n\t\t\treturn $value;\n\t\t}\n\t\tif (is_int($value) || is_float($value)) {\n\t\t\treturn ($value !== 0);\n\t\t}\n\t\tif (is_string($value)) {\n\t\t\treturn ($value === 't' || $value === 'T' || $value === 'true');\n\t\t}\n\t\treturn (boolean)$value;\n\t}", "function &bool(bool $value, string $namespace = 'default'): bool\n{\n $var = new Variable\\BoolVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}", "private static function castToType($value) {\n if ($value == \"true\" || $value == \"1\")\n return true;\n\n if ($value == \"false\" || $value == \"0\")\n return false;\n\n return $value;\n\n }", "function sanitize_bool( $value, $key, array $data ) {\n\tif ( is_bool( $value ) ) {\n\t\treturn $value;\n\t} elseif ( is_numeric( $value ) ) {\n\t\treturn (bool) $value;\n\t} elseif ( is_string( $value ) ) {\n\t\tif ( in_array( strtolower( $value ), array( 'true', 'on', 'yes' ), true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( strtolower( $value ), array( 'false', 'off', 'no' ), true ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn (bool) $value;\n}", "function wp_validate_boolean($value)\n {\n }", "function PrepBool(&$bool,$blnNullable = true) {\n $bool = (integer)$bool;\n }", "public function getBool(): bool;", "static function toBoolean ($v)\n {\n return is_string ($v) ? get (self::$BOOLEAN_VALUES, $v, false) : boolval ($v);\n }", "function checked($field, $value = null) {\n if ( is_string($field) ) {\n if ( $this->setting($field) == $value ) {\n echo 'checked=\"checked\"';\n }\n } else if ( (bool) $field ) {\n echo 'checked=\"checked\"';\n }\n }", "public function setIsExactMatchRequired(?bool $value): void {\n $this->getBackingStore()->set('isExactMatchRequired', $value);\n }", "public function _typecastSaveField(Field $f, $value)\n {\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'boolean':\n // if enum is not set, then simply cast value to integer\n if (!isset($f->enum) || !$f->enum) {\n $v = (int) $v;\n break;\n }\n\n // if enum is set, first lets see if it matches one of those precisely\n if ($v === $f->enum[1]) {\n $v = true;\n } elseif ($v === $f->enum[0]) {\n $v = false;\n }\n\n // finally, convert into appropriate value\n $v = $v ? $f->enum[1] : $f->enum[0];\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if ($v instanceof $dt_class) {\n $format = ['date' => 'Y-m-d', 'datetime' => 'Y-m-d H:i:s', 'time' => 'H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set to persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v->setTimezone(new $tz_class($f->persist_timezone));\n }\n $v = $v->format($format);\n }\n break;\n case 'array':\n case 'object':\n // don't encode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonEncode($f, $v);\n break;\n }\n\n return $v;\n }", "function toBool ($value) {\n assert(count(func_get_args()) == 1);\n if (is_scalar($value)) {\n $convertedValue = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);\n if ($convertedValue !== null)\n return $convertedValue;\n }\n if (is_object($value) && hasMember($value, 'toBool'))\n return toBool($value->toBool());\n throw new RuntimeException('Unable to convert to bool.');\n}", "abstract public function escapeBoolean($bool);", "function setIsCorrect( $value )\r\n {\r\n if ( $value == true )\r\n $this->IsCorrect = 1;\r\n else\r\n $this->IsCorrect = 0;\r\n }", "function bool($val,$str=false){\n if(is_string($val)) {\n $val=strtolower($val);\n $val=$val && $val!=\"false\" && $val !=\"no\" && $val !=\"n\" && $val !=\"f\" && $val !=\"off\";\n }else $val=(bool)$val;\n return $str?($val?\"true\":\"false\"):$val;\n}", "public function booleanValue($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "final protected function setColumnBoolean($key, $value, $allowNull = false)\n\t\t{\n\t\t\t$col = $this->findColumn($key);\n\t\t\tif($col === null)\n\t\t\t\treturn;\n\n\t\t\t$col->setValue($allowNull && is_null($value) ? null : CDFDataHelper::AsBool($value));\n\t\t}", "public static function toBool($val) {\n return ($val === true || in_array($val, array('true', 'yes', 'on', 'checked', '1', 1))) ? true : false;\n }", "public static function prepareBool($value)\n {\n return (bool) $value;\n }", "public function value(): bool\n {\n if (($val = $this->raw()) === null) {\n return false;\n }\n\n return (new Boolean)->decode($val);\n }", "public function boolValue()\n {\n return $this->value;\n }", "public function setValue($value)\n {\n if ($value === 'on') {\n $this->_value = 1;\n }\n $this->_value = trim($this->_db->prepareString($value));\n }", "function erp_validate_boolean( $value ) {\n return filter_var( $value, FILTER_VALIDATE_BOOLEAN );\n}", "protected function toBool($value)\n\t{\n\t\tif ($value === true) {\n\t\t\treturn 'yes';\n\t\t}\n\t\treturn 'no';\n\t}", "function isBoolType($a = 0)\n{\n $b = (boolean)$a;\n\n echo \"число $a при переводе в булев тип изменится на '$b ' <br/>\n так как при переводе значение boolean будет = false(по правилам приведения типов)\";\n echo \"<br>\";\n var_dump($a, $b);\n}", "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 function isTrue()\n {\n \n return !!$this->value;\n \n }", "public function testSaveDataTableBooleanDataType() {\r\n\t\t$minvalue = '0';\r\n\t\t$maxvalue = '1';\r\n\t\t// Store datatable\r\n\t\t$datatable = new avorium_core_data_DataTable(2, 2);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, 'testuuid0');\r\n\t\t$datatable->setCellValue(0, 1, $minvalue);\r\n\t\t$datatable->setCellValue(1, 0, 'testuuid1');\r\n\t\t$datatable->setCellValue(1, 1, $maxvalue);\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read database via SQL\r\n\t\t$results = $this->executeQuery('select BOOLEAN_VALUE from POTEST order by UUID');\r\n\t\t// Compare values\r\n\t\t$this->assertEquals($minvalue, $results[0][0], 'Minimum boolean value is not converted from string as expected.');\r\n\t\t$this->assertEquals($maxvalue, $results[1][0], 'Maximum boolean value is not converted from string as expected.');\r\n\t}", "public function clean_boolean($input)\r\n {\r\n settype($input, 'boolean');\r\n return $input;\r\n }", "private function strToBoolean($value) {\r\n\t\tif ($value && strtolower($value) === \"true\") {\r\n\t\t return true;\r\n\t\t} else {\r\n\t\t return false;\r\n\t\t}\r\n\t}", "public function eventTypesSetProperty( $field, $value ) {\r\n\t\t$this->{$field} = $value;\r\n\t\treturn( true );\r\n\t}", "public function prepare_field_value($field_id, $field, $value) {\n $return = false;\n switch ($field['type']) {\n case 'checkbox':\n $return = $return == 1 ? $return : 0;\n break;\n default:\n $return = sanitize_text_field($value);\n }\n return $return;\n }", "public function toBooleanFilter($value)\n {\n return $value == '1' || $value == '0'\n ? filter_var($value, FILTER_VALIDATE_BOOLEAN)\n : $value;\n }", "public function scrubBool(bool $data) : bool;", "public function testCastToBooleanTrue($data) {\n\t\t$this->assertTrue(Convertor::cast($data), \"[{$data}] is not Boolean TRUE\");\n\t}", "function pseudoTypeFalseAndBool(bool|false $var = false) {}", "public static function bool(): Type\n {\n return new Type(null, 'bool');\n }", "public function setUserField($field,$value) {\n $value = preg_replace(\"/[^A-Za-z0-9]/\", '', $value);\n if(array_key_exists($field,$this->_dbFields)) {\n $this->_dbFields[$field]=$value;\n return true;\n } else {\n return false;\n }\n }", "private function boolArg($value)\n {\n return ($value ? 1 : null);\n }", "function toBool($var) {\n\tif (true === $var || 1 === $var) {\n\t\treturn true;\n\t}\n\tswitch (strtolower($var)) {\n\t\tcase \"yes\":\n\t\tcase \"on\":\n\t\tcase \"1\":\n\t\tcase \"y\":\n\t\tcase \"true\":\n\t\tcase \"t\":\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}", "public function eventsSetProperty( $field, $value ) {\r\n\t\t$this->{$field} = $value;\r\n\t\treturn( true );\r\n\t}", "static public function Boolean( $var ) {\r\n\r\n\t\t$options = array('flags' => FILTER_NULL_ON_FAILURE);\r\n\t\t$result = filter_var( $var, FILTER_VALIDATE_BOOLEAN, $options);\r\n\r\n\t}", "private function setFieldValue($fieldName, $value)\n\t{\n\t\tif (empty($value)) return false;\n\n\t\t// go through all fields, and update the given value\n\t\t$this->fields->transform(function ($fieldData) use ($fieldName, $value) {\n\t\t\tif ($fieldData['name'] === $fieldName) {\n\t\t\t\t$fieldData['value'] = $value;\n\t\t\t}\n\t\t\treturn $fieldData;\n\t\t});\n\n\t\treturn true;\n\t}" ]
[ "0.7290104", "0.70995814", "0.7055473", "0.6919809", "0.684212", "0.684212", "0.682021", "0.6764078", "0.6567937", "0.6544976", "0.6504999", "0.65042543", "0.64911336", "0.64566106", "0.6448191", "0.6404919", "0.63292354", "0.63213944", "0.6318951", "0.6301071", "0.6259234", "0.62591666", "0.6249202", "0.6240689", "0.6212975", "0.6162865", "0.61572105", "0.615296", "0.61519575", "0.61506593", "0.61200845", "0.6112989", "0.6112881", "0.61003244", "0.60810345", "0.60688305", "0.60654855", "0.60627156", "0.60486174", "0.6040556", "0.60288006", "0.602809", "0.6027651", "0.5955817", "0.59484667", "0.590273", "0.5899893", "0.5880126", "0.58665806", "0.58585167", "0.58482116", "0.583508", "0.5819711", "0.5819711", "0.5796561", "0.5778953", "0.5769692", "0.575501", "0.57545984", "0.57510406", "0.5738955", "0.5738307", "0.57377386", "0.57338643", "0.57091755", "0.5703719", "0.57031685", "0.5695768", "0.5694576", "0.56829363", "0.5682597", "0.5676803", "0.566528", "0.565244", "0.56520784", "0.5640692", "0.5639371", "0.563161", "0.56300724", "0.56021535", "0.5601681", "0.5593467", "0.5591754", "0.55896825", "0.5573367", "0.55727744", "0.5547614", "0.55364937", "0.55299515", "0.55276215", "0.55070525", "0.55049676", "0.5502092", "0.5492674", "0.5475368", "0.54660535", "0.5462988", "0.5459774", "0.54532045", "0.5447944" ]
0.70688397
2
Set the given field with the given value typecasted as a string
protected function setAsString($field, $value) { $this->object[$field] = (string) $value; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set($field, $value);", "public function set($field, $value);", "public function setField(string $name, $value);", "function map_field($field){\n $str= $field->to_str();\n //\n //return field to str\n return $str;\n }", "public function setField($field);", "public function setField($field);", "public function setValue($fieldName, $value, $encoding = 'UTF-8') {}", "public function setValue($fieldname, $value);", "public function setField($name, $value);", "public function setField($value) {\n\t\t$this->_field = $value;\n\t}", "public function setFieldValue(Field $field, $model, $value);", "public function setFieldValue($fieldSlug, $value);", "protected function setLocalField($field, $value) {\n if ($field == 'union_name') {\n $field = 'organization_name';\n }\n #converts phone field so it's found in union's telecommunication_number\n if ($field == 'union_phone_no') {\n $field = 'contact_number';\n }\n return parent::setLocalField($field, $value);\n }", "public function SetField($val, $field)\n {\n $this->{$field} = $val;\n //echo $field.'<br>';\n }", "public function setField(string $name, Field $field);", "function nodeCoreTextField(&$node, $field, $value){\n \t\tif (!empty($node->nid)){\n \t\t\t//its an existing node...\n \t\t\tif (!isset($node->{$field}) || $node->{$field} != $value){\n \t\t\t\t//...with a new incoming value\n \t\t\t\t$this->nodeNeedsUpdate[$node->nid] = true;\n \t\t\t\t//dsm(__FUNCTION__.\" flagging \".$node->nid);\n \t\t\t}\n \t\t}\n \t\t\t\n \t\t$node->{$field} = $value;\n \t}", "public function set($field, $value) {\r\n\t\t$this -> fields[$field] = $value;\r\n\t}", "function setField($field, $value)\n {\n $this->_data[$field] = $value;\n }", "public function toValue(\n ExtraField $field\n ) {\n Assert::stringNotEmpty(\n $field->name,\n 'Дополнительное поле не имеет названия.'\n );\n\n Assert::notEmpty(\n $field->value,\n 'Дополнительное поле не имеет значения.'\n );\n\n return $field->name .'|'. $field->value;\n }", "function o_castString($value) {\n\t\t\treturn Obj::singleton()->castString($value);\n\t\t}", "protected function setFieldValue ($field) {\n if ($this->$field instanceof Newforms_File)\n $this->$field->setValue('');\n if (!$this->__bound) return;\n if (is_array($this->__Data)) {\n if (isset($this->__Data[$field])) {\n $this->$field->setValue ($this->__Data[$field]);\n return;\n }\n return;\n }\n if (is_object ($this->__Data)) {\n if (isset($this->__Data->$field)) {\n $this->$field->setValue ($this->__Data->$field);\n return;\n }\n return;\n }\n }", "public function __set($field, $value){\n if (array_key_exists($field, $this->fields)){\n $this->fields[$field] = $value;\n }\n }", "public function __set($field, $value){\n if (array_key_exists($field, $this->fields)){\n $this->fields[$field] = $value;\n }\n }", "function __r_setValueType(&$str) {\n\t//$str=gettype($str).$str;\n\t// if (gettype($str)=='string' && substr($str,0,1)=='0') $str='=\"'.$str.'\"';\n\t// if (gettype($str) == 'string' && substr($str,0,1) == '0') $str = '\\''.$str;\n}", "abstract public function convertField($field);", "public function setValue($field, $value){\n $this->values[$field] = $value;\n }", "public function setField(string $field): void\n {\n $this->field = $field;\n }", "public function _typecastSaveField(Field $f, $value)\n {\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'boolean':\n // if enum is not set, then simply cast value to integer\n if (!isset($f->enum) || !$f->enum) {\n $v = (int) $v;\n break;\n }\n\n // if enum is set, first lets see if it matches one of those precisely\n if ($v === $f->enum[1]) {\n $v = true;\n } elseif ($v === $f->enum[0]) {\n $v = false;\n }\n\n // finally, convert into appropriate value\n $v = $v ? $f->enum[1] : $f->enum[0];\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if ($v instanceof $dt_class) {\n $format = ['date' => 'Y-m-d', 'datetime' => 'Y-m-d H:i:s', 'time' => 'H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set to persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v->setTimezone(new $tz_class($f->persist_timezone));\n }\n $v = $v->format($format);\n }\n break;\n case 'array':\n case 'object':\n // don't encode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonEncode($f, $v);\n break;\n }\n\n return $v;\n }", "public function setValueField($valueField) {\n\t\t$this->valueField = $valueField;\n\t}", "protected function _setStringValue($name, $value, $encoding) {}", "public function setCustomField($field, $value, $type = 'TYPE_STRING') {\n\n $fieldObj = Doctrine::getTable('ArticleCustomField')->findOneByName($field);\n\n if(!$fieldObj) {\n // pole nie istnieje\n // to na przyszlosc, gdy dojdzie mozliwosc samodzielnego definiowania pol przez usera\n// $fieldObj = new ArticleCustomField();\n// $fieldObj->name = $field;\n// $fieldObj->type = $type;\n// $fieldObj->save();\n\n return;\n }\n\n if(!$article2customFieldValue = Doctrine::getTable('ArticleCustomFieldValue')->find(array('article_id' => $this->getPrimaryKey(),\n 'field_id' => $fieldObj->getPrimaryKey()))) {\n $article2customFieldValue = new ArticleCustomFieldValue();\n }\n\n $article2customFieldValue->article_id = $this->getPrimaryKey();\n $article2customFieldValue->field_id = $fieldObj->getPrimaryKey();\n\n if($fieldObj->type == 'TYPE_DATE') {\n //0 - rok, 1 - miesiac, 2 - dzien, 3 - godzina, 4 - minuty, 5 - sekundy\n $time = preg_split('/[\\s-:]+/', $value);\n $value = mktime($time[3], $time[4], $time[5], $time[1], $time[2], $time[0]);\n }\n\n $article2customFieldValue->value = $value;\n\n $article2customFieldValue->save();\n\n }", "public function getStringField()\n {\n $value = $this->get(self::STRING_FIELD);\n return $value === null ? (string)$value : $value;\n }", "public function setValue($value)\n {\n $this->value = (string) $value;\n }", "public function __set($field, $value)\n {\n if (array_key_exists($field, $this->fields))\n {\n $this->fields[$field] = $value;\n }\n }", "public function __set($field, $value)\n {\n if (array_key_exists($field, $this->fields))\n {\n $this->fields[$field] = $value;\n }\n }", "public function set($field, $value) {\n $this->$field = $value;\n }", "public function __set(string $field, $value): void\n\t{\n\t\t$this->setValue($field, $value);\n\t}", "public function __set($field, $value){\n\t\tif(array_key_exists($field, $this->fields)){\n\t\t\t$this->fields[$field]=$value;\n\t\t}\n\t}", "public function escape_value($type,$value=null)\n\t{\n\t\tif ($value==null)\n\t\t\t$value=$this->value;\n\t\t\n \t\t$value=str_replace(\"'\",\"''\",$value);\n\t\t\n\t\tswitch($type)\n\t\t{\n\t\t\tcase Field::STRING:\n\t\t\tcase Field::TEXT:\n\t\t\t\treturn \"'$value'\";\n\t\t\tcase Field::BOOLEAN:\n\t\t\t\treturn ($value) ? \"true\" : \"false\";\n\t\t\tcase Field::OBJECT:\n\t\t\t\treturn \"'\".(($value instanceof DynamicObject) ? $value->to_string() : serialize($value)).\"'\";\n\t\t\tdefault:\n\t\t\t\tif (is_numeric($value))\n\t\t\t\t\treturn $value;\n\t\t\t\telse\n\t\t\t\t\treturn \"'$value'\";\n\t\t}\n\t}", "public function __set($field, $value) {\r\n $this->$field = $value;\r\n }", "public function __set($field, $value) {\r\n $this->$field = $value;\r\n }", "public function set_field( string $field, $data ) {\n\t\t$this->data[ $field ] = $data;\n\t}", "function quote_field($sql, $fieldname, $fieldvalue){\r\n\t\t$rs = $this->select_limit($sql, 1, 1);\r\n $fm_type = $this->field_metatype($rs, $this->field_index($rs, str_replace('`', '', $fieldname)));\r\n\t\tswitch ($fm_type) {\r\n\t\t\tcase 'I':\r\n\t\t\tcase 'N':\r\n\t\t\tcase 'R':\r\n\t\t\tcase 'L':\r\n\t\t\t\t$qstr = $fieldname .\"=\". $fieldvalue; \r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$qstr = $fieldname .\"='\". $fieldvalue .\"'\"; \r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn $qstr;\r\n\t}", "public function setStringField($value)\n {\n return $this->set(self::STRING_FIELD, $value);\n }", "function setField($field) {\r\r\n\t\t$this->field = $field;\r\r\n\t}", "public function setValue($value) {\n\t\tparent::setValue(stripslashes($value));\n\t}", "public function setField(string $field): static;", "public function escapeField($string);", "private function setAttributeValueFromField(string $field_name) {\n // We need to unaltered field data value here not the field value returned\n // by $this->get($field_name)->value (magic getter).\n $field_value = $this->get($field_name)->getValue();\n // Property not found so let's save it as an attribute value.\n $attribute_value = $this->fieldAttributeConverter()->getAttributeValueFromField($this->entityTypeId, $field_name, $field_value);\n if ($attribute_value !== NULL) {\n $attribute_name = $this->fieldAttributeConverter()->getAttributeName($field_name);\n // Do not leave empty attributes. If generated attribute value is an\n // empty string let's remove it from the entity.\n // (Apigee Edge MGMT UI does not allow to save an entity with empty\n // attribute value, the API does.)\n if ($attribute_value === '') {\n $this->decorated->deleteAttribute($attribute_name);\n }\n else {\n $this->decorated->setAttribute($attribute_name, $attribute_value);\n }\n }\n }", "public function setField($field)\n {\n $this->_field = $field;\n }", "public function setUserField($field,$value) {\n $value = preg_replace(\"/[^A-Za-z0-9]/\", '', $value);\n if(array_key_exists($field,$this->_dbFields)) {\n $this->_dbFields[$field]=$value;\n return true;\n } else {\n return false;\n }\n }", "public function fromValue(\n ExtraField $field,\n $value\n ) {\n Assert::stringNotEmpty($value);\n\n $name = $field->name;\n\n $matches = [];\n\n preg_match(\n \"/^$name\\|([^\\|]+)$/\",\n $value,\n $matches\n );\n\n if (count($matches) !== 2)\n throw new \\Exception(\n 'Значение дополнительного поля имеет неизвестный формат.'\n );\n\n $field->value = $matches[1];\n\n return $field;\n }", "function cast($field, $value) {\n\t\t// if the column doesn't exist, don't cast the value\n\t\tif (!isset($this->columns[$field])) {\n\t\t\treturn $value;\n\t\t}\n\n\t\t// precast arrays\n\t\tif (is_array($value)) {\n\t\t\t$value = $this->columns[$field]->array_to_type(array_values($value));\n\t\t}\n\n\t\t// cast value\n\t\t$value = $this->columns[$field]->type_cast($value);\n\n\t\treturn $value;\n\n\t}", "public function setField($field) {\n\t\t$this->_field = $field;\n\t}", "public static function sanitize_field( $field, $value ) {\n\t\tif ( in_array( $field, array( 'referral_id', 'affiliate_id' ) ) ) {\n\t\t\t$value = (int) $value;\n\t\t}\n\n\t\tif ( in_array( $field, array( 'rest_id' ) ) ) {\n\t\t\t$value = sanitize_text_field( $value );\n\t\t}\n\n\t\treturn $value;\n\t}", "public function _typecastLoadField(Field $f, $value)\n {\n // LOB fields return resource stream\n if (is_resource($value)) {\n $value = stream_get_contents($value);\n }\n\n // work only on copied value not real one !!!\n $v = is_object($value) ? clone $value : $value;\n\n switch ($f->type) {\n case 'string':\n case 'text':\n // do nothing - it's ok as it is\n break;\n case 'integer':\n $v = (int) $v;\n break;\n case 'float':\n $v = (float) $v;\n break;\n case 'money':\n $v = round($v, 4);\n break;\n case 'boolean':\n if (isset($f->enum) && is_array($f->enum)) {\n if (isset($f->enum[0]) && $v == $f->enum[0]) {\n $v = false;\n } elseif (isset($f->enum[1]) && $v == $f->enum[1]) {\n $v = true;\n } else {\n $v = null;\n }\n } elseif ($v === '') {\n $v = null;\n } else {\n $v = (bool) $v;\n }\n break;\n case 'date':\n case 'datetime':\n case 'time':\n $dt_class = isset($f->dateTimeClass) ? $f->dateTimeClass : 'DateTime';\n $tz_class = isset($f->dateTimeZoneClass) ? $f->dateTimeZoneClass : 'DateTimeZone';\n\n if (is_numeric($v)) {\n $v = new $dt_class('@'.$v);\n } elseif (is_string($v)) {\n // ! symbol in date format is essential here to remove time part of DateTime - don't remove, this is not a bug\n $format = ['date' => '+!Y-m-d', 'datetime' => '+!Y-m-d H:i:s', 'time' => '+!H:i:s'];\n $format = $f->persist_format ?: $format[$f->type];\n\n // datetime only - set from persisting timezone\n if ($f->type == 'datetime' && isset($f->persist_timezone)) {\n $v = $dt_class::createFromFormat($format, $v, new $tz_class($f->persist_timezone));\n if ($v === false) {\n throw new Exception(['Incorrectly formatted datetime', 'format' => $format, 'value' => $value, 'field' => $f]);\n }\n $v->setTimeZone(new $tz_class(date_default_timezone_get()));\n } else {\n $v = $dt_class::createFromFormat($format, $v);\n if ($v === false) {\n throw new Exception(['Incorrectly formatted date/time', 'format' => $format, 'value' => $value, 'field' => $f]);\n }\n }\n\n // need to cast here because DateTime::createFromFormat returns DateTime object not $dt_class\n // this is what Carbon::instance(DateTime $dt) method does for example\n if ($dt_class != 'DateTime') {\n $v = new $dt_class($v->format('Y-m-d H:i:s.u'), $v->getTimeZone());\n }\n }\n break;\n case 'array':\n // don't decode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonDecode($f, $v, true);\n break;\n case 'object':\n // don't decode if we already use some kind of serialization\n $v = $f->serialize ? $v : $this->jsonDecode($f, $v, false);\n break;\n }\n\n return $v;\n }", "public function setUserfield($value);", "function setValue(int $field, $value) : void;", "function set_post_field ($field, $value, $post_id) {\n\t\tglobal $wpdb;\n\n\t\t$post_id = absint($post_id);\n\t\t// sigh ... when FWP is active, I need to avoid avoid_kses_munge\n\t\t// $value = sanitize_post_field($field, $value, $post_id, 'db');\n\t\treturn $wpdb->update($wpdb->posts, array($field => $value), array('ID' => $post_id));\n\t}", "public function getValueEncoded($field) {\n return htmlspecialchars($this->getValue($field));\n}", "public function setField($field)\n {\n $this->field = (string) $field;\n return $this;\n }", "function nameEqValueEscaped($data_type, $field_name, $value)\n{\n return \" \".$field_name.\" = \".escapeValue($data_type, $value);\n}", "private function _assignCustom($field, $value)\n {\n $this->custom[$field['COLUMN_NAME']] = $value;\n }", "function format_field_value($field_name,$field_value,$field_type)\n\t{\n\t\tif($field_type == \"datetime\")\n\t\t{\n\t\t\tif($field_name == 'dob')\n\t\t\t{\n\t\t\t\t$field_value = date('l\\, F jS\\, Y',strtotime($field_value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$field_value = date('g:ia \\o\\n l\\, F jS\\, Y', strtotime($field_value));\n\t\t\t}\n\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($field_name == 'event_name')\n\t\t\t{\n\t\t\t\tif($field_value == 'resume')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"resumed working\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'qbreak')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"took a break\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'pause')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"paused work\";\n\t\t\t\t}\n\t\t\t\telse if($field_value == 'work')\n\t\t\t\t{\n\t\t\t\t\t$field_value = \"continued working\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$field_value = $field_value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $field_value;\n\t}", "public function __set($field, $value) {\n\t\t$this[$field] = $value;\n\t}", "public function set(string $field, int | float | bool | string | Expr $value): static\n {\n $this->what[$field] = $value;\n return $this;\n }", "public function __set($field, $value)\n {\n $this->checkForNecessaryProperties();\n\n $this->data[$field] = $value;\n }", "public function setField(Field $field) {\n\t\t$this->field = $field; \n\t}", "public function setPropertyValue(string $field_name, $value): void;", "public function formFld(string $field): string\n\t{\n\t\treturn Formatter::setTimeDate(self::fld($field));\n\t}", "function load_value($value, $post_id, $field)\n\t{\n\t\tif ( 'null' == $value ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tswitch( $field['save_format'] )\n\t\t{\n\t\t\tcase 'object':\n\t\t\t\t$icon_unicode_string = $this->defaults['choices'][ $value ];\n\t\t\t\t$icon_unicode_arr = explode( ' ', $icon_unicode_string );\n\t\t\t\t$icon_unicode = $icon_unicode_arr[0];\n\t\t\t\t$value = (object) array(\n\t\t\t\t\t\t'unicode' => $icon_unicode,\n\t\t\t\t\t\t'class'\t => $value,\n\t\t\t\t\t\t'element' => '<i class=\"fa ' . $value . '\"></i>'\n\t\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'unicode':\n\t\t\t\t$icon_unicode_string = $this->defaults['choices'][ $value ];\n\t\t\t\t$icon_unicode_arr = explode( ' ', $icon_unicode_string );\n\t\t\t\t$value = $icon_unicode_arr[0];\n\t\t\t\tbreak;\n\n\t\t\tcase 'element':\n\t\t\t\t$value = '<i class=\"fa ' . $value . '\"></i>';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}", "public function field_value($element_id, $value)\n\t{\n\t\t// Only strings and numbers can be set to form fields\n\t\t// Numbers and floats will be converted to string\n\t\tif (is_object($value) || is_array($value) || is_bool($value))\n\t\t{\n\t\t\tthrow new Kollection_Script_Exception('Values accepted are only strings and integers/floats.');\n\t\t}\n\t\t\n\t\t$s = 'var field_%s = document.getElementById(\"%s\");'.\"\\n\"\n\t\t\t.\"if (field_%s) {\\n\"\n\t\t\t\t.'field_%s.value = \"%v\";'.\"\\n\"\n\t\t\t.\"}\\n\";\n\t\t\t\n\t\treturn str_replace(\n\t\t\tarray('%s', '%v'),\n\t\t\tarray($element_id, (string) $value),\n\t\t\t$s\n\t\t);\n\t}", "public function __set ($field, $val) {\n if (isset($this->__fields[$field]['set'])) {\n $this->__fields[$field]['data'] = $this->__fields[$field]['set']($val);\n } else {\n $this->__fields[$field]['data'] = $val;\n }\n }", "public function bis2HsSetProperty( $field, $value ) {\r\n\t\t$this->record[$field] = $value;\r\n\t\treturn( true );\r\n\t}", "public final function checkFieldvalue($fld, $val)\n {\n // Return NULL value as string 'NULL' to identify this value to be passed as raw type to query\n if (is_null($val))\n \treturn 'NULL';\n\n // trim the string, baby!\n if (is_string($val))\n $val = trim($val);\n\n // convert string numbers into correct fieldtypes\n if ($this->isField($fld) && ($this->getFieldtype($fld) == 'int' || $this->getFieldtype($fld) == 'float') && is_string($val))\n {\n switch ($this->getFieldtype($fld))\n {\n case 'int' :\n $val = intval($val);\n break;\n\n case 'float' :\n $val = floatval($val);\n break;\n }\n }\n\n // check for not allowed empty field value\n if ($val === '' && $this->isField($fld) && $this->isNullAllowed($fld) == false)\n {\n switch ($this->getFieldtype($fld))\n {\n case 'string' :\n $val = '';\n break;\n\n case 'int' :\n case 'float' :\n $val = 0;\n break;\n }\n }\n\n if (is_string($val) && $this->clean == 1)\n $val = Lib::sanitizeUserInput($val);\n\n if (in_array($fld, $this->serialized) && (is_array($val) || $val instanceof Data))\n $val = serialize($val);\n\n return $val;\n }", "public function field($value) {\n return $this->setProperty('field', $value);\n }", "public function field($value) {\n return $this->setProperty('field', $value);\n }", "public function field($value) {\n return $this->setProperty('field', $value);\n }", "public function __set($field, $value) {\n\t\tif(array_key_exists($field, $this->_data)) {\n\t\t\t$this->_data[$field] = $value;\n\t\t\t\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$this->_state = self::STATE_CHANGED;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The specified field \"' . $field . '\" was not found.');\n\t\t}\n\t}", "public function prepare_field_value($field_id, $field, $value) {\n $return = false;\n switch ($field['type']) {\n case 'checkbox':\n $return = $return == 1 ? $return : 0;\n break;\n default:\n $return = sanitize_text_field($value);\n }\n return $return;\n }", "function nodeTextField(&$node, $field, $value){\n \t\tif (!empty($node->nid)){\n \t\t\t//its an existing node...\n \t\n \t\t\tif (!isset($node->{$field}[$node->language][0]['value']) && strlen($value)> 0){\n \t\t\t\t$this->nodeNeedsUpdate[$node->nid] = true;\n \t\t\t\t//dsm(__FUNCTION__.\" flagging \".$node->nid);\n \t\t\t\t//dsm($node->{$field}[$node->language][0]['value'].\" \".$value.\" \".$field);\n \t\t\t}\n \t\n \t\t\t/*\n \t\t\t * Don't need this. If its an existing node, the set value != a blank incoming value\n \t\t\t* This is always true\n \t\t\tif (isset($node->{$field}[$node->language][0]['value']) && strlen($value)== 0){\n \t\t\t$this->nodeNeedsUpdate[$node->nid] = true;\n \t\t\tdsm(__FUNCTION__.\" flagging \".$node->nid);\n \t\t\tdsm($node->{$field}[$node->language][0]['value'].\" \".$value.\" \".$field);\n \t\t\t}*/\n \t\n \t\n \t\t\tif ((isset($node->{$field}[$node->language][0]['value']) &&\t$node->{$field}[$node->language][0]['value'] != $value)){\n \t\t\t\t//...with a new incoming value\n \t\t\t\t$this->nodeNeedsUpdate[$node->nid] = true;\n \t\t\t\t//dsm(__FUNCTION__.\" flagging \".$node->nid);\n \t\t\t\t//dsm($node->{$field}[$node->language][0]['value'].\" \".$value.\" \".$field);\n \t\t\t}\n \t\t}\n \t\t\t\n \t\tif ($value == \"\"){\n \t\t\tunset($node->{$field}[$node->language]);\n \t\t}else{\n \t\t\t$node->{$field}[$node->language][0]['value'] = $value;\n \t\t}\n \t}", "public static function castFieldValue($value, $type)\n {\n if ($value === null || is_string($value)) {\n return $value;\n }\n\n if ($type === 'dateTime' && $value instanceof DateTime) {\n return (string)$value->getTimestamp();\n }\n\n if ($type === 'integer' && is_int($value)) {\n return sprintf('%011d', $value);\n }\n\n if ($type === 'double' && is_float($value)) {\n // 123.15 => 00000000123.15000, padding to 11 numbers before and padding to 5 behind decimal point\n return sprintf('%017.5f', $value);\n }\n\n if ($type === 'boolean' && is_bool($value)) {\n return $value ? '1' : '0';\n }\n\n if ($type === 'array' && is_array($value)) {\n return array_values($value);\n }\n\n return null;\n }", "public function eventTypesSetProperty( $field, $value ) {\r\n\t\t$this->{$field} = $value;\r\n\t\treturn( true );\r\n\t}", "function getFieldValue($field);", "public function __is ( $sField, $mValue )\n {\n return \"$sField = $mValue\";\n }", "public function setPatternedField(string $field, $value): ObjectInterface;", "public function set($field, $value, $type = 'HOME')\n {\n $field = strtolower($field);\n $type_uc = strtoupper($type);\n\n switch ($field) {\n case 'name':\n case 'displayname':\n $this->raw['FN'][0][0] = $this->displayname = $value;\n break;\n\n case 'surname':\n $this->raw['N'][0][0] = $this->surname = $value;\n break;\n\n case 'firstname':\n $this->raw['N'][0][1] = $this->firstname = $value;\n break;\n\n case 'middlename':\n $this->raw['N'][0][2] = $this->middlename = $value;\n break;\n\n case 'prefix':\n $this->raw['N'][0][3] = $value;\n break;\n\n case 'suffix':\n $this->raw['N'][0][4] = $value;\n break;\n\n case 'nickname':\n $this->raw['NICKNAME'][0][0] = $this->nickname = $value;\n break;\n\n case 'organization':\n $this->raw['ORG'][0][0] = $this->organization = $value;\n break;\n\n case 'photo':\n if (strpos($value, 'http:') === 0) {\n // TODO: fetch file from URL and save it locally?\n $this->raw['PHOTO'][0] = array(0 => $value, 'url' => true);\n }\n else {\n $this->raw['PHOTO'][0] = array(0 => $value, 'base64' => (bool) preg_match('![^a-z0-9/=+-]!i', $value));\n }\n break;\n\n case 'email':\n $this->raw['EMAIL'][] = array(0 => $value, 'type' => array_filter(array('INTERNET', $type_uc)));\n $this->email[] = $value;\n break;\n\n case 'im':\n // save IM subtypes into extension fields\n $typemap = array_flip($this->immap);\n if ($field = $typemap[strtolower($type)]) {\n $this->raw[$field][] = array(0 => $value);\n }\n break;\n\n case 'birthday':\n case 'anniversary':\n if (($val = rcube_utils::anytodatetime($value)) && ($fn = self::$fieldmap[$field])) {\n $this->raw[$fn][] = array(0 => $val->format('Y-m-d'), 'value' => array('date'));\n }\n break;\n\n case 'address':\n if ($this->addresstypemap[$type_uc]) {\n $type = $this->addresstypemap[$type_uc];\n }\n\n $value = $value[0] ? $value : array('', '', $value['street'], $value['locality'], $value['region'], $value['zipcode'], $value['country']);\n\n // fall through if not empty\n if (!strlen(join('', $value))) {\n break;\n }\n\n default:\n if ($field == 'phone' && $this->phonetypemap[$type_uc]) {\n $type = $this->phonetypemap[$type_uc];\n }\n\n if (($tag = self::$fieldmap[$field]) && (is_array($value) || strlen($value))) {\n $index = count($this->raw[$tag]);\n $this->raw[$tag][$index] = (array)$value;\n if ($type) {\n $typemap = array_flip($this->typemap);\n $this->raw[$tag][$index]['type'] = explode(',', $typemap[$type_uc] ?: $type);\n }\n }\n else {\n unset($this->raw[$tag]);\n }\n\n break;\n }\n }", "public function field($value)\n {\n return $this->setProperty('field', $value);\n }", "private function get_field_value($value) {\r\n\t if ($value instanceof LazyDBExpressionType) {\r\n\t return $value->getExpression();\r\n\t } else if (is_array ( $value )) {\r\n\t\t\treturn \"'\" . $this->add_slashes( serialize($value) ) . \"'\";\r\n\t\t} else {\r\n\t\t\treturn \"'\" . $this->add_slashes ( $value ) . \"'\";\r\n\t\t}\r\n\t}", "function __toString()\n {\n return strval($this->value);\n }", "protected function setValue($field, $value, $throwException = true) {\n if(isset($this->nameToIndex[$field])) {\n $fieldClass = $this->fields[$this->nameToIndex[$field]];\n $fieldClass->setValue($value);\n return;\n }\n if($throwException) {\n throw new PhpBuf_Message_Exception(\"property $field not found\");\n }\n }", "public function set_custom_field($member, $field, $value)\n {\n $this->connection->query_update('users', array('cms_' . $field => $value), array('uid' => $member), '', null, null, false, true);\n }", "public function setValue($value, $encoding = 'UTF-8') {}", "public function setValue($value, $encoding = 'UTF-8') {}", "public function __set($fieldName, $fieldValue) {\n\t\t$this->document->$fieldName = json_decode(json_encode($fieldValue));\n\t}", "public function setValue($field, $value): int {\n if (in_array($field, static::fields, TRUE)){\n $this->{$field}->setValue($value);\n return 1;\n }\n return 0;\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }", "function format_value($value, $post_id, $field)\n {\n }" ]
[ "0.66491777", "0.66491777", "0.6647228", "0.6556398", "0.6523034", "0.6523034", "0.646744", "0.6452322", "0.64317095", "0.6431247", "0.64247346", "0.6370303", "0.63624835", "0.635717", "0.6300282", "0.6289519", "0.626967", "0.621251", "0.62057155", "0.6197703", "0.61959285", "0.61835605", "0.61835605", "0.61644405", "0.6163312", "0.61265224", "0.61061376", "0.6083066", "0.60818887", "0.60734046", "0.6065865", "0.604129", "0.6039986", "0.6032383", "0.6032383", "0.6027126", "0.601403", "0.6012769", "0.60079324", "0.5998984", "0.5998984", "0.5960335", "0.59390897", "0.59295565", "0.5914412", "0.5905165", "0.5887057", "0.5857632", "0.5850407", "0.5830624", "0.5824959", "0.58167493", "0.5815334", "0.5806755", "0.5794962", "0.5790513", "0.5789937", "0.57873607", "0.57728714", "0.57650965", "0.5759526", "0.5758329", "0.57409614", "0.57338756", "0.57314223", "0.5726311", "0.57259095", "0.5718843", "0.5715175", "0.57137936", "0.57103777", "0.57028913", "0.5691753", "0.56916815", "0.5662608", "0.5647159", "0.5647159", "0.5647159", "0.563778", "0.5624393", "0.5620101", "0.5617867", "0.5610674", "0.56017756", "0.55909187", "0.5590223", "0.553751", "0.55174524", "0.5516447", "0.55065286", "0.55039585", "0.5501462", "0.55012673", "0.5500433", "0.5499352", "0.5498704", "0.5492692", "0.5492692", "0.5492692", "0.5492692" ]
0.6738087
0
/ LIsta de TUtores
function index($usuario){ global $tutores; $tutores = lista_vinculos($usuario); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AggiornaPrezzi(){\n\t}", "public function tampilDataGalang(){\n\t\t\n\t}", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "public function tipo_tarjeta();", "function ToonFormulierAfspraak()\n{\n\n}", "public function obtenerViajesplus();", "final function velcom(){\n }", "function formulaires_editer_feuillederoute_charger_dist() {\n\t$valeurs = array( '_texte' => '' );\n\tlire_fichier_securise(_DIR_IMG . 'feuillederoute.php',$contenu);\n\t$contenu = @unserialize($contenu);\n\tif($contenu){\n\t\t$valeurs['_texte'] = $contenu;\n\t}\n\treturn $valeurs;\n}", "function palabraDescubierta($coleccionLetras){\n \n /*>>> Completar el cuerpo de la función, respetando lo indicado en la documentacion <<<*/\n}", "public function traerCualquiera()\n {\n }", "function sobre_planeacion($minimoMes,$maximoMes,$vigencia,$unidades,$tipo_usuario)\n\t\t{\n\t\t\t//$tipo_usuario ALMACENA EL TIPO DE USUARIO( I O E), EN UN ARRAY, ESTE SE CARGA EN LA PAGINA DE PLANEACION DE PROYECTOS (upHTplaneacionProy.PHP)\t\n//echo $unidades[0].\" - $minimoMes - $maximoMes - $vigencia ********************** <br><br>\";\n\t\t?>\n\n<?\t\t\n\t\t$ban_reg=0; //PERMITE IDENTIFICAR, SI SE ENCONTRO ALMENOS, UN USUARIO SOBRE PLANEADO, DE NO SER ASI, NO SE ENVIA EL CORREO\n\t\t$pTema ='<table width=\"100%\" border=\"0\">\n\t\t <tr class=\"Estilo2\" >\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td width=\"5%\" >Asunto:</td>\n\t\t\t<td >Sobre planeaci&oacute;n de participantes.</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t \n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\">Los siguientes participantes, tienen una dedicaci&oacute;n superior a 1 en los siguientes proyectos:</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t </tr>\n\t\t\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\" >\n\t\t\t\t<table width=\"100%\" border=\"1\" >\n\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td colspan=\"5\"></td>\n\t\t\t\t\t<td colspan=\"'.(($maximoMes-$minimoMes)+1).'\" align=\"center\" >'.$vigencia.'</td>\n\t\t\t\t </tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td>Unidad</td>\n\t\t\t\t\t<td>Nombre</td>\n\t\t\t\t\t<td>Departamento</td>\n\t\t\t\t\t<td>Divisi&oacute;n</td>\n\t\t\t\t\t<td>Proyecto</td>';\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$vMeses= array(\"\",\"Ene\",\"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"); \n\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t{\n\n\t\t\t\t\t $pTema = $pTema.'<td>'.$vMeses[$m].' </td>';\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t $pTema = $pTema.' </tr>';\n\t\t\t\t$cur_tipo_usu=0; //CURSOR DEL ARRAY, DEL TIPO DE USUARIO \n\t\t\t\tforeach($unidades as $unid)\n\t\t\t\t{\n//tipo_usuario\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"I\")\t\n\t\t\t\t\t{\n\t\t\t\t\t//CONSULTA SI EL USUARIO ESTA SOBREPLANEADO EN ALMENOS, UN MES DURANTE LA VIGENCIA\n\n\t\t\t\t\t//COSNULTA PARA LOS USUARIOS INTERNOS\n\t\t\t\t\t\t\t$sql_planea_usu=\"select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, Usuarios.nombre, \n\t\t\t\t\t\t\t\t\t\t\tUsuarios.apellidos ,Divisiones.nombre as div,Departamentos.nombre as dep\n\t\t\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t\t inner join Usuarios on PlaneacionProyectos.unidad=Usuarios.unidad \n\t\t\t\t\t\t\t\t\t\t\t inner join Departamentos on Departamentos.id_departamento=Usuarios.id_departamento \n\t\t\t\t\t\t\t\t\t\t\t inner join Divisiones on Divisiones.id_division=Departamentos.id_division \n\t\t\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \"; \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\t\t//PlaneacionProyectos.id_proyecto,\t\t\t\t\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\t\t\tand esInterno='I'\n\t\t\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,Usuarios.nombre, Usuarios.apellidos,Divisiones.nombre ,Departamentos.nombre \n\t\t\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \";\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"E\")\t\n\t\t\t\t\t{\n\t\t\t\t\t\t//COSNULTA PARA LOS USUARIOS EXTERNOS\n\t\t\t\t\t\t$sql_planea_usu=\" select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, TrabajadoresExternos.nombre, \n\t\t\t\t\t\t\t\t\tTrabajadoresExternos.apellidos,'' div, ''dep\n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t inner join TrabajadoresExternos on PlaneacionProyectos.unidad=TrabajadoresExternos.consecutivo \n\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\tand esInterno='E'\n\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,TrabajadoresExternos.nombre, TrabajadoresExternos.apellidos\n\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \t\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$cur_planea_usu=mssql_query($sql_planea_usu);\n//echo $sql_planea_usu.\" ---- <br>\".mssql_get_last_message().\" *** \".mssql_num_rows($cur_planea_usu).\"<br>\";\n\t\t\t\t\twhile($datos__planea_usu=mssql_fetch_array($cur_planea_usu))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ban_reg=1; //SI ENCUENTRA ALMENOS UN USUARIO SOBREPLANEADO, ENVIA EL CORREO\n\t\t\t\t\n\t\t\t\t\t\t//CONSULTA LOS PROYECTOS, EN LOS CUALES EL PARTICIAPENTE HA SIDO PLANEADO, ESTO PARA PODER DOBUJAR LA TABLA DE FORMA CORRECTA\n\t\t\t\t\t\t$sql_uu=\" select distinct(id_proyecto),nombre,codigo,cargo_defecto from (select SUM (hombresMes) as total_hombre_mes ,unidad, mes,PlaneacionProyectos.id_proyecto ,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto \n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos\n\t\t\t\t\t\t\t\t\t\tinner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\n\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$sql_uu=$sql_uu.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]=0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql_uu=$sql_uu.\"0) and unidad in(\".$unid.\") and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by unidad, mes , PlaneacionProyectos.id_proyecto,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto ) aa \";\n// HAVING (SUM (hombresMes)\t>1\t\n\t\t\t\t\t\t$cur_uu=mssql_query($sql_uu);\n\t\t\t\t\t\t$cant_proy=mssql_num_rows($cur_uu);\n//echo \"<br><BR>---//**************--------------\".$sql_uu.\" \".mssql_get_last_message().\"<br>\".$cant_proy.\"<br>\";\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t<?\n\t\t\t\t//echo $sql_proy_planea.\" ---- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\n\t\t\t\t\t\t$total_planeado= array();\n\t\t\t\t\t\t$cont=0;\n\t\t\t\t\t\twhile($datos_uu=mssql_fetch_array($cur_uu))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($cont==0)\n\t\t\t\t\t\t\t{\n\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\t\t\t\t\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \"> '.$datos__planea_usu[\"unidad\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'.$datos__planea_usu[\"apellidos\"].' '.$datos__planea_usu[\"nombre\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"dep\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"div\"].' </td>';\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" >['.$datos_uu[\"codigo\"].'.'.$datos_uu[\"cargo_defecto\"].'] '. $datos_uu[\"nombre\"].' </td>';\n\n\t\t\t\t\t\t\t//CONSULTA LA INFORMACION DE LO PLANEADO EN CADA MES, DE ACUERDO AL PORYECTO CONSULTADO\n\t\t\t\t\t\t\t$sql_pro=\"select SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.id_proyecto,PlaneacionProyectos.unidad,mes\n\t\t\t\t\t\t\t\t\t\t from PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and PlaneacionProyectos.unidad=\".$unid.\" and id_proyecto=\".$datos_uu[\"id_proyecto\"].\" and mes in(\";\n\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" 0) and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by PlaneacionProyectos.id_proyecto ,PlaneacionProyectos.unidad ,mes order by (mes) \";\n// HAVING (SUM (hombresMes))>1\n\t\t\t\t\t\t\t$cur_proy_planea=mssql_query($sql_pro);\n//\t\t\t\techo $sql_pro.\" --22222222222-- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\t\t\t$m=$minimoMes;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($datos_proy_planea=mssql_fetch_array($cur_proy_planea))\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tfor ($m;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($datos_proy_planea[\"mes\"]==$m)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]+=( (float) $datos_proy_planea[\"total_hombre_mes\"]);\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" align=\"right\" >'.((float) $datos_proy_planea[\"total_hombre_mes\"] ).'</td>';\n\n\t\t\t\t\t\t\t\t\t\t$m=$datos_proy_planea[\"mes\"];\n\t\t\t\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>&nbsp; </td>';\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$m--;\n\t\t\t\t\t\t\tfor ($m++;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.'<td>&nbsp;</td>';\n\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t$cont++;\n\t\t\t\t\t\t\tunset($datos_proy_planea);\n\n\t\t\t\t\t\t\t $pTema = $pTema.' </tr>';\n\n\t\t\t\t//\t\t\techo $datos_proy_planea[\"total_hombre_mes\"].\"<br>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\n\t\t\t\t\t\t<td colspan=\"4\" >&nbsp;</td>\n\n\t\t\t\t\t\t<td>Total planeaci&oacute;n</td>';\n\n\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($total_planeado[$m]==0)\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>&nbsp;</td>';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>'.$total_planeado[$m].'</td>';\n\t\t\t\t\t\t}\n \n\t\t\t\t\t $pTema = $pTema.' </tr>\n\t\t\t\t\t <tr >\n\t\t\t\t\t\t<td colspan=\"17\">&nbsp;</td>\n\t\t\t\t\t </tr>\t';\n\n\t\t\t\t\t}\n\t\t\t\t\t$cur_tipo_usu++;\n\t\t\t\t}\n\t\t\t\t$pTema = $pTema.'\n\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t </tr>\n\t\t<tr class=\"Estilo2\"><td colspan=\"2\" >Para consultar en detalle la planeaci&oacute;n de un participante, en un proyecto especifico, utilice el reporte Usuarios por proyecto, accediendo a el, atravez del boton Consolidados por divisi&oacute;n, ubicado en la parte superior de la pagina principal de la planeaci&oacute;n por proyectos. </td></tr>\n\t\t</table>';\n\n\t\t/*\n\t\t\t\t//consulta la unidad del director y el coordinador de proyecto\n\t\t\t\t$sql=\"SELECT id_director,id_coordinador FROM HojaDeTiempo.dbo.proyectos where id_proyecto = \" . $cualProyecto.\" \" ;\n\t\t\t\t$eCursorMsql=mssql_query($sql);\n\t\t\t\t$usu_correo= array(); //almacena la unidad de los usuarios a los que se le enviara el correo\n\t\t\t\t$i=1;\n\t\t\t\twhile($datos_dir_cor=mssql_fetch_array($eCursorMsql))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_coordinador\"];\n\t\t\t\t\t$i++;\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_director\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\n\t\t\t\t//consulta la unidad porgramadores y ordenadores de gasto\t\t\t\n\t\t//select unidad from HojaDeTiempo.dbo.Programadores where id_proyecto=\".$cualProyecto.\" union\n\t\t\t\t$sql_pro_orde=\" select unidadOrdenador from GestiondeInformacionDigital.dbo.OrdenadorGasto where id_proyecto=\".$cualProyecto;\n\t\t\t\t$cur_pro_orde=mssql_query($sql_pro_orde);\n\t\t\t\twhile($datos_pro_orde=mssql_fetch_array($cur_pro_orde))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_pro_orde[\"unidad\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\t\t\t\n\t\t\n\t\t\t\t$i=0;\n\t\t\t\t//consulta el correo de los usuarios(director,cordinador,ordenadroes de G, y programadores) asociados al proyecto\n\t\t\t\t$sql_usu=\" select email from HojaDeTiempo.dbo.Usuarios where unidad in(\";\n\t\t\t\tforeach($usu_correo as $unid)\n\t\t\t\t{\n\t\t\t\t\tif($i==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" \".$unid;\t\t\n\t\t\t\t\t\t$i=1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" ,\".$unid;\n\t\t\t\t}\n\t\t\t\t$sql_usu=$sql_usu.\") and retirado is null\";\n\t\t\t\t$cur_usu=mssql_query($sql_usu);\t\t\t\t\n\t\t\n\t\t\t\t//se envia el correo a el director, cordinador, orenadores de gasto, y programadores del proyecto\t\n\t\t\t\twhile($eRegMsql = mssql_fetch_array($cur_usu))\n\t\t\t\t{\t\t\n\t\t\t\t $miMailUsuarioEM = $eRegMsql[email] ;\n\t\t\t\n\t\t\t\t //***EnviarMailPEAR\t\n\t\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\n\t\t\t\n\t\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\n\t\t\t\n\t\t\t\t //***FIN EnviarMailPEAR\n\t\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t\n\t\t\t\t}\n\t\t*/\n\t\t\tif($ban_reg==1) //SEW ENVIA EL CORREO SI EXISTE ALMENOS UN USUARIO SOBREPLANEADO\n\t\t\t{\n\t\t///////////////////////////**********************************************************PARA QUITAR\n\t\t\t $miMailUsuarioEM = 'carlosmaguirre'; //$eRegMsql[email] ;\t\n\t\t\t\t$pAsunto='Sobre planeaci&oacute;n de proyectos';\n\t\t\t //***EnviarMailPEAR\t\n\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\t\n\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\t\n\t\t\t //***FIN EnviarMailPEAR\n\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t}\n\t\t\n\t\t?>\n\n<?\n}", "public function obtenerViajesplusAbonados();", "function cl_sau_triagemavulsa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_triagemavulsa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function masodik()\n {\n }", "public function getUtilisateurs();", "function getTitulos() {\r\n //arreglo para remplazar los titulos de las columnas\r\n $titulos_campos['ivg_id'] = INVENTARIO_GRUPO;\r\n $tirulos_campos['ivg_nombre'] = INVENTARIO_GRUPO;\r\n\r\n $titulos_campos['ine_id'] = INVENTARIO_EQUIPO;\r\n $titulos_campos['ine_nombre'] = INVENTARIO_NOMBRE_EQUIPO;\r\n $titulos_campos['ine_reposicion'] = INVENTARIO_EQUIPO_REPOSICION;\r\n\r\n $titulos_campos['ies_id'] = INVENTARIO_ESTADO;\r\n $titulos_campos['ies_nombre'] = INVENTARIO_NOMBRE_ESTADO;\r\n\r\n $titulos_campos['inm_id'] = INVENTARIO_MARCA;\r\n $titulos_campos['inm_nombre'] = INVENTARIO_MARCA;\r\n\r\n $tirulos_campos['obc_id'] = OBLIGACION_CLAUSULA;\r\n $tirulos_campos['obc_nombre'] = OBLIGACION_CLAUSULA;\r\n\r\n $tirulos_campos['oco_id'] = OBLIGACION_COMPONENTE;\r\n $tirulos_campos['oco_nombre'] = OBLIGACION_COMPONENTE;\r\n\r\n $titulos_campos['dti_id'] = DOCUMENTO_TIPO;\r\n\t $titulos_campos['dti_nombre'] = DOCUMENTO_TIPO;\r\n \t\t$titulos_campos['dti_estado'] = DOCUMENTO_ESTADO_CONTROL;\r\n \t\t$titulos_campos['dti_responsable'] = DOCUMENTO_RESPONSABLE_CONTROL;\r\n\r\n \t\t$titulos_campos['dot_id'] = DOCUMENTO_TEMA;\r\n \t\t$titulos_campos['dot_nombre'] = DOCUMENTO_TEMA;\r\n\r\n \t\t$titulos_campos['dos_id'] = DOCUMENTO_SUBTEMA;\r\n \t\t$titulos_campos['dos_nombre'] = DOCUMENTO_SUBTEMA;\r\n\r\n \t\t$titulos_campos['doa_id'] = DOCUMENTO_RESPONSABLE;\r\n \t\t$titulos_campos['doa_nombre'] = DOCUMENTO_RESPONSABLE;\r\n \t\t$titulos_campos['doa_sigla'] = DOCUMENTO_SIGLA;\r\n\r\n \t\t$titulos_campos['tib_nombre'] = DOCUMENTO_BUSQUEDA;\r\n\r\n \t\t$titulos_campos['doe_nombre'] = DOCUMENTO_ESTADOS;\r\n \t\t$titulos_campos['der_nombre'] = DOCUMENTO_ESTADO_RESPUESTA;\r\n \t\t$titulos_campos['see_nombre'] = SEGUIMIENTO_ESTADOS;\r\n \t\t$titulos_campos['ces_nombre'] = COMPROMISO_ESTADOS;\r\n\r\n \t\t$titulos_campos['dta_id'] = DOCUMENTO_TIPO_ACTOR;\r\n \t\t$titulos_campos['dta_nombre'] = DOCUMENTO_TIPO_ACTOR;\r\n\r\n \t\t$titulos_campos['rpr_nombre'] = PROBABILIDAD;\r\n \t\t$titulos_campos['rpr_valor'] = PROBABILIDAD_VALOR;\r\n\r\n \t\t$titulos_campos['rca_nombre'] = CATEGORIA;\r\n \t\t$titulos_campos['rca_minimo'] = CATEGORIA_MINIMO;\r\n \t\t$titulos_campos['rca_maximo'] = CATEGORIA_MAXIMO;\r\n\r\n \t\t$titulos_campos['rim_nombre'] = IMPACTO;\r\n \t\t$titulos_campos['rim_valor'] = IMPACTO_VALOR;\r\n\r\n \t\t$titulos_campos['rer_id'] = COD_ROL;\r\n \t\t$titulos_campos['rer_nombre'] = COD_ROL;\r\n\r\n\t $titulos_campos['dep_id'] = COD_DEPARTAMENTO;\r\n\t $titulos_campos['dep_nombre'] = NOMBRE_DEPARTAMENTO;\r\n\r\n\t $titulos_campos['dpr_id'] = COD_DEPARTAMENTO_REGION;\r\n\t $titulos_campos['dpr_nombre'] = NOMBRE_DEPARTAMENTO_REGION;\r\n\r\n \t\t$titulos_campos['mun_id'] = COD_MUNICIPIO;\r\n \t\t$titulos_campos['mun_nombre'] = NOMBRE_MUNICIPIO;\r\n \t\t$titulos_campos['mun_poblacion'] = POB_MUNICIPIO;\r\n\r\n $titulos_campos['tia_nombre'] = TIPO_ACTOR;\r\n\r\n $titulos_campos['ope_id'] = OPERADOR;\r\n $titulos_campos['ope_nombre'] = OPERADOR_NOMBRE;\r\n $titulos_campos['ope_sigla'] = OPERADOR_SIGLA;\r\n \t\t$titulos_campos['ope_contrato_no'] = OPERADOR_CONTRATO_NRO;\r\n \t\t$titulos_campos['ope_contrato_valor'] = OPERADOR_CONTRATO_VALOR;\r\n\r\n return $titulos_campos;\r\n }", "public function hapus_toko(){\n\t}", "function cl_tfd_situacaopedidotfd() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_situacaopedidotfd\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function accueil()\n {\n }", "public function valorpasaje();", "public function getChapeau();", "function getTitulos() {\n //arreglo para remplazar los titulos de las columnas \n $titulos_campos['dep_id'] = COD_DEPARTAMENTO;\n $titulos_campos['dep_nombre'] = NOMBRE_DEPARTAMENTO;\n\n $titulos_campos['der_id'] = COD_DEPARTAMENTO_REGION;\n $titulos_campos['der_nombre'] = NOMBRE_DEPARTAMENTO_REGION;\n\n $titulos_campos['mun_id'] = COD_MUNICIPIO;\n $titulos_campos['mun_nombre'] = NOMBRE_MUNICIPIO;\n $titulos_campos['mun_poblacion'] = POB_MUNICIPIO;\n\n $titulos_campos['ope_id'] = OPERADOR;\n $titulos_campos['ope_nombre'] = OPERADOR_NOMBRE;\n $titulos_campos['ope_sigla'] = OPERADOR_SIGLA;\n $titulos_campos['ope_contrato_no'] = OPERADOR_CONTRATO_NRO;\n $titulos_campos['ope_contrato_valor'] = OPERADOR_CONTRATO_VALOR;\n\n $titulos_campos['Id_Ciudad'] = TITULO_CIUDAD;\n $titulos_campos['Id_Pais'] = NOMBRE_PAIS;\n $titulos_campos['Nombre_Ciudad'] = NOMBRE_CIUDAD;\n\n $titulos_campos['Nombre_Pais'] = NOMBRE_PAIS;\n\n $titulos_campos['Id_Familia'] = TITULO_FAMILIAS;\n $titulos_campos['Descripcion_Familia'] = DESCRIPCION_FAMILIA;\n\n $titulos_campos['Id_Moneda'] = TITULO_MONEDA;\n $titulos_campos['Descripcion_Moneda'] = DESCRIPCION_MONEDA;\n\n $titulos_campos['cfi_numero'] = CUENTA_NUMERO;\n $titulos_campos['cfi_nombre'] = CUENTA_NOMBRE;\n\n $titulos_campos['cft_id'] = CUENTA_TIPO;\n $titulos_campos['cft_nombre'] = CUENTA_TIPO;\n\n $titulos_campos['mov_descripcion'] = MOVIMIENTO_DESCRIPCION;\n $titulos_campos['mov_tipo'] = MOVIMIENTO_TIPO;\n\n $titulos_campos['idCentroPoblado'] = TITULO_CENTRO_POBLADO;\n $titulos_campos['codigoDane'] = CODIGO_DANE_CENTRO_POBLADO;\n $titulos_campos['nombre'] = NOMBRE_CENTRO_POBLADO;\n $titulos_campos['mun_id'] = MUNICIPIO_CENTRO_POBLADO;\n\n $titulos_campos['enc_tipo_nombre'] = TIPO_INSTRUMENTO;\n $titulos_campos['enc_tipo_desc'] = DESCRIPCION_ACTIVIDAD;\n\n $titulos_campos['Descripcion_Tipo'] = \"Plan\";\n \n $titulos_campos['descripcionTipoHallazgo'] = DESCRIPCION_TIPO_HALLAZGO;\n $titulos_campos['descripcion'] = AREA_TIPO_HALLAZGO;\n\n return $titulos_campos;\n }", "function truc() {\n}", "function tous_auteurs_date_passage() {\r\n\tglobal $couleur_claire, $connect_id_auteur;\r\n\r\n\t// fixer le nombre de ligne du tableau (tranche)\r\n\t$fl = $GLOBALS['actijour']['nbl_aut'];\r\n\r\n\t// recup $vl dans URL\r\n\t$dl = intval(_request('vl'));\r\n\t$dl = ($dl + 0);\r\n\t// valeur de tranche affichꥍ\r\n\t$nba1 = $dl + 1;\r\n\r\n\t$p_st = _request('st');\r\n\tif (!$p_st) {\r\n\t\t$where_st = \"statut IN ('0minirezo','1comite','6forum')\";\r\n\t\t$p_st = 'tous';\r\n\t} else {\r\n\t\t$where_st = \"statut = \" . _q($p_st);\r\n\t}\r\n\r\n\t$q = sql_select(\"SQL_CALC_FOUND_ROWS id_auteur, statut, nom,\r\n\t\t\t\t\t\tDATE_FORMAT(en_ligne,'%d/%m/%y %H:%i') AS vu \"\r\n\t\t. \"FROM spip_auteurs \"\r\n\t\t. \"WHERE $where_st \"\r\n\t\t. \"ORDER BY en_ligne DESC,nom \"\r\n\t\t. \"LIMIT $dl,$fl\"\r\n\t);\r\n\r\n\t// recup nombre total d'entrees\r\n\t$nl = sql_select(\"FOUND_ROWS()\");\r\n\t$found = @sql_fetch($nl);\r\n\t$nb_auteurs = $found['FOUND_ROWS()'];\r\n\r\n\t$ifond = 0;\r\n\r\n\t$aff = '';\r\n\r\n\t# onglet select statut\r\n\t$lst_statut = array('tous', '0minirezo', '1comite', '6forum');\r\n\t$script = _request('exec');\r\n\r\n\t$aff .= debut_onglet();\r\n\tforeach ($lst_statut as $statut) {\r\n\t\t$aff .= onglet(_T('actijour:onglet_connect_' . $statut),\r\n\t\t\tgenerer_url_ecrire($script, 'st=' . ($statut == 'tous' ? '' : $statut)),\r\n\t\t\t$statut,\r\n\t\t\t($p_st == $statut ? $statut : ''), '');\r\n\t}\r\n\t$aff .= fin_onglet();\r\n\r\n\r\n\t# tableau\r\n\t#\r\n\t$aff .= debut_cadre_relief(\"annonce.gif\", true);\r\n\r\n\t$aff .= \"<table align='center' border='0' cellpadding='2' cellspacing='0' width='100%'>\\n\"\r\n\t\t. \"<tr><td colspan='3' class='verdana3 bold'>\" . _T('actijour:tous_date_connections')\r\n\t\t. \"</td></tr>\";\r\n\t# Tranches\r\n\t$aff .= \"<tr><td colspan='3' class='verdana3 bold'>\";\r\n\t$aff .= \"<div align='center' class='iconeoff verdana2 bold' style='clear:both;'>\\n\"\r\n\t\t. tranches_liste_art($nba1, $nb_auteurs, $fl)\r\n\t\t. \"\\n</div>\\n\";\r\n\t$aff .= \"</td></tr>\";\r\n\r\n\twhile ($row = sql_fetch($q)) {\r\n\t\t$ifond = $ifond ^ 1;\r\n\t\t$couleur = ($ifond) ? '#FFFFFF' : $couleur_claire;\r\n\r\n\t\t$aff .= \"<tr bgcolor='$couleur'>\"\r\n\t\t\t. \"<td width='5%'>\\n\"\r\n\t\t\t. bonhomme_statut($row) . \"</td>\\n\"\r\n\t\t\t. \"<td width='75%'>\"\r\n\t\t\t. \"<a class='verdana2 bold' href='\" . generer_url_ecrire(\"auteur_infos\", \"id_auteur=\" . $row['id_auteur']) . \"'>\"\r\n\t\t\t. entites_html($row['nom']) . \"</a>\\n\"\r\n\t\t\t. \"<td width='20%'>\\n\"\r\n\t\t\t. \"<div align='right' class='verdana1'>\" . $row['vu'] . \"</div>\\n\"\r\n\t\t\t. \"</td></tr>\\n\";\r\n\r\n\t}\r\n\t$aff .= \"</table>\\n\\n\";\r\n\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n}", "public function ispisiOsobu(){\n // echo \"$this->ime $this->prezime $this->godRdoj\";\n echo \"<br>Ime: \" . $this->getIme() . \"<br>Prezime: \" . $this->getPrezime() . \"<br>Godina rodjenja: \" . $this->getGodRodj() . \"<br>\";\n }", "function RellenarTitulo()\r\n {\r\n $this->Imprimir('ANÁLSIS DE FALLAS DE DISTRIBUCIÓN');\r\n\r\n $this->Imprimir($this->convocatoria->getLugar(), 93, 10);\r\n\r\n $this->Imprimir(strftime(\"%A %d de %B de %Y\", strtotime($this->convocatoria->getFecha())) .\r\n ' - Hora: ' . $this->convocatoria->getHoraIni() . ' a ' .\r\n $this->convocatoria->getHoraFin(), 95, 10, 16);\r\n }", "function accesrestreintobjets_affiche_milieu($flux){\n\tif ($flux[\"args\"][\"exec\"] == \"configurer_accesrestreint\") {\n\t\t$flux[\"data\"] = recuperer_fond('prive/squelettes/inclure/configurer',array('configurer'=>'configurer_accesrestreintobjets')).$flux[\"data\"];\n\t}\n\t// Ajouter la config des zones sur la vue de chaque objet autorisé\n\telseif (\n\t\t$exec = trouver_objet_exec($flux['args']['exec'])\n\t\tand include_spip('inc/config')\n\t\tand include_spip('inc/autoriser')\n\t\tand $objets_ok = lire_config('accesrestreintobjets/objets')\n\t\t// Si on a les arguments qu'il faut\n\t\tand $type = $exec['type']\n\t\tand $id = intval($flux['args'][$exec['id_table_objet']])\n\t\t// Si on est sur un objet restrictible\n\t\tand in_array($exec['table_objet_sql'], $objets_ok)\n\t\t// Et que l'on peut configurer le site\n\t\tand autoriser('configurer')\n\t) {\n\t\t$liens = recuperer_fond(\n\t\t\t'prive/objets/editer/liens',\n\t\t\tarray(\n\t\t\t\t'table_source'=>'zones',\n\t\t\t\t'objet' => $type,\n\t\t\t\t'id_objet' => $id,\n\t\t\t)\n\t\t);\n\t\tif ($liens){\n\t\t\tif ($pos = strpos($flux['data'],'<!--affiche_milieu-->'))\n\t\t\t\t$flux['data'] = substr_replace($flux['data'], $liens, $pos, 0);\n\t\t\telse\n\t\t\t\t$flux['data'] .= $liens;\n\t\t}\n\t}\n\t\n\treturn $flux;\n}", "public function etatListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Etat\");//type array\n\t}", "function cl_avaliacaoestruturanota() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"avaliacaoestruturanota\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function tipo_viajes($t = 0){\n\t\t$tipo_viajes = array(\"<span class=\\\"texto-claro\\\">No Capturado</span>\", \"Técnico\", \"Alto Nivel\");\n\t\treturn $tipo_viajes[$t];\n\t}", "function cl_sau_receitamedica() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_receitamedica\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ouvidoriaatendimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ouvidoriaatendimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function getAllFromProizvod(){\n\t\treturn $this->ime . \"&nbsp\" . $this->imeProizvođača . \"&nbsp\" \n\t\t. $this->prezimeProizvođača . \"&nbsp\" . $this->cijena;\n\t}", "public function elso()\n {\n }", "public function boleta()\n\t{\n\t\t//\n\t}", "function cl_tarefa_lanc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tarefa_lanc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "abstract public function getPasiekimai();", "public function contrato()\r\n\t{\r\n\t}", "private function Zapis_kolize_formulare($pole, $idcka_skolizi, $iducast, $formular) { \r\n//znevalidneni vsech kolizi pro ucastnika a tento formular\r\n self::Znevalidni_kolize_ucastnika_formulare($iducast, $formular); \r\n\r\n//zapis do uc_kolize_table pro kazdou nastalou s_kolizi\r\n foreach ($idcka_skolizi as $id_skolize) { //zapisovana policka jsou v $pole\r\n //echo \"policko: \" . $pole['uc_kolize_table§' . $id_skolize . '_revidovano'];\r\n $kolize = new Projektor2_Table_UcKolizeData ($iducast, (int)$id_skolize,\r\n $pole['uc_kolize_table§' . $id_skolize . '_revidovano'],\r\n $pole['uc_kolize_table§' . $id_skolize . '_revidovano_pozn'],\r\n null, 1,\r\n null,null,null,null,null) ;\r\n // echo \"v Zapis_kolize_temp\" . var_dump ($kolize);\r\n $kolize->Zapis_jednu_kolizi(); //kdyz je v tabulce uc_kolize_table, tak prepsat, kdyz neni, tak insert\r\n }\r\n\r\n}", "function formulaires_recommander_charger_dist(){\n\t$valeurs = array('destinataire'=>'','destinataires'=>'','texte'=>'');\n\n\treturn $valeurs;\n}", "protected function convertirMayuscula(){\n $cadena=strtoupper($this->tipo);\n $this->tipo=$cadena;\n }", "public function uputstvo()\n {\n $this->prikaz(\"uputstvo\", []);\n }", "public static function transformatorUscatJT(){\n $joasaTensiune=array(\n \"loj\" => Converter::from('length.mm')->to('length.m')->convert(1.5)->getValue(),\n \"g_oj\" => Converter::from('length.mm')->to('length.m')->convert(1)->getValue(),\n //2*0.5carton mm\n \"aoj\" => Converter::from('length.mm')->to('length.m')->convert(10)->getValue(),\n );\n return $joasaTensiune;\n }", "public static function getReceta(){\n return array(\"LENTEJA\"=>200, \"LONGANIZA VEGANA\"=>1);\n }", "function cl_tipovistoriasrec() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tipovistoriasrec\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function possederListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Posseder\");//type array\n\t}", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_cemiteriorural() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cemiteriorural\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_traperm() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"traperm\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function determinaFechosVazios()\n{\n\tglobal $mTransicoes, $lAlfabeto, $fechoVazio, $lEstados, $lTokens; \t\n\n\t//Variáveis\n\t$arrayEstados = NULL; //array com as diversas transições vazias de um mesmo estado\n\t$arrayEstados2 = NULL;\t\n\t$transConcatenadas = NULL; //array com a string inteira da transição, pode ter diversas transições vazias\n\n\techo \"------------------------------------<br>\";\n\techo \"Passo 1: Fechos dos estados<br>\";\n\t\n\tfor($i = 1; $i <= sizeof($lEstados); $i++) //determina o fecho para cada estado do autômato\n\t{ \n\t\t//echo \"Fecho de \".$lEstados[$i].\":<br>\";\n\t\t//echo \"&nbsp;&nbsp;Transicoes vazias: \".$mTransicoes[$lEstados[$i]][$lAlfabeto[0]].\"<br>\";\n\t\tif($mTransicoes[$lEstados[$i]][$lAlfabeto[0]] != '-') //mtransicoes[\"q0\"][\"e\"] != \"-\" \n\t\t{\n\t\t\t//echo \"&nbsp;&nbsp;Diferente de '-'<br>\";\n\t\t\t$fechoVazio[$lEstados[$i]][] = $lEstados[$i]; //coloca ele mesmo na lista //fechoVazio[\"q0\"][0] = \"q0'\n\t\t\t$lTokens = NULL; //limpa conteúdo de $lTokens\n\t\t\ttokeniza($mTransicoes[$lEstados[$i]][$lAlfabeto[0]]); //\"tokeniza\" vai deixar em $lTokens todos os estados de transição vazia\n\t\t\t$arrayEstados = $lTokens;\t\n\t\n\t\t\tfor($j = 0; $j < sizeof($arrayEstados); $j++)\n\t\t\t{\n\t\t\t\t//echo \"&nbsp;&nbsp;arrayEstados[$j] = \".$arrayEstados[$j].\"<br>\";\t\t\t\t\n\t\t\t\t//ve se o estado está no fecho, se não estiver coloca\n\t\t\t\tif(array_search($arrayEstados[$j], $fechoVazio[$lEstados[$i]]) == NULL \t\n\t\t\t\t\t\t\t\t&& $arrayEstados[$j] != '-'\n\t\t\t\t\t\t\t\t&& $arrayEstados[$j] != $fechoVazio[$lEstados[$i]][0])\t\n\t\t\t\t{ //o teste é igual a NULL, logo não achou o estado no fecho\n\t\t\t\t\t$fechoVazio[$lEstados[$i]][sizeof($fechoVazio[$lEstados[$i]])] = $arrayEstados[$j];\n\t\t\t\t\t//echo \"&nbsp;&nbsp;&nbsp;&nbsp;1fechoVazio[$lEstados[$i]][\".sizeof($fechoVazio[$lEstados[$i]]).\"]: \".$arrayEstados[$j].\"<br>\";\n\t\t\t\t\t//agora precisamos ver as transições vazias do arrayEstados[$j]\n\t\t\t\t\t$lTokens = NULL; //limpa conteúdo de $lTokens\n\t\t\t\t\ttokeniza($mTransicoes[$arrayEstados[$j]][$lAlfabeto[0]]); \n\t\t\t\t\t$arrayEstados2 = NULL;\n\t\t\t\t\t$arrayEstados2 = $lTokens;\n\t\t\t\t\t//echo \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\";\t\n\t\t\t\t\t//echo \"transicao: \".$arrayEstados2[0].\"<br>\";\n\t\n\t\t\t\t\tfor($k = 0; $k < sizeof($arrayEstados2); $k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(array_search($arrayEstados2[$j], $fechoVazio[$lEstados[$i]]) == NULL \n\t\t\t\t\t\t\t\t\t\t&& $arrayEstados2[$j] != '-' \n\t\t\t\t\t\t\t\t\t\t&& $arrayEstados2[$j] != $fechoVazio[$lEstados[$i]][0])\t\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t$fechoVazio[$lEstados[$i]][sizeof($fechoVazio[$lEstados[$i]])] = $arrayEstados2[$k];\n\t\t\t\t\t\t\t//echo \"&nbsp;&nbsp;&nbsp;&nbsp;2fechoVazio[$lEstados[$i]][\".sizeof($fechoVazio[$lEstados[$i]]).\"]: \".$arrayEstados2[$j].\"<br>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t} \t\n\t\t}\n\t\telse //estado sem transições vazias, logo o fecho vazio é vazio\n\t\t{\n\t\t\t$fechoVazio[$lEstados[$i]][] = $lEstados[$i]; //o fecho de um estado contém ele próprio sempre\n\t\t\t//echo \"&nbsp;&nbsp;&nbsp;&nbsp;Eh vazio, coloca so ele mesmo<br>\";\n\t\t}\n\t}\t\n\n\tfor($i = 1; $i <= sizeof($lEstados); $i++) //determina o fecho para cada estado do autômato\n\t{ \n\t\tsort($fechoVazio[$lEstados[$i]]);\n\t\techo $lEstados[$i].\": \";\n\t\tfor($j = 0; $j < sizeof($fechoVazio[$lEstados[$i]]); $j++)\n\t\t{\n\t\t\techo $fechoVazio[$lEstados[$i]][$j].\".\";\n\t\t}\n\t\techo \"<br>\";\n\t}\n\n\techo \"------------------------------------<br>\";\n\treturn;\n}", "public function run()\n {\n $list=[];\n $types1=[\"CNTT - Viễn thông\",\"Thiết bị - Phần cứng\"];\n sort($types1);\n for($i=1;$i<=count($types1);$i++){\n array_push($list,[\n 'cd_ma'=>$i,\n 'cd_ten'=> $types1[$i-1],\n 'lv_ma'=>'1'\n ]); \n }\n \n $types=[\"Học bổng - Du học\",\"Đào tạo - Thi cử\"];\n sort($types);\n for($i=1,$j=3;$i<=count($types);$i++,$j++){\n array_push($list,[\n 'cd_ma'=>$j,\n 'cd_ten'=> $types[$i-1],\n 'lv_ma'=>'2'\n ]); \n }\n\n \n\n $types2=[\"Âm nhạc\",\"Thời trang\", \"Điện ảnh - Truyền hình\"];\n sort($types2);\n for($i=1,$j=5;$i<=count($types2);$i++,$j++){\n array_push($list,[\n 'cd_ma'=>$j,\n 'cd_ten'=> $types2[$i-1],\n 'lv_ma'=>'3'\n ]); \n }\n\n $types4=[\"Lao động - Việc làm\",\"Tài chính\", \"Chứng khoán\"];\n sort($types4);\n for($i=1,$j=8;$i<=count($types4);$i++,$j++){\n array_push($list,[\n 'cd_ma'=>$j,\n 'cd_ten'=> $types4[$i-1],\n 'lv_ma'=>'4'\n ]); \n }\n\n $types6=[\"Hình sự - Dân sự\",\"An ninh - Trật tự\"];\n sort($types6);\n for($i=1,$j=11;$i<=count($types6);$i++,$j++){\n array_push($list,[\n 'cd_ma'=>$j,\n 'cd_ten'=> $types6[$i-1],\n 'lv_ma'=>'5'\n ]); \n }\n\n $types5=[\"Bóng đá quốc tế\",\"Bóng đá Việt Nam\"];\n sort($types5);\n for($i=1,$j=13;$i<=count($types5);$i++,$j++){\n array_push($list,[\n 'cd_ma'=>$j,\n 'cd_ten'=> $types5[$i-1],\n 'lv_ma'=>'6'\n ]); \n }\n\n $types3=[\"Nghệ thuật\",\"Ẩm thực\", \"Du lịch\"];\n sort($types3);\n for($i=1,$j=15;$i<=count($types3);$i++,$j++){\n array_push($list,[\n 'cd_ma'=>$j,\n 'cd_ten'=> $types3[$i-1],\n 'lv_ma'=>'7'\n ]); \n } \n\n DB::table('chude')->insert($list);\n }", "function get_tipos_espacios_mtrx()\n\t{\n\t\t$ef = new Tipo_espacio();\n\t\t$ef->order_by('tag');\n\t\t$ef->get();\n\t\tif($ef->c_rows>0){\n\t\t\t$colect[0]=\"TODOS\";\n\t\t\tforeach($ef->all as $row){\n\t\t\t\t$colect[$row->id]=$row->tag;\n\t\t\t}\n\t\t\treturn $colect;\n\t\t} else\n\t\t\treturn 0;\n\t}", "function cl_bensetiquetaimpressa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bensetiquetaimpressa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_moblevantamentoedi() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamentoedi\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function mostrarTeatros(){\n /**\n * @var object $objTeatro\n * @var array $colTeatro\n * @var string $strTeatros\n */\n $objTeatro = new Teatro();\n $colTeatro = $objTeatro->listar();\n $strTeatros = \"Teatros: \\n\";\n foreach($colTeatro as $teatro){\n $strTeatros.=\"* \\n\".$teatro;\n }\n return $strTeatros;\n }", "public function getDirectriz()\n {\n $dir = false;\n if (self::getCod() === '110000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '120000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '210000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '220000') $dir='Ciencias Experimentales';\n if (self::getCod() === '230000') $dir='Ciencias Experimentales';\n if (self::getCod() === '240000') $dir='Ciencias de la Salud';\n if (self::getCod() === '250000') $dir='Ciencias Experimentales';\n if (self::getCod() === '310000') $dir='Ciencias Experimentales';\n if (self::getCod() === '320000') $dir='Ciencias de la Salud';\n if (self::getCod() === '330000') $dir='Enseñanzas Técnicas';\n if (self::getCod() === '510000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '520000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '530000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '540000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '550000') $dir='Humanidades';\n if (self::getCod() === '560000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '570000') $dir='Humanidades';\n if (self::getCod() === '580000') $dir='Humanidades';\n if (self::getCod() === '590000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '610000') $dir='Ciencias de la Salud';\n if (self::getCod() === '620000') $dir='Humanidades';\n if (self::getCod() === '630000') $dir='Ciencias Sociales y Jurídicas';\n if (self::getCod() === '710000') $dir='Humanidades';\n if (self::getCod() === '720000') $dir='Humanidades';\n return $dir;\n }", "function moviextranjeros($ejer,$poli){\n\t\t\t$sql=$this->query(\"select m.*,c.manual_code from cont_polizas p,cont_movimientos m,cont_accounts c,cont_config con\n\t\t\twhere m.IdPoliza=p.id and m.Cuenta=c.`account_id` and c.currency_id!=1 and m.Activo=1 and c.main_father!=con.CuentaBancos\n\t\t\t and p.idejercicio=\".$ejer.\" and p.id=\".$poli);\n\t\t\t \n\t\t\treturn $sql;\n\t\t\t\n\t\t}", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rechumano() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rechumano\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_rhempenhofolharubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhempenhofolharubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function getTarjetas(){\n\t\treturn $this->objetos_tarjetas;\n\t}", "function pegaDadosEtiquetas()\n\t{\n\t\tif(!$this->layer){return \"erro\";}\n\t\t$itens = $this->layer->getmetadata(\"ITENS\");\n\t\t$itens = explode(\",\",$itens);\n\t\t$itensdesc = mb_convert_encoding($this->layer->getmetadata(\"ITENSDESC\"),\"UTF-8\",\"ISO-8859-1\");\n\t\t$itensdesc = explode(\",\",$itensdesc);\n\t\t$itenslink = $this->layer->getmetadata(\"ITENSLINK\");\n\t\t$itenslink = explode(\",\",$itenslink);\n\n\t\t$tips = $this->layer->getmetadata(\"TIP\");\n\n\t\t$res = array(\n\t\t\t\t\"itens\"=>$itens,\n\t\t\t\t\"itensdesc\"=>array_combine($itens,$itensdesc),\n\t\t\t\t\"itenslink\"=>array_combine($itens,$itenslink),\n\t\t\t\t\"tips\"=>explode(\",\",$tips),\n\t\t\t\t\"itembuscarapida\"=>$this->layer->getmetadata(\"itembuscarapida\")\n\t\t);\n\t\treturn($res);\n\t}", "function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}", "public function geraClasseControle(){\n # Abre o template da classe Controle e armazena conteudo do modelo\t\t\n $modelo = Util::getConteudoTemplate('class.Modelo.Controle.tpl');\n\n # Abre o template dos metodos de cadastros e armazena conteudo do modelo\n $modeloCAD = Util::getConteudoTemplate('metodoCadastra.tpl');\n $modeloExclui = Util::getConteudoTemplate('metodoExclui.tpl');\n $modeloSelecionar = Util::getConteudoTemplate('metodoSeleciona.tpl');\n $modeloGetAll = Util::getConteudoTemplate('metodoGetAll.tpl'); \n $modeloConsultar = Util::getConteudoTemplate('metodoConsulta.tpl');\n $modeloAlterar = Util::getConteudoTemplate('metodoAltera.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n $aRequire = $aCadastro = $aExclui = $aSelecionar = $aGetAll = $aAlterar = $aConsultar = array();\n $copiaModelo = $modelo;\n //print_r($aBanco);exit;\n foreach($aBanco as $aTabela){\n $aPKDoc = $aPK = array(); \n foreach($aTabela as $oCampo){\n if((string)$oCampo->CHAVE == '1'){\n $aPKDoc[] = \"\\t * @param integer \\$\".(string)$oCampo->NOME;\n $aPK[] = \"\\$\".(string)$oCampo->NOME;\n }\n }\n\n # Montar a Lista de DOC do metodo selecionar\n $listaPKDoc = join(\"\\n\", $aPKDoc);\n $listaPK = join(\",\", $aPK);\n\n # Recupera o nome da tabela e gera os valores a serem gerados\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n $copiaModeloCAD = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloCAD);\n $copiaModeloExclui = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloExclui);\n $copiaModeloSelecionar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloSelecionar);\n $copiaModeloGetAll = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloGetAll);\n $copiaModeloAlterar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloAlterar);\n $copiaModeloConsultar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloConsultar);\n\n $montaObjeto = $this->retornaObjetosMontados($aTabela['NOME']);\n $montaObjetoBD = $this->retornaObjetosBDMontados($aTabela['NOME']);\n\n $copiaModeloCAD = str_replace('%%MONTA_OBJETO%%', $montaObjeto, $copiaModeloCAD);\n $copiaModeloCAD = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloCAD);\n $copiaModeloExclui = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloExclui);\n $copiaModeloSelecionar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloSelecionar);\n $copiaModeloSelecionar = str_replace('%%DOC_LISTA_PK%%', $listaPKDoc, $copiaModeloSelecionar);\n $copiaModeloSelecionar = str_replace('%%LISTA_PK%%', \t$listaPK, $copiaModeloSelecionar);\n $copiaModeloGetAll = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloGetAll);\n $copiaModeloAlterar = str_replace('%%MONTA_OBJETO%%', $montaObjeto, $copiaModeloAlterar);\n $copiaModeloAlterar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloAlterar);\n $copiaModeloConsultar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloConsultar);\n\n $aRequire[] = \"require_once(dirname(__FILE__).'/bd/class.$nomeClasse\".\"BD.php');\";\n $aCadastro[] = $copiaModeloCAD;\n $aExclui[] = $copiaModeloExclui;\n $aSelecionar[] = $copiaModeloSelecionar;\n $aGetAll[] = $copiaModeloGetAll;\n $aAlterar[] = $copiaModeloAlterar;\n $aConsultar[] = $copiaModeloConsultar;\n }\n\n # Monta demais valores a serem substituidos\n $listaRequire = join(\"\\n\", $aRequire);\n $listaCadastro = join(\"\\n\\n\", $aCadastro);\n $listaExclui = join(\"\\n\\n\", $aExclui);\n $listaSelecionar = join(\"\\n\\n\", $aSelecionar);\n $listaGetAll = join(\"\\n\\n\", $aGetAll);\n $listaAlterar = join(\"\\n\\n\", $aAlterar);\n //print \"<pre>\"; print_r($aAlterar); print \"</pre>\"; \n //print \"<pre>\"; print_r($aConsultar); print \"</pre>\"; \n $listaConsultar = join(\"\\n\\n\", $aConsultar);\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%LISTA_REQUIRE%%',\t\t $listaRequire, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CADASTRA%%',\t $listaCadastro, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_EXCLUI%%',\t $listaExclui, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_SELECIONAR%%',\t $listaSelecionar, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CARREGAR_COLECAO%%', $listaGetAll, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_ALTERA%%',\t $listaAlterar, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CONSULTA%%',\t $listaConsultar, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) mkdir($dir);\n\n $fp = fopen(\"$dir/class.Controle.php\",\"w\");\n fputs($fp,$copiaModelo);\n\n # ============ Adicionando Classes de core/Config =========\n $modeloConfig = Util::getConteudoTemplate(\"Modelo.Config.\".$aBanco['SGBD'].\".tpl\");\n $modeloConfig = str_replace('%%DATABASE%%', $this->projeto, $modeloConfig);\n \n $fpConfig = fopen(\"$dir/core/config.ini\",\"w\"); \t\n fputs($fpConfig, $modeloConfig); \n fclose($fpConfig);\n\n copy(dirname(__FILE__).\"/core/class.Seguranca.php\", \"$dir/class.Seguranca.php\");\n copy(dirname(__FILE__).\"/class.Util.php\",\t \"$dir/core/class.Util.php\");\n copy(dirname(__FILE__).\"/class.Conexao.php\", \"$dir/core/class.Conexao.php\");\n \n return true;\n }", "function sevenconcepts_formulaire_charger($flux){\n $form=$flux['args']['form'];\n if($form=='inscription'){\n include_spip('cextras_pipelines');\n $champs_extras=champs_extras_objet(table_objet_sql('auteur'));\n foreach($champs_extras as $value){\n $flux['data'][$value['options']['nom']]=''; \n if(isset($value['options']['obligatoire']))$flux['data']['obligatoire'][$value['options']['nom']]='on';\n }\n $flux['data']['nom_inscription']='';\n $flux['data']['mail_inscription']='';\n }\n \n return $flux;\n}", "function geraClassesBasicas(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.Modelo.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n //print_r($aBanco);\n # varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $copiaModelo = $modelo;\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n # Varre a estrutura dos campos da tabela em questao\n $aAtributo = $aListaAtributo = $aAtribuicao = $aFuncaoGet = $aFuncaoSet = array();\n foreach($aTabela as $oCampo){\n $nomeCampo \t = (string)$oCampo->NOME;\n if((string)$oCampo->FKTABELA != ''){\n # Processa nome original da tabela estrangeira\n $nomeFKClasse = ucfirst($this->getCamelMode((string)$oCampo->FKTABELA));\n if($nomeFKClasse == $nomeClasse){\n $nomeCampo = \"o\".ucfirst(preg_replace(\"#^(?:id_?|cd_?)(.*?)#is\", \"$1\", $nomeCampo));\n } else {\n $nomeCampo = \"o$nomeFKClasse\";\n }\n }\n\n # Atribui resultados\n $aAtributo[] \t = \"\\tpublic \\$$nomeCampo;\";\n $aListaAtributo[] = ((string)$oCampo->FKTABELA != '') ? \"$nomeFKClasse \\$$nomeCampo = NULL\" : \"\\$$nomeCampo = NULL\";\n $aAtribuicao[] \t = \"\\t\\t\\$this->$nomeCampo = \\$$nomeCampo;\";\n }\n\n # Monta demais valores a serem substituidos\n $atributos = join($aAtributo,\"\\n\");\n $listaAtributos = join(\", \", $aListaAtributo);\n $atribuicao = join(\"\\n\", $aAtribuicao);\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo);\n $copiaModelo = str_replace('%%ATRIBUTOS%%', $atributos, $copiaModelo);\n $copiaModelo = str_replace('%%LISTA_ATRIBUTOS%%', $listaAtributos, $copiaModelo);\n $copiaModelo = str_replace('%%ATRIBUICAO%%', $atribuicao, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/core/basicas\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.$nomeClasse.php\",\"w\");\n fputs($fp, $copiaModelo);\n fclose($fp);\n }\n return true;\t\n }", "public function test_medio_boleto_trasbordo_CUVP(){\n $tiempo = new Tiempo();\n $tiempo->avanzar( 36000 );\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n $colectivo2 = new Colectivo( 'mixta', '102', 421 );\n\t\t\n $medio_boleto->recargar( 50.0 );\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n\t\t\n $this->assertEquals( $boleto->getValor(), $this->getCostoMedioBoleto() );\n $medio_boleto->gastarPlus();\n\t\t\n $tiempo->avanzar( 300 );\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo2 , $tiempo );\n\t\t\n $this->assertEquals( $boleto->getValor(), $this->getCostoViaje() );\n }", "function usuarios_estados_datos()\n\t{\n\n\t\tparent::objeto();\n\n\t\t$this->tabla=\"usuarios_estados\";\n\t\t$this->campoClave=\"Id\";\n\t\t$this->id=null;\n\t\t\n\t\t\n$v=new Variable(2,$this->tabla,\"Id\",1);\n\t\t\t\n$v->clave=true;\n\t\t\t\n\t\t\t\n$v->autonumerica=true;\n\t\t\t\n$this->agregarVariable2($v);\n$v=new Variable(1,$this->tabla,\"Estado\",2);\n$this->agregarVariable2($v);\n\n\t}", "function SuoritaLisaysToimet(){\n /*Otetaan puuhaId piilotetustaKentasta*/\n $puuhaid = $_POST['puuha_id'];\n \n /* Hae puuhan tiedot */\n $puuha = Puuhat::EtsiPuuha($puuhaid);\n $suositus=luoSuositus($puuhaid,null);\n \n /*Tarkistetaan oliko suosituksessa virheita*/\n if(OlioOnVirheeton($suositus)){\n LisaaSuositus($suositus,$puuhaid);\n header('Location: puuhanTiedotK.php?puuhanid=' . $puuhaid . '.php');\n } else {\n $virheet = $suositus->getVirheet();\n naytaNakymaSuosituksenKirjoitusSivulle($puuha, $suositus, $virheet, \"Lisays\");\n }\n}", "function cl_contacorrenteregravinculo() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"contacorrenteregravinculo\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_agendaexames() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function difundir() {\n\n // La funcion obtener_frase esta heredado del pariente Orador\n $frase = $this->obtener_frase();\n\n // Convirtir a mayusculos\n $frase_mayusculas = strtoupper($frase);\n\n echo $frase_mayusculas;\n\n }", "function cl_escolabase() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"escolabase\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"].\"?ed77_i_escola=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_escola\"].\"&ed18_c_nome=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed18_c_nome\"].\"&ed31_c_descr=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed31_c_descr\"].\"&ed77_i_base=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_base\"]);\n }", "function ler($nome) {\n $x = 1;\n\t while($x < $this->bd[0][0] && !$this->str_igual($nome, $this->bd[$x][2])) {$x++;}\n if($x >= $this->bd[0][0]) {return 0;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\nreturn 1;\n }", "function Geral() {\r\n extract($GLOBALS);\r\n if ($P1==1 && $O=='I' &&f($RS_Menu,'envio_inclusao')=='S') {\r\n // Recupera a chave do trâmite de cadastramento\r\n $sql = new db_getTramiteList; $RS = $sql->getInstanceOf($dbms,$w_menu,null,null,null);\r\n $RS = SortArray($RS,'ordem','asc');\r\n foreach($RS as $row) { \r\n $w_tramite = f($row,'sq_siw_tramite'); \r\n break; \r\n }\r\n \r\n $w_envio_inclusao = 'S';\r\n } else {\r\n $w_envio_inclusao = 'N';\r\n }\r\n if ($SG=='SRTRANSP') {\r\n include_once('transporte_gerais.php');\r\n } elseif ($SG=='SRSOLCEL') {\r\n include_once('celular_gerais.php');\r\n } else {\r\n include_once('geral_gerais.php');\r\n }\r\n}", "function prepare_remito($id_remito,&$filas)\r\n{\r\n while ($filas['cantidad']--)\r\n {\r\n\t$filas[$filas['cantidad']]['id_remito']=$id_remito;\r\n \t$filas[$filas['cantidad']]['descripcion']=\"'\".$filas[$filas['cantidad']]['descripcion'].\"'\";\r\n \tunset($filas[$filas['cantidad']]['subtotal']);\r\n }\r\n unset($filas['cantidad']);\r\n}", "public function afficherAll()\n {\n }", "public function tes()\n\t{\n\t\t$tes = \"^ & %aku% ak4 $ 12 Trilyun2 Enak2 banget2 ya Tragedi ular kembali memakan korban. Kali ini seorang bocah laki2 di Bandung tewas setelah dipatuk ular weling.--Insiden itu menimpa Andi Ramdani (11), bocah asal Jalan Nagrog, Gang Keramat RT 04/09, Kelurahan Pasirjati, Kecamatan Ujungberung, Kota Bandung. Andi tewas saat dilarikan ke rumah sakit umum daerah (RSUD) Bandung pada Rabu (23/1) siang.--Bagaimana awal mula kejadiannya? Simak selengkapnya di link yang ada di stories!--Sumber: detiknews--#detikcom #ularweling #dipatukular\";\n\t\t$tes1 = \"'DANAR' Dono y nyiyir gak ga adalah..,./ seorang...!! @mahasiswa2%&& :D z!! @mas danar_dono\";\n\t\t$cek = $this->case_folding($tes);\n\t\t$cek = $this->cleansing($cek);\n\t\t$cek = $this->stemmer($cek);\n\t\t$cek = $this->stopword($cek);\n\t\t$cek = preg_split('/ /',$cek);\n\t\t$count = count($cek);\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t$cek[$i] = $this->hilangkan_kataberulang($cek[$i]);\n\t\t}\n\t}", "public function getDetalle();", "function getEstadisticaDetallado() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\t\tglobal $usr;\n\n\t\t# Variables para eventos especiales marcados por el cliente codigo 9.\n\t\t$event = new Event;\n\t\t$usr = new Usuario($current_usuario_id);\n\t\t$usr->__Usuario();\n\t\t$graficoSvg = new GraficoSVG();\n\n\n\t\t$timeZoneId = $usr->zona_horaria_id;\n\t\t$arrTime = Utiles::getNameZoneHor($timeZoneId); \t\t\n\t\t$timeZone = $arrTime[$timeZoneId];\n\t\t$tieneEvento = 'false';\n\t\t$arrayDateStart = array();\t\t\n\t\t$nameFunction = 'EstadisticaDet';\n\t\t$data = null;\n\t\t$ids = null;\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(($this->extra[\"imprimir\"])?REP_PATH_PRINTTEMPLATES:REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'comparativo_resumen.tpl');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TITULO_HORARIOS', 'bloque_titulo_horarios');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_MONITOR', 'es_primero_monitor');\n\t\t$T->setBlock('tpl_tabla', 'ES_PRIMERO_TOTAL', 'es_primero_total');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_PASOS', 'lista_pasos');\n\t\t$T->setBlock('tpl_tabla', 'BLOQUE_TABLA', 'bloque_tabla');\n\n\t\t$T->setVar('__item_orden', $this->extra[\"item_orden\"]);\n\t\t# Variables para mantenimiento.\n\t\t$T->setVar('__path_jquery_ui', REP_PATH_JQUERY_UI);\n\t\n\t\t$horarios = array($usr->getHorario($this->horario_id));\n\t\tif ($this->horario_id != 0) {\n\t\t\t$horarios[] = $usr->getHorario(0);\n\t\t}\n\n\t\t$orden = 1;\n\t\t$T->setVar('bloque_titulo_horarios', '');\n\t\tforeach ($horarios as $horario) {\n\n\t\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t\t$sql = \"SELECT * FROM reporte.comparativo_resumen_parcial(\".\n\t\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\t\tpg_escape_string($this->objetivo_id).\", \".\n\t\t\t\t\tpg_escape_string($horario->horario_id).\",' \".\n\t\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"', '\".\n\t\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t\t$res =& $mdb2->query($sql);\n// \t\t\tprint($sql);\n\t\t\tif (MDB2::isError($res)) {\n\t\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t$row = $res->fetchRow();\n\t\t\t$dom = new DomDocument();\n\t\t\t$dom->preserveWhiteSpace = false;\n\t\t\t$dom->loadXML($row[\"comparativo_resumen_parcial\"]);\n\t\t\t$xpath = new DOMXpath($dom);\n\t\t\tunset($row[\"comparativo_resumen_parcial\"]);\n\n\t\t\tif ($xpath->query('//detalle[@paso_orden]/estadisticas/estadistica')->length == 0) {\n\t\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$conf_objetivo = $xpath->query('/atentus/resultados/propiedades/objetivos/objetivo')->item(0);\n\t\t\t$conf_pasos = $xpath->query(\"paso[@visible=1]\", $conf_objetivo);\n\t\t\t$conf_nodos = $xpath->query('//nodos/nodo');\n\n\t\t\tif(count($horarios) > 1) {\n\t\t\t\t$T->setVar('__item_horario', $this->extra[\"item_orden\"]);\n\t\t\t\t$T->setVar('__horario_orden', $orden);\n\t\t\t\t$T->setVar('__horario_nombre',$horario->nombre);\n\t\t\t\t$T->parse('bloque_titulo_horarios', 'BLOQUE_TITULO_HORARIOS', false);\n\t\t\t}\n\n\t\t\t\n\t\t\t# Obtención de los eventos especiales marcados por el cliente\n\t\t\tforeach ($xpath->query(\"/atentus/resultados/detalles_marcado/detalle/marcado\") as $tag_marcado) {\n\t\t\t$ids = $ids.','.$tag_marcado->getAttribute('mantenimiento_id');\n\t\t\t$marcado = true;\n\t\t\t}\t\t\n\t\t\t\n\t\t\t# Verifica que exista marcado evento cliente.\n\t\t\tif ($marcado == true) {\n\n\t\t\t\t$dataMant = $event->getData(substr($ids, 1), $timeZone);\n\t\t\t\t$character = array(\"{\", \"}\");\n\t\t\t\t$objetives = explode(',',str_replace($character,\"\",($dataMant[0]['objetivo_id'])));\n\t\t\t\t$tieneEvento = 'true';\n\t\t\t\t$encode = json_encode($dataMant);\n\t\t\t\t$nodoId = (string)0;\n\t\t\t\t$T->setVar('__tiene_evento', $tieneEvento);\n\t\t\t\t$T->setVar('__name', $nameFunction);\n\n\t\t\t}\n\n\t\t\t/* LISTA DE MONITORES */\n\t\t\t$linea = 1;\n\t\t\t$T->setVar('lista_pasos', '');\n\t\t\tforeach($conf_nodos as $conf_nodo) {\n\t\t\t\t$primero = true;\n\t\t\t\t$tag_nodo = $xpath->query('//detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/estadisticas/estadistica')->item(0);\n\n\t\t\t\t/* LISTA DE PASOS */\n\t\t\t\tforeach($conf_pasos as $conf_paso) {\n\t\t\t\t\t$tag_dato = $xpath->query('//detalle[@nodo_id='.$conf_nodo->getAttribute('nodo_id').']/detalles/detalle[@paso_orden='.$conf_paso->getAttribute('paso_orden').']/estadisticas/estadistica')->item(0);\n\t\t\t\t\tif($tag_dato != null) {\n\t\t\t\t\t\t$T->setVar('__print_class', ($linea % 2 == 0)?\"celdaIteracion2\":\"celdaIteracion1\");\n\t\t\t\t\t\t$T->setVar('__class', ($linea % 2 == 0)?\"celdanegra15\":\"celdanegra10\");\n\n\t\t\t\t\t\t$T->setVar('es_primero_monitor', '');\n\t\t\t\t\t\t$T->setVar('es_primero_total', '');\n\t\t\t\t\t\tif ($primero) {\n\t\t\t\t\t\t\t$T->setVar('__monitor_nombre', $conf_nodo->getAttribute('nombre'));\n\t\t\t\t\t\t\t$T->setVar('__monitor_rowspan', $conf_pasos->length);\n\t\t\t\t\t\t\t$T->setVar('__monitor_total_monitoreo', $tag_nodo->getAttribute('cantidad'));\n\t\t\t\t\t\t\t$T->parse('es_primero_monitor', 'ES_PRIMERO_MONITOR', false);\n\t\t\t\t\t\t\t$T->parse('es_primero_total', 'ES_PRIMERO_TOTAL', false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$T->setVar('__paso_nombre', $conf_paso->getAttribute(\"nombre\"));\n\t\t\t\t\t\t$T->setVar('__paso_minimo', number_format($tag_dato->getAttribute('tiempo_min'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_maximo', number_format($tag_dato->getAttribute('tiempo_max'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_promedio', number_format($tag_dato->getAttribute('tiempo_prom'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_uptime', number_format($tag_dato->getAttribute('uptime'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_downtime', number_format($tag_dato->getAttribute('downtime'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_no_monitoreo', number_format($tag_dato->getAttribute('sin_monitoreo'), 3, ',', ''));\n\t\t\t\t\t\t$T->setVar('__paso_evento_especial', number_format($tag_dato->getAttribute('marcado_cliente'), 3, ',', ''));\n\n\t\t\t\t\t\t$T->parse('lista_pasos', 'LISTA_PASOS', true);\n\t\t\t\t\t\t$primero = false;\n\t\t\t\t\t\t$linea++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$T->parse('bloque_tabla', 'BLOQUE_TABLA', true);\n\t\t\t$orden++;\n\t\t}\n\t\t$this->tiempo_expiracion = (strtotime($xpath->query(\"//fecha_expiracion\")->item(0)->nodeValue) - strtotime($xpath->query(\"//fecha\")->item(0)->nodeValue));\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\n\t\t# Agrega el acordeon cuando existan eventos.\n\t\tif (count($dataMant)>0){\n\t\t\t$this->resultado.= $graficoSvg->getAccordion($encode,$nameFunction);\n\t\t}\n\t\treturn $this->resultado;\n\t}", "function Resumen() {\r\n\t\t/*RGB begin*/\r\n\t\tglobal $variables;\r\n\t\tif (!$variables)\r\n\t\t{\r\n\t\t\tchangeVariables();\r\n\t\t\t$variables = 1;\r\n\t\t}\r\n\t\t/*RGB end*/\r\n\t\r\n\t\tglobal $mis_puntos, $wcag1, $lst_A, $lst_AA, $lst_AAA, $resultados, $lang;\r\n\t\t$resultados = array();\r\n\t\t$letras = array('A' => 'lst_A', 'AA' => 'lst_AA', 'AAA' => 'lst_AAA');\r\n\r\n\t\tforeach ($letras as $p => $arr) {\r\n\t\t\tforeach ($$arr as $k => $v) {\r\n\t\t\t\tif (array_key_exists($v, $wcag1)) {\r\n\t\t\t\t\t$x = $p.$mis_puntos[$v];\r\n\t\t\t\t}\r\n\t\t\t\t/*RGB begin*/\r\n\t\t\t\tif($_SESSION['emag'] == true)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($v != 53 && $v != 56 && $v != 92 && $v != 72)\r\n\t\t\t\t\t\t$resultados[$x]++;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$resultados[$x]++;\r\n\t\t\t\t/*RGB end*/\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->t_duda = $resultados['Aduda'] + $resultados['AAduda'] + $resultados['AAAduda'];\r\n\t\t$this->t_mal = $resultados['Amal'] + $resultados['AAmal'] + $resultados['AAAmal'];\r\n\t\t$this->t_parcial = $resultados['Aparcial'] + $resultados['AAparcial'] + $resultados['AAAparcial'];\r\n\t\t$this->t_nose = $resultados['Anose'] + $resultados['AAnose'] + $resultados['AAAnose'];\r\n\r\n\t\tif ($resultados['Aduda'] + $resultados['Anose'] + $resultados['Aparcial'] + $resultados['Amal'] == 0) {\r\n\t\t\tif ($resultados['AAduda'] + $resultados['AAnose'] + $resultados['AAparcial'] + $resultados['AAmal'] == 0) {\r\n\t\t\t\tif ($resultados['AAAduda'] + $resultados['AAAnose'] + $resultados['AAAparcial'] + $resultados['AAAmal'] == 0) {\r\n\t\t\t\t\t$ico_acc = 'AAA';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$ico_acc = 'AA';\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$ico_acc = 'A';\r\n\t\t\t}\r\n\t\t\t$this->accesibilidad = ' <img src=\"img/her_'.$ico_acc.'.gif\" alt=\"'.sprintf($lang['ico_hera_acc'], $ico_acc).'\" width=\"90\" height=\"30\" style=\"float:right\" />';\r\n\t\t}\r\n\t\t\r\n\t\t$this->myresults = $resultados;\r\n\r\n\t}", "function masque_details_evt($evt_tmp)\r\n{\r\n\tif($evt_tmp[\"droit_acces\"]<1){\r\n\t\tglobal $trad;\r\n\t\t$evt_tmp[\"titre\"] = \"<i>\".$trad[\"AGENDA_evt_prive\"].\"</i>\";\r\n\t\t$evt_tmp[\"description\"] = \"\";\r\n\t}\r\n\treturn $evt_tmp;\r\n}", "function joueContre($adversaire, $lieu, $date) // trois argument définis pour la première fois\n{\n // contenant les infos de la rencontre\n array_push($this->rencontres, [\"adversaire\" => $adversaire, \n \"lieu\" => $lieu, \n \"date\" => $date\n\n ]); // on range les données dans le tableau rencontres, tableau de niveau 2\n\n}", "function todas($suscriptor, $orden) {\n $db = new MySQL(Sesion::getConexion());\n $sql = \"SELECT * FROM `facturacion_lecturas` WHERE `suscriptor` ='\" . $suscriptor . \"' ORDER BY `fecha` \" . strtoupper($orden) . \";\";\n $consulta = $db->sql_query($sql);\n $filas = array();\n while ($fila = $db->sql_fetchrow($consulta)) {\n array_push($filas, $fila);\n }\n return($filas);\n }", "function traduire($mot,$temps,$type,$personne){\n //type = 1affirm - 2neg - 3question;\n //personne = 1;\n \n \n \n $fin1 = substr($mot, -1);\n $fin2 = substr($mot,-2,1);\n $liaison = \"\";\n $passe = 'd';\n $kconsonne = false;\n $consonne = false;\n switch ($fin1) {\n case 'a':\n case 'ı':\n $voyelle = 'ı';\n $pvoyelle = 'a';\n $dvoyelle = 'ı';\n $liaison = 'y';\n break;\n case 'e':\n case 'i':\n $voyelle = 'i';\n $pvoyelle = 'e';\n $dvoyelle = 'i';\n $liaison = 'y';\n break;\n case 'o':\n case 'u':\n $voyelle = 'u';\n $pvoyelle = 'a';\n $dvoyelle = 'ı';\n $liaison = 'y';\n break;\n case 'ü':\n case 'ö':\n $voyelle = 'ü';\n $pvoyelle = 'e';\n $dvoyelle = 'i';\n $liaison = 'y';\n break;\n case 'k':\n $passe = 't';\n $consonne = 'true';\n $kconsonne ='true';\n break;\n case 't':\n case 'p':\n case 'ç':\n case 'h':\n case 'f':\n case 's':\n case 'ş':\n $passe = 't';\n $consonne = 'true';\n break;\n default : \n $consonne = 'true';\n break;\n \n }\n \n if($consonne == 'true'){\n \n switch ($fin2) {\n case 'a':\n case 'ı':\n $voyelle = 'ı';\n $pvoyelle = 'a';\n $dvoyelle = 'ı';\n \n break;\n case 'e':\n case 'i':\n $voyelle = 'i';\n $pvoyelle = 'e';\n $dvoyelle = 'i';\n \n break;\n case 'o':\n case 'u':\n $voyelle = 'u';\n $pvoyelle = 'a';\n $dvoyelle = 'ı';\n \n break;\n case 'ü':\n case 'ö':\n $voyelle = 'ü';\n $pvoyelle = 'e';\n $dvoyelle = 'i';\n \n break;\n }\n \n }\n \n \n \n switch ($temps) {\n // passé\n case 1 :\n switch($type){\n // passe affirm\n case 1:\n $traduction = $mot;\n switch($personne){\n case 1:\n $traduction = $traduction.$liaison.$passe.$voyelle.\"m\";\n break;\n case 2:\n $traduction = $traduction.$liaison.$passe.$voyelle.\"n\";\n break;\n case 3:\n $traduction = $traduction.$liaison.$passe.$voyelle;\n break;\n case 4:\n $traduction = $traduction.$liaison.$passe.$voyelle.\"k\";\n break;\n case 5:\n $traduction = $traduction.$liaison.$passe.$voyelle.\"n\".$voyelle.\"z\";\n break;\n case 6:\n $traduction = $traduction.\"l\".$pvoyelle.\"r\".\"d\".$dvoyelle;\n break;\n }\n break;\n // passe neg\n case 2:\n $traduction = $mot.\" değil\";\n switch($personne){\n case 1:\n $traduction = $traduction.\"dim\";\n break;\n case 2:\n $traduction = $traduction.\"din\";\n break;\n case 3:\n $traduction = $traduction.\"di\";\n break;\n case 4:\n $traduction = $traduction.\"dik\";\n break;\n case 5:\n $traduction = $traduction.\"diniz\";\n break;\n case 6:\n $traduction = $traduction.\"diler\";\n break;\n }\n break;\n // passe quest\n case 3:\n $traduction = $mot. \" m\".$voyelle.\"yd\".$voyelle;\n switch($personne){\n case 1:\n $traduction = $traduction.\"m\";\n break;\n case 2:\n $traduction = $traduction.\"n\";\n break;\n case 3:\n $traduction = $traduction;\n break;\n case 4:\n $traduction = $traduction.\"k\";\n break;\n case 5:\n $traduction = $traduction.\"n\".$voyelle.\"z\";\n break;\n case 6:\n $traduction = $traduction.\"l\".$pvoyelle.\"r\";\n break;\n }\n \n break;\n }\n break;\n \n // présent \n case 0 :\n switch($type){\n // present affirm\n case 1:\n $traduction = $mot;\n switch($personne){\n case 1:\n if($kconsonne=='true'){\n $traduction = $traduction.substr($traduction,0,-1);\n $traduction = $traduction.\"ğ\".$voyelle.\"m\";\n }else{\n $traduction = $traduction.$liaison.$voyelle.\"m\";\n }\n \n break;\n case 2:\n $traduction = $traduction.\"s\".$voyelle.\"n\";\n break;\n case 3:\n $traduction = $traduction;\n break;\n case 4:\n if($kconsonne=='true'){\n $traduction = $traduction.substr($traduction,0,-1);\n $traduction = $traduction.\"ğ\".$voyelle.\"z\";\n }else{\n $traduction = $traduction.$liaison.$voyelle.\"z\";\n }\n \n break;\n case 5:\n $traduction = $traduction.\"s\".$voyelle.\"n\".$voyelle.\"z\";\n break;\n case 6:\n $traduction = $traduction.\"l\".$pvoyelle.\"r\";\n break;\n }\n break;\n // present nega\n case 2:\n $traduction = $mot.\" değil\";\n switch($personne){\n case 1:\n $traduction = $traduction.\"im\";\n break;\n case 2:\n $traduction = $traduction.\"sin\";\n break;\n case 3:\n $traduction = $traduction;\n break;\n case 4:\n $traduction = $traduction.\"iz\";\n break;\n case 5:\n $traduction = $traduction.\"siniz\";\n break;\n case 6:\n $traduction = $traduction.\"ler\";\n break;\n }\n break;\n \n //present question\n case 3:\n $traduction = $mot;\n switch($personne){\n case 1:\n $traduction = $traduction. \" m\".$voyelle.\"y\".$voyelle.\"m ?\";\n break;\n case 2:\n $traduction = $traduction. \" m\".$voyelle.\"s\".$voyelle.\"n ?\";\n break;\n case 3:\n $traduction = $traduction. \" m\".$voyelle.\" ?\";\n break;\n case 4:\n $traduction = $traduction. \" m\".$voyelle.\"y\".$voyelle.\"z ?\";\n break;\n case 5:\n $traduction = $traduction. \" m\".$voyelle.\"s\".$voyelle.\"n\".$voyelle.\"z ?\";\n break;\n case 6:\n $traduction = $traduction.\"l\".$pvoyelle.\"r\". \" m\".$voyelle .\" ?\";\n break;\n }\n break;\n }\n break;\n \n //futur\n case 2 :\n switch($type){\n //futur affirm\n case 1:\n $traduction = $mot;\n switch($personne){\n case 1:\n $traduction = $traduction.\" olacağım\";\n break;\n case 2:\n $traduction = $traduction. \" olacaksın\";\n break;\n case 3:\n $traduction = $traduction. \" olacak\";\n break;\n case 4:\n $traduction = $traduction. \" olacağız\";\n break;\n case 5:\n $traduction = $traduction. \" olacaksınız\";\n break;\n case 6:\n $traduction = $traduction. \" olacaklar\";\n break;\n }\n break;\n //futur negation\n case 2:\n $traduction = $mot;\n switch($personne){\n case 1:\n $traduction = $traduction.\" olmayacağım\";\n break;\n case 2:\n $traduction = $traduction. \" olmayacaksın\";\n break;\n case 3:\n $traduction = $traduction. \" olmayacak\";\n break;\n case 4:\n $traduction = $traduction. \" olmayacağız\";\n break;\n case 5:\n $traduction = $traduction. \" olmayacaksınız\";\n break;\n case 6:\n $traduction = $traduction. \" olmayacaklar\";\n break;\n }\n break;\n case 3:\n $traduction = $mot. \" olacak\";\n switch($personne){\n case 1:\n $traduction = $traduction.\" mıyım ?\";\n break;\n case 2:\n $traduction = $traduction. \" mısın ?\";\n break;\n case 3:\n $traduction = $traduction. \" mı ?\";\n break;\n case 4:\n $traduction = $traduction. \" mıyız ?\";\n break;\n case 5:\n $traduction = $traduction. \" mısınız ?\";\n break;\n case 6:\n $traduction = $traduction. \"lar mı ?\";\n break;\n }\n break;\n }\n break;\n }\n return $traduction;\n }", "public function mostra(){\n }", "function actualiser_etat() {\n try {\n $m = $_SESSION[\"mascotte\"];\n\n // Actualisation de base\n changer_etat($m->sante, -20);\n changer_etat($m->bonheur, -20);\n changer_etat($m->faim, 10);\n changer_etat($m->pourc_maladie, 10);\n\n // Actualisation selon l'environnement\n $decos = array();\n if (isset($_SESSION[\"mascotte\"]->decorations))\n $decos = $_SESSION[\"mascotte\"]->decorations;\n foreach ($decos as $d) {\n actualiser_etat_objet($d);\n }\n\n // Actualisation selon les vetements\n $vets = array();\n if (isset($_SESSION[\"mascotte\"]->vetements))\n $vets = $_SESSION[\"mascotte\"]->vetements;\n foreach ($vets as $v) {\n actualiser_etat_objet($v);\n }\n\n $m->sante = intval($m->sante);\n $m->bonheur = intval($m->bonheur);\n $m->faim = intval($m->faim);\n $m->pourc_maladie = intval($m->pourc_maladie);\n\n retourner_succes(array(\"sante\" => $m->sante,\n \"bonheur\" => $m->bonheur,\n \"faim\" => $m->faim,\n \"maladie\" => $m->pourc_maladie));\n }\n catch(Exception $ex) {\n retourner_erreur($ex->getMessage());\n }\n }", "function cl_reconhecimentocontabil() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"reconhecimentocontabil\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function get_title_lectura($lectura)\n{\n $cadena = $lectura->libro_nombre . ' ' . $lectura->capitulo . ': ' . $lectura->inicio\n . '-' . $lectura->final;\n\n return $cadena;\n}", "function calculer_boucle($id_boucle, &$boucles) {\n\n\t// gerer les statuts si declares pour cette table\n\t/*\n\t$table_statut[nom_table][] = array(\n\t\t'champ'=>'statut', // champ de la table sur lequel porte le filtrage par le statut\n\t\t'publie'=>'publie', // valeur ou liste de valeurs, qui definissent l'objet comme publie.\n\t\t'previsu'=>'publie,prop', // valeur ou liste de valeurs qui sont visibles en previsu\n\t\t'post_date'=>'date', // un champ de date pour la prise en compte des post_dates, ou rien sinon\n\t 'exception'=>'statut', // liste des modificateurs qui annulent le filtrage par statut\n\t // si plusieurs valeurs : array('statut','tout','lien')\n\t);\n\n\tPour 'publier' ou 'previsu', si la chaine commence par un \"!\" on exclu au lieu de filtrer sur les valeurs donnees\n\tsi la chaine est vide, on ne garde rien si elle est seulement \"!\" on n'exclu rien\n\n\tSi le statut repose sur une jointure, 'champ' est alors un tableau du format suivant :\n\t'champ'=>array(\n\t array(table1, cle1),\n\t ...\n\t array(tablen, clen),\n\t champstatut\n\t )\n\n\tchampstatut est alors le champ statut sur la tablen\n\tdans les jointures, clen peut etre un tableau pour une jointure complexe : array('id_objet','id_article','objet','article')\t \n\t*/\n\n\t$boucle = &$boucles[$id_boucle];\n\t$id_table = $boucle->id_table;\n\t$table_sql = $boucle->from[$id_table];\n\tif (isset($GLOBALS['table_statut'][$table_sql])){\n\t\tforeach($GLOBALS['table_statut'][$table_sql] as $s){\n\t\t\t// Restreindre aux elements publies si pas de {statut} ou autre dans les criteres\n\t\t\t$filtrer = true;\n\t\t\tif (isset($s['exception'])) {\n\t\t\t\tforeach(is_array($s['exception'])?$s['exception']:array($s['exception']) as $m) {\n\t\t\t\t\tif (isset($boucle->modificateur[$m]) OR isset($boucle->modificateur['criteres'][$m])) {\n\t\t\t\t\t\t$filtrer = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($filtrer) {\n\t\t\t\tif (is_array($s['champ'])){\n\t\t\t\t\t$statut = preg_replace(',\\W,','',array_pop($s['champ'])); // securite\n\t\t\t\t\t$jointures = array();\n\t\t\t\t\tforeach($s['champ'] as $j) {\n\t\t\t\t\t\t$jointures[] = array('',array($id=reset($j)),end($j));\n\t\t\t\t\t}\n\t\t\t\t\t$jointures[0][0] = $id_table;\n\t\t\t\t\tif (!array_search($id, $boucle->from)){\n\t\t\t\t\t\tfabrique_jointures($boucle, $jointures, true, $boucle->show, $id_table);\n\t\t\t\t\t}\n\t\t\t\t\t// trouver l'alias de la table d'arrivee qui porte le statut\n\t\t\t\t\t$id = array_search($id, $boucle->from);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$id = $id_table;\n\t\t\t\t\t$statut = preg_replace(',\\W,','',$s['champ']); // securite\n\t\t\t\t}\n\t\t\t\t$mstatut = $id .'.'.$statut;\n\n\t\t\t\tif (!$GLOBALS['var_preview']) {\n\t\t\t\t\tif (isset($s['post_date']) AND $s['post_date']\n\t\t\t\t\t\tAND $GLOBALS['meta'][\"post_dates\"] == 'non'){\n\t\t\t\t\t\t$date = $id.'.'.preg_replace(',\\W,','',$s['post_date']); // securite\n\t\t\t\t\t\tarray_unshift($boucle->where,\"quete_condition_postdates('$date')\");\n\t\t\t\t\t}\n\t\t\t\t\tarray_unshift($boucle->where,calculer_where_statut($mstatut,$s['publie']));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tarray_unshift($boucle->where,calculer_where_statut($mstatut,$s['previsu']));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\n\t$boucles[$id_boucle] = pipeline('post_boucle', $boucles[$id_boucle]);\n\n\t// en mode debug memoriser les premiers passages dans la boucle,\n\t// mais pas tous, sinon ca pete.\n\tif (_request('var_mode_affiche') != 'resultat') \n\t\t$trace = '';\n\telse {\n\t\t$trace = $boucles[$id_boucle]->descr['nom'] . $id_boucle;\n\t\t$trace = \"if (count(@\\$GLOBALS['debug_objets']['resultat']['$trace'])<3)\n\t \\$GLOBALS['debug_objets']['resultat']['$trace'][] = \\$t0;\";\n\t}\n\treturn ($boucles[$id_boucle]->type_requete == 'boucle')\n\t? calculer_boucle_rec($id_boucle, $boucles, $trace) \n\t: calculer_boucle_nonrec($id_boucle, $boucles, $trace);\n}", "function translitteration($texte, $charset='AUTO', $complexe='') {\n\tstatic $trans;\n\tif ($charset == 'AUTO')\n\t\t$charset = $GLOBALS['meta']['charset'];\n\n\t$table_translit ='translit'.$complexe;\n\n\t// 0. Supprimer les caracteres illegaux\n\tinclude_spip('inc/filtres');\n\t$texte = corriger_caracteres($texte);\n\n\t// 1. Passer le charset et les &eacute en utf-8\n\t$texte = unicode_to_utf_8(html2unicode(charset2unicode($texte, $charset, true)));\n\n\t// 2. Translitterer grace a la table predefinie\n\tif (!$trans[$complexe]) {\n\t\tglobal $CHARSET;\n\t\tload_charset($table_translit);\n\t\tforeach ($CHARSET[$table_translit] as $key => $val)\n\t\t\t$trans[$complexe][caractere_utf_8($key)] = $val;\n\t}\n\n\treturn strtr($texte, $trans[$complexe]);\n}", "function ambas()\n {\n print \"Ejecución de la función ambas<br>\";\n # mediante $this-> requerimos la ejecución de metodo prueba\n # de la clase actual\n $this->prueba();\n # al señalar parent:: requerimos la ejecución de metodo prueba\n # de la clase padre\n parent::prueba();\n }", "public function tampil_res()\n {\n $id_res = $this->uri->segment(3);\n $id_pros = $this->uri->segment(4);\n\n $where = ['id_resources' => $id_res];\n\n $data = [ 'data_res' => $this->M_prospektus->get_res_id_pros('resources',$where)->row_array(),\n 'aktif' => 'prospektus',\n 'id_pros' => $id_pros\n ];\n\n $this->template->load('template','prospektus/Tampil_res', $data);\n }", "public function getMataPelajaran();", "protected function subjonctifImparfait(){\n $terminaisons=[];\n $terminaisons[]= \"fuguèsse\";\n $terminaisons[]= \"fuguèsses\";\n $terminaisons[]= \"fuguèsse\";\n $terminaisons[]= \"fuguessian\";\n $terminaisons[]= \"fuguessias\";\n $terminaisons[]= \"fuguèsson\";\n return $terminaisons;\n }", "function cl_tfd_bpamagnetico() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_bpamagnetico\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function id_tarjeta();", "function cl_alunos() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunos\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function lectureContenu ()\n {\n\n //$metadata = simplexml_load_file(\"xmoddledata/metadata.xml\");\n\n // on Vérifie si le cours existe\n\n /* @TODO Partie à décommenter lorsque le module de navigation sera intégré au reste de l'application */\n\n // $nbrCours = $metadata->attributes()->nbrCours;\n // $isFound = false;\n // $i = 0;\n // for ($i = 0; $i < $nbrCours; $i++) {\n // if ($metadata->cours[$i]->attributes()->title == $title && $metadata->cours[$i]->attributes()->id == $id) {\n // $isFound = true;\n // break;\n // }\n // }\n\n // if ($isFound) {\n //$cours = simplexml_load_file(\"xmoddledata/\" . $metadata->cours[$i]->attributes()->id . \"_\" . $metadata->cours[$i]->attributes()->title . \"/description.xml\"); \n\n $description = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/description.xml');\n $notions = simplexml_load_file('xmoddledata/2_ModeleDeSupport2/descriptionNotions.xml');\n\n // Création d'un tableau associatif de notions avec l'id comme clé\n\n $notionsArray = $this->getNotions($notions);\n\n // Construction de la navigation\n $text_parties = \"\";\n $nav_parties = [];\n for ($i = 0; $i < $description->attributes()->nbrParties; $i++) {\n $text_parties = \"<div style='\";\n $text_parties .= $this->getStyle($description->partie[$i]->attributes());\n $text_parties .= \"'\";\n $text_parties .= \" id='\".$i.\"'>\";\n $nav_chapitres = [];\n $text_parties .= $description->partie[$i]->attributes()->title;\n $text_parties .= \"</div>\";\n $text_parties .= \"<br/><br/>\";\n $text_chapitres = \"\";\n for ($j = 0; $j < $description->partie[$i]->attributes()->nbrChapitres; $j++) {\n $text_chapitres .= \"<div style='\";\n $text_chapitres .= $this->getStyle($description->partie[$i]->chapitre[$j]->attributes());\n $text_chapitres .= \"'\";\n $text_chapitres .= \" id='\".$i.\"_\".$j.\"'>\";\n $nav_paragraphes = [];\n $text_chapitres .= $description->partie[$i]->chapitre[$j]->attributes()->title;\n $text_chapitres .= \"</div>\";\n $text_chapitres .= \"<br/><br/>\";\n $text_paragraphes = \"\";\n for ($k = 0; $k < $description->partie[$i]->chapitre[$j]->attributes()->nbrParagraphes; $k++) {\n // On renseigne le titre du paragraphe\n $text_paragraphes .= \"<div style='\";\n $text_paragraphes .= $this->getStyle($description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes());\n $text_paragraphes .= \"'\";\n // Ajout d'un ancre de navigation\n $text_paragraphes .= \" id='\".$i.\"_\".$j.\"_\".$k.\"'>\";\n $text_paragraphes .= $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n $text_paragraphes .= \"</div>\";\n $text_paragraphes .= \"<br/>\";\n // Navigation avec paragraphes\n $nav_paragraphes[\"\".$i.\"_\".$j.\"_\".$k] = $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->title;\n // On remplit les notions contenus dans le paragraphe\n for ($l = 0; $l < $description->partie[$i]->chapitre[$j]->paragraphe[$k]->attributes()->nbrNotions; $l++) {\n $text_paragraphes .= $notionsArray[\"\".$description->partie[$i]->chapitre[$j]->paragraphe[$k]->notion[$l]->attributes()->id];\n }\n }\n $text_chapitres .= $text_paragraphes;\n $nav_chapitres[\"\".$i.\"_\".$j] = $nav_paragraphes;\n }\n $text_parties .= $text_chapitres;\n $nav_parties[\"\".$i] = $nav_chapitres;\n }\n// dd($nav_parties);\n// dd($navigation);\n// dd($description);\n\n // Construction de la page web\n $titre = $description->attributes()->title;\n// dd($description);\n// forearch( $navigation->partie[] as $partie) {\n// dd($pantie);\n// }\n// dd($titre);\n\n\n // $notions = simplexml_load_file(\"../../../fichiersdestructuration/descriptionNotions.xml\");\n\n\n // $nbrNotions = $cours->attributes()->nbrNotions;\n // $notionsConvertis = array();\n // for ($i = 0; $i < $nbrNotions; $i++) {\n // $attributs = $cours->notion[$i]->attributes();\n // $style = \"\";\n // if ($attributs['font-weight'] != null) {\n // $style .= 'font-weight:' . $attributs['font-weight'] . \";\";\n // }\n // if ($attributs['font-size'] != null) {\n // $style .= 'font-size:' . $attributs['font-size'] . \";\";\n // }\n\n // if ($attributs['font-family'] != null) {\n // $style .= 'font-family:' . $attributs['font-family'] . \";\";\n // }\n\n // if ($attributs['color'] != null) {\n // $style .= 'color:' . $attributs['color'] . \";\";\n // }\n\n // if ($attributs['text-decoration'] != null) {\n // $style .= 'text-decoration:' . $attributs['text-decoration'] . \";\";\n // }\n\n // $text = \"\";\n // foreach ($cours->notion[$i]->children() as $child) {\n // $text .= $child->asXML();\n // }\n // $notionHtml = \"<div style='\";\n // $notionHtml .= $style;\n // $notionHtml .= \"'>\";\n // $notionHtml .= $text;\n // $notionHtml .= \"</div>\";\n\n\n // //dd(strval($text));\n // array_push($notionsConvertis, $notionHtml);\n\n // }\n // }else{\n // return view(\"/\");\n // }\n //$notions = $notionsConvertis;\n // return response()->json($notions,200);\n\n // return \"lecture cours\";\n return 0;\n }", "public function Zapis_vsechny_kolize_v_zaveru_formulare ($pole, $idcka_skolizi, $iducast, $formular){\r\n //zapise kolize formulare \r\n self::Zapis_kolize_formulare($pole,$idcka_skolizi, $iducast, $formular);\r\n //-----------------------------------------------------------------------------\r\n \r\n \r\n //a zjisti a zapise kolize ucastnika pro vsechny formulare \r\n $vsechny_kolize_ucastnika_pole = self::Najdi_kolize_vsechny($iducast);\r\n //echo \"<br>**Vsechny kolize_pole v Zapis_vsechny_kolize..... **\";\r\n //var_dump($vsechny_kolize_ucastnika_pole);\r\n \r\n //znevalidneni vsech kolizi pro ucastnika \r\n self::Znevalidni_kolize_ucastnika_vsechny($iducast);\r\n foreach($vsechny_kolize_ucastnika_pole as $jedna_kolize){\r\n if ($jedna_kolize->kolize_nastala) {\r\n $jedna_kolize->Zapis_jednu_kolizi();\r\n } \r\n }\r\n \r\n}" ]
[ "0.6645503", "0.63558054", "0.6304763", "0.6241529", "0.622575", "0.6191252", "0.6164379", "0.6160302", "0.61209124", "0.609888", "0.607848", "0.60506403", "0.5996369", "0.59957033", "0.59308934", "0.5909933", "0.59069246", "0.5894129", "0.58781683", "0.58754927", "0.5864815", "0.5861421", "0.58583754", "0.5856776", "0.5854093", "0.5852422", "0.58510274", "0.58452606", "0.58445424", "0.5829149", "0.58220214", "0.58126926", "0.58126676", "0.5808703", "0.5801241", "0.5800374", "0.57797444", "0.5778317", "0.5754565", "0.5748442", "0.5745234", "0.5720679", "0.57175344", "0.5717266", "0.5713424", "0.571057", "0.5703888", "0.5699694", "0.56967676", "0.5691067", "0.5684861", "0.5680115", "0.56784666", "0.56734836", "0.5662117", "0.5659882", "0.56514794", "0.5641163", "0.5636766", "0.5628818", "0.56279784", "0.56257516", "0.56254387", "0.5620052", "0.5618492", "0.56183785", "0.561565", "0.56082386", "0.5604484", "0.56010425", "0.5600561", "0.5598189", "0.5592961", "0.55869", "0.55794257", "0.55733055", "0.55680406", "0.55647933", "0.5563446", "0.5558289", "0.5554422", "0.5553449", "0.55525947", "0.555079", "0.55504906", "0.5549679", "0.5547674", "0.5544444", "0.5541952", "0.55416626", "0.5534575", "0.5528629", "0.55283105", "0.5520817", "0.552", "0.55179006", "0.5516501", "0.55160666", "0.55158216", "0.55092925", "0.5508815" ]
0.0
-1
Constructs the validator subscriber.
public function __construct(ValidatorInterface $validator) { $this->validator = $validator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(Validator $validator)\n {\n $this->validator = $validator;\n }", "public function createValidator();", "public function createSubscriber();", "public function __construct()\n\t{\n\t\t$this->type('subscriber');\n\t}", "public function construction()\n {\n $equalValidator = new stubEqualValidator(5);\n $equalValidator = new stubEqualValidator('foo');\n $equalValidator = new stubEqualValidator(true);\n $equalValidator = new stubEqualValidator(false);\n $equalValidator = new stubEqualValidator(null);\n }", "public function __construct() {\n\n $this->inputmanager = new Validator();\n\n $this->config = $this->configuration();\n\n $this->validation = $this->validate(); \n\n }", "protected function createValidator() {\n return $this->validator;\n }", "public function __construct(Validator $validator)\n\t {\n\t\t\t$this->validator = $validator;\n\t\t\t$this->messages = $validator->messages();\n\t\t\tparent::__construct($this->messages, 400);\n\t\t}", "public function getValidatorInstance() {\n $validator = parent::getValidatorInstance();\n\n $validator->after(function() use ($validator) {\n\n // Does the event exist?\n if( !$this->checkEventExists()){\n $validator->errors()->add('event.Exists', 'This event does not longer exist.');\n } else {\n\n // Does the booker is not the creator?\n if( !$this->checkEventNotBookedByCreator()){\n $validator->errors()->add('event.BookedCreator', 'You can\\'t unbook this event because since you are the owner.'); \n }\n\n // Does the event is not already finished/has begun?\n if( !$this->checkEventDateNotDue()){\n $validator->errors()->add('event.DateDue', 'You can\\'t unbook this event because it\\'s already begun or is terminated.'); \n }\n }\n\n });\n\n return $validator;\n }", "public function __construct(Factory $validator)\r\n {\r\n $this->validator = $validator;\r\n }", "public function __construct(ValidatorsVerifier $validatorsVerifier)\n {\n parent::__construct();\n $this->validatorsVerifier = $validatorsVerifier;\n }", "public function __construct($validationOptions = array()) {\n\t\t$this->validators = new \\SplObjectStorage();\n\t}", "function __construct($validator)\n {\n $this->validator = $validator;\n\n $messageArray = [];\n foreach ($validator->failed() as $attribute => $failedRules) {\n $messageArray[] = $attribute . ': ' . join(array_keys($failedRules), ', ');\n }\n $message = join($messageArray, ' - ');\n\n parent::__construct($message);\n }", "public static function create()\r\n\t{\r\n\t\t$validator = Validation::forge('callback');\r\n\t\t\r\n\t\t$validator->add('event', 'Event Name')->add_rule('trim')->add_rule('required')->add_rule(array('invalid_event_name' => function ($event_name) {\r\n\t\t\t$event = Service_Event::find_one(array('name' => $event_name));\r\n\t\t\tif (!$event) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}));\r\n\t\t\r\n\t\t$validator->add('url', 'Callback URL')->add_rule('trim')->add_rule('valid_url')->add_rule('required');\r\n\t\t\r\n\t\treturn $validator;\r\n\t}", "public function __construct()\n\t{\n\t\t$this->add(array(\n\t\t\t'name' => 'note', // 'usr_name'\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StripTags'),\n\t\t\t),\n\t\t\t'validators' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'name' => 'StringLength',\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'encoding' => 'UTF-8',\n\t\t\t\t\t\t'min' => 1,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t), \n\t\t));\n \n $this->add(array(\n\t\t\t'name' => 'duration', // 'usr_name'\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t),\n 'validators' => array(\n array(\n 'name' => 'Int',\n ),\n array(\n 'name' => 'GreaterThan',\n 'options' => array(\n 'min' => 0,\n 'inclusive' => true\n ),\n ),\n array(\n 'name' => 'LessThan',\n 'options' => array(\n 'max' => 20160, // 14 days maximum\n 'inclusive' => true\n ),\n ),\n ), \n\t\t));\n\n\t}", "public function __construct() {\n\n\t\t//Call the parent constructor\n\t\tparent::__construct(); \n\t\t\n\t\t$this->validate = array_merge(\n\t\t\t\t\t$this->validate\n\t\t\t\t);\t\t\n\n\t}", "public function __construct()\n {\n $this->app = app();\n $this->validator = $this->app['validator'];\n }", "public function __construct( Validator $validator )\n {\n $this->setValidationMessages( $validator );\n\n parent::__construct( 'Form request validation has failed.' );\n }", "public function setupValidatorRules()\n { }", "public function getValidator() {}", "protected function getValidator(): void\n {\n // TODO: Implement getValidator() method.\n }", "private function createValidator()\n {\n // add custom validation rules\n \\Validator::extend('contains_caps',\n function($field, $value, $params)\n {\n return preg_match('#[A-Z]#', $value);\n }\n );\n\n \\Validator::extend('contains_digit',\n function($field, $value, $params)\n {\n return preg_match('#[0-9]#', $value);\n }\n );\n\n // set array of messages for custom rules\n $messages = array(\n 'contains_caps' => ':attribute must contain at least one capital letter.',\n 'contains_digit' => ':attribute must contain at least one numeric digit.'\n );\n\n // set array of rules to use for validation (many are Laravel's built-ins)\n $rules = array(\n 'email' => 'required|email|max:255',\n 'password' => 'required|between:8,50|contains_caps|contains_digit', // password has some \"strength\" requirements\n 'first_name' => 'required|max:50',\n 'last_name' => 'required|max:50',\n 'city' => 'required|max:100',\n 'state' => 'required|max:2',\n 'zip' => 'required|max:20',\n 'biography' => 'required',\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, $messages);\n\n return $validator;\n }", "function __construct($value, $validator = null) {\n $this->value = $value;\n $this->validator = $validator;\n }", "protected function setupValidation()\n\t{\n\t\t$this->setInputFactory(new InputFactory(new Builder));\n\t\t$this->setValidator(new Validator\\Illuminate(App::make('validator')));\n\t}", "public function __construct()\n {\n $this->services = $this->privates = [];\n $this->methodMapping = [\n \\Viserio\\Contract\\Validation\\Validator::class => 'get9c2345652e8ae3f87ba009d0f8fedee27bb751398014908e9ab2fb6d5bf1300f',\n ];\n $this->aliases = [\n \\Viserio\\Component\\Validation\\Validator::class => \\Viserio\\Contract\\Validation\\Validator::class,\n 'validator' => \\Viserio\\Contract\\Validation\\Validator::class,\n ];\n }", "public function __construct(TemplateValidatorService $validationService)\n {\n $this->validationService = $validationService;\n }", "public function __construct() {\n $this->_resetValidation();\n return;\n }", "public function __construct()\n {\n $this->subscribe = new Subscribe();\n }", "public function validator()\n {\n }", "public function __construct()\n\t{\n\t\t$this->validator = new Validator();\n\t\t$this->validator->set_validator(new YBValidator());\n\n\t\t$this->db_connection = new DBConnection();\n\t\t$this->db_connection->set_connection(new MySQLConnection);\n\t}", "public function __construct()\n\t{\n\t\t$this->validator = new Validator();\n\t\t$this->validator->set_validator(new YBValidator());\n\n\t\t$this->db_connection = new DBConnection();\n\t\t$this->db_connection->set_connection(new MySQLConnection);\n\t}", "public function createValidator()\n {\n $validator = Validation::createValidatorBuilder()\n ->setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))\n ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app))\n ->setTranslator($this->getTranslator())\n ->setApiVersion(Validation::API_VERSION_2_5)\n ->getValidator();\n\n return $validator;\n }", "protected function buildValidationCallback() {\n }", "public function initializeControllerArgumentsBaseValidators() {}", "protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n\n $validator->sometimes('family_member_id.*', 'distinct', function($input)\n {\n return $input->family_member == 1;\n });\n\n $validator->sometimes('family_member_id.*', 'not_in:'. $this->request->get('patriarch'), function($input)\n {\n return $input->family_member == 1;\n });\n\n return $validator;\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TActiveControlAdapter($this));\n\t\t$this->getActiveControl()->setClientSide(new TActiveCustomValidatorClientSide);\n\t}", "public function __construct(Subscriber $subscriber)\n {\n $this->subscriber = $subscriber;\n $this->url = Url::signedRoute('change-status-mail', ['subscriber' => $subscriber->id, 'status' => 'INACTIVE']);\n }", "protected function makeValidator()\n {\n $rules = $this->expandUniqueRules($this->rules);\n\n $validator = static::$validator->make($this->getAttributes(), $rules);\n\n event(new ModelValidator($this, $validator));\n\n return $validator;\n }", "public function __construct(SubscriberInterface $subscriber)\n {\n $this->subscriberRepository = $subscriber;\n }", "public function __construct(UserPresenter $presenter, UserValidator $validator)\n\t{\n\t\t$this->presenter = $presenter;\n\t\t$this->validator = $validator;\n\n\t\tparent::__construct();\n\t}", "public function __construct(UserRepository $repository, UserValidator $validator ) {\n \n $this->repository = $repository;\n $this->validator = $validator;\n \n }", "public function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n\n\n $validator->after(\n function () use ($validator) {\n $input = $this->all();\n }\n );\n\n return $validator;\n }", "public function initialize(Validator $validator)\n\t{\n\t\tif ( ! is_null($this->verifier) ){\n\t\t\t$validator->setPresenceVerifier($this->verifier);\n\t\t}\n\t\tif ( ! is_null($this->container) ){\n\t\t\t$validator->setContainer($this->container);\n\t\t}\n\t\t$this->addExtensions($validator);\n\n\t\treturn $validator;\n\t}", "public function getValidator();", "public function getValidator();", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "public function __construct(Validator $validator, SimulatorServiceInterface $sim)\n {\n parent::__construct();\n\n $this->validator = $validator;\n $this->sim = $sim;\n }", "public function __construct()\n\t{\n $subscriber = new SystemListern();\n Event::subscribe($subscriber);\n\t\t//$this->middleware('auth');\n\t}", "public function __construct(ExtensionPresenter $presenter, ExtensionValidator $validator)\n {\n $this->presenter = $presenter;\n $this->validator = $validator;\n }", "function validator() {\n if ($this->validator) return $this->validator;\n $options = array();\n foreach ($this->fields_options as $field => $field_options) {\n if (!@$field_options['validation']) continue;\n $options[$field] = $field_options['validation'];\n }\n return $this->validator = new xValidatorStore($options, $_REQUEST);\n }", "public function getValidatorService();", "protected function getValidator_BuilderService()\n {\n $this->services['validator.builder'] = $instance = \\Symfony\\Component\\Validator\\Validation::createValidatorBuilder();\n\n $instance->setConstraintValidatorFactory(new \\Symfony\\Bundle\\FrameworkBundle\\Validator\\ConstraintValidatorFactory($this, array('validator.expression' => 'validator.expression', 'Symfony\\\\Component\\\\Validator\\\\Constraints\\\\ExpressionValidator' => 'validator.expression', 'Symfony\\\\Component\\\\Validator\\\\Constraints\\\\EmailValidator' => 'validator.email', 'security.validator.user_password' => 'security.validator.user_password', 'Symfony\\\\Component\\\\Security\\\\Core\\\\Validator\\\\Constraints\\\\UserPasswordValidator' => 'security.validator.user_password', 'doctrine.orm.validator.unique' => 'doctrine.orm.validator.unique', 'Symfony\\\\Bridge\\\\Doctrine\\\\Validator\\\\Constraints\\\\UniqueEntityValidator' => 'doctrine.orm.validator.unique')));\n $instance->setTranslator($this->get('translator.default'));\n $instance->setTranslationDomain('validators');\n $instance->addXmlMappings(array(0 => ($this->targetDirs[3].'/vendor/symfony/symfony/src/Symfony/Component/Form/Resources/config/validation.xml'), 1 => ($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/Resources/config/validation.xml')));\n $instance->enableAnnotationMapping($this->get('annotation_reader'));\n $instance->addMethodMapping('loadValidatorMetadata');\n $instance->setMetadataCache(new \\Symfony\\Component\\Validator\\Mapping\\Cache\\Psr6Cache(\\Symfony\\Component\\Cache\\Adapter\\PhpArrayAdapter::create((__DIR__.'/validation.php'), ${($_ = isset($this->services['cache.validator']) ? $this->services['cache.validator'] : $this->getCache_ValidatorService()) && false ?: '_'})));\n $instance->addObjectInitializers(array(0 => $this->get('doctrine.orm.validator_initializer'), 1 => new \\FOS\\UserBundle\\Validator\\Initializer(${($_ = isset($this->services['fos_user.util.canonical_fields_updater']) ? $this->services['fos_user.util.canonical_fields_updater'] : $this->getFosUser_Util_CanonicalFieldsUpdaterService()) && false ?: '_'})));\n $instance->addXmlMapping(($this->targetDirs[3].'/vendor/friendsofsymfony/user-bundle/DependencyInjection/Compiler/../../Resources/config/storage-validation/orm.xml'));\n\n return $instance;\n }", "public function __construct()\n {\n $this->subscription = new Subscription();\n }", "public function __construct(ImageStoreValidationService $validator, ImageUploader $uploader)\n {\n $this->validator = $validator;\n $this->uploader = $uploader;\n }", "public function initValidator()\n {\n if (!is_null($this->_validator)) {\n return $this->_validator;\n }\n $this->_validator = new SurveyManager_Entity_Validator_Survey($this);\n \n return $this->_validator;\n }", "public function __construct()\n {\n $this->callbacks = array(\n \n );\n \n $this->initializeMessages();\n }", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::class);\n }", "public function boot()\n {\n BaseValidator::resolver(function(Translator $translator, array $data, array $rules,\n array $messages = [], array $customAttributes = [])\n {\n return new Validator($translator, $data, $rules, $messages, $customAttributes);\n });\n }", "protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('postHashtag', json_decode($this->input()['postHashtag'], true));\n $this->request->set('activeLocales', json_decode($this->input()['activeLocales'], true));\n // clean alias from unnecessary symbols\n $this->request->set('postAlias', Helpers::cleanToOnlyLettersNumbers($this->input()['postAlias']));\n\n\n return parent::getValidatorInstance();\n }", "public function __construct(\\Closure $func)\n {\n $params = (new \\ReflectionFunction($func))->getParameters();\n\n // Must have exactly 2 params\n if (2 != count($params)) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: Must have exactly 2 parameters.');\n }\n\n // First must be 'input' and be of type pointybeard\\Helpers\\Cli\\Input\\AbstractInputType\n if ('input' != $params[0]->getName() || __NAMESPACE__.'\\AbstractInputType' != (string) $params[0]->getType()) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: First parameter must match '.__NAMESPACE__.\"\\AbstractInputType \\$input. Provided with \".(string) $params[0]->getType().\" \\${$params[0]->getName()}\");\n }\n\n // Second must be 'context' and be of type pointybeard\\Helpers\\Cli\\Input\\AbstractInputHandler\n if ('context' != $params[1]->getName() || __NAMESPACE__.'\\AbstractInputHandler' != (string) $params[1]->getType()) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: Second parameter must match '.__NAMESPACE__.\"\\AbstractInputHandler \\$context. Provided with \".(string) $params[1]->getType().\" \\${$params[1]->getName()}\");\n }\n\n $this->func = $func;\n }", "function setValidator(utilityValidator $inValidator) {\n\t\t$this->_Validator = $inValidator;\n\t\treturn $this;\n\t}", "function setValidator(utilityValidator $inValidator) {\n\t\t$this->_Validator = $inValidator;\n\t\treturn $this;\n\t}", "function setValidator(utilityValidator $inValidator) {\n\t\t$this->_Validator = $inValidator;\n\t\treturn $this;\n\t}", "protected function setupValidation()\n {\n }", "private function getValidator()\n {\n $v = new Validator();\n $v->addRules([\n ['label', 'Label', 'required'],\n ['num_value', 'Number', 'exists type=number'],\n ['comment', 'Comment', 'exists'],\n ]);\n return $v;\n }", "public function __construct() {\n $this->regex = '/^';\n foreach (CreditCardValidator::$card_patterns as $card => $regex)\n $this->regex .= '(' . $regex . ')|';\n $this->regex .= '$/';\n // remove final pipe\n $this->regex = str_replace(')|$/', ')$/', $this->regex);\n $this->invalid_msg = 'is not a valid CreditCard number';\n }", "public function init()\n {\n $notified = [];\n /** @var ListenerInterface $subscriber */\n foreach ($this->subscribers as $message => $subscribers) {\n foreach ($subscribers as $subscriber) {\n if (in_array($subscriber, $notified)) {\n continue;\n }\n $subscriber->init();\n $notified[] = $subscriber;\n }\n }\n }", "public\n function buildValidator(Event $event, Validator $validator, string $name) {\n\n if ($this->manager) {\n $this->manager->validation($validator);\n }\n }", "function _init(&$event)\r\n\t\t{\r\n\t\t\tparent::_init($event);\r\n\t\t\t\r\n\t\t\t$this->inp\t\t\t\t=\t&$event->object('input_validation', array(&$event));\r\n\t\t\t$this->data_validation\t=\t&$event->object('data_validation', array(&$event));\r\n\t\t}", "public function __construct(){\n require_once \"GestioneAcquariMarini/libs/ValidationFunction/validationFunction.php\";\n $this->validationFunction = new ValidationFunction();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->validations = [\n 'name' => 'required|min:3',\n 'admin' => 'required|min:3',\n 'admin_email' => 'required|email',\n 'health_email' => 'required|email',\n 'timezone' => 'required|min:3',\n 'timezone_update' => 'required|boolean',\n 'php_post_max_size' => 'required',\n 'php_upload_max_filesize' => 'required',\n 'php_memory_limit' => 'required',\n 'pma_version' => 'required',\n 'pma_update_version' => 'required|boolean',\n 'smtp_relay_host' => 'required',\n 'smtp_relay_domain' => 'required',\n 'smtp_relay_user' => 'required|email',\n 'smtp_relay_password' => 'required'\n ];\n }", "public function makeValidator()\r\n {\r\n if (10 == $this->countDigits($this->string)) {\r\n return new Validator10($this->string);\r\n }\r\n\r\n if (13 == $this->countDigits($this->string)) {\r\n return new Validator13($this->string);\r\n } \r\n }", "function __construct(TranslatorInterface $translator, Container $container)\n\t{\n\t\tparent::__construct($translator, $container);\n\t\t$this->setPresenceVerifier(app('validation.presence'));\n\t}", "public function __construct() {\n\t\n\t\t\t//Call the parent constructor\n\t\t\tparent::__construct();\n\t\t\t\n\t\t\t$this->validate = array_merge( \n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => [\n\t\t\t\t\t\t\t\t'rule' \t=> 'alphaNumeric',\n\t\t\t\t\t\t\t\t'required' \t=>\ttrue,\n\t\t\t\t\t\t\t\t'message' \t=> \tparent::$alphaNumericMessage\n\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t],\n\t\t\t\t\t\t$this->validate\n\t\t\t\t\t);\n\n\t\t}", "public function __construct()\n {\n /* excepts */\n $this->validateRoutes(['sendNotificationToAllUser']);\n }", "public function __construct(Validator $validator, ConfigInterface $config, array $options)\n\t{\n\t\t$this->config = $config;\n\t\t$this->validator = $validator;\n\t\t$this->name = $options['action_name'];\n\t\t$this->title = $this->validator->arrayGet($options, 'title', $this->title);\n\t\t$this->hasPermission = $options['has_permission'];\n\n\t\t//check if a confirmation was supplied\n\t\t$confirmation = $this->validator->arrayGet($options, 'confirmation');\n\n\t\tif (is_string($confirmation))\n\t\t{\n\t\t\t$this->confirmation = $confirmation;\n\t\t}\n\t\telse if (is_callable($confirmation))\n\t\t{\n\t\t\t$this->confirmation = $confirmation($model);\n\t\t}\n\n\t\t//run through the messages\n\t\t$this->messages['active'] = $this->validator->arrayGet($options['messages'], 'active', trans('administrator::administrator.active'));\n\t\t$this->messages['success'] = $this->validator->arrayGet($options['messages'], 'success', trans('administrator::administrator.success'));\n\t\t$this->messages['error'] = $this->validator->arrayGet($options['messages'], 'error', trans('administrator::administrator.error'));\n\n\t\t//set up the action\n\t\t$this->action = $this->validator->arrayGet($options, 'action', function() {});\n\t}", "public function __construct($email, $subscriber)\n {\n $this->email = $email;\n $this->subscriber = $subscriber;\n parent::__construct();\n }", "public function call()\n {\n $this->addTranslations($this->getTranslator(), $this->getTranslationsRootFolder());\n\n $middleware = $this;\n $this->app->container->singleton(\n self::SERVICE_VALIDATOR,\n function () use ($middleware) {\n return $middleware->createValidator();\n }\n );\n\n $this->next->call();\n }", "public function __construct() {\n\n\t\t$this->error = '';\n\t\t\n\t\tif(!empty($this->error)){\n\t\t\tadd_action( 'admin_notices', array( $this, 'thm_blocksy_validation_error_notice' ) );\n\t\t}\n\n\t}", "public function addValidator()\n {\n $this->app->validator->extendImplicit('recaptcha', function ($attribute, $value, $parameters) {\n $captcha = new Recaptcha();\n return $captcha->validate();\n }, config('Recaptcha.custom_error'));\n }", "function __construct( $options = array() ) {\n\t\tself::$_rules[ \"required\" ] = function( $data, $params ) {\n\t\t\treturn !empty( $data );\n\t\t};\n\t\tself::$_rules[ \"email\" ] = function( $data, $params ) {\n\t\t\treturn filter_var( $data, FILTER_VALIDATE_EMAIL );\n\t\t};\n\t\tself::$_rules[ \"date\" ] = function( $data, $params ) {\n\t\t\treturn ( date( \"Y-m-d\", strtotime( $data ) ) == $data );\n\t\t};\n\t}", "abstract protected function buildValidator(ArrayValidator $desc);", "public function __construct()\n {\n $this->eventPublisher = new InMemoryEventPublisher();\n EventPublisher::registerPublisher($this->eventPublisher);\n $this->prospectId = ProspectId::fromExisting('test-prospect-id');\n }", "public function construct() {\n\t\tparent::construct();\n\t\t// set the custom error messages\n \t$this->addCustomErrorMessages(array(\n \t\t\t\t\t\t\t\t\t\"name.notblank\" => $this->translate->_(\"company_name_error\")\n \t \t\t\t\t\t\t));\n\t}", "public function __construct(PhoneValidator $validator, Phone $phone)\n {\n $this->validator = $validator;\n $this->model = $phone;\n }", "public function addValidator(\\Closure $v)\n {\n $this->validators[] = $v;\n return $this;\n }", "public function __construct(CategoryValidator $categoryValidator, CategoryRepository $categoryRepository)\n {\n $this->categoryValidator = $categoryValidator;\n $this->categoryRepostory = $categoryRepository;\n }", "protected function initialize() {\n //validaciones\n $this->validates_presence_of('nombre', 'message: Debe escribir un <b>Nombre</b>');\n \n $this->validates_uniqueness_of('nombre', 'message: Este Municipio <b>ya existe</b> en el sistema');\n }", "function __construct($args)\n\t\t{\n\t\t\t$this->validateFields\t=\t$args;\n\t\t}", "function __construct()\n\t{\n\t\t$functionArguments\t=\tfunc_get_args(); \n\t\t$referenznummer\t\t=\t$functionArguments[0];\n\t\t$validationResult\t=\tarray();\n\t\t$otherError = error_get_last(); if ($otherError && $otherError['message'] != '')\t{ $validationResult['notUIDvalidationAustriaRelatedError']\t= $otherError['message']; }\t\n\t\t@trigger_error('');\n\t\t$initialize = UIDvalidationAustria::initialize($referenznummer, $validationResult);\n\t}", "public function __construct(StockSharesRequestValidator $validator)\n {\n $this->validator = $validator;\n $this->middleware('auth');\n }", "public function __construct($interval = 1) {\n if($interval <= 0) {\n throw new InvalidArgumentException(\"Interval must be > 0\");\n }\n $this->validation_collection = new ValidationCollection($this);\n $this->interval = $interval;\n }", "public function injectValidator(\\Symfony\\Component\\Validator\\ValidatorInterface $urlQueueValidator) {\n\t\t$this->enrichmentValidator = $urlQueueValidator;\n\t}", "public function __construct(validador $validador){\n\n $this->middleware('auth');//Verificacion de la autenticidad de la sesion\n $this->_validador = $validador;//asignacion de la clase a la variable protegida\n }", "public function validate()\n {\n $loader = new FileLoader(new Filesystem, 'lang');\n $translator = new Translator($loader, 'en');\n $validation = new Factory($translator, new Container);\n\n $rules = $this->rules();\n\n $this->_applyCustomValidationRules($validation);\n\n $validation->validate($this->attributes, $rules, $this->messages);\n }", "public function __construct()\n {\n $this->transformer = new ReactionTransformer;\n }", "public function __construct()\n {\n $this->validateArray = [\n 'title' => 'required|unique:books',\n 'year' => 'required|integer',\n 'author' => 'exists:authors,id'\n ];\n }", "public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Klikasi\\\\Validator\\Newsletter')) {\n\n $this->setValidator(new \\Klikasi\\Validator\\Newsletter);\n }\n }\n\n return $this->_validator;\n }" ]
[ "0.6823797", "0.66067344", "0.6486448", "0.64660436", "0.64080155", "0.626752", "0.6255187", "0.624644", "0.62234664", "0.6141159", "0.6081786", "0.60597456", "0.605093", "0.60072565", "0.60054064", "0.5959668", "0.5917092", "0.5906891", "0.58922464", "0.58917624", "0.58855534", "0.5873064", "0.58651865", "0.58615243", "0.58371603", "0.58337635", "0.5807405", "0.5798316", "0.57964945", "0.5754539", "0.5754539", "0.5743811", "0.5728733", "0.5713094", "0.57083905", "0.5692368", "0.56830096", "0.5659983", "0.5642907", "0.5640895", "0.56250256", "0.56227356", "0.56159973", "0.5610012", "0.5610012", "0.560797", "0.56039596", "0.557333", "0.555552", "0.5552778", "0.5550742", "0.5546503", "0.55378044", "0.55289495", "0.55252606", "0.5524998", "0.55177444", "0.55012333", "0.5499152", "0.5494985", "0.54776144", "0.54776144", "0.54776144", "0.54743886", "0.5473162", "0.5463973", "0.54637975", "0.54520565", "0.54516584", "0.54432994", "0.54430026", "0.5435605", "0.5432501", "0.54157364", "0.53977233", "0.538557", "0.53819335", "0.53706145", "0.5367091", "0.53615373", "0.536102", "0.53575385", "0.53561985", "0.53531235", "0.5349886", "0.5348374", "0.53451926", "0.5337946", "0.53322035", "0.5330999", "0.5329575", "0.53235173", "0.531904", "0.5305017", "0.530126", "0.5300853", "0.5295919", "0.5295481" ]
0.6328894
7
Validates entity before CREATE operation.
public function prePersist(LifecycleEventArgs $args) { $this->validator->validateWithException($args->getEntity()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate_on_create() {}", "public function beforeValidationOnCreate()\n {\n\n }", "protected function onCreating()\n {\n return $this->isDataOnCreateValid();\n }", "public function beforeValidationOnCreate()\r\n {\r\n // Data de cadastro\r\n $this->cadastroDt = date('Y-m-d H:i:s');\r\n\r\n // Seta status da mensagem para ativa\r\n $this->enviadoEmail = 'N';\r\n }", "public function beforeCreate(\\stdClass $data, Entity $entity) { }", "public function beforeValidationOnCreate() {\n\t\t$this->created = new RawValue('now()');\n\t\t$this->active = 0;\n\t\t$this->validated = 0;\n\t}", "function before_validation_on_create() {}", "protected function beforeCreate()\n {\n $this->idInitializationCheck();\n $this->setDefaults();\n return $this->validation('create');\n }", "protected function canCreate() {}", "public function beforeValidate()\n \t{\n \t\tif ($this->isNewRecord) {\n \t\t} else {\n \t\t}\n\n \t\treturn parent::beforeValidate();\n \t}", "public function createEntity();", "public function checkIsValidForCreate() {\n $errors = array();\n if (strlen($this->email) < 5) {\n $errors[\"email\"] = i18n(\"You must write your email\");\n }\n if (sizeof($errors)>0){\n throw new ValidationException($errors, \"user is not valid\");\n }\n }", "private function beforeCreate(): bool\n {\n $event = new BuildEvent();\n $this->trigger(self::EVENT_BEFORE_CREATING, $event);\n\n return $event->canCreate;\n }", "public function beforeCreate()\n {\n // init fields by default\n $this->setDateCreate(new \\DateTime());\n }", "public function beforeCreate() : bool\n\t{\n\t\treturn true;\n\t}", "public function checkIsValidForCreate() {\n $errors = array();\n /*if (strlen($this->email) < 5) {\n $errors[\"register-email\"] = \"You must write your email\";\n }*/\n if (sizeof($errors)>0){\n throw new ValidationException($errors, \"Notification is not valid\");\n }\n }", "private function validateInsert() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t\t// application id not 0\n\t}", "public function beforeCreate(\\stdClass $data, EntityInterface $entity)\n {\n $this->processFormData($data);\n }", "public function beforeCreate(RestDtoInterface $dto, EntityInterface $entity): void\n {\n }", "protected function _precreate() {\n }", "public function validate($entity)\n {\n }", "public function create(Entity $entity);", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "public function validateCreate(){\n $currentUser=$this->getCurrentUser();\n /** @noinspection PhpMethodParametersCountMismatchInspection */\n $this->input->field('miner')\n ->addRule(IValidator::REQUIRED,'Miner ID is required!')\n ->addRule(IValidator::CALLBACK,'Requested miner is not available!',function($value)use($currentUser){\n try{\n $miner=$this->minersFacade->findMiner($value);\n }catch(\\Exception $e){\n return false;\n }\n if (!($miner->getUserId()==$currentUser->userId)){return false;}\n return $miner->metasource->state==Metasource::STATE_AVAILABLE;\n });\n /** @noinspection PhpMethodParametersCountMismatchInspection */\n $this->input->field('minSupport')\n ->addRule(IValidator::REQUIRED,'Min value of support is required!')\n ->addRule(IValidator::RANGE,'Min value of support has to be in interval [0;1]!',[0,1]);\n }", "public function prePersist(LifecycleEventArgs $args)\n {\n $constraintViolationList = $this->validator->validate($args->getEntity());\n\n if ($constraintViolationList->count() > 0) {\n throw new ValidatorException(\n (string)$constraintViolationList\n );\n }\n }", "function validateOnAdd( $entity ){\t\t\t\n\t\t//TODO unicidad (cliente )\n\t\t\n\t}", "public function canCreate();", "public function canCreate();", "public function create()\n {\n $this->authorize('create', Transaction::class);\n }", "public function create($validatedData)\n {\n }", "public function create($entity);", "protected function beforeValidate()\n\t{\n if ($this->isNewRecord) {\n $this->created = date('Y-m-d H:i:s');\n }\n\n return parent::beforeValidate();\n }", "protected function validate()\n {\n// echo static::class;\n if (!isset($this->getProperty('raw_data')['_'])) {\n throw new InvalidEntity('Invalid entity data given: ' . json_encode($this->getRawData(), JSON_PRETTY_PRINT));\n }\n }", "function create($entity);", "public function beforeValidationOnCreate()\n {\n\t // Timestamp the confirmaton\n\t $this->password_change_created = time();\n }", "protected function beforeValidate()\n\t{\n\t\t$loUser = Yii::app()->user;\n\t\t$lcUser = !is_null($loUser) && $loUser->hasState('GUID') ? $loUser->GUID : \"SYSTEM\";\n\t\tif ($this->getIsNewRecord())\n\t\t{\n\t\t\t// Set the created date and created user\n\t\t\t$this->CreatedDate = $this->ModifiedDate = $this->Rowversion = Utilities::getTimestamp();\n\t\t\t$this->CreatedBy = $this->ModifiedBy = $lcUser;\n\n\t\t\tif ($this->hasAttribute('GUID') && is_null($this->GUID))\n\t\t\t{\n\t\t\t\t$this->GUID = Utilities::getStringGUID();\n\t\t\t}\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ModifiedDate = $this->Rowversion = Utilities::getTimestamp();\n\t\t\t$this->ModifiedBy = $lcUser;\n\t\t}\n\n\t\treturn parent::beforeValidate();\n\t}", "public function prevalidate(EntityEvent $event) {\n $GLOBALS['feeds_test_events'][] = (__METHOD__ . ' called');\n\n $feed_type_id = $event->getFeed()->getType()->id();\n switch ($feed_type_id) {\n case 'no_title':\n // A title is required, set a title on the entity to prevent validation\n // errors.\n $event->getEntity()->title = 'foo';\n break;\n }\n }", "function before_create() {}", "public function isValidCreateData($form){\n return true;\n }", "final public function assertHydratedEntity()\n {\n if ($this->isSimpleEntity()) {\n throw ValidationException::create(ERR300_CANNOT_PERSIST_SIMPLE_ENTITY);\n }\n }", "public static function checkCreateRequest() {\n self::checkConnection();\n $data = self::validateCreateRequest();\n $project = new Project();\n if ($data != null) {\n $project->update($data);\n $project->save();\n $project->updateCategory($data['categories']);\n redirect(url(['_page' => 'project_detail', 'project_id' => $project->id]));\n }\n }", "function after_validation_on_create() {}", "public function testItCanCreateEntity()\n {\n $values = [\n 'first_name' => 'First name account',\n 'last_name' => 'Last name account',\n 'email' => '[email protected]',\n ];\n $ignore = [\n 'is_active' => false,\n 'is_superuser' => true,\n 'is_staff' => true,\n ];\n $password = 'testpass';\n\n $entity = $this->accountService->create(array_merge(\n $values,\n ['password' => $password],\n $ignore\n ));\n $data = $entity->toArray();\n\n $this->assertDatabaseHas('user_users', $values);\n $this->assertInstanceOf(User::class, $entity);\n $this->assertTrue(Hash::check($password, $entity->password));\n $this->assertTrue($entity->is_active);\n $this->assertFalse($entity->is_superuser);\n $this->assertFalse($entity->is_staff);\n\n foreach ($this->dataStructure() as $key) {\n $this->assertArrayHasKey($key, $data);\n }\n }", "public function prePersist($entity);", "abstract public function validate($entity);", "public function beforeSave()\n {\n $value = $this->getValue();\n try {\n $this->validate($value);\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $msg = __('%1', $e->getMessage());\n $error = new \\Magento\\Framework\\Exception\\LocalizedException($msg, $e);\n throw $error;\n }\n }", "public function beforeCreate()\n {\n if (is_null($this->brand_id)) {\n $this->brand_id = 0;\n }\n }", "public function before_insert(Model $obj) {\n\t\t$this->validate ( $obj );\n\t}", "protected function preValidate() {}", "public function beforeCreate()\n {\n if (!$this->fecha) {\n $this->fecha = date('Y-m-d H:i:s');\n }\n\n if (!$this->fk_funcionario) {\n $this->fk_funcionario = SessionController::getValue('idfuncionario');\n }\n\n return true;\n }", "private function validateCreatedAt()\n {\n try {\n new DateTime($this->created_at);\n return true;\n } catch (Exception $e) {\n return false;\n }\n }", "public function create()\n {\n // $this->authorize('create', Comment::class);\n\n }", "public function validate(Request $request): bool {\n\n if(!empty($this->validation_rules)) {\n\n $validator = BaseValidator::make($request->all(), $this->validation_rules, $this->validation_messages, $this->attributes);\n\n if($validator->fails()) {\n\n foreach($validator->errors()->all() as $msg) {\n $this->error_message = $msg;\n break;\n }\n\n return false;\n\n } else {\n $this->createEntity($request->all());\n }\n\n return true;\n\n }\n\n throw new Exception(\"You have not created any field with its validation rules\");\n\n }", "protected function _checkRecordInstance()\n {\n if (!$this->_entity)\n {\n $this->_entity = new $this->entityName();\n return false;\n }\n else\n return true; \n }", "protected function beforeValidate()\n\t{\n if($this->getIsNewRecord()) {\n $this->setAuthorId(Yii::app()->user->getId());\n }\n\t\treturn true;\n\t}", "public static function validateCreateRequest() {\n $errors = array();\n $data = array();\n self::checkTitle($errors, $data);\n self::checkDescription($errors, $data);\n self::checkGoal($errors, $data);\n self::checkStartDate($errors, $data);\n self::checkDuration($errors, $data);\n self::checkCategories($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'create_project']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "public function check_create_person_validation()\n {\n\n $person = [];\n $this->signInAsRelationshipsManager('api');\n $response = $this->json('POST','api/v1/person/', $person);\n $response->assertStatus(422)\n ->assertJson( [\n 'message' => 'The given data was invalid.',\n 'errors' => [\n 'givenName' => [\n 'The given name field is required.'\n ],\n \"surname1\" => [\n \"The surname1 field is required.\"\n ],\n \"identifier\" => [\n \"The identifier field is required.\"\n ],\n \"identifier_type\" => [\n \"The identifier type field is required.\"\n ]\n\n ]\n ]);\n }", "public function prePersist()\n {\n $this->dateCreation = new \\DateTime();\n }", "public function preUpdate(LifecycleEventArgs $args)\n {\n $this->validator->validateWithException($args->getEntity());\n }", "public function Create()\n\t\t{\n\t\t\t$this->ID = null;\n\t\t\t$this->Created = new DateTime();\n\t\t\t$this->CreatedBy = User::GetCurrentUser();\n\t\t\t$this->Modified = new DateTime();\n\t\t\t$this->ModifiedBy = User::GetCurrentUser();\n\t\t\t\n\t\t\t$type = strtolower($this->GetType());\n\t\t\t$values = $this->GetChangedValues();\n\t\t\t\n\t\t\t$id = DomainObjectAccess::Create($type, $values);\n\t\t\t$this->ID = $id;\n\t\t\t\n\t\t\treturn true;\n\t\t}", "public function test_create()\n\t{\n\t\tlist($id, $affected) = $this->model->create(array(\n\t\t\t'user_id' => '1',\n\t\t\t'role_id' => '1'\n\t\t));\n\n\t\t$this->assertSame(0, $id); // No primary key...\n\t\t$this->assertSame(1, $affected);\n\t}", "public function afterCreate(\\stdClass $data, Entity $entity) { }", "public function create()\n\t{\n\t\treturn $this->fail(lang('RESTful.notImplemented', ['create']), 501);\n\t}", "public function beforeCreate()\n {\n\t\t// Asignar la fecha y hora de creacion del registro\n $this->createdon = time();\n $this->updatedon = time();\n\t\tif ($this->subscribedon == 0) {\n\t\t\t$this->subscribedon = $this->createdon;\n\t\t}\n }", "protected abstract function importCreate($entity);", "public function first_name_is_required_on_create()\n {\n $this\n ->from('nova/resources/users/new')\n ->post('nova-api/users', [\n 'first_name' => '',\n ])\n ->assertRedirect('nova/resources/users/new')\n ->assertSessionHasErrors('first_name');\n }", "protected function performPrePersistCallback()\n {\n // echo 'inserting a record ...';\n $this->validate();\n \n return true;\n }", "function _create($entity)\n {\n $retval = FALSE;\n $id = $this->object->_wpdb()->insert($this->object->get_table_name(), $this->object->_convert_to_table_data($entity));\n if ($id) {\n $key = $this->object->get_primary_key_column();\n $retval = $entity->{$key} = intval($this->object->_wpdb()->insert_id);\n }\n return $retval;\n }", "protected function setupCreateOperation()\n {\n CRUD::setValidation(CodeRequest::class);\n\n $this->addFieldDescriptionText();\n $this->addFieldIsVisibleCheckbox();\n }", "protected function beforeValidate() {\n \n if ($this->isNewRecord) {\n // set the create date, last updated date, then the user doing the creating\n // $this->created = new CDbExpression('NOW()');\n $this->created = date('Y-m-d H:i:s');\n $this->created_by = Yii::app()->user->id;\n } else {\n //not a new record, so nothing to do right now.\n $this->modified = date('Y-m-d H:i:s');\n $this->modified_by = Yii::app()->user->id;\n\n }\n\n return parent::beforeValidate();\n }", "public static function validateCreateRequest() {\n $errors = array();\n $data = array();\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "public function preDelete(LifecycleEventArgs $args)\n {\n $constraintViolationList = $this->validator->validate($args->getEntity());\n\n if ($constraintViolationList->count() > 0) {\n throw new ValidatorException(\n (string)$constraintViolationList\n );\n }\n }", "public function testAllowCreate()\n {\n $createFalse = LogEntry::create()->canCreate(null);\n $this->assertFalse($createFalse);\n $this->logInWithPermission('ADMIN');\n $createFalse = LogEntry::create()->canCreate();\n $this->assertFalse($createFalse);\n }", "protected function entityValidate($entity) {\n parent::entityValidate($entity);\n\n if (!isset($entity->uid) || !is_numeric($entity->uid)) {\n $entity->uid = $this->config['author'];\n }\n }", "public function postCreate() {\n\t\t// Check permission\n //\n if (!Sentry::getUser()->hasAccess($this->permission_prefix . '.create')) {\n return App::abort('403');\n }\n\t}", "public function create()\n {\n // Admin only\n }", "public function checkIntegrity();", "public function validateForCreate(CarismaRequest $request)\n {\n return Validator::make(\n $request->all(),\n $this->creationFields($request)->mapWithKeys(function ($field) use ($request) {\n return $field->getCreationRules($request);\n })->all()\n )->after(function ($validator) use ($request) {\n static::afterValidation($request, $validator);\n static::afterValidationOnCreate($request, $validator);\n })->validate();\n }", "protected function setupCreateOperation()\n {\n CRUD::setValidation(StoreRequest::class);\n\n /**\n * Fields can be defined using the fluent syntax or array syntax:\n * - CRUD::field('price')->type('number');\n * - CRUD::addField(['name' => 'price', 'type' => 'number']));\n */\n }", "public function testIsValidException()\n {\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $validator->isValid([]);\n }", "protected function beforeValidate() {\n \n if ($this->isNewRecord) {\n // set the create date, last updated date, then the user doing the creating\n // $this->created = $this->modified = new CDbExpression('NOW()');\n $this->created = date('Y-m-d H:i:s');\n $this->created_by = Yii::app()->user->id;\n } else {\n //not a new record, so just set the last updated time and last updated user id\n //$this->update_time = new CDbExpression('NOW()');\n $this->modified = date('Y-m-d H:i:s');\n $this->modified_by = Yii::app()->user->id;\n }\n\n return parent::beforeValidate();\n }", "public function prePersist()\n {\n }", "public function create(Request $request)\n {\n \t$leiNumber = $this->legalEntityGenerateUniqueService->generateUniqueLegalEntity();\n \t$version = $this->legalEntityGenerateUniqueService->defaultLegalEntityVersion();\n \n \t$data = ['lei' => $leiNumber,\n 'version' => $version,\n 'name' => $request->name,\n 'country_code' => $request->country,\n 'status' => $request->status\n \t]; \n \t$resourceObj = $this->legalEntityRepository->store($data);\n if($resourceObj){\n ProcessLegalEntityValidation::dispatch($resourceObj->id)->delay(now()->addSeconds(30));\n }\n return $resourceObj;\n }", "protected function _validate()\n {\n // validate order has created_at updated_at\n }", "protected function afterValidationOnCreate(CarismaRequest $request, $validator)\n {\n //\n }", "function canCreate() {\r\n\t\treturn !DataObject::get_one($this->class);\r\n\t}", "public function beforeValidationOnCreate()\n {\n $this->username = strtolower($this->username);\n return $this->validation();\n }", "public function create()\n {\n $this->authorize('create', Status::class);\n }", "abstract protected function createEntityInstance();", "protected function beforeValidate()\n\t{\n\t\t$this->lastUpdatedBy=Yii::app()->user->id;\n\t\t$invoiceTotals=$this->getInvoiceValues();\n\t\t$this->invoiceTotal=$invoiceTotals['invoiceTotal'];\n\t\t\n\t\tif($this->isNewRecord)\n\t\t{\n\t\t\t$this->created=$this->lastModified=date('Y-m-d H:i:s');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->lastModified=date('Y-m-d H:i:s');\n\t\t}\n\t\treturn true;\n\t}", "public function initializeCreateAction() {\n\t\t$fieldConfigurationWithValues = $this->fieldConfiguration;\n\t\tif ($this->request->hasArgument('frontendUser')) {\n\t\t\t$frontendUserData = $this->request->getArgument('frontendUser');\n\t\t\t$errors = 0;\n\t\t\tforeach ($frontendUserData as $fieldName => $value) {\n\t\t\t\t// XSS sanitation\n\t\t\t\t$value = htmlspecialchars(strip_tags(trim($value)));\n\t\t\t\tif (array_key_exists($fieldName, $this->fieldConfiguration)) {\n\t\t\t\t\t// the field is allowed\n\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['value'] = $value;\n\t\t\t\t\tif ($this->fieldConfiguration[$fieldName]['mandatory']) {\n\t\t\t\t\t\t// the field is mandatory, thus it must not be empty\n\t\t\t\t\t\tif (empty($value)) {\n\t\t\t\t\t\t\t// Error: Empty mandatory field\n\t\t\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['cssClasses'] = 'has-error';\n\t\t\t\t\t\t\t$errors++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Validate e-mail address\n\t\t\t\t\t\t\tif ($fieldName === 'email' && GeneralUtility::validEmail($value) === FALSE) {\n\t\t\t\t\t\t\t\t// Error: Invalid e-mail address\n\t\t\t\t\t\t\t\t$fieldConfigurationWithValues[$fieldName]['cssClasses'] = 'has-error';\n\t\t\t\t\t\t\t\t$errors++;\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} else {\n\t\t\t\t\t// Unset fields that are not allowed for security reasons\n\t\t\t\t\tunset($frontendUserData[$fieldName]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($errors > 0) {\n\t\t\t\t$this->forward('new', NULL, NULL, array('fieldConfiguration' => $fieldConfigurationWithValues));\n\t\t\t} else {\n\t\t\t\t$this->forward('addAccountAndLogin', NULL, NULL, array('frontendUserData' => $frontendUserData));\n\t\t\t}\n\t\t} else {\n\t\t\t$this->forward('new');\n\t\t}\n\n\t}", "public function initalize()\n {\n $this->addBehavior(new Timestampable(array(\n 'beforeValidationOnCreate' => array(\n 'field' => 'created',\n 'format' => 'Y-m-d H:i:s'\n )\n )));\n $this->belongsTo('users_id', 'Users', 'id', array(\n 'alias' => 'user',\n 'foreignKey' => array(\n 'message' => 'invalid user.'\n )\n ));\n }", "public function create()\n {\n return true;\n }", "public function create()\n {\n return true;\n }", "protected function _validate() {\n\t}", "public function create() {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }" ]
[ "0.7168315", "0.70376307", "0.6917109", "0.68956697", "0.6876916", "0.684775", "0.68158317", "0.67350984", "0.66225976", "0.64554816", "0.6435591", "0.6428803", "0.6398109", "0.6376238", "0.6341968", "0.6308704", "0.62995917", "0.62741494", "0.6254682", "0.6227516", "0.6208459", "0.6197493", "0.6192202", "0.6183967", "0.6174895", "0.61643094", "0.6149106", "0.6149106", "0.61262083", "0.61228156", "0.6085382", "0.6075505", "0.6057622", "0.6052652", "0.6028254", "0.60262287", "0.6016619", "0.60102487", "0.60001266", "0.5970067", "0.59669787", "0.5962705", "0.5935512", "0.59327596", "0.59284925", "0.592321", "0.59227586", "0.58998", "0.5889618", "0.58883375", "0.5874308", "0.5865521", "0.58630955", "0.586149", "0.58612025", "0.585644", "0.5843362", "0.58319426", "0.5822943", "0.58227247", "0.5821831", "0.5818945", "0.578221", "0.57794654", "0.57761395", "0.5772508", "0.576937", "0.5760667", "0.57483894", "0.5745662", "0.57443714", "0.57441866", "0.5742683", "0.5738872", "0.5735661", "0.57327014", "0.5732156", "0.5721926", "0.57122874", "0.5709197", "0.57059056", "0.57024115", "0.5699914", "0.5699433", "0.56757", "0.56743675", "0.566907", "0.56615174", "0.5611173", "0.5607658", "0.55987364", "0.55943274", "0.5590823", "0.5590823", "0.5590355", "0.5588772", "0.5588073", "0.5588073", "0.5588073", "0.5588073" ]
0.65774614
9
Validates entity before UPDATE operation.
public function preUpdate(LifecycleEventArgs $args) { $this->validator->validateWithException($args->getEntity()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validateUpdate($obj);", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "function validate_on_update() {}", "public function before_update(Model $obj) {\n\t\t$this->validate ( $obj );\n\t}", "public function isUpdateRequired();", "function before_validation_on_update() {}", "public function beforeValidationOnUpdate()\n {\n // Timestamp on the update\n $this->modifyAt = time();\n }", "function update(){\n\n // Check the required fields to see if each required field exists.\n forEach($requiredFields as $field){\n if(!$this->bean->contains($field)){\n throw new Exception(\"Required field $field does not exists.\");\n }\n }\n\n // Check to see if there are any fields that are not specified as a possible field.\n forEach($this->bean as $key => $value){\n if(!$possibleFields->contains($key)){\n throw new Exception(\"Invalid field $key passed to model.\");\n }\n }\n \n // Validate bean. \n if(!validate($this->bean)){\n throw new Exception(\"Bean is not valid. For a more detailed message throw a custom exception in validation function.\");\n }\n }", "public function testValueValidationForUpdate()\n {\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => 'customer_invoice']);\n\n $this->assertNotNull($eavValue);\n\n $eavValue->setValue('not_existing_type');\n\n $this->em->persist($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(1, $violations);\n }", "public function checkIsValidForUpdate() {\n $errors = array();\n\n if (strlen($this->phone) >0 && !is_numeric($this->phone)){\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n if (strlen($this->phone) < 1) {\n $errors[\"phone\"] = i18n(\"You must write a valid phone number\");\n }\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"User is not valid\");\n }\n }", "public function checkIsValidForUpdate() {\n $errors = array();\n\n try{\n $this->checkIsValidForCreate();\n }catch(ValidationException $ex) {\n foreach ($ex->getErrors() as $key=>$error) {\n $errors[$key] = $error;\n }\n }\n if (sizeof($errors) > 0) {\n throw new ValidationException($errors, \"Notification is not valid\");\n }\n }", "protected function beforeUpdate()\n {\n $this->idInitializationCheck(true);\n return $this->validation('update');\n }", "protected function onUpdating()\n {\n return $this->isDataOnUpdateValid();\n }", "public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "protected function beforeUpdating()\n {\n }", "public function beforeSave()\n {\n $value = $this->getValue();\n try {\n $this->validate($value);\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n $msg = __('%1', $e->getMessage());\n $error = new \\Magento\\Framework\\Exception\\LocalizedException($msg, $e);\n throw $error;\n }\n }", "public function beforeUpdate(&$id, \\stdClass $data, Entity $entity) { }", "public function check () {\n $modelName = $this->field->model->name;\n $fieldName = $this->field->name;\n $bean = $this->field->model->bean;\n $ctx = @$this->field->constraints['context'];\n $update = $ctx ? strpos(\",,{$ctx->value},\", ',update,') : true;\n return $this->dispatch(\n (!$this->value) || ($this->field && $this->field->value) || ($bean->id && !$update),\n \"{$this->field->title} is required\"\n );\n }", "public function testUpdateValidProperty() : void {\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"property\");\n\n\t\t//make a valid property uuid\n\t\t$propertyId = generateUuidV4();\n\n\t\t//make a new property with valid entries\n\t\t$property = new Property($propertyId, $this->VALID_PROPERTYCITY, $this->VALID_PROPERTYCLASS, $this->VALID_PROPERTYLATITUDE, $this->VALID_PROPERTYLONGITUDE, $this->VALID_PROPERTYSTREETADDRESS, $this->VALID_PROPERTYVALUE);\n\n\t\t//insert property\n\t\t$property->insert($this->getPDO());\n\n\t\t//edit the property and update it in MySQL\n\t\t$property->setPropertyValue($this->VALID_PROPERTYVALUE2);\n\t\t$property->update($this->getPDO());\n\n\t\t//grab dah data from mySQL and check that the fields match our expectations\n\t\t$pdoProperty = Property::getPropertyByPropertyId($this->getPDO(), $property->getPropertyId());\n\t\t$this->assertEquals($numRows +1, $this->getConnection()->getRowCount(\"property\"));\n\t\t$this->assertEquals($pdoProperty->getPropertyId()->toString(), $propertyId->toString());\n\t\t$this->assertEquals($pdoProperty->getPropertyCity(), $this->VALID_PROPERTYCITY);\n\t\t$this->assertEquals($pdoProperty->getPropertyClass(), $this->VALID_PROPERTYCLASS);\n\t\t$this->assertEquals($pdoProperty->getPropertyLatitude(), $this->VALID_PROPERTYLATITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyLongitude(), $this->VALID_PROPERTYLONGITUDE);\n\t\t$this->assertEquals($pdoProperty->getPropertyStreetAddress(), $this->VALID_PROPERTYSTREETADDRESS);\n\t\t$this->assertEquals($pdoProperty->getPropertyValue(), $this->VALID_PROPERTYVALUE2);\n\t}", "protected function validate()\r\n\t{\r\n\t\tif (!$this->isFetched())\r\n\t\t{\r\n\t\t\treturn;\r\n }\r\n \r\n\t\tif ($this->validationInfo)\r\n\t\t{\r\n\t\t\t$this->validationInfo->validate($this->normalizedValue);\r\n\t\t}\r\n\t\t$this->isValid = true;\r\n\t}", "protected function beforeUpdate()\n {\n }", "private function _validateModifiable()\n {\n if(!($this->_getDataSource() instanceof wCrudAdapter))\n {\n throw new Exception('Object is read-only.');\n }\n }", "public function checkIntegrity();", "public function validate($entity)\n {\n }", "function after_validation_on_update() {}", "private function validateUpdateRequest( Request $request ) {\n\t\t$this->validate($request, [\n\t\t\t'book_id' => 'exists:books,id',\n\t\t\t'price' => 'numeric|min:1',\n\t\t],[\n\t\t\t'books_id.exists' => 'Not an existing book for this sale.',\n\t\t\t'min' => 'The :attribute field needs at least :min chars.',\n\t\t\t'numeric' => 'The :attribute field needs to be numeric.',\n\t\t\t'price.min' => 'The :attribute needs to be equals or bigger than 1.',\n\t\t]);\n\t}", "public function testItCanUpdateEntity()\n {\n $values = [\n 'first_name' => 'First name account update',\n 'last_name' => 'Last name account update',\n 'email' => '[email protected]',\n ];\n $ignore = [\n 'is_active' => false,\n 'is_superuser' => true,\n 'is_staff' => true,\n ];\n $password = 'testpassupdate';\n\n $token = factory(User::class)->create([\n 'is_active' => true,\n 'is_superuser' => false,\n 'is_staff' => false,\n ])->createToken('TokenAccountTest')->token->id;\n\n $entity = $this->accountService->update(array_merge(\n $values, $ignore, ['password' => $password]\n ), $token);\n\n $data = $entity->toArray();\n $this->assertDatabaseHas('user_users', $values);\n $this->assertInstanceOf(User::class, $entity);\n $this->assertTrue(Hash::check($password, $entity->password));\n $this->assertTrue($entity->is_active);\n $this->assertFalse($entity->is_superuser);\n $this->assertFalse($entity->is_staff);\n\n foreach ($this->dataStructure() as $key) {\n $this->assertArrayHasKey($key, $data);\n }\n }", "protected function updateEntity($entity)\n {\n }", "function setAllowEntityUpdate($update) {\n $this->_allowEntityUpdate = $update;\n }", "protected function _validate_update($table)\n\t{\n\t\tif (count($this->qb_set) === 0)\n\t\t{\n\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_use_set') : FALSE;\n\t\t}\n\n\t\tif ($table !== '')\n\t\t{\n\t\t\t$this->qb_from = array($this->protect_identifiers($table, TRUE, NULL, FALSE));\n\t\t}\n\t\telseif ( ! isset($this->qb_from[0]))\n\t\t{\n\t\t\treturn ($this->db_debug) ? $this->display_error('db_must_set_table') : FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "abstract public function validate($entity);", "public function isValidUpdate($data) { \n\t\t$options = array('presence' => 'optional');\n\t\treturn $this -> validate($data,$options);\n\t}", "public function test_it_doesnt_update_a_user_if_validation_fails()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $update = ['email' => '[email protected]'];\n\n $response = $this->call('PUT', sprintf('/users/%d', $user->id), $update);\n\n $this->assertEquals(422, $response->status());\n $this->assertJsonStringEqualsJsonString(json_encode([\n 'given_name' => ['The given name field is required.'],\n 'family_name' => ['The family name field is required.']\n ]), $response->getContent());\n }", "function isValidUpdate($productItem, $id) {\n return isValidInsert($productItem, false) && is_numeric($id) && $id > 0;\n}", "public function updated($property)\n {\n $this->validateOnly($property);\n }", "protected function entityValidate($entity) {\n parent::entityValidate($entity);\n\n if (!isset($entity->uid) || !is_numeric($entity->uid)) {\n $entity->uid = $this->config['author'];\n }\n }", "public function update($entity)\n {\n \n }", "public function updated($field)\n {\n // Solo validamos el campo que genera el update\n $validatedData = $this->validateOnly($field, [\n 'usuario' => 'required',\n 'mensaje' => 'required',\n ]);\n }", "public function update(UpdateOngRequest $request, Ong $entity)\n {\n $entity->fill($request->validated());\n\n $onValidate = function () use ($entity) {\n $entity->save();\n\n return $entity;\n };\n\n if ($entity->userId === $request->user()->id)\n return $onValidate();\n\n if ($request->user()->isAdmin())\n return $onValidate();\n\n abort(403, 'Você não tem permissão para atualizar as informações dessa ONG.');\n }", "public function postUpdate($entity);", "public function testUpdateInvalidUser() {\n\t\t// create a USer and try to update it without actually inserting it\n\t\t$user = new User(null, $this->VALID_SALT, $this->VALID_HASH, $this->VALID_EMAIL, $this->VALID_NAME);\n\t\t$user->update($this->getPDO());\n\t}", "protected function performUpdate()\n {\n // Once we have run the update operation, we will fire the \"updated\" event for\n // this model instance. This will allow developers to hook into these after\n // models are updated, giving them a chance to do any special processing.\n $dirty = $this->getDirty();\n\n if (count($dirty) > 0) {\n $updatedField = $this->getApi()->{'update'.ucfirst($this->getEntity())}($this->{$this->primaryKey}, $dirty);\n $this->fill($updatedField);\n $this->syncChanges();\n }\n\n return true;\n }", "public function update(){\r\n\t\tif (!$this->hasChanged) return self::RES_UNCHANGED;\r\n\t\t$table = $this->getTable();\r\n\t\tif ($this->new){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the record doesn't exist.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\tif (!$table->hasPrimaryKey()){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the table does not have a primary key.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$where = array();\r\n\t\t$changeCount = 0;\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\tif ($value->hasChanged()){\r\n\t\t\t\t$vals[] = \"`$name` = \".$value->getSQLValue();\r\n\t\t\t\t$changeCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\t$where[] = \"`$name` = \".$this->values[$name]->getSQLValue();\r\n\t\t}\r\n\t\t$sql = 'UPDATE '.$this->getFullTableName().' SET '.implode(', ',$vals).' WHERE '.implode(' AND ',$where).' LIMIT 1';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to update record in '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "protected function update() {\n if ($this->_isLoaded()) {\n $this->db->where('id', $this->id);\n $this->db->update($this->tableName, $this->mapToDatabase());\n } else {\n throw new Exception(\"Model is not loaded\");\n }\n }", "protected function validate()\n {\n// echo static::class;\n if (!isset($this->getProperty('raw_data')['_'])) {\n throw new InvalidEntity('Invalid entity data given: ' . json_encode($this->getRawData(), JSON_PRETTY_PRINT));\n }\n }", "public function Update($entity) {\n }", "public function testUpdateCardValidationRules()\n {\n $card = factory('App\\Card')->create();\n\n $response = $this->actingAs($card->owner, 'api')\n ->withHeader('Accept', 'application/json')\n ->put(route('api.cards.update', [$card->id]), []);\n\n $response->assertStatus(422);\n $response->assertJsonValidationErrors(['name']);\n }", "public function testUpdateUserValidationError()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->putJson('/api/user/' . $user->id, ['email' => 'Invalid@email com']);\n\n $response->assertStatus(422);\n }", "public function testIsValidSuccessWithoutHasDataChanges()\n {\n $this->_object->expects($this->once())->method('hasDataChanges')->will($this->returnValue(false));\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $validator->setReadOnlyProperties(['attr1']);\n $this->assertTrue($validator->isValid($this->_object));\n }", "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function update(DataObject $entity){\n }", "public function validate(){\r\n\t\tif(array_get($this->entity, array_get($this->validate, 'fieldName')) != $this->fieldValue){\r\n\t\t\tHmsException::occur($fieldName. '必须等于', $this->fieldValue);\r\n\t\t}\r\n\t}", "public function update(Entity $entity);", "public function testUpdateInvalidScheduleItem() {\n // create a ScheduleItem, try to update it without actually inserting it and watch it fail\n $scheduleItem = new ScheduleItem(null,$this->VALID_SCHEDULE_ITEM_DESCRIPTION, $this->VALID_SCHEDULE_ITEM_NAME,$this->VALID_SCHEDULE_START_TIME, $this->VALID_SCHEDULE_END_TIME, $this->VALID_USER_ID);\n $scheduleItem->update($this->getPDO());\n }", "final public function assertHydratedEntity()\n {\n if ($this->isSimpleEntity()) {\n throw ValidationException::create(ERR300_CANNOT_PERSIST_SIMPLE_ENTITY);\n }\n }", "private function validateUpdate($data){\n return Validator::make($data, [\n 'context' => 'required|in:answer,complete,scoring',\n 'answer' => 'required_if:context,==,answer',\n 'answer.questionId' => 'required_if:context,==,answer',\n ]);\n }", "public function preUpdate(LifecycleEventArgs $args)\n {\n $constraintViolationList = $this->validator->validate($args->getEntity());\n\n if ($constraintViolationList->count() > 0) {\n throw new ValidatorException(\n (string)$constraintViolationList\n );\n }\n }", "public function update($entity){ \n //TODO: Implement update record.\n }", "public function testHandleUpdateValidationError()\n {\n // Populate data\n $this->_populate();\n \n // Request\n $response = $this->withSession($this->adminSession)\n ->call('POST', '/branch/edit', $this->customBranchData, [], [], ['HTTP_REFERER' => '/branch/edit']);\n \n // Verify\n $this->assertRedirectedTo('/branch/edit');\n $this->assertSessionHasErrors();\n }", "public function updated($field)\n {\n $this->validateOnly($field);\n }", "public function processUpdate()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter updateModifyValidationRules\n $validationRules = $this->doFilter(\"updateModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter updateModifyValidationMessages\n $validationMessages = $this->doFilter(\"updateModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set initial configuration\n $Model->build($this->Model->getTable());\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter updateModifyRequest\n $this->Model = clone $Model;\n $parameters = $this->doFilter(\"updateModifyRequest\", $requestParameters);\n // Update record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($Model, $parameters) {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n });\n } else {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.update.success'));\n // Hook Filter updateModifyResponse\n $Response = $this->doFilter(\"updateModifyResponse\", $Response);\n $this->redirect($Response);\n }", "public static function checkUpdateRequest() {\n self::checkConnection();\n $data = self::validateUpdateRequest();\n if ($data != null) {\n $project = self::getProjectById($data['id']);\n $project->update($data);\n $project->save();\n $project->updateCategory($data['categories']);\n redirect(url(['_page' => 'project_detail', 'project_id' => $data['id']]));\n }\n }", "function isValidUpdate($user, $id)\n{\n return isValidInsert($user) && is_numeric($id) && $id > 0;\n}", "public function update($entity);", "public function update($entity);", "public function testUpdateValidUser() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"user\");\n\n\t\t// create a new user and insert to into mySQL\n\t\t$user = new User(null, $this->VALID_SALT, $this->VALID_HASH, $this->VALID_EMAIL, $this->VALID_NAME);\n\t\t$user->insert($this->getPDO());\n\n\t\t// edit the user and update it in mySQL\n\t\t$user->setHash($this->VALID_HASH);\n\t\t$user->update($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoUser = User::getUserByUserId($this->getPDO(), $user->getUserId());\n\t\t$this->assertSame($numRows + 1, $this->getConnection()->getRowCount(\"user\"));\n\t\t$this->assertLessThan($pdoUser->getUserId(), 0);\n\t\t$this->assertSame($pdoUser->getSalt(), $this->VALID_SALT);\n\t\t$this->assertSame($pdoUser->getHash(), $this->VALID_HASH);\n\t\t$this->assertSame($pdoUser->getEmail(), $this->VALID_EMAIL);\n\t\t$this->assertSame($pdoUser->getName(), $this->VALID_NAME);\n\t}", "protected function performPreUpdateCallback()\n {\n // echo 'updating a record ...';\n $this->validate();\n \n return true;\n }", "public function beforeValidation() {\n\t\t$this->modified = new RawValue('now()');\n\t}", "public function update() {\n if (!$this->id) {\n //echo \"No se tiene referencia al ID del objeto a actulizar.\";\n throw new Exception(\"No se tiene referencia al ID del objeto a actulizar.\");\n }\n\n $sql = \"UPDATE contratos SET numero_contrato=:numero_contrato, objeto_contrato=:objeto_contrato, presupuesto=:presupuesto, fecha_estimada_finalizacion=:fecha_estimada_finalizacion WHERE id=:id\";\n $args = array(\n \":id\" => $this->id,\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n return !$stmt ? false : true;\n }", "function validateupdate(){\n\t\tglobal $_REQUEST;\t\t\n\t\t\n\t\tif(!empty($this->errors)){\n\t\t\t$result = false;\n\t\t}else{\n\t\t\t$result = true;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function update($instance, $validatedData)\n {\n }", "public function validate() {\n $stmt = $this->pdo->prepare('update user set valid = true where id = :id');\n $stmt->bindValue(':id', $this->id);\n if ($stmt->execute() == 1) {\n $this->valid = true;\n }\n return $this->valid;\n }", "public function update() {\r\n try {\r\n $type = get_object_vars($this->model);\r\n\r\n foreach ($type as $key => $value) {\r\n if (in_array($key, $this->validColumns)) {\r\n if(is_bool($value)) {\r\n $value = (int)$value;\r\n }\r\n $data[$key] = $value;\r\n }\r\n }\r\n\r\n $this->db->update(\"assets_permissions\", $data, $this->db->quoteInto(\"id = ?\", $this->model->getId()));\r\n }\r\n catch (Exception $e) {\r\n throw $e;\r\n }\r\n }", "protected function performUpdate() {}", "public function validate(): void\n {\n $errors = $this->getErrors();\n $this->throwExceptionIfErrors($errors);\n }", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "public function updateRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getEditRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// update\n\t\t\t\t$this->getHandler()->update($record);\n\n\n\t\t\t\t$msg = new Message('You have successful edit a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "abstract protected function isSyncRequired($entity);", "public function checkIsSaved()\n {\n if (isset($this->owner->primaryKey) == false) {\n throw new ModelIsUnsaved();\n }\n }", "public static function validateUpdate($data) {\n\t\t$v = parent::getValidationObject($data);\n\n\t\t//Set rules\n\t\t$v->rule('optional', 'name')\n\t\t ->rule('lengthMin', 'name', 1)->message(__('Name size is too small!'))\n\t\t ->rule('relationData', 'property', 'int')->message(__('Incorrect data format for category properties!'));\n\n\t\t//Validate\n\t\treturn parent::validate($v, self::$__validationErrors);\n\t}", "public function testInvalidUpdate()\n {\n $manager = $this->getModelManager();\n\n // Get the first tutor\n $tutor = $manager->findById(1);\n\n /** @var TutorLanguage $tutorLanguage */\n $tutorLanguage = $tutor->getTutorLanguages()->first();\n\n $response = $this->performMockedUpdate($tutor, $tutorLanguage, 'tutor-language-banana');\n\n $this->assertBadRequestJsonResponse($response);\n }", "public function testUpdateUnauthorized()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $newModel = $this->makeFactory();\n\n $this->json('PUT', static::ROUTE . '/' . $model->id, $newModel->toArray(), [])\n ->seeStatusCode(JsonResponse::HTTP_UNAUTHORIZED);\n }", "public function testUpdateDocumentValueFailed()\n {\n $eavDocument = $this->getEavDocumentRepo()->findOneBy(['path' => 'some/path/to/bucket/document1.pdf']);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n $this->assertTrue($eavDocument->hasValue('customerId'));\n\n $eavDocument->setValue('customerId', '6789');\n $this->em->persist($eavDocument);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavDocument->getLastViolations();\n\n $this->assertCount(1, $violations);\n $this->assertContains('customerId', (string) $violations);\n }", "public function test_if_failed_update()\n {\n }", "private function Update() {\n $Update = new Update;\n $Update->ExeUpdate(self::Entity, $this->Data, \"WHERE id = :id\", \"id={$this->Post}\");\n if ($Update->getResult()):\n $this->Error = [\"As informações de <b>contato</b> foram atualizadas com sucesso!\", WS_ACCEPT];\n $this->Result = true;\n endif;\n }", "public function validateForUpdate(CarismaRequest $request)\n {\n return Validator::make(\n $request->all(),\n $this->updateFields($request)->mapWithKeys(function ($field) use ($request) {\n return $field->getUpdateRules($request);\n })->all()\n )->after(function ($validator) use ($request) {\n $this->afterValidation($request, $validator);\n $this->afterValidationOnUpdate($request, $validator);\n })->validate();\n }", "function validate() {\n\t\t// execute the column validation \n\t\tparent::validate();\n\t\t\n\t\t// connection\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM company WHERE name = '\".$this->getName().\"' AND id <> '\".$this->getID().\"'\";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage(\"result is \".$result);\n\t\tif(!isEmptyString($result)){ \n\t\t\t$this->getErrorStack()->add(\"unique.name\", \"The name \".$this->getName().\" already exists. Please specify another.\");\n\t\t}\n\t}", "public function testHandleUpdateValidationError()\n {\n // Populate data\n $this->_populate();\n \n // Request\n $response = $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/edit', $this->customDealerAccountData, [], [], ['HTTP_REFERER' => '/dealer-account/edit']);\n \n // Verify\n $this->assertRedirectedTo('/dealer-account/edit');\n $this->assertSessionHasErrors();\n }", "public function beforeSave()\n {\n $this->setParams([\n 'url' => $this->getValue(),\n 'apiKey' => $this->getFieldsetDataValue('api_key'),\n 'version' => $this->getFieldsetDataValue('api_version')\n ]);\n\n if (!$this->isUrl($this->getValue())) {\n throw new \\Magento\\Framework\\Exception\\ValidatorException(__('Invalid CRM url'));\n }\n\n if (!$this->isHttps($this->getValue())) {\n $this->schemeEdit($this->getValue());\n }\n\n if ($this->validateApiUrl($this->api)) {\n $this->setValue($this->getValue());\n }\n\n parent::beforeSave();\n }", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public static function validateUpdateRequest() {\n $errors = array();\n $data = array();\n self::checkID($errors, $data);\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "function _update($entity)\n {\n $key = $this->object->get_primary_key_column();\n return $this->object->_wpdb()->update($this->object->get_table_name(), $this->object->_convert_to_table_data($entity), array($key => $entity->{$key}));\n }", "private function _update(){\n\t\tif($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){\n\t\t\t$this->read();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function update(AbstractEntity $entity)\n\t{\n\t\tif(!$this->isValidEntity($entity))\n\t\t{\n\t\t\tthrow new \\Exception('The specified entity ('. get_class($entity) .') is not allowed for this mapper ('. get_called_class() .')');\n\t\t}\n\t\t\n\t\t$aData = $this->filterOnlyAcceptedFields($entity->toArray());\n\t\tunset($aData['id']);\n\t\t\n\t\tif(empty($aData))\n\t\t{\n\t\t\tthrow new \\Exception('No fields to update. Data array is empty.');\n\t\t}\n\t\t\n\t\t$aCriterias['id'][] = array(\n\t\t\t'operator'\t=> '=',\n\t\t\t'value'\t\t=> $entity->id\n\t\t);\n\t\t\n\t\t$aTableSource = array_merge($this->_acceptedFields, $this->_cascadeFields);\n\t\t\n\t\t$aTables\t= $this->extractTables($aTableSource);\n\t\t$aData\t\t= $this->filterOnlyAcceptedFields($entity->toArray());\t\t\n\t\t$sWhere\t\t= $this->compileClauseStrings(array(\n\t\t\t\t\t\t\t$this->getClauseStrings($aCriterias),\n\t\t\t\t\t\t\t$this->compileClauseStrings($this->_cascadeFields)\n\t\t\t\t\t));\n\t\t\n\t\treturn $this->_adapter->update($aTables, $aData, $sWhere);\n\t}", "public function preSave($with_validation) {}", "public function update(UpdateCauseRequest $request, Cause $entity)\n {\n $entity->loadMissing('ong');\n $entity->fill($request->validated());\n\n $onValidate = function () use ($entity) {\n $entity->save();\n\n return $entity;\n };\n\n if ($entity->ong->userId === $request->user()->id)\n return $onValidate();\n\n if ($request->user()->isAdmin())\n return $onValidate();\n\n abort(403, 'Você não tem permissão para atualizar as informações dessa ONG.');\n }", "public function update()\n {\n $this->crud->setRequest($this->crud->validateRequest());\n $this->crud->unsetValidation(); // validation has already been run\n\n return $this->traitUpdate();\n }", "public function testNothingModified()\n {\n $check = $this->_cs->checkEntitiesChanged(rand(0, 9999), array(self::ENTITY_NAME));\n $this->assertTrue($check);\n }", "public function testIsValidSuccessWithoutInvokedSetter()\n {\n $validator = new \\Magento\\Framework\\Validator\\Entity\\Properties();\n $this->assertTrue($validator->isValid($this->_object));\n }", "function update(IContract $entity);" ]
[ "0.69616675", "0.6871938", "0.6807692", "0.6670377", "0.665699", "0.66455835", "0.66057485", "0.64774096", "0.6444995", "0.6410272", "0.636906", "0.63444626", "0.62870777", "0.61815745", "0.60987216", "0.60747606", "0.6072038", "0.60380614", "0.6010651", "0.5940964", "0.58820885", "0.58583707", "0.5857463", "0.58222973", "0.5813678", "0.58039314", "0.57921076", "0.5763486", "0.5762443", "0.57486093", "0.5747612", "0.5715586", "0.5705109", "0.57037544", "0.56985915", "0.5691113", "0.56864834", "0.56846946", "0.5659345", "0.5654231", "0.5646404", "0.56434476", "0.5635559", "0.56315404", "0.56202966", "0.5618122", "0.561322", "0.56009346", "0.5599229", "0.558822", "0.55698925", "0.55667824", "0.5560688", "0.5560421", "0.55542487", "0.5551836", "0.5542005", "0.55305684", "0.552453", "0.55217147", "0.5514054", "0.55109763", "0.55014485", "0.5499235", "0.5499235", "0.5497146", "0.5496674", "0.5496488", "0.549434", "0.549418", "0.54874665", "0.54780495", "0.5475212", "0.54634637", "0.54591095", "0.5450288", "0.5439829", "0.5422177", "0.5422061", "0.54133576", "0.5410937", "0.54011625", "0.5393037", "0.5391533", "0.5390217", "0.53870344", "0.5377704", "0.5368825", "0.5365065", "0.536365", "0.5359075", "0.53509814", "0.53490597", "0.53427666", "0.53283226", "0.53122455", "0.53085214", "0.53054094", "0.52814436", "0.5281364" ]
0.62281203
13
Validates entity before DELETE operation.
public function preRemove(LifecycleEventArgs $args) { $this->validator->validateWithException($args->getEntity()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function validateDeletedEntity(EntityInterface $entity): void\n {\n try {\n static::controllerForEntityLoad()->load($entity->id());\n } catch (ApiRequestException $e) {\n Assert::assertContains('does not exist', $e->getMessage(), $e->getMessage());\n }\n }", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function isDeleteGranted($entity): bool;", "public function beforeDelete(&$id, Entity $entity) { }", "protected function beforeDelete()\n {\n }", "public function delete($entity) : bool;", "protected function _preDelete() {}", "public function onBeforeDelete();", "public function preDelete() { }", "function beforeDelete() {\n\t\t\treturn $this->_deletable($this->_Model->id);\n\t\t}", "public function delete($entity)\n {\n \n }", "public function preDelete(LifecycleEventArgs $args)\n {\n $constraintViolationList = $this->validator->validate($args->getEntity());\n\n if ($constraintViolationList->count() > 0) {\n throw new ValidatorException(\n (string)$constraintViolationList\n );\n }\n }", "private function tinydb_check_deleted()\n {\n if ($this->tinydb_is_deleted) {\n throw new \\TinyDb\\NoRecordException('Object was deleted.');\n }\n }", "public function delete() {\n if(!isset($this->id)) {\n $error = 'We need an id to delete an object with this method, if you don\\'t have any, use the static remove instead';\n $line = \"delete(\".$propname.\") => \" . $error;\n $this->writeErrorLog($line);\n throw new \\Exception($error);\n } else {\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n $qb = $this::remove();\n $qb->where(['id' => $this->id])->make();\n return true;\n }\n }", "public function validateDelete(ValidationHook $hook)\n {\n return;\n }", "public function delete(DataObject $entity){\n }", "public function delete($entity);", "public function beforeDelete() {\n\t\tif (parent::beforeDelete() && $this->hasAttribute('status')) {\n\t\t\t$this->status = self::STATUS_DELETED;\n\t\t\t$this->save(false);\n\t\t\treturn false; // Prevent actual DELETE query from being run\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function _postDelete() {}", "protected function _postDelete() {}", "abstract public function shouldIDelete();", "public function destroy(Request $request, Ong $entity)\n {\n $onValidate = function () use ($entity) {\n $entity->delete();\n\n return response()->noContent();\n };\n\n if ($entity->userId === $request->user()->id)\n return $onValidate();\n\n if ($request->user()->isAdmin())\n return $onValidate();\n\n abort(403, 'Você não tem permissão para remover essa ONG.');\n }", "public function Delete($entity) {\n }", "protected function _predelete() {\n }", "public function deleteUserValidator() {\n return Validator::make($this->request->all(), [\n 'user_id' => 'required|integer'\n ]);\n }", "public function delete($entity){ \n //TODO: Implement remove record.\n }", "private static function validateDelete(\\Scrivo\\Context $context, $id) {\n\t\t$context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function beforeDelete(){\r\n //Ok he has the right to do that - remove all the ACL-objects associated with this object\r\n $class = Strategy::getClass('Aro');\r\n $aro = $class::model()->find('model = :model AND foreign_key = :key', array(':model' => get_class( $this), ':key' => $this->getPrimaryKey()));\r\n \r\n if(!$aro)\r\n throw new RuntimeException('No associated Aro-Collection!');\r\n \r\n $transaction = Yii::app()->db->beginTransaction();\r\n try{\r\n $suc =$aro->delete()&& parent::beforeDelete();\r\n $transaction->commit();\r\n return $suc;\r\n }\r\n catch(Exception $e){\r\n $transaction->rollback();\r\n throw $e;\r\n }\r\n }", "function before_delete() {}", "function beforeDelete(&$model, $cascade = true) {\n $response = assetDelete($model);\n \n if (is_array($response) && $response['status'] != true) {\n $this->_setError($model, $response['message'], $response['type']);\n return false;\n }\n \n return true;\n }", "public function isDeleteResource();", "function delete(IContract $entity);", "public function testDeleteUnauthorized()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [])\n ->seeStatusCode(JsonResponse::HTTP_UNAUTHORIZED);\n }", "protected function beforeDelete()\n { \n return parent::beforeDelete();\n }", "public function preRemove($entity);", "public function delete()\n {\n $this->_validateModifiable();\n\n $this->_getDataSource()->delete($this);\n }", "public function testValidDelete() {\n\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//perform the actual delete\n\t\t$response = $this->guzzle->delete('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(),\n\t\t\t\t['headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t// grab the data from guzzle and enforce that the status codes are correct\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//try retrieving entry from database and ensuring it was deleted\n\t\t$deletedOrg = Organization::getOrganizationByOrgId($this->getPDO(), $organization->getOrgId());\n\t\t$this->assertNull($deletedOrg);\n\n\t}", "public function beforeDelete(EventInterface $event, EntityInterface $entity): void\n {\n $config = $this->getConfig();\n $this->_ensureFields($entity);\n $left = $entity->get($config['left']);\n $right = $entity->get($config['right']);\n $diff = (int)($right - $left + 1);\n\n if ($diff > 2) {\n if ($this->getConfig('cascadeCallbacks')) {\n $query = $this->_scope($this->_table->query())\n ->where(\n fn (QueryExpression $exp) => $exp\n ->gte($config['leftField'], $left + 1)\n ->lte($config['leftField'], $right - 1)\n );\n\n $entities = $query->toArray();\n foreach ($entities as $entityToDelete) {\n $this->_table->delete($entityToDelete, ['atomic' => false]);\n }\n } else {\n $this->_scope($this->_table->deleteQuery())\n ->where(\n fn (QueryExpression $exp) => $exp\n ->gte($config['leftField'], $left + 1)\n ->lte($config['leftField'], $right - 1)\n )\n ->execute();\n }\n }\n\n $this->_sync($diff, '-', \"> {$right}\");\n }", "protected function preDelete() {\n\t\treturn true;\n\t}", "public function delete(IndexableEntity $entity);", "public function beforeDelete($event){\r\n $owner = $this->getOwner();\r\n //Ok he has the right to do that - remove all the ACL-objects associated with this object\r\n $class = Strategy::getClass('Aro');\r\n $aro = $class::model()->find('model = :model AND foreign_key = :key', array(':model' => get_class($owner), ':key' => $owner->getPrimaryKey()));\r\n \r\n if(!$aro)\r\n throw new RuntimeException('No associated Aro-Collection!');\r\n \r\n $transaction = Yii::app()->db->beginTransaction();\r\n try{\r\n $suc =$aro->delete()&& parent::beforeDelete($event);\r\n $transaction->commit();\r\n return $suc;\r\n }\r\n catch(Exception $e){\r\n $transaction->rollback();\r\n throw $e;\r\n }\r\n \r\n return parent::beforeDelete($event);\r\n \r\n }", "protected function performDeleteOnModel()\n {\n $this->getApi()->{'delete'.ucfirst($this->getEntity())}(\n $this->{$this->primaryKey},\n array_merge(...array_values($this->getGlobalScopes()))\n );\n\n $this->exists = false;\n }", "public function isDeleted() {}", "public function isDeleted() {}", "abstract function allowDeleteAction();", "protected function _before_delete(): void\n {\n //this will try to delete all the content records to which it has access\n //if there are remaining content records the deletion of the Page will fail due to the Foreign Key contraint restrict\n $contents = PageContent::get_by( ['page_id' => $this->page_id] );\n foreach ($contents as $PageContent) {\n $PageContent->delete();\n }\n }", "public function validateMultiDelete()\n {\n return true;\n }", "public function delete( UserEntityInterface $user ): bool;", "public function deleteObject($entity)\n {\n try {\n return (bool) $entity->delete();\n } catch (\\Exception $ex) {\n Yii::$app->getErrorHandler()->logException($ex);\n\n return false;\n }\n }", "public function processDelete()\n {\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set initial configuration\n $Model->build($this->Model->getTable());\n // Delete record\n if ($this->getIsTransaction()) {\n $result = DB::transaction(function ($db) use ($Model) {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n });\n } else {\n $result = $Model->delete();\n // Hook Action deleteAfterDelete\n $this->doHooks(\"deleteAfterDelete\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.delete.success'));\n // Hook Filter deleteModifyResponse\n $Response = $this->doFilter(\"deleteModifyResponse\", $Response);\n $this->redirect($Response);\n }", "public function authorizedToDelete(Request $request)\n {\n return false;\n }", "protected function validateDelete() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canDeleteUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups(array_keys($this->objects));\r\n\t}", "public function isDeleted();", "public function isDeleted();", "public function testDocumentIntegrityAfterManualValueDeletion()\n {\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => '123']);\n $this->em->remove($eavValue);\n\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => 'customer_invoice']);\n $this->em->remove($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(2, $violations);\n $this->assertContains('customerId', (string) $violations);\n $this->assertContains('customerDocumentType', (string) $violations);\n }", "public function testValidateAndDelete() {\r\n\t\ttry {\r\n\t\t\t$postData = array();\r\n\t\t\t$this->ShopProductAttribute->validateAndDelete('invalidShopProductAttributeId', $postData);\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'Invalid Shop Product Attribute');\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t$postData = array(\r\n\t\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t\t'confirm' => 0));\r\n\t\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$this->assertEqual($e->getMessage(), 'You need to confirm to delete this Shop Product Attribute');\r\n\t\t}\r\n\r\n\t\t$postData = array(\r\n\t\t\t'ShopProductAttribute' => array(\r\n\t\t\t\t'confirm' => 1));\r\n\t\t$result = $this->ShopProductAttribute->validateAndDelete('shopproductattribute-1', $postData);\r\n\t\t$this->assertTrue($result);\r\n\t}", "protected function beforeDelete()\n {\n $this->idInitializationCheck(true);\n return true;\n }", "protected function preDelete( ModelInterface &$model ) {\n }", "public function isDelete();", "protected function handle_delete_item_validate($Item, $args)\n {\n /*\n * Return TRUE to allow delete\n * Return array of errors when stopping delete action\n */\n return array();\n }", "public function onBeforeDelete()\n {\n // after deleting the code it's not validatable anymore, simply here for cleanup\n if ($this->TicketQRCode()->exists()) {\n $this->TicketQRCode()->delete();\n }\n\n parent::onBeforeDelete();\n }", "public function beforeDelete()\r\n\t{\r\n\t\tself::deleteByParentId($this->id);\r\n\r\n\t\treturn TRUE;\r\n\t}", "protected function _beforeDelete()\n {\n $this->_protectFromNonAdmin();\n $this->cleanCache();\n\n return parent::_beforeDelete();\n }", "public function delete()\n {\n try {\n parent::delete(null, $this->data['id']);\n } catch (Exception $e) {\n die('ERROR');\n }\n }", "public function deleteEntity($entity): void\n {\n /** @var EntityRepository $repository */\n $repository = Prime::repository($entity);\n $mapper = $repository->mapper();\n\n $isReadOnly = $mapper->isReadOnly();\n $mapper->setReadOnly(false);\n\n $repository->disableEventNotifier();\n $repository->delete($entity);\n $repository->enableEventNotifier();\n\n $mapper->setReadOnly($isReadOnly);\n }", "public function testDeleteSingleSuccess()\n {\n $entity = $this->findOneEntity();\n\n // Delete Entity\n $this->getClient(true)->request('DELETE', $this->getBaseUrl() . '/' . $entity->getId(),\n [], [], ['Authorization' => 'Bearer ' . $this->adminToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->adminToken]);\n $this->assertEquals(StatusCodesHelper::SUCCESSFUL_CODE, $this->getClient()->getResponse()->getStatusCode());\n }", "public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }", "abstract public function delete(Request $request);", "public function forceDelete()\n {\n //\n }", "public function action_delete_delete(){\r\n\t\t\t//permission check\r\n\t\t\tif(!$this->user->can('Assumeownership', array('owner' => $this->user->id))){\r\n\t\t\t\t$this->throw_permission_error(Constant::NOT_OWNER);\r\n\t\t\t}\r\n\r\n\t\t\tif(!isset($this->myID) || !isset($this->myID2))\r\n\t\t\t{\r\n\t\t\t\t$error_array = array(\r\n\t\t\t\t\t\"error\" => \"Required Parameters Missing\",\r\n\t\t\t\t\t\"desc\" => \"Required Parameters Missing.\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$this->modelNotSetError($error_array);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$subject = Ent::eFact($this->myID, $this->myID2);\r\n\t\t\t$subject->delete_with_deps();\r\n\t\t\treturn $subject->getBasics();\r\n\t\t}", "public function delete(EntityInterface $Entity);", "public function forceDeleting(POSPoint $pos_point)\n\t{\n\t\tif ($pos_point->invoices()->count()) throw ValidationException::withMessages(['id' => 'immutable:HAS_INVOICES']);\n\n\t\t/*---------- Cannot delete if has products ----------*/\n\t\tif ($pos_point->products()->count()) throw ValidationException::withMessages(['id' => 'immutable:HAS_PRODUCTS']);\n\t\t\n\t}", "public function postRemove($entity);", "public function delete(DimeEntityInterface $entity);", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "public function validateSoftDeletes(EntityDefinition $entityMetadata)\n {\n $columnNames = [];\n\n // get column names\n foreach ($entityMetadata['table']['columns'] as $column) {\n $columnNames[] = $column['name'];\n }\n\n // get version column names\n if (! empty($entityMetadata['versionTable'])) {\n foreach ($entityMetadata['versionTable']['columns'] as $column) {\n $columnNames[] = $column['name'];\n }\n }\n\n if (! in_array('deleted_at', $columnNames)) {\n throw new DomainException('@SoftDeletes annotation defined in class ' . $entityMetadata['class'] . ' requires a $deletedAt column property.');\n }\n }", "protected function onDeleting()\n {\n return true;\n }", "protected function beforeDelete()\n\t{\n\t\tif(parent::beforeDelete()){\n\t\t\t$avaiable = $this->chkAvaiableDelete($this->id);\n\t\t\tif($avaiable!=''){\n\t\t\t\techo $avaiable;\n\t\t\t\treturn false;\n\t\t\t}else\n\t\t\t\treturn true;\n\t\t}else \n\t\t\treturn false;\n\t}", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "public function onDelete(): void\n {\n if ($this->globals->getUpdated() !== (int) $_GET['id']) {\n $this->_entity->delete($_GET['id']);\n $this->globals->setUpdated($_GET['id']);\n $this->globals->unsetAlert();\n }\n }", "public function delete() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['delete']) && !empty($_POST['delete'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->delete(explode(\"/\", $this->_url)[1])) {\n echo \"error\";\n } else {\n echo \"good\";\n }\n }\n }\n }", "public function delete($entity) {\n $this->deleteRecord([\n 'id' => $entity->getId(),\n ]);\n }", "public function onBeforeDelete() {\r\n\t\tparent::onBeforeDelete();\r\n\t}", "private function _delete()\n {\n if (!$this->isLoaded()) {\n return false;\n }\n\n $className = get_called_class();\n $db = self::getDb();\n $useValue = self::sModifyStr($this->getPrimaryValue(), 'formatToQuery');\n $db->query(\"delete from \" . self::structGet('tableName') . \" where \" . self::structGet('primaryKey') . \" = {$useValue}\",\n \"{$className}->_delete()\");\n if ($db->error()) {\n return false;\n }\n\n if (self::structGet('cbAuditing')) {\n $cbAuditing = self::structGet('cbAuditing');\n if (is_array($cbAuditing)) {\n call_user_func($cbAuditing, $this, $this->getPrimaryValue(), 'delete', false);\n } else {\n $cbAuditing($this, $this->getPrimaryValue(), 'delete', false);\n }\n }\n\n // Vamos processar eventListener:delete\n self::_handleEventListeners('delete', $this, $this->getPrimaryValue(), false);\n\n // Vamos marcar o objeto como !loaded\n $this->setLoaded(false);\n\n // Vamos processar eventListener:afterDelete\n self::_handleEventListeners('afterDelete', $this, $this->getPrimaryValue(), false);\n\n return true;\n }", "public function deleteRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getDeleteRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// delete\n\t\t\t\t$this->getHandler()->delete($record);\n\n\n\t\t\t\t$msg = new Message('You have successful delete a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function testValidateAndDelete() {\n\t\ttry {\n\t\t\t$postData = array();\n\t\t\t$this->CreditNote->validateAndDelete('invalidCreditNoteId', $postData);\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->assertEqual($e->getMessage(), 'Invalid Credit Note');\n\t\t}\n\t\ttry {\n\t\t\t$postData = array(\n\t\t\t\t'CreditNote' => array(\n\t\t\t\t\t'confirm' => 0));\n\t\t\t$result = $this->CreditNote->validateAndDelete('creditnote-1', $postData);\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertEqual($e->getMessage(), 'You need to confirm to delete this Credit Note');\n\t\t}\n\n\t\t$postData = array(\n\t\t\t'CreditNote' => array(\n\t\t\t\t'confirm' => 1));\n\t\t$result = $this->CreditNote->validateAndDelete('creditnote-1', $postData);\n\t\t$this->assertTrue($result);\n\t}", "public function executeDelete()\n {\n $valid = $this->hasRequiredParameters($this->requiredParams);\n if ($valid instanceof Frapi_Error) {\n return $valid;\n }\n \n return $this->toArray();\n }", "public function beforeDelete() {\n // Check foreign table treatment_schedules\n $treatmentSchedules = TreatmentSchedules::model()->findByAttributes(array('doctor_id' => $this->id));\n if (count($treatmentSchedules) > 0) {\n return false;\n }\n // Handle Agent relation\n OneMany::deleteAllManyOldRecords($this->id, OneMany::TYPE_AGENT_USER);\n // Handle Social network relation\n SocialNetworks::deleteAllOldRecord($this->id, SocialNetworks::TYPE_USER);\n\n return parent::beforeDelete();\n }", "public function validate($entity)\n {\n }", "public function deleteEntity($entity)\n {\n return $this->model->destroy($entity->id);\n\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/transaction/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Transaction', 'transactionId', self::$objectId);\n }", "public function delete()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n $entity->delete();\n }\n }\n );\n }", "public function deleting(POSPoint $pos_point)\n\t{\n\t\tif ($pos_point->invoices()->count()) throw ValidationException::withMessages(['id' => 'immutable:HAS_INVOICES']);\n\n\t\t/*---------- Cannot delete if has products ----------*/\n\t\tif ($pos_point->products()->count()) throw ValidationException::withMessages(['id' => 'immutable:HAS_PRODUCTS']);\n\t\t\n\t}", "public function afterDelete(&$id, Entity $entity) { }", "public function validateDelete(array $input)\n {\n $this->checkProfileExists($input['id']);\n }", "public function delete(EntityInterface $entity, array $options = []): bool;", "public function delete(string $entityId): void;", "public function forceDelete();", "public function beforeDelete($event=null) {\n if ($this->_ignoreEvent)\n return true;\n else\n throw new CDbException(Yii::t('yiiext', 'You should not use CActiveRecord::delete() method when NestedSetBehavior attached.'));\n }", "public function destroy(Request $request, Cause $entity)\n {\n $entity->loadMissing('ong');\n $onValidate = function () use ($entity) {\n $entity->delete();\n\n return response()->noContent();\n };\n\n if ($entity->ong->userId === $request->user()->id)\n return $onValidate();\n\n if ($request->user()->isAdmin())\n return $onValidate();\n\n abort(403, 'Você não tem permissão para remover essa causa.');\n }" ]
[ "0.72106874", "0.71529263", "0.6797856", "0.6783865", "0.67443395", "0.66284895", "0.6615344", "0.6598", "0.6573656", "0.6419454", "0.6401939", "0.6377258", "0.6355486", "0.63380754", "0.63222253", "0.6321536", "0.6318649", "0.6290464", "0.62729245", "0.62716055", "0.62711555", "0.6213545", "0.61965144", "0.61859137", "0.6164462", "0.616246", "0.61281574", "0.61137766", "0.61130154", "0.6082048", "0.6079412", "0.6063402", "0.6038415", "0.6034267", "0.6023173", "0.601947", "0.60173255", "0.5986634", "0.5981797", "0.5978267", "0.5963222", "0.5962566", "0.595441", "0.5953613", "0.5937437", "0.5911352", "0.590591", "0.5904157", "0.5902232", "0.5895415", "0.5878995", "0.5876056", "0.58756167", "0.58756167", "0.5875182", "0.58715737", "0.5869863", "0.5868437", "0.5862541", "0.5860583", "0.5848377", "0.58362645", "0.5827338", "0.58217466", "0.5814991", "0.58116746", "0.5805237", "0.5799251", "0.5790873", "0.5784421", "0.5777399", "0.5777017", "0.5776594", "0.57675606", "0.57612276", "0.5760131", "0.5757631", "0.5755545", "0.5754243", "0.5750734", "0.5748048", "0.5736509", "0.57315284", "0.5731058", "0.5729388", "0.57280046", "0.5726603", "0.5718741", "0.5717594", "0.57162744", "0.57129586", "0.5712799", "0.5711041", "0.57047725", "0.5703752", "0.57014257", "0.5695914", "0.5694531", "0.5690309", "0.5687426" ]
0.598483
38
Display a listing of the resource.
public function index() { return Anime::with('image')->paginate(20); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Display the specified resource.
public function show(Anime $anime) { return $anime->load(['image']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Anime $anime) { $anime->delete(); return response('', 204); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Run the database seeds.
public function run() { $faker = Faker\Factory::create(); $plainPw = 'password'; $hashedPw = hash('sha256', $plainPw); $dbHashedPw = Hash::make($hashedPw); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'DKessler', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Delilah', 'last_name' => 'Kessler', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'EKing', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Elian', 'last_name' => 'King', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'MDooley', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Maud', 'last_name' => 'Dooley', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'JRunolfsdottir', 'password' => $dbHashedPw, 'title' => 'Miss', 'first_name' => 'Josiane', 'last_name' => 'Runolfsdottir', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'GHerman', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Gideon', 'last_name' => 'Herman', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'SWiegand', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Sheldon', 'last_name' => 'Wiegand', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'KLegros', 'password' => $dbHashedPw, 'title' => 'Miss', 'first_name' => 'Kaylin', 'last_name' => 'Legros', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'CRippin', 'password' => $dbHashedPw, 'title' => 'Miss', 'first_name' => 'Chaya', 'last_name' => 'Rippin', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'ARolfson', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Ardith', 'last_name' => 'Rolfson', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'ERobel', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Efren', 'last_name' => 'Robel', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'FLeffler', 'password' => $dbHashedPw, 'title' => 'Miss', 'first_name' => 'Felipa', 'last_name' => 'Leffler', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'VPagac', 'password' => $dbHashedPw, 'title' => 'Mr', 'first_name' => 'Vincent', 'last_name' => 'Pagac', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'EConsidine', 'password' => $dbHashedPw, 'title' => 'Miss', 'first_name' => 'Evelyn', 'last_name' => 'Considine', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'CEichmann', 'password' => $dbHashedPw, 'title' => 'Miss', 'first_name' => 'Charity', 'last_name' => 'Eichmann', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); DB::table('users')->insert([ 'email' => '[email protected]', 'username' => 'VKlocko', 'password' => $dbHashedPw, 'title' => 'Miss', 'first_name' => 'Vida', 'last_name' => 'Klocko', 'dob' => $faker->date, 'street' => $faker->streetAddress, 'city' => $faker->city, 'state' => $faker->state, 'country' => $faker->country ]); // $limit = 20; // // for ($i = 0; $i < $limit; $i++) { // DB::table('users')->insert([ // 'email' => $faker->email, // 'username' => str_random(5), // 'password' => str_random(10), // 'title' => 'Mr', // 'first_name' => $faker->firstName, // 'last_name' => $faker->lastName, // 'dob' => $faker->date, // 'street' => $faker->streetAddress, // 'city' => $faker->city, // 'state' => $faker->state, // 'country' => $faker->country // ]); // } // users for CeBIT // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'KEN GALLACHER', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'ROD SMITH', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'LYNWEN CONNICK', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'DUNCAN CHALLEN', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'ROCKY SCOPELLITI', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'JOHN DARDO', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'GILBERT VERDIAN', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'BRAD ROSSER', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'STEVE BAXTER', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'PETER STROHKORB', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'STUART CORNER', // 'password' => $dbHashedPw // ]); // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'toby', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'matthew', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'michael', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'sandon', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'cy', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'looyee', // 'password' => $dbHashedPw // ]); // // DB::table('users')->insert([ // 'email' => '[email protected]', // 'username' => 'blithe', // 'password' => $dbHashedPw // ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Tests the 'Back to site' link behaves with manage layout as admin page.
public function testBackToSiteLink() { $assert_session = $this->assertSession(); $page = $this->getSession()->getPage(); $this->drupalLogin($this->drupalCreateUser([ 'configure any layout', 'access administration pages', 'administer node display', 'administer node fields', 'access toolbar', ])); $field_ui_prefix = 'admin/structure/types/manage/bundle_with_section_field'; // From the manage display page, go to manage the layout. $this->drupalGet("$field_ui_prefix/display/default"); $this->submitForm(['layout[enabled]' => TRUE], 'Save'); $assert_session->linkExists('Manage layout'); $this->clickLink('Manage layout'); // Save the defaults. $page->pressButton('Save layout'); $assert_session->addressEquals("$field_ui_prefix/display/default"); // As the Layout Builder UI is typically displayed using the frontend theme, // it is not marked as an administrative page at the route level even though // it performs an administrative task, therefore, we need to verify that it // behaves as such, redirecting out of the admin section. // Clicking "Back to site" navigates to the homepage. $this->drupalGet("$field_ui_prefix/display/default/layout"); $this->clickLink('Back to site'); $assert_session->addressEquals("/user/2"); $this->drupalGet("$field_ui_prefix/display/default/layout/discard-changes"); $page->pressButton('Confirm'); $this->clickLink('Back to site'); $assert_session->addressEquals("/user/2"); $this->drupalGet("$field_ui_prefix/display/default/layout/disable"); $page->pressButton('Confirm'); $this->clickLink('Back to site'); $assert_session->addressEquals("/user/2"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function BackLink()\n {\n return BackendRouter::ModuleUrl(new Overview());\n }", "protected function BackLink()\n {\n return BackendRouter::ModuleUrl(new Overview());\n }", "public function testgoBackOneLevel()\n {\n\n // this link is available to users who are not authenticated\n $client = static::createClient();\n\n $client->followRedirects(true);\n $crawler = $client->request('GET', '/tag/2');\n $link= $crawler->selectLink('Back to the list')->link();;\n\n\n $this->assertEquals(\n\n $link->getUri(),'http://localhost/tag/');\n\n }", "public function goBackToHome()\n {\n if (Gate::allows('isContractor')) {\n abort(420, 'You Are not Allowed to access this site');\n }\n return view('welcome');\n }", "protected function _redirectBack()\n {\n $this->_helper->redirector->gotoUrl($this->_request->getServer('HTTP_REFERER'));\n }", "function cera_grimlock_after_site() {\n\t\tdo_action( 'grimlock_back_to_top_button' );\n\t}", "protected function renderBackButton() {}", "function orderdown() {\n\t\t\n\t\t$this->_order(1);\n\t\t\n\t\t$this->adminLink->makeURL();\n\t\t$this->app->redirect( $this->adminLink->url );\n\t\n\t}", "public function getBackUrl()\n {\n return $this->getUrl('*/*/index');\n }", "public function getBackUrl()\n {\n return $this->getUrl('*/*/index');\n }", "function fiorello_mikado_back_to_top_button() {\n\t\tif (fiorello_mikado_options()->getOptionValue('show_back_button') == 'yes') { ?>\n\t\t\t<a id='mkdf-back-to-top' href='#'>\n <span class=\"mkdf-icon-stack\">\n <?php fiorello_mikado_icon_collections()->getBackToTopIcon('font_awesome');?>\n <?php fiorello_mikado_icon_collections()->getBackToTopIcon('font_awesome');?>\n </span>\n\t\t\t</a>\n\t\t<?php }\n\t}", "public function mainscreen()\r\n\t{\r\n\t\t$this->setRedirect( 'index.php?option=com_jblesta&controller=default' );\r\n\t\t$this->redirect();\r\n\t}", "public function testHome() { \n $array = $this->adminController->home();\n\n $this->assertEquals('Admin Panel', $array['title']);\n }", "public function back();", "public function getBackLink(){\n $folder = $this->currentPage();\n \n return Controller::join_links(singleton('AssetAdmin')->Link('show'), $folder ? $folder->ID : 0);\n }", "function revert_site() {\n if ( MAIN_SITE != \"\" ) {\n restore_current_blog();\n }\n}", "function OnGoBack(){\n if (strlen($this->host_library_ID))\n $this->library_ID = $this->host_library_ID;\n\n if ($this->is_context_frame)\n\t\t\t$url = \"?package=context&page=contextframe&event=close\";\n\t\telse\n\t\t\t$url =\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&\" . $this->restore;\n\n $this->AfterSubmitRedirect($url);\n }", "static private function historyback()\n {\n echo '<script>window.history.back();</script>';\n }", "public function switchUserBack();", "public function paml_back_to_login() {\n\t\techo '<a href=\"#login\" class=\"modal-login-nav\">' . __( 'Login', 'pressapps' ) . '</a>';\n\t}", "public function previousAction()\n {\n $this->pageAction('goToPreviousPage');\n }", "public function testMenuLinkContentForm() {\n $this->drupalGet('admin/structure/menu/manage/admin/add');\n $option = $this->assertSession()->optionExists('edit-menu-parent', 'admin:');\n $this->assertTrue($option->isSelected());\n // Test that the field description is present.\n $this->assertSession()->pageTextContains('The location this menu link points to.');\n\n $this->submitForm([\n 'title[0][value]' => 'Front page',\n 'link[0][uri]' => '<front>',\n ], 'Save');\n $this->assertSession()->pageTextContains('The menu link has been saved.');\n }", "public function goHome()\n {\n $this->redirect(config('default_module').'/'.config('default_controller').'/'.config('default_action'));\n }", "function back() {\n if (!empty($_SERVER['HTTP_REFERER'])) {\n header('location: ' . $_SERVER['HTTP_REFERER']);\n exit;\n }\n}", "function orderdown()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$model = $this->getModel('weblink');\n\t\t$model->move(1);\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks');\n\t}", "function test_restrict_deletion_of_Home_page(){}", "function smarty_function_page_back($params, &$smarty)\n{\n\t$message_2196 = $smarty->get_template_vars(message_2196);\n\treturn '<a id=\"linkbacktop_back\" href=\"javascript:history.go(-1)\" title=\"' . $message_2196 . '\">' . $message_2196 . '</a>';\n}", "public function goHome()\n {\n $this->redirect(url($this->getHomeUrl()));\n }", "function orderup() {\n\t\t\n\t\t$this->_order(-1);\n\t\t\n\t\t$this->adminLink->makeURL();\n\t\t$this->app->redirect( $this->adminLink->url );\n\t\n\t}", "function back_link($width)\n\t{\n\t\tif(empty($_POST))\n\t\t\t$_SESSION['back_page'] = $_SERVER['HTTP_REFERER'];\n\t\t\t\n\t\t\techo '<table width=\"'.$width.'\" border=\"0\" align=\"center\"><tr><td align=\"right\" valign=\"middle\"><a href=\"'.$_SESSION['back_page'].'\" title=\"'.BACK_ICON_ALT.'\"><img border=\"0\" align=\"absmiddle\" src=\"'.BACK_ICON.'\" title=\"'.BACK_ICON_ALT.'\" alt=\"'.BACK_ICON_ALT.'\">Back</a></td></tr></table>';\n\t}", "public function homeAction()\n {\n return $this->redirect($this->generateUrl('system_tracking_homepage'), 301);\n }", "private function back(){\n \t$params = array(\n \t\t\t'page'=>intval(I('p')) ? intval(I('p')) : 1,\n \t\t\t'pagesize'=>$this->pagesize,\n \t\t\t'type'=>Status::AfterSaleBack,\n \t);\n \tif (session('distributor_id')) {\n \t\t$params['distributor_id'] = session('distributor_id');\n \t}\n \t$result = $this->afterSalesService()->getPagerList($params);\n \t$this->assign('back_list', $result['list']);\n }", "public function onBackForm()\n {\n // Load another page\n AdiantiCoreApplication::loadPage('MultiStepMultiFormView', 'onLoadFromSession');\n }", "function themes_button_back($url) {\n\tglobal $apps_path;\n\tif (function_exists('bindtextdomain')) {\n\t\tbindtextdomain('messages', $apps_path['plug'].'/language/');\n\t\tbind_textdomain_codeset('messages', 'UTF-8');\n\t\ttextdomain('messages');\n\t}\n\n\t$content = themes_button($url, _('Back'), 'button_back');\n\treturn $content;\n}", "protected function _goToOverview()\n {\n $this->_redirect($this->view->url(array(\n 'module' => 'user',\n 'controller' => 'roles',\n 'action' => 'index',\n ), 'admin', true));\n }", "public function goBack($defaultUrl = null)\n {\n if ($defaultUrl){\n $this->redirect($defaultUrl);\n }\n\n $backUrl = (array) session(config('user._back_url'));\n if (!empty($backUrl)){\n $index = count($backUrl);\n $this->success('正在恢复...',$backUrl[$index-1]);\n }\n\n $this->goHome();\n }", "public function actionHome(){\n\t\t\n\t\t$this->getContent('home');\n\t\t\n\t}", "public function redirectBack()\n {\n $httpReferer = $this->referer();\n $previousRoute = \\explode(\"?\", $httpReferer)[0];\n\n $this->redirect($previousRoute);\n }", "protected function _updateBackButtonLink($link)\n {\n $this->updateButton('back', 'onclick', 'setLocation(\\'' . $link . '\\')');\n }", "function switch_site() {\n // confirm whether this is the main site, if not switch over to it\n if ( MAIN_SITE != \"\" ) {\n switch_to_blog( MAIN_SITE );\n }\n}", "function orderup()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$model = $this->getModel('weblink');\n\t\t$model->move(-1);\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks');\n\t}", "function testNavigationWorkingProperly() {\n\t\t$this->get('http://www.ug.it.usyd.edu.au/~dbro8182/lnm/');\n\t\t$this->setField('username', 'admin');\n\t\t$this->setField('passwd', 'admin');\n\t\t$this->click('Submit');\n\t\t$this->click('Conflicts');\n\t\t$this->click('Home');\n\t\t$this->assertTitle('Administration :: Local Network Monitor');\n\t\t$this->click('Conflicts');\n\t\t$this->click('Registered Devices');\n\t\t$this->assertTitle('Registered Devices :: Local Network Monitor');\n\t\t$this->click('Conflicts');\n\t\t$this->click('Map');\n\t\t$this->assertText('Select a map to view');\n\t\t$this->click('Conflicts');\n\t\t$this->click('Unregistered Devices');\n\t\t$this->assertTitle('Unregistered Devices :: Local Network Monitor');\n\t}", "public function goBack()\n {\n return redirect()->back();\n }", "function back() {\n if (isset($_SERVER['HTTP_REFERER'])) {\n $back = $_SERVER['HTTP_REFERER'];\n $back = explode('?', $back);\n $back = '?' . $back[1];\n return $back;\n } else {\n return index_public;\n }\n}", "public function testRedirectAfterLogin()\n {\n $this->auth();\n\n // Should redirect to the first route in the config\n $response = $this->get('admin');\n $response->assertRedirect('admin/articles');\n\n }", "function single_product_back_button() {\n $url_path = $_SERVER['REQUEST_URI'];\n\n if ( strpos($url_path, 'diff-wizard') !== false ) {\n if ( ! session_id() ) {\n session_start();\n }\n $_SESSION['product-back-button-text'] = 'Return to Diff Wizard Results';\n $_SESSION['product-back-button-url'] = $url_path;\n } elseif( strpos($url_path, 'product-category') !== false || is_search() ) {\n if ( ! session_id() ) {\n session_start();\n }\n $_SESSION['product-back-button-text'] = 'Back to Product List';\n $_SESSION['product-back-button-url'] = $url_path;\n } elseif( strpos($url_path, 'product') === false) {\n if ( ! session_id() ) {\n session_start();\n }\n unset(\n $_SESSION['product-back-button-text'],\n $_SESSION['product-back-button-url']\n );\n }\n}", "function testShow() {\n $this->setMaximumRedirects(0);\n $this->get(WEBSITE_URL . '/' . $this->aRequest['controller']);\n $this->assertResponse(302);\n }", "public function testResetLinkWorking()\n {\n $client = static::createClient();\n $client->request(\"GET\", '/');\n $client->clickLink('Reset');\n\n $this->assertResponseRedirects('/');\n\n return null;\n }", "function bones_main_nav_fallback() {\n\twp_page_menu( 'show_home=Home&menu_class=menu' );\n}", "protected function _goBack()\n {\n\t $buy_now = $this->getRequest()->getParam('buy_now');\n\n\t $returnUrl = $this->getRequest()->getParam('return_url');\n if ($returnUrl) {\n\n if (!$this->_isUrlInternal($returnUrl)) {\n throw new Mage_Exception('External urls redirect to \"' . $returnUrl . '\" denied!');\n }\n\n $this->_getSession()->getMessages(true);\n\t $this->getResponse()->setRedirect($returnUrl);\n\n } elseif (!Mage::getStoreConfig('checkout/cart/redirect_to_cart')\n && !$this->getRequest()->getParam('in_cart')\n && $backUrl = $this->_getRefererUrl()\n ) {\n $referralUrl=Mage::getSingleton('core/session')->getCustomRefererUrl();\n if(!empty($referralUrl)){\n $backUrl = Mage::getSingleton('core/session')->getCustomRefererUrl();\n Mage::getSingleton('core/session')->unsCustomRefererUrl();\n }\n //$this->getResponse()->setRedirect($backUrl);\n\t if (!empty($buy_now)) {\n\t\t $this->_redirect('onestepcheckout'); // If you are using onepagecheckout or use this $this->_redirect('checkout/onepage/')\n\t }else{\n\t\t $this->getResponse()->setRedirect($backUrl);\n\t }\n } else {\n if ((strtolower($this->getRequest()->getActionName()) == 'add') && !$this->getRequest()->getParam('in_cart')) {\n $this->_getSession()->setContinueShoppingUrl($this->_getRefererUrl());\n }\n $this->_redirect('checkout/cart');\n }\n return $this;\n }", "function redirect_back_field()\n {\n return new HtmlString('<input type=\"hidden\" name=\"_redirect_back\" value=\"'.old('_redirect_back', back()->getTargetUrl()).'\">');\n }", "public function wpcd_team_backtolist_btn() {\n\t\t$screen = get_current_screen();\n\t\t$post_type = 'wpcd_team';\n\n\t\tif ( $screen->id === $post_type ) {\n\t\t\t$query = sprintf( 'edit.php?post_type=%s', $post_type );\n\t\t\t$backtolist_url = admin_url( $query );\n\t\t\t$backtolist_txt = __( 'Back To List', 'wpcd' );\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery(document).ready(function($){\n\t\t\t\t\t$('<a href=\"<?php echo esc_attr( $backtolist_url ); ?>\" class=\"page-title-action\"><?php echo esc_html( $backtolist_txt ); ?></a>').insertBefore('hr.wp-header-end');\t\t\t\t\t\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\t}", "public function index()\n {\n redirect(site_url('admin'));\n }", "public function testGetPreviousPage()\n {\n $this->assertContains(\n 'subfolder/subsubfolder/subsubpage',\n $this->manifest->getPreviousPage(\n DOCSVIEWER_PATH . '/tests/docs/en/test.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )->Link\n );\n\n // does not leak between entities\n $this->assertNull(\n $this->manifest->getPreviousPage(\n DOCSVIEWER_PATH . '/tests/docs/en/index.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )\n );\n\n // does not leak between entities\n $this->assertNull(\n $this->manifest->getPreviousPage(\n DOCSVIEWER_PATH . '\t/tests/docs/en/index.md',\n DOCSVIEWER_PATH . '/tests/docs/en/'\n )\n );\n }", "function freshTrackback ()\n{\n global $_CONF, $LANG_TRB;\n\n $retval = '';\n\n $freshurl = $_CONF['site_admin_url'] . '/trackback.php?mode=fresh';\n\n $retval .= COM_startBlock($LANG_TRB['trackback'], getHelpUrl(),\n COM_getBlockTemplate('_admin_block', 'header'));\n $retval .= sprintf ($LANG_TRB['trackback_note'], $freshurl);\n $retval .= COM_endBlock();\n\n return $retval;\n}", "public function testRedirectAfterLoginToExplicitlyDefinedUrl()\n {\n $this->auth();\n\n config()->set('decoy.site.post_login_redirect', '/admin/something');\n\n // Should redirect to the first route in the config\n $response = $this->get('admin');\n $response->assertRedirect('admin/something');\n\n }", "public function goBack($defaultUrl = null)\n {\n $url = $this->get('core.tracker')\n ->getPreviousUrl();\n\n if ($url === null) {\n $url = $defaultUrl;\n }\n\n $this->goRedirect($url);\n }", "public function testDeleteSite()\n {\n }", "public function fixHomeRedirect(){\n\n \t$check = $this->modx->getObject('modContextSetting',[\n 'key'=>'base_url',\n 'value:LIKE'=>'%'.$_GET[$this->modx->getOption('request_param_alias')].'%'\n ]);\n \n if($check){ //if new route is valid\n\n $siteStart = $this->modx->getObject('modContextSetting',[\n 'key' => 'site_start',\n 'context_key' => $check->get('context_key')\n ]);\n \n \n if($this->modx->getObject('modResource',$siteStart->get('value'))->get('published') == 1) \n $this->modx->sendRedirect($this->modx->makeUrl($siteStart->get('value')),['responseCode' => 'HTTP/1.1 301 Moved Permanently']);\n }\n }", "public function testHomeView()\n\t{\n\t\t$response = $this->call('GET', '/');\n\t\t$view = $response->original;\n\t\t\n\t\t$this->assertEquals('home.index', $view['name']);\n\t}", "function getBackLink ()\n\t{\n\t\t$page = basename( __FILE__ );\n\t\tif ( isset( $_GET['page'] ) && ! empty( $_GET['page'] ) ) {\n\t\t\t$page = preg_replace( '[^a-zA-Z0-9\\.\\_\\-]', '', $_GET['page'] );\n\t\t}\n\n\t\tif ( function_exists( \"admin_url\" ) )\n\t\t\treturn admin_url( basename( $_SERVER[\"PHP_SELF\"] ) ) . \"?page=\" . $page;\n\t\telse\n\t\t\treturn $_SERVER['PHP_SELF'] . \"?page=\" . $page;\n\t}", "public function getBackUrl()\n {\n return $this->getUrl('orderflow/import/index/type/'.strtolower($this->getImport()->getEntity()));\n }", "public function manageshops()\n\t{\n\t\tif( $this->uri->uri_string() == 'client/market/manageshops')\n\t\t\tshow_404();\n $this->load->view('client/agriculture');\n\t}", "public function controller_global(){\n\t\tparent::controller_global();\n\t\tunset($this->sub_links[\"index\"]);\n\t\tunset($this->sub_links[\"create\"]);\n\n\t}", "public function go_home(){\n\t wp_redirect( home_url() );\n\t exit();\n\t}", "public function testOpenTopPage()\n {\n $blog1 = Blog::factory()->has(Comment::factory()->count(1))->create();\n $blog2 = Blog::factory()->has(Comment::factory()->count(2))->create();\n $blog3 = Blog::factory()->has(Comment::factory()->count(3))->create();\n\n $this->get(route('blog.list'))\n ->assertOk()\n ->assertSee($blog1->title)->assertSee($blog1->user->name)->assertSee('1件')\n ->assertSee($blog2->title)->assertSee($blog2->user->name)->assertSee('2件')\n ->assertSee($blog3->title)->assertSee($blog3->user->name)->assertSee('3件')\n ->assertSeeInOrder([$blog3->title, $blog2->title, $blog1->title]);\n }", "public function getBackURL()\n {\n $request = $this->getRequest();\n if (!$request) {\n return null;\n }\n\n // Initialize a sane default (basically redirects to root admin URL).\n $controller = $this->getToplevelController();\n\n if (method_exists($this->requestHandler, \"Link\")) {\n $url = $this->requestHandler->Link();\n } else {\n $url = $controller->Link();\n }\n\n // Try to parse out a back URL using standard framework technique.\n if ($request->requestVar('BackURL')) {\n $url = $request->requestVar('BackURL');\n } elseif ($request->isAjax() && $request->getHeader('X-Backurl')) {\n $url = $request->getHeader('X-Backurl');\n } elseif ($request->getHeader('Referer')) {\n $url = $request->getHeader('Referer');\n }\n\n return $url;\n }", "function index()\n {\n redirect(URL_SITE_SETTINGS);\n }", "public function actionDefault(){\n \n $this->redirect('Homepage:');\n }", "public function redirectBack() {\n\t\treturn Redirect::route($this->getAlias());\n\t}", "public function testUi() {\n // Generate a unique title so we can find it on the page easily.\n $title = $this->randomMachineName();\n\n // Add a single article.\n $article = $this->drupalCreateNode(['type' => 'article', 'title' => $title]);\n\n $auth_user = $this->drupalCreateUser([\n 'flag bookmark',\n 'unflag bookmark',\n ]);\n\n $assert_session = $this->assertSession();\n\n $this->drupalLogin($auth_user);\n\n // Check the link to bookmark exist.\n $this->drupalGet('node/1');\n\n // Check that the bookmark count is equal to zero.\n $element0 = $assert_session->waitForElementVisible('css', '.flag-bookmark span:contains(\"[0]\")');\n $this->assertNotNull($element0);\n\n $this->clickLink('Bookmark this');\n\n // Check that after clicking the link bookmark count is equal to one.\n $element1 = $assert_session->waitForElementVisible('css', '.flag-bookmark span:contains(\"[1]\")');\n $this->assertNotNull($element1);\n\n // Observe a change in the frontpage link title.\n $bookmark_link = $assert_session->waitForLink('Remove bookmark');\n $this->assertNotNull($bookmark_link, 'Remove bookmark is availble on the page.');\n\n // Check the view is shown correctly.\n $this->drupalGet('bookmarks');\n $assert_session->pageTextContains($article->getTitle());\n }", "public function getBackUrl()\n {\n $url = $this->helperWizard()->getPreviousPageUrlAsString();\n return $this->getUrl($url, array('_current' => true));\n }", "function get_default_page_to_edit()\n {\n }", "public function test_edit_settings_page_show_as_guest()\n {\n $this->get('/settings')\n ->assertStatus(302);\n }", "public function getShowInHome();", "function block_admin_default() {\n dd_goto('admin/blocks/settings/' .$GLOBALS['conf']['default_theme']);\n}", "public function testVisitingRolesAsNonAdminRedirectsHome()\n {\n $response = $this->get('/admin/Role')\n ->assertRedirect('/');\n }", "static public function insert_go_to_top_link() {\n\t\techo self::go_to_top_link();\n\t}", "public function home()\n {\n\t\tif(!$_SESSION['logged_in'])\n\t\t\tredirect('administrator');\n\t\t\n $data = array(\n 'admin' => $_SESSION['username']\n );\n $this->page('administrator/home',$data);\n }", "public function getContent()\n {\n Tools::redirectAdmin($this->context->link->getAdminLink('AdminBackupProSettings'));\n }", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->redirect( 'index.php?r=sales/dashboard/admin');\n\t}", "public function testIndexAction()\n {\n $this->url('http://localhost/hacker-news/index.php');\n $this->assertEquals('Hacker News - Github', $this->title());\n }", "public function getBackUrl()\n {\n return $this->getUrl('*/*/list', ['id' => $this->getProductData()->getId()]);\n }", "public function checkPageForShortcutRedirect() {}", "public function testGuestNotAccessHomePage()\n\t{\n\t\t$this->open('/');\n\t\t$this->assertTextNotPresent('Home');\n\t}", "public function index() {\n redirect(site_url('admin/dashboard'), 'refresh');\n }", "public function menu_page() {\n\t\tinclude EPT_PATH . 'views/troubleshoot.php';\n\t}", "public function getBackUrl()\n {\n return $this->backUrl;\n }", "public function testmenuAction()\n {\n parent::login();\n $this->clickAt(\"link=CMS\", \"\");\n $this->click(\"link=Menus\");\n $this->waitForPageToLoad(\"30000\");\n $this->isElementPresent(\"id=sortable1\");\n $this->isElementPresent(\"id=sortable2\");\n parent::logout();\n }", "function goToSite() {\n header('Location: index.php?action=start-app');\n\n}", "abstract public function should_link_to_wp_admin();", "public function actionIndex() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t$this->redirect(array(\n\t\t\t'content/detail',\n\t\t\t'contentId'=>\\Yii::app()->request->getParam('contentId', 0)\n\t\t));\n\t}", "public function testIndexPage()\n {\n $this->visit('/')\n ->see('Read a Blog')\n ->see('Admin')\n ->see('Sign in')\n ->dontSee('Logout');\n }", "public function testMenuLinkContentFormLinkToAnyPage() {\n $menu_link = MenuLinkContent::create([\n 'title' => 'Menu link test',\n 'provider' => 'menu_link_content',\n 'menu_name' => 'admin',\n 'link' => ['uri' => 'internal:/user/login'],\n ]);\n $menu_link->save();\n\n // The user should be able to edit a menu link to the page, even though\n // the user cannot access the page itself.\n $this->drupalGet('/admin/structure/menu/item/' . $menu_link->id() . '/edit');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->drupalLogin($this->basicUser);\n\n $this->drupalGet('/admin/structure/menu/item/' . $menu_link->id() . '/edit');\n $this->assertSession()->statusCodeEquals(403);\n }", "function setBackStore() {\n $requestParam = explode('/', $this->params->url);\n $store_name = trim($requestParam[0]); // Name of the store which we will change later with Saas\n $StoreAdminid = $this->Session->read('Auth.Admin.id');\n if ($store_name && !$StoreAdminid) {\n $this->loadModel('Store');\n $store_result = $this->Store->store_info($store_name);\n if ($store_result) {\n $storeName = $store_result['Store']['store_name'];\n $this->Session->write('admin_domainname', $store_name);\n $this->Session->write('admin_storeName', $storeName);\n $this->Session->write('admin_store_id', $store_result['Store']['id']);\n $this->Session->write('admin_merchant_id', $store_result['Store']['merchant_id']);\n } else {\n $this->redirect(array('controller' => 'users', 'action' => 'selectStore'));\n }\n }\n }", "public function showBackEnd();", "public function actionIndex()\n {\n return $this->redirect((array('site/index')));\n }", "public function toBack()\r\n {\r\n return $this->app->request->server('HTTP_REFERER');\r\n }", "public function testRedirectHome()\n {\n $response = $this->get('/');\n\n $response->assertStatus(302);\n }", "public function redirect_overview_to_setup() : void {\n\t\t\tglobal $pagenow;\n\n\t\t\t// phpcs:ignore WordPress.Security.NonceVerification.Recommended\n\t\t\tif ( $pagenow === 'admin.php' && isset( $_GET['page'] ) && $_GET['page'] === self::OVERVIEW_PAGE_SLUG ) {\n\t\t\t\t$setup_slug = learndash_cloud_is_enabled() ? self::SETUP_SLUG_CLOUD : self::SETUP_SLUG;\n\n\t\t\t\twp_safe_redirect( admin_url( 'admin.php?page=' . $setup_slug ) );\n\t\t\t\texit();\n\t\t\t}\n\t\t}" ]
[ "0.67043716", "0.67043716", "0.62552434", "0.6172643", "0.60133404", "0.60096174", "0.5935994", "0.5867099", "0.5849595", "0.5849595", "0.58401513", "0.5789324", "0.57285047", "0.5714606", "0.57101625", "0.5685016", "0.5673081", "0.5656947", "0.5649427", "0.56389576", "0.56075", "0.55790365", "0.5574071", "0.55569595", "0.55558866", "0.5552709", "0.5552293", "0.5552063", "0.5548422", "0.5531474", "0.5520097", "0.5510691", "0.55031705", "0.54961663", "0.5489722", "0.54861253", "0.548426", "0.54697025", "0.5467721", "0.5460895", "0.54400116", "0.54198116", "0.54075724", "0.54034376", "0.5392979", "0.53789693", "0.5377643", "0.5376288", "0.5372824", "0.5356604", "0.53527373", "0.5351951", "0.5350221", "0.5339924", "0.53375316", "0.53288513", "0.53189546", "0.5314391", "0.5312437", "0.53106064", "0.53016657", "0.52935207", "0.5284105", "0.5273578", "0.52689594", "0.52608454", "0.52575195", "0.5256844", "0.52564895", "0.5247193", "0.52465874", "0.52449864", "0.52328026", "0.52295864", "0.52197015", "0.5214979", "0.5211104", "0.5208052", "0.5207046", "0.5204677", "0.52038324", "0.5202291", "0.5201736", "0.5197821", "0.5190077", "0.5185587", "0.5185348", "0.5184049", "0.51833934", "0.5183018", "0.5179933", "0.5164402", "0.5151952", "0.51479775", "0.5145351", "0.5143322", "0.5140821", "0.51393294", "0.5136664", "0.5135332" ]
0.7478297
0
Main constructor for this factory class which builds an object with the correct methods based on interaction goal with the Emma API
public function __construct( $account_id, $public_key, $private_key, $interface = '') { $this->_request = new Request( $account_id, $public_key, $private_key ); if (isset($interface) && $interface != '') { $this->build($interface, $this->_request); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function create(): self;", "public function construct() {\n\n }", "public abstract function make();", "public function make() {}", "public function construct()\n\t\t{\n\t\t}", "function _construct() {\n \t\n\t\t\n\t}", "function _construct(){ }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "abstract function create();", "protected abstract function __construct();", "abstract protected function create ();", "public function make();", "protected function construct(){\n\n }", "public function __construct()\n {\n # no args = no further setup\n if (func_num_args() == 0) return;\n\n # use this to work out whether an arg refers to an Orm name\n $name_specified = 0;\n\n if (is_array($input = func_get_arg(0))) { # array = new object with initial values\n if (func_num_args() == 2)\n $name_specified = 1;\n\n foreach($input as $key => $val)\n $this->$key = $val;\n\n }\n\n if ($name_specified > 0) {\n $this->setup_name = func_get_arg($name_specified);\n }\n }", "final private function __construct() {}", "final private function __construct() {}", "private final function __construct() {}", "public function _construct()\n\t{\n\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "function __construct() {}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}" ]
[ "0.67702794", "0.67565423", "0.6711048", "0.6700422", "0.66726875", "0.66617656", "0.66375977", "0.6623841", "0.6623841", "0.6623841", "0.6582119", "0.65373534", "0.65225685", "0.65111935", "0.6450663", "0.644477", "0.64186794", "0.64186794", "0.6397777", "0.63794565", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.63552403", "0.6353685", "0.6353685", "0.6352666", "0.63526005", "0.63526005", "0.63526005", "0.63526005", "0.63526005", "0.63526005", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265", "0.6344265" ]
0.0
-1
Factory method for building control object.
public function build($interface, $_request) { switch ($interface) { case 'fields': $this->control = new Fields($_request); break; case 'groups': $this->control = new Groups($_request); break; case 'mailings'; $this->control = new Mailings($_request); break; case 'members': $this->control = new Members($_request); break; case 'response'; $this->control = new Response($_request); break; case 'searches'; $this->control = new Searches($_request); break; case 'triggers'; $this->control = new Triggers($_request); break; case 'webhooks'; $this->control = new Webhooks($_request); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildControl()\n\t\t{\n\t\t\tswitch($this->getDisplayMode())\n\t\t\t{\n\t\t\t\tcase self::DISPLAYMODE_ICONS :\n\t\t\t\t\t$this->buildIconView();\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::DISPLAYMODE_LIST :\n\t\t\t\t\t$this->buildListView();\n\t\t\t\t\tbreak;\n\t\t\t\tcase self::DISPLAYMODE_DETAILS :\n\t\t\t\t\t$this->buildDetailView();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstatic::fail(\"Unknown DisplayMode '%s'\", $this->getDisplayMode());\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function BuildControls() {\n\n $this->EncType= $this->GetOption('EncType');\n\n // convert array of arrays into array of objects\n foreach($this->Controls as $Name=>&$Control) {\n // skip already builded controls\n if (is_object($Control)) {\n continue;\n }\n // find classname\n if (!isset($Control['Type'])) {\n $Control += array('Type'=>'text', 'Attributes'=>array('UNKNOWNTYPE'=>'YES'));\n }\n if (strpos($Control['Type'], '\\\\') === false) { // short name, ex.: \"select\"\n $Type= ucfirst($Control['Type']);\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\'.$Type.'Control';\n } else { // it is fully qualified class name\n $Class= $Control['Type'];\n }\n if (!class_exists($Class)) {\n $this->Error('Class \"'.$Class.'\" not found.');\n $Class= '\\\\Accent\\\\Form\\\\Control\\\\TextControl'; // fallback to any primitive control\n }\n // copy this array into $Options and append few more items\n // and append common options to allow usage of services\n $Options= $Control + array(\n 'Name'=> $Name,\n 'Form'=> $this,\n 'Book'=> $this->GetOption('Book')\n ) + $this->GetCommonOptions();\n $Control= new $Class($Options);\n // switch to multipart encoding if any control require that\n if ($Control->GetMultipartEncoding()) {\n $this->EncType= 'multipart/form-data';\n }\n }\n $this->Builded= true;\n }", "public function construct()\r\n\t{\r\n\t\t\r\n\t\t\r\n\t\t$class = ($this->classClr) ? 'w50 clr' : 'w50';\r\n\t\t$class = ($this->classLong) ? 'long clr' : $class;\r\n\t\t$class .= ($this->picker) ? ' wizard' : '';\r\n\t\t\r\n\t\t$wizard = ($this->picker == 'page') ? array(array('tl_content', 'pagePicker')) : false;\r\n\t\t\r\n\t\t// input unit\r\n\t\tif (($this->picker == 'unit'))\r\n\t\t{\r\n\t\t\t$options = array();\r\n\t\t\tforeach (deserialize($this->units) as $arrOption)\r\n\t\t\t{\r\n\t\t\t\t$options[$arrOption['value']] = $arrOption['label'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// the text field\r\n\t\t$this->generateDCA(($this->picker != 'unit') ? ($this->multiple) ? 'multiField' : 'textField' : 'inputUnit', array\r\n\t\t(\r\n\t\t\t'inputType' =>\t($this->picker == 'unit') ? 'inputUnit' : 'text',\r\n\t\t\t'label'\t\t=>\tarray($this->label, $this->description),\r\n\t\t\t'default'\t=>\t$this->defaultValue,\r\n\t\t\t'wizard'\t=>\t$wizard,\r\n\t\t\t'options'\t=>\t$options,\r\n\t\t\t'eval'\t\t=>\tarray\r\n\t\t\t(\r\n\t\t\t\t'mandatory'\t\t=>\t($this->mandatory) ? true : false, \r\n\t\t\t\t'minlength'\t\t=>\t$this->minlength, \r\n\t\t\t\t'maxlength'\t\t=>\t$this->maxLength, \r\n\t\t\t\t'tl_class'\t\t=>\t$class,\r\n\t\t\t\t'rgxp'\t\t\t=>\t$this->rgxp,\r\n\t\t\t\t'multiple'\t\t=>\t($this->multiple) ? true : false,\r\n\t\t\t\t'size'\t\t\t=>\t$this->multiple,\r\n\t\t\t\t'datepicker' \t=> \t($this->picker == 'datetime') ? true : false,\r\n\t\t\t\t'colorpicker' \t=> \t($this->picker == 'color') ? true : false,\r\n\t\t\t\t'isHexColor' \t=> \t($this->picker == 'color') ? true : false,\r\n\t\t\t),\r\n\t\t));\r\n\t\t\r\n\t}", "function Control($name = \"\") {\n $this->Name = $name;\n $this->_state = WEB_CONTROL_CONSTRUCTED;\n }", "public function build_controls()\n\t{\n\t\t$this->add_control( 'title', [\n\t\t\t'label' => __( 'Title' )\n\t\t] );\n\t\t$this->add_control( 'content', [\n\t\t\t'label' => __( 'Content' ),\n\t\t\t'type' => 'textarea'\n\t\t] );\n\t\t$this->add_control( 'link_url', [\n\t\t\t'label' => __( 'URL' )\n\t\t] );\n\t\t$this->add_control( 'link_text', [\n\t\t\t'label' => __( 'Link Text' )\n\t\t] );\n\t\t$this->add_control( 'link_target', [\n\t\t\t'label' => __( 'Open link in a new window/tab' ),\n\t\t\t'type' => 'checkbox',\n\t\t\t'value' => '1'\n\t\t] );\n\t}", "function &getInstance($control_name, $name=null) {\r\n\t\trequire_once ZAR_CONTROLS_PATH . '/'.strtolower($control_name).'.php';\r\n\t\t$class = 'ZariliaControl_'.$control_name.'.php';\r\n\t\t$obj = new $class($name);\r\n\t\tunset($class);\r\n\t\treturn $obj;\r\n\t}", "public function txtMotorShort_Create($strControlId = null) {\n\t\t\t$this->txtMotorShort = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtMotorShort->Name = QApplication::Translate('Motor Short');\n\t\t\t$this->txtMotorShort->Text = $this->objFichas->MotorShort;\n\t\t\t$this->txtMotorShort->MaxLength = Fichas::MotorShortMaxLength;\n\t\t\treturn $this->txtMotorShort;\n\t\t}", "public function generate_control($args = array()){\n /*Generate a repeater*/\n if($this->is_repeater()){\n $repeater_settings = is_array($this->settings['repeater']) ? $this->settings['repeater'] : array();\n $this->rb_control_field = new RB_Repeater_Field($this->id, $this->value, $this->controls, $items_settings = array(\n 'collapsible' => true,\n ), $repeater_settings);\n }\n //Renders the controls in the controls array\n else if( $this->is_group() ){\n if( is_array($this->settings['controls']) ){\n $group_settings = isset($args['group_settings']) && is_array($args['group_settings']) ? $args['group_settings'] : array();\n $this->rb_control_field = new RB_Group_Field($this->id, $this->value, $this->settings['controls'], $group_settings);\n }\n }\n //Generates the controler when only one control was provided\n else{\n $control_settings = is_array($this->controls) ? reset($this->controls) : array();//First item in the controls array\n $control_settings['id'] = $this->id;\n $control_type = isset($control_settings['type']) && $control_settings['type'] ? $control_settings['type'] : 'RB_Input_Control';\n $this->rb_control_field = new RB_Single_Field($this->id, $this->value, $control_settings, $control_type);\n }\n }", "public function getControl()\n\t{\n\t\t$container = clone $this->container;\n\t\t$separator = (string) $this->separator;\n\t\t$control = parent::getControl();\n\t\t$id = $control->id;\n\t\t$counter = 0;\n\t\t$value = $this->value === NULL ? NULL : (string) $this->getValue();\n\t\t$label = /*Nette\\Web\\*/Html::el('label');\n\n\t\tforeach ($this->items as $key => $val) {\n\t\t\t$control->id = $label->for = $id . '-' . $key;\n\t\t\t$control->checked = (string) $key == $value;\n\t\t\t$control->value = $key;\n\n\t\t\t/* Novak - vse bude HTML */\n\t\t\t/*if ($val instanceof Html) {\n\t\t\t\t$label->setHtml($val);\n\t\t\t} else {\n\t\t\t\t$label->setText($val);\n\t\t\t}*/\n\t\t\t$label->setHtml($val);\n\n\t\t\t// za posledni polozkou nebude oddelovac\n\t\t\tif($counter == count($this->items)-1) $separator = \"\";\n\n\t\t\t$container->add((string) $control . (string) $label . $separator);\n\t\t\t$counter++;\n\n\t\t}\n\n\t\treturn $container;\n\t}", "public function create_justart_form_control( $id, $settings ) {\n\t\tglobal $post;\n\t\t\n\t\t$value = '';\n\t\t$formControl = null;\n\t\t\n\t\t$repeatable \t = $this->getIfSet( $settings['repeatable'], false);\n\t\t$parent_field_type = $this->getIfSet($settings['type'], '');\n\t\t$field_counter \t = $this->getIfSet($settings['field_counter'], '');\n\t\t$settings \t\t = $settings['fields'][$id];\n\t\t$field_type \t = $settings['type'];\n\t\t\n\t\tif ( ( $repeatable || $parent_field_type == 'repeatable_fieldset' ) && isset( $this->field[$id] ) ) {\n\t\t\t$value = $this->field[$id];\n\t\t} else if ( !$repeatable ) {\n\t\t\t$value = get_post_meta( $post->ID, $id, true );\n\t\t}\n\n\t\tif ( !is_numeric( $value ) && empty( $value ) && isset( $settings['default'] ) ) {\t\t\n\t\t\t$value = $settings['default'];\n\t\t}\n\t\t\n\t\t$formControl = new JustArtSliderControl( $id, $this, $repeatable, $settings, $value, $field_counter );\n\t\t\n\t\treturn $formControl;\n\t}", "public function txtCapacidadBaul_Create($strControlId = null) {\n\t\t\t$this->txtCapacidadBaul = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCapacidadBaul->Name = QApplication::Translate('Capacidad Baul');\n\t\t\t$this->txtCapacidadBaul->Text = $this->objFichas->CapacidadBaul;\n\t\t\t$this->txtCapacidadBaul->MaxLength = Fichas::CapacidadBaulMaxLength;\n\t\t\treturn $this->txtCapacidadBaul;\n\t\t}", "public function getControl()\n\t{\n\t\t$control = parent::getControl();\n\t\t$control->addAttributes(array(\n\t\t\t'id' => $this->getHtmlId(),\n\t\t));\n\t\treturn $control;\n\t}", "public function txtAceleracion0100_Create($strControlId = null) {\n\t\t\t$this->txtAceleracion0100 = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtAceleracion0100->Name = QApplication::Translate('Aceleracion 0100');\n\t\t\t$this->txtAceleracion0100->Text = $this->objFichas->Aceleracion0100;\n\t\t\t$this->txtAceleracion0100->MaxLength = Fichas::Aceleracion0100MaxLength;\n\t\t\treturn $this->txtAceleracion0100;\n\t\t}", "function componentBuilder() { $this->__construct(); }", "public function setupControl()\n\t{\n\t\t$this->addText('referenceNumber', 'Reference number:');\n\t\t$this->addSelect('priority', 'Priority:', PriorityEnum::getOptions());\n\t\t$this->addTextArea('symptoms', 'Symptoms:', 40, 8)\n\t\t\t->addRule(Form::FILLED, 'Symptoms are required.');\n\t\t$this->addText('problemOwner', 'Problem owner:');\n\t\t$this->addSelect('status', 'State:', array(\n\t\t\tOperationProblem::STATUS_NEW => 'new',\n\t\t\tOperationProblem::STATUS_INVESTIGATED => 'investigated',\n\t\t\tOperationProblem::STATUS_RESOLVED => 'resolved',\n\t\t\tOperationProblem::STATUS_CLOSED => 'closed'\n\t\t));\n\n\t\t$this->addSelect('category', 'Category:', array('' => $this->noCategoryText) + $this->getCategoriesOptions());\n\n\t\t$this->addTextArea('onEventRaw', 'onEvent:');\n\n\t\t$this->addSubmit('save', 'Save problem');\n\n\t\t$this->onValidate[] = $this->onValidateForm;\n\t}", "public function __construct(ControlPanelBuilder $builder)\n {\n $this->builder = $builder;\n }", "public static function builder();", "public function lblMotorShort_Create($strControlId = null) {\n\t\t\t$this->lblMotorShort = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblMotorShort->Name = QApplication::Translate('Motor Short');\n\t\t\t$this->lblMotorShort->Text = $this->objFichas->MotorShort;\n\t\t\treturn $this->lblMotorShort;\n\t\t}", "public function txtParMotorTorque_Create($strControlId = null) {\n\t\t\t$this->txtParMotorTorque = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtParMotorTorque->Name = QApplication::Translate('Par Motor Torque');\n\t\t\t$this->txtParMotorTorque->Text = $this->objFichas->ParMotorTorque;\n\t\t\t$this->txtParMotorTorque->MaxLength = Fichas::ParMotorTorqueMaxLength;\n\t\t\treturn $this->txtParMotorTorque;\n\t\t}", "public function addControl(IControl $control): IControl;", "public abstract function make();", "function addOptionControl($params, $section = null) {\n // otherwise add it to the element root\n if ($section) {\n $l = $section;\n } else {\n $l = $this->El;\n }\n\n $control_type = $params['type'];\n\n if (isset($params['name'])) {\n $control_label = $params['name'];\n } else {\n throw new Exception(\"addOptionControl params['name'] must be set\");\n }\n\n // generate a unique slug for the control based on the name\n if (isset($params['slug'])) {\n $control_slug = $params['slug'];\n } else {\n $control_slug = str_replace(\" \", \"-\", $params['name']);\n $control_slug = 'slug_'.preg_replace(\"/[^A-Za-z0-9 ]/\", \"\", $control_slug);\n }\n\n $Control = $l->addControl($control_type, $control_slug, __($control_label));\n\n // option controls is not a style controls, make those auto rebuild element to avoid \"Apply param\" button\n /*$rebuild_element = isset($params['rebuild_element']) ? $params['rebuild_element'] : true; \n if ($rebuild_element) {\n $Control->rebuildElementOnChange();\n }*/\n\n if (isset($params['condition'])) {\n $Control->setCondition($params['condition']);\n }\n\n if (isset($params['value'])) {\n $Control->setValue($params['value']);\n }\n\n if (isset($params['default'])) {\n $Control->setDefaultValue($params['default']);\n }\n\n if (isset($params['base64']) && $params['base64'] == true) {\n $Control->base64();\n }\n\n return $Control;\n\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function setControl($var)\n {\n GPBUtil::checkString($var, True);\n $this->control = $var;\n\n return $this;\n }", "public function txtTipo_Create($strControlId = null) {\n\t\t\t$this->txtTipo = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtTipo->Name = QApplication::Translate('Tipo');\n\t\t\t$this->txtTipo->Text = $this->objFichas->Tipo;\n\t\t\t$this->txtTipo->MaxLength = Fichas::TipoMaxLength;\n\t\t\treturn $this->txtTipo;\n\t\t}", "abstract public function openControl($label, $class = '', $attr = '');", "abstract public function build();", "abstract public function build();", "public function getControl()\r\n\t{\r\n\t\t$control=parent::getControl();\r\n\t\t$control->class[]='tag-control';\r\n\r\n\t\tif ($this->delimiter!==NULL && Strings::trim($this->delimiter)!=='') {\r\n\t\t\t$control->attrs['data-tag-delimiter']=$this->delimiter;\r\n\t\t\t}\r\n\r\n\t\tif ($this->joiner!==NULL && Strings::trim($this->joiner)!=='') {\r\n\t\t\t$control->attrs['data-tag-joiner']=$this->joiner;\r\n\t\t\t}\r\n\t\r\n\t\tif ($this->suggestCallback!==NULL) {\r\n\t\t\t$form=$this->getForm();\r\n\t\t\tif (!$form || !$form instanceof Form) {\r\n\t\t\t\tthrow new \\Nette\\InvalidStateException('TagInput supports only Nette\\Application\\UI\\Form.');\r\n\t\t\t\t}\r\n\t\t\t$control->attrs['data-tag-suggest']=$form->presenter->link($this->renderName, array('word_filter' => '%__filter%'));\r\n\t\t\t}\r\n\r\n\t\treturn $control;\r\n\t}", "function customize_controls_init()\n {\n }", "public function txtConsumoInterurbano_Create($strControlId = null) {\n\t\t\t$this->txtConsumoInterurbano = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtConsumoInterurbano->Name = QApplication::Translate('Consumo Interurbano');\n\t\t\t$this->txtConsumoInterurbano->Text = $this->objFichas->ConsumoInterurbano;\n\t\t\t$this->txtConsumoInterurbano->MaxLength = Fichas::ConsumoInterurbanoMaxLength;\n\t\t\treturn $this->txtConsumoInterurbano;\n\t\t}", "public function lblAceleracion0100_Create($strControlId = null) {\n\t\t\t$this->lblAceleracion0100 = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblAceleracion0100->Name = QApplication::Translate('Aceleracion 0100');\n\t\t\t$this->lblAceleracion0100->Text = $this->objFichas->Aceleracion0100;\n\t\t\treturn $this->lblAceleracion0100;\n\t\t}", "public abstract function build();", "public abstract function build();", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: border properties');\r\n\r\n $borderpainted[] =& $this->createElement('radio', null, null, 'Yes', true);\r\n $borderpainted[] =& $this->createElement('radio', null, null, 'No', false);\r\n $this->addGroup($borderpainted, 'borderpainted', 'Display the border:');\r\n\r\n $this->addElement('text', 'borderclass', 'CSS class:', array('size' => 32));\r\n\r\n $borderstyle['style'] =& $this->createElement('select',\r\n 'style', 'style',\r\n array('solid' => 'Solid',\r\n 'dashed' => 'Dashed',\r\n 'dotted' => 'Dotted',\r\n 'inset' => 'Inset',\r\n 'outset' => 'Outset'));\r\n $borderstyle['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 2));\r\n $borderstyle['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($borderstyle, 'borderstyle', null, ' ');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }", "public function txtCombustible_Create($strControlId = null) {\n\t\t\t$this->txtCombustible = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCombustible->Name = QApplication::Translate('Combustible');\n\t\t\t$this->txtCombustible->Text = $this->objFichas->Combustible;\n\t\t\t$this->txtCombustible->MaxLength = Fichas::CombustibleMaxLength;\n\t\t\treturn $this->txtCombustible;\n\t\t}", "public function getControl(): Html\n {\n $html = parent::getControl();\n $classNames = $html->getAttribute('class');\n $classNames['custom-select'] = true;\n $html->setAttribute('class', $classNames);\n return $html;\n }", "public function build_controls()\n {\n $this->add_control( 'id', [\n 'label' => __( 'Post', 'customize-static-layout' ),\n 'type' => 'object_selector',\n 'post_query_vars' => static::get_post_query_vars(),\n 'select2_options' => [\n 'allowClear' => true,\n 'placeholder' => __( '&mdash; Select &mdash;', 'customize-static-layout' ),\n ],\n ], 'CustomizeObjectSelector\\Control' );\n }", "public function getControl()\n {\n $control = parent::getControl();\n $rules = json_encode($control->attrs['data-nette-rules']);\n\n $name = $this->getHtmlName();\n $result = Html::el('div')->addAttributes(['class' => 'input-date',]);\n\n $selectDay = $this->day ?: '';\n $selectMonth = $this->month ?: '';\n $selectYear = $this->year ?: '';\n\n return $result\n ->add(Nette\\Forms\\Helpers::createSelectBox(\n self::$days,\n ['selected?' => $selectDay,'disabled:' => ['' => TRUE],]\n )->addAttributes(['class' => 'form-control input-date-item', 'placeholder'=> 'den', 'data-nette-rules' => $rules])->name($name . '[day]'))\n ->add(Nette\\Forms\\Helpers::createSelectBox(\n self::$months,\n ['selected?' => $selectMonth,'disabled:' => ['' => TRUE],]\n )->addAttributes(['class' => 'form-control input-date-item', 'data-nette-rules' => $rules])->name($name . '[month]'))\n ->add(Nette\\Forms\\Helpers::createSelectBox(\n $this->getYears(),\n ['selected?' => $selectYear,'disabled:' => ['' => TRUE],]\n )->addAttributes(['class' => 'form-control input-date-item', 'data-nette-rules' => $rules])->name($name . '[year]'));\n }", "static function create()\n\t{\n\t\treturn new UomChoiceList(\n\t\t\tarray('','PZ','MQ','ML','KG','CP','LT','SET'),\n\t\t\tarray('---','Pezzi','Metri Quadri','Metri Lineari','Kilogrammi','Coppie','Litri','Set')\n\t\t);\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}", "public function txtCilindrada_Create($strControlId = null) {\n\t\t\t$this->txtCilindrada = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCilindrada->Name = QApplication::Translate('Cilindrada');\n\t\t\t$this->txtCilindrada->Text = $this->objFichas->Cilindrada;\n\t\t\t$this->txtCilindrada->MaxLength = Fichas::CilindradaMaxLength;\n\t\t\treturn $this->txtCilindrada;\n\t\t}", "public function createBuilder();", "function __construct($control, $reason)\n\t{\n\t\t$this->control = $control;\n\t\t$this->reason = $reason;\n\t\tparent::__construct($this->control->getName()\n\t\t\t. \": \" . self::$REASON_DESCRIPTION[$this->reason]);\n\t}", "public function create() {\r\n\t\r\n\t$form = new Form();\r\n\t$form->setTranslator($this->translator);\r\n\treturn $form;\r\n }", "public function build()\n {\n $this->validate_attributes();\n\n $attributes = [];\n foreach (static::$object_attributes as $key => $value) {\n $attributes[$key] = $this->{$key};\n }\n\n // Construct a vcalendar object based on the templated\n return (new Build(\n static::VTEMPLATE\n ))->build(\n $attributes\n );\n }", "public function testConstructMethod()\n {\n $grid = new Grid($this->getContainer());\n $stub = new FormBuilder($grid);\n\n $refl = new \\ReflectionObject($stub);\n $name = $refl->getProperty('name');\n $grid = $refl->getProperty('grid');\n\n $name->setAccessible(true);\n $grid->setAccessible(true);\n\n $this->assertInstanceOf('\\Antares\\Html\\Form\\FormBuilder', $stub);\n $this->assertInstanceOf('\\Antares\\Html\\Builder', $stub);\n $this->assertInstanceOf('\\Illuminate\\Contracts\\Support\\Renderable', $stub);\n\n $this->assertNull($name->getValue($stub));\n $this->assertNull($stub->name);\n $this->assertInstanceOf('\\Antares\\Html\\Form\\Grid', $grid->getValue($stub));\n $this->assertInstanceOf('\\Antares\\Html\\Form\\Grid', $stub->grid);\n }", "protected function build()\n\t{\n\t}", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function construct()\n\t\t{\n\t\t}", "abstract protected function construct($params);", "abstract function build();", "abstract public function createForm();", "abstract public function createForm();", "public function make() {}", "static function create(): self;", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TJuiControlAdapter($this));\n\t}", "public function txtConsumoUrbano_Create($strControlId = null) {\n\t\t\t$this->txtConsumoUrbano = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtConsumoUrbano->Name = QApplication::Translate('Consumo Urbano');\n\t\t\t$this->txtConsumoUrbano->Text = $this->objFichas->ConsumoUrbano;\n\t\t\t$this->txtConsumoUrbano->MaxLength = Fichas::ConsumoUrbanoMaxLength;\n\t\t\treturn $this->txtConsumoUrbano;\n\t\t}", "public function customize_controls_init()\n {\n }", "public static function builder() {\n return new self();\n }", "public function txtAnio_Create($strControlId = null) {\n\t\t\t$this->txtAnio = new QIntegerTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtAnio->Name = QApplication::Translate('Anio');\n\t\t\t$this->txtAnio->Text = $this->objFichas->Anio;\n\t\t\treturn $this->txtAnio;\n\t\t}", "function CreateChildControls() {\n }", "public function get_widget_control($args)\n {\n }", "public function txtConsumoMixto_Create($strControlId = null) {\n\t\t\t$this->txtConsumoMixto = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtConsumoMixto->Name = QApplication::Translate('Consumo Mixto');\n\t\t\t$this->txtConsumoMixto->Text = $this->objFichas->ConsumoMixto;\n\t\t\t$this->txtConsumoMixto->MaxLength = Fichas::ConsumoMixtoMaxLength;\n\t\t\treturn $this->txtConsumoMixto;\n\t\t}", "function addStyleControl($params, $section = null) {\n // otherwise add it to the element root\n if ($section) {\n $l = $section;\n } else {\n $l = $this->El;\n }\n\n $control_type = isset($params['control_type']) ? $params['control_type'] : $this->get_control_type_by_css_property($params['property']);\n\n // use the provided name as the control label if it is set\n // otherwise auto generate a name based on the CSS property it sets\n if (isset($params['name'])) {\n $control_label = $params['name'];\n } else {\n $control_label = ucwords(str_replace('-', ' ', $params['property']));\n }\n\n // generate a unique slug for the control\n // based on the selector and the css property\n if (isset($params['selectors'])) {\n // take the first selector from array to generate the slug. Is there a better way?\n $property = str_replace('-', '_', $params['selectors'][0]['property']);\n\n $selector = $params['selectors'][0]['selector'];\n $selector = str_replace(\" \", \"-\", $selector);\n $selector = preg_replace(\"/[^A-Za-z0-9 ]/\", \"\", $selector);\n\n $control_slug = 'slug_'.$selector.'_'.$property;\n\n }\n else if (isset($params['selector'])) {\n \n $property = str_replace('-', '_', $params['property']);\n \n $selector = $params['selector'];\n $selector = str_replace(\" \", \"-\", $selector);\n $selector = preg_replace(\"/[^A-Za-z0-9 ]/\", \"\", $selector);\n\n $control_slug = 'slug_'.$selector.'_'.$property;\n }\n else {\n $control_slug = $params['property'];\n }\n if (isset($params['slug'])) {\n $control_slug = $params['slug'];\n }\n\n $control = $l->addControl($control_type, $control_slug, __($control_label));\n\n // now map the control to the appropriate css selector, based on the control slug\n if (isset($params['selector'])){\n // single\n $this->mapPropertyHelper($params['selector'], $params['property'], $control_slug);\n }\n elseif (isset($params['selectors']) && is_array($params['selectors'])) {\n // multiple\n foreach ($params['selectors'] as $selector) {\n $this->mapPropertyHelper($selector['selector'], $selector['property'], $control_slug);\n $this->fixUnitsAndValues($control, $selector['property']);\n }\n }\n // if no selector defined assume this is a CSSOption\n else {\n $control->CSSOption();\n }\n\n // utility function to set the units and values properply\n // depending on the CSS property the control is affecting\n // for example, it will add the px unit to a control that is applied to font-size\n // and 100 - 900 values to a control setting font-weight \n if (isset($params['property'])){\n $this->fixUnitsAndValues($control, $params['property']);\n }\n\n if (isset($params['unit'])){\n $control->setUnits($params['unit']);\n }\n if (isset($params['value'])){\n $control->setValue($params['value']);\n }\n\n if (isset($params['default'])) {\n $control->setDefaultValue($params['default']);\n }\n\n if (isset($params['condition'])) {\n $control->setCondition($params['condition']);\n }\n\n if (isset($params['description'])) {\n $control->setDescription($params['description']);\n }\n\n if (isset($params['hidden'])) {\n $control->hidden();\n }\n\n // call whiteList to make the control settable in classes, states, and media queries\n $control->whiteList();\n\n\n return $control;\n\n }", "public function __construct($control, $onlyinternal = false) {\n\t\t$this->_control = $control;\n\t\t$this->_internalonly = $onlyinternal;\n\t}", "public function txtLetra_Create($strControlId = null) {\n\t\t\t$this->txtLetra = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtLetra->Name = QApplication::Translate('Letra');\n\t\t\t$this->txtLetra->MaxLength = Seccion::LetraMaxLength;\n\t\t\t$this->txtLetra->PreferredRenderMethod = 'RenderWithName';\n\t\t\t$this->txtLetra->LinkedNode = QQN::Seccion()->Letra;\n\t\t\t$this->txtLetra->Text = $this->objSeccion->Letra;\n\t\t\treturn $this->txtLetra;\n\t\t}", "public static function createInstance()\n {\n return new CheckBox('ISerializable', 'ISerializable');\n }", "public function txtBatchLabel_Create($strControlId = null) {\n\t\t\t$this->txtBatchLabel = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtBatchLabel->Name = QApplication::Translate('Batch Label');\n\t\t\t$this->txtBatchLabel->Text = $this->objStewardshipBatch->BatchLabel;\n\t\t\t$this->txtBatchLabel->Required = true;\n\t\t\t$this->txtBatchLabel->MaxLength = StewardshipBatch::BatchLabelMaxLength;\n\t\t\treturn $this->txtBatchLabel;\n\t\t}", "public function Create()\n {\n parent::Create();\n\n //Properties\n $this->RegisterPropertyString('VariableList', '[]');\n\n //Scripts\n $this->RegisterScript('TurnOff', $this->Translate('Turn Off'), \"<?php\\n\\nAL_SwitchOff(IPS_GetParent(\\$_IPS['SELF']));\");\n }", "protected function make() {\n\n\t\tif ( ! is_null( $this->tag ) && isset( self::$aliases[ $this->tag ] ) ) {\n\t\t\t$this->set( 'key', self::$aliases[ $this->tag ] );\n\t\t}\n\n\t\t// Set Template\n\t\tif ( false !== $this->attributes['label'] ) {\n\t\t\t$template = 'shortcodes/metadata-label.php';\n\t\t} else {\n\t\t\t$template = 'shortcodes/metadata.php';\n\t\t}\n\n\t\t$this->template = new Template( $template );\n\t}", "public function build() { $this->form_built = TRUE; return $this; }", "public static function build() {\n return new Builder();\n }", "private function control()\n\t{\n\t\tif ( $this->controller && is_null($this->is_controlled) ){\n\t\t\tob_start();\n\t\t\trequire($this->controller);\n\t\t\t$output = ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\tif ( is_object($this->obj) && !isset($this->obj->output) && !empty($output) ){\n\t\t\t\t$this->obj->output = $output;\n\t\t\t}\n\t\t\t$this->is_controlled = 1;\n\t\t}\n\t\treturn $this;\n\t}", "public function lblParMotorTorque_Create($strControlId = null) {\n\t\t\t$this->lblParMotorTorque = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblParMotorTorque->Name = QApplication::Translate('Par Motor Torque');\n\t\t\t$this->lblParMotorTorque->Text = $this->objFichas->ParMotorTorque;\n\t\t\treturn $this->lblParMotorTorque;\n\t\t}", "protected function createComponentRestaurantMenu(): RestaurantMenuControl\n\t{\n\t\t$restaurantMenu = new RestaurantMenuControl($this->modelRestaurant);\n\t\treturn $restaurantMenu;\n\t}", "public function lblTipo_Create($strControlId = null) {\n\t\t\t$this->lblTipo = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblTipo->Name = QApplication::Translate('Tipo');\n\t\t\t$this->lblTipo->Text = $this->objFichas->Tipo;\n\t\t\treturn $this->lblTipo;\n\t\t}", "function initControlStructureForm()\n\t{\n\t\tinclude_once (\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n $form = new ilPropertyFormGUI();\n\n\t\t$form->setId(\"control_structure\");\n\t\t$form->setTitle($this->lng->txt(\"ctrl_structure\"));\n\t\t$form->setFormAction(\"setup.php?cmd=gateway\");\n\n\t\t$ilDB = $this->setup->getClient()->db;\n\t\t$cset = $ilDB->query(\"SELECT count(*) as cnt FROM ctrl_calls\");\n\t\t$crec = $ilDB->fetchAssoc($cset);\n\n\t\t$item = new ilCustomInputGUI($this->lng->txt(\"ctrl_structure_reload\"));\n\t\tif ($crec[\"cnt\"] == 0)\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt(\"ctrl_missing_desc\"));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$item->setInfo($this->lng->txt(\"ctrl_structure_desc\"));\n\t\t}\n\t\t$form->addItem($item);\n\n\t\t$form->addCommandButton(\"reloadStructure\", $this->lng->txt(\"reload\"));\n\t\treturn $form;\n\t}", "public static function create($type, $name, array $options = null, array $input = null, MessageBag $errors = null)\n\t\t{\n\t\t\t// variables\n\t\t\t$control = new static;\n\t\t\t$field = $control->field;\n\t\t\t$errors = isset($errors) ? $errors : Session::get('errors', new MessageBag);\n\t\t\t$input = isset($input) ? $input : Input::all();\n\n\t\t\t// populate field\n\t\t\t$field->type = $type;\n\t\t\t$field->name = $name;\n\t\t\t$field->label = ucwords($name);\n\t\t\t$field->value = is_object($input) ? $input->$name : $input[$name];\n\t\t\t$field->error = $errors ? $errors->first($name) : null;\n\t\t\t$field->options = $options;\n\t\t\t$field->view = 'resourcery::partials.field';\n\n\t\t\t// debug\n\t\t\t//pd($field);\n\n\t\t\t// return\n\t\t\treturn $control;\n\t\t}", "abstract protected function create ();", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function lblCapacidadBaul_Create($strControlId = null) {\n\t\t\t$this->lblCapacidadBaul = new QLabel($this->objParentObject, $strControlId);\n\t\t\t$this->lblCapacidadBaul->Name = QApplication::Translate('Capacidad Baul');\n\t\t\t$this->lblCapacidadBaul->Text = $this->objFichas->CapacidadBaul;\n\t\t\treturn $this->lblCapacidadBaul;\n\t\t}", "public function make();", "protected function construct(){\n\n }", "public function txtCapacidadTanque_Create($strControlId = null) {\n\t\t\t$this->txtCapacidadTanque = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCapacidadTanque->Name = QApplication::Translate('Capacidad Tanque');\n\t\t\t$this->txtCapacidadTanque->Text = $this->objFichas->CapacidadTanque;\n\t\t\t$this->txtCapacidadTanque->MaxLength = Fichas::CapacidadTanqueMaxLength;\n\t\t\treturn $this->txtCapacidadTanque;\n\t\t}", "public static function build(): self\n {\n $localChargers = Charger :: with( 'connector_types' ) -> get();\n $localConnectorTypes = ConnectorType :: all();\n \n return (new self) \n -> setLocalChargers ( $localChargers )\n -> setLocalConnectorTypes( $localConnectorTypes );\n }", "public function buildForm()\n {\n $this\n ->addMeasureList()\n ->addAscendingList()\n ->addTitles(['class' => 'indicator_title_title_narrative', 'narrative_true' => true])\n ->addDescriptions(['class' => 'indicator_description_title_narrative'])\n ->addCollection('reference', 'Activity\\Reference', 'reference', [], trans('elementForm.reference'))\n ->addAddMoreButton('add_reference', 'reference')\n ->addBaselines()\n ->addPeriods()\n ->addAddMoreButton('add_period', 'period')\n ->addRemoveThisButton('remove_indicator');\n }", "public function construct() {\n\n }", "public function txtCapacidadCarga_Create($strControlId = null) {\n\t\t\t$this->txtCapacidadCarga = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtCapacidadCarga->Name = QApplication::Translate('Capacidad Carga');\n\t\t\t$this->txtCapacidadCarga->Text = $this->objFichas->CapacidadCarga;\n\t\t\t$this->txtCapacidadCarga->MaxLength = Fichas::CapacidadCargaMaxLength;\n\t\t\treturn $this->txtCapacidadCarga;\n\t\t}", "private function buildControls(){\n\n\t\t//create key - label pairs for this dropdown:\n\n\t\t$name = '_column_type_'.$this->fullId;\n\t\t$types = $this->getTypes();\n\n\t\tif( $this->referenceMode )\n\t\t\t$name = 'reference_'.$this->fullId;\n\n\n\t\tif( sizeof( $types ) > 1 ){\n\t\t\t\n\t\t\t$typeSelector = Field::select(\n\t\t\t\t$name,\n\t\t\t\t'',\n\t\t\t\t$types,\n\t\t\t\tarray(\n\t\t\t\t\t'defaultValue' => $this->type\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$class = 'column-controls column-choices-available';\n\n\t\t}else{\n\t\t\t$class = 'column-controls';\n\t\t\t$key = array_keys( $types );\n\t\t\t$typeSelector = Field::hidden( \n\t\t\t\t$name, \n\t\t\t\t[ \n\t\t\t\t\t'defaultValue' => $this->type, \n\t\t\t\t\t'class' => 'type-select'\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\techo '<div class=\"'.$class.'\">';\n\n\t\t\t//render the dropdown:\n\t\t\t$typeSelector->render();\n\t\t\techo '<h3 class=\"column-type\">'.$types[ $this->type ].'</h3>';\n\n\t\t\t//sorter\n\t\t\techo '<span class=\"sort dashicons dashicons-leftright\"></span>';\n\n\t\techo '</div>';\n\n\t}", "protected function _register_controls() {\n\n\t\t//link\n\t\t//image\n\t\t//featured\n\t\t//term\n\t\t//style alternative-imagebox\n\t\t//\n\t\t//\n\n\n\t\t$this->start_controls_section(\n\t\t\t'section_content',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Content', 'elementor-listeo' ),\n\t\t\t)\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'url',\n\t\t\t[\n\t\t\t\t'label' => __( 'Link','elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::URL,\n\t\t\t\t'placeholder' => __( 'https://your-link.com', 'elementor-listeo' ),\n\t\t\t\t'show_external' => true,\n\t\t\t\t'default' => [\n\t\t\t\t\t'url' => '',\n\t\t\t\t\t'is_external' => true,\n\t\t\t\t\t'nofollow' => true,\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'background',\n\t\t\t[\n\t\t\t\t'label' => __( 'Choose Background Image', 'elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::MEDIA,\n\t\t\t\t'default' => [\n\t\t\t\t\t'url' => \\Elementor\\Utils::get_placeholder_image_src(),\n\t\t\t\t]\n\t\t\t]\n\t\t);\n\n\n\n\t\t// $this->add_control(\n\t\t// \t'featured',\n\t\t// \t[\n\t\t// \t\t'label' => __( 'Featured badge', 'elementor-listeo' ),\n\t\t// \t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t// \t\t'label_on' => __( 'Show', 'your-plugin' ),\n\t\t// \t\t'label_off' => __( 'Hide', 'your-plugin' ),\n\t\t// \t\t'return_value' => 'yes',\n\t\t// \t\t'default' => 'yes',\n\t\t// \t]\n\t\t// );\n\n\t\t$this->add_control(\n\t\t\t'taxonomy',\n\t\t\t[\n\t\t\t\t'label' => __( 'Taxonomy', 'elementor-listeo' ),\n\t\t\t\t'type' => Controls_Manager::SELECT2,\n\t\t\t\t'label_block' => true,\n\t\t\t\t'default' => [],\n\t\t\t\t'options' => $this->get_taxonomies(),\n\t\t\t\t\n\t\t\t]\n\t\t);\n\n\t\t$taxonomy_names = get_object_taxonomies( 'listing','object' );\n\t\tforeach ($taxonomy_names as $key => $value) {\n\t\n\t\t\t$this->add_control(\n\t\t\t\t$value->name.'term',\n\t\t\t\t[\n\t\t\t\t\t'label' => __( 'Show term from '.$value->label, 'elementor-listeo' ),\n\t\t\t\t\t'type' => Controls_Manager::SELECT2,\n\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t'default' => [],\n\t\t\t\t\t'options' => $this->get_terms($value->name),\n\t\t\t\t\t'condition' => [\n\t\t\t\t\t\t'taxonomy' => $value->name,\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\n\t\t$this->add_control(\n\t\t\t'show_counter',\n\t\t\t[\n\t\t\t\t'label' => __( 'Show listings counter', 'elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Show', 'your-plugin' ),\n\t\t\t\t'label_off' => __( 'Hide', 'your-plugin' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => 'yes',\n\t\t\t]\n\t\t);\n\n\n\t\t$this->add_control(\n\t\t\t'style',\n\t\t\t[\n\t\t\t\t'label' => __( 'Style ', 'elementor-listeo' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t'default' => 'alternative-imagebox',\n\t\t\t\t'options' => [\n\t\t\t\t\t'standard' => __( 'Standard', 'elementor-listeo' ),\n\t\t\t\t\t'alternative-imagebox' => __( 'Alternative', 'elementor-listeo' ),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\n\t\t\n\n\t\t$this->end_controls_section();\n\n\t}", "public function txtState_Create($strControlId = null) {\n\t\t\t$this->txtState = new QTextBox($this->objParentObject, $strControlId);\n\t\t\t$this->txtState->Name = QApplication::Translate('State');\n\t\t\t$this->txtState->Text = $this->objCharityPartner->State;\n\t\t\t$this->txtState->MaxLength = CharityPartner::StateMaxLength;\n\t\t\treturn $this->txtState;\n\t\t}", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: string properties');\r\n\r\n $stringpainted[] =& $this->createElement('radio', null, null, 'Yes', true);\r\n $stringpainted[] =& $this->createElement('radio', null, null, 'No', false);\r\n $this->addGroup($stringpainted, 'stringpainted', 'Render a custom string:');\r\n\r\n $this->addElement('text', 'stringid', 'Id:', array('size' => 32));\r\n $this->addElement('text', 'stringclass', 'CSS class:', array('size' => 32));\r\n $this->addElement('text', 'stringvalue', 'Content:', array('size' => 32));\r\n\r\n $stringsize['width'] =& $this->createElement('text',\r\n 'width', 'width',\r\n array('size' => 4));\r\n $stringsize['height'] =& $this->createElement('text',\r\n 'height', 'height',\r\n array('size' => 4));\r\n $stringsize['left'] =& $this->createElement('text',\r\n 'left', 'left',\r\n array('size' => 4));\r\n $stringsize['top'] =& $this->createElement('text',\r\n 'top', 'top',\r\n array('size' => 4));\r\n $stringsize['bgcolor'] =& $this->createElement('text',\r\n 'bgcolor', 'bgcolor',\r\n array('size' => 7));\r\n $this->addGroup($stringsize, 'stringsize', 'Size, position and color:', ' ');\r\n\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Left', 'left');\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Right', 'right');\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Top', 'top');\r\n $stringvalign[] =& $this->createElement('radio', null, null,\r\n 'Bottom', 'bottom');\r\n $this->addGroup($stringvalign, 'stringvalign', 'Vertical alignment:');\r\n\r\n $stringalign[] =& $this->createElement('radio', null, null,\r\n 'Left', 'left');\r\n $stringalign[] =& $this->createElement('radio', null, null,\r\n 'Right', 'right');\r\n $stringalign[] =& $this->createElement('radio', null, null,\r\n 'Center', 'center');\r\n $this->addGroup($stringalign, 'stringalign', 'Horizontal alignment:');\r\n\r\n $stringfont['family'] =& $this->createElement('text',\r\n 'family', 'family',\r\n array('size' => 40));\r\n $stringfont['size'] =& $this->createElement('text',\r\n 'size', 'size',\r\n array('size' => 2));\r\n $stringfont['color'] =& $this->createElement('text',\r\n 'color', 'color',\r\n array('size' => 7));\r\n $this->addGroup($stringfont, 'stringfont', 'Font:', ' ');\r\n\r\n $stringweight[] =& $this->createElement('radio', null, null,\r\n 'normal', 'normal');\r\n $stringweight[] =& $this->createElement('radio', null, null,\r\n 'Bold', 'bold');\r\n $this->addGroup($stringweight, 'stringweight', 'Font weight:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('apply','process'));\r\n }", "public function __get($strName) {\n\t\t\tswitch ($strName) {\n\t\t\t\t// General MetaControlVariables\n\t\t\t\tcase 'ComandoRisco': return $this->objComandoRisco;\n\t\t\t\tcase 'TitleVerb': return $this->strTitleVerb;\n\t\t\t\tcase 'EditMode': return $this->blnEditMode;\n\n\t\t\t\t// Controls that point to ComandoRisco fields -- will be created dynamically if not yet created\n\t\t\t\tcase 'IdControl':\n\t\t\t\t\tif (!$this->lblId) return $this->lblId_Create();\n\t\t\t\t\treturn $this->lblId;\n\t\t\t\tcase 'IdLabel':\n\t\t\t\t\tif (!$this->lblId) return $this->lblId_Create();\n\t\t\t\t\treturn $this->lblId;\n\t\t\t\tcase 'ComandoItemIdControl':\n\t\t\t\t\tif (!$this->lstComandoItem) return $this->lstComandoItem_Create();\n\t\t\t\t\treturn $this->lstComandoItem;\n\t\t\t\tcase 'ComandoItemIdLabel':\n\t\t\t\t\tif (!$this->lblComandoItemId) return $this->lblComandoItemId_Create();\n\t\t\t\t\treturn $this->lblComandoItemId;\n\t\t\t\tcase 'ComandoIdControl':\n\t\t\t\t\tif (!$this->lstComando) return $this->lstComando_Create();\n\t\t\t\t\treturn $this->lstComando;\n\t\t\t\tcase 'ComandoIdLabel':\n\t\t\t\t\tif (!$this->lblComandoId) return $this->lblComandoId_Create();\n\t\t\t\t\treturn $this->lblComandoId;\n\t\t\t\tcase 'ReferenciaControl':\n\t\t\t\t\tif (!$this->txtReferencia) return $this->txtReferencia_Create();\n\t\t\t\t\treturn $this->txtReferencia;\n\t\t\t\tcase 'ReferenciaLabel':\n\t\t\t\t\tif (!$this->lblReferencia) return $this->lblReferencia_Create();\n\t\t\t\t\treturn $this->lblReferencia;\n\t\t\t\tcase 'MoldeIdControl':\n\t\t\t\t\tif (!$this->lstMolde) return $this->lstMolde_Create();\n\t\t\t\t\treturn $this->lstMolde;\n\t\t\t\tcase 'MoldeIdLabel':\n\t\t\t\t\tif (!$this->lblMoldeId) return $this->lblMoldeId_Create();\n\t\t\t\t\treturn $this->lblMoldeId;\n\t\t\t\tcase 'TamanhoIdControl':\n\t\t\t\t\tif (!$this->lstTamanho) return $this->lstTamanho_Create();\n\t\t\t\t\treturn $this->lstTamanho;\n\t\t\t\tcase 'TamanhoIdLabel':\n\t\t\t\t\tif (!$this->lblTamanhoId) return $this->lblTamanhoId_Create();\n\t\t\t\t\treturn $this->lblTamanhoId;\n\t\t\t\tcase 'QuantidadeRiscoControl':\n\t\t\t\t\tif (!$this->txtQuantidadeRisco) return $this->txtQuantidadeRisco_Create();\n\t\t\t\t\treturn $this->txtQuantidadeRisco;\n\t\t\t\tcase 'QuantidadeRiscoLabel':\n\t\t\t\t\tif (!$this->lblQuantidadeRisco) return $this->lblQuantidadeRisco_Create();\n\t\t\t\t\treturn $this->lblQuantidadeRisco;\n\t\t\t\tcase 'BalancoPecasAsOrdemProducaoGradeControl':\n\t\t\t\t\tif (!$this->lstBalancoPecasAsOrdemProducaoGrade) return $this->lstBalancoPecasAsOrdemProducaoGrade_Create();\n\t\t\t\t\treturn $this->lstBalancoPecasAsOrdemProducaoGrade;\n\t\t\t\tcase 'BalancoPecasAsOrdemProducaoGradeLabel':\n\t\t\t\t\tif (!$this->lblBalancoPecasAsOrdemProducaoGrade) return $this->lblBalancoPecasAsOrdemProducaoGrade_Create();\n\t\t\t\t\treturn $this->lblBalancoPecasAsOrdemProducaoGrade;\n\t\t\t\tdefault:\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn parent::__get($strName);\n\t\t\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\t\t\tthrow $objExc;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}", "public function build();", "public function build();" ]
[ "0.6844415", "0.66062874", "0.6547124", "0.633422", "0.62981737", "0.603502", "0.6032244", "0.6017804", "0.5953629", "0.5951771", "0.57967544", "0.5744204", "0.5725183", "0.5694053", "0.56798923", "0.5679738", "0.5674477", "0.56679595", "0.5666812", "0.56638664", "0.56607026", "0.5657083", "0.5615587", "0.5615587", "0.5615587", "0.56152433", "0.56142396", "0.5609812", "0.5609812", "0.56079096", "0.5598025", "0.5580191", "0.55649585", "0.5560976", "0.5560976", "0.5560419", "0.55545914", "0.5552763", "0.5549279", "0.55481833", "0.55394596", "0.5527461", "0.5527461", "0.5527461", "0.5527461", "0.55271053", "0.55255276", "0.5521252", "0.5508464", "0.5506851", "0.54994786", "0.5498528", "0.5492178", "0.5486205", "0.54781973", "0.54771924", "0.545612", "0.545612", "0.5450483", "0.54448867", "0.5444034", "0.544127", "0.5437383", "0.54348505", "0.5432109", "0.5428565", "0.5418007", "0.54168594", "0.5416409", "0.54093426", "0.5406136", "0.5395952", "0.5391378", "0.5389693", "0.53871477", "0.5372744", "0.5365843", "0.5363959", "0.5358685", "0.5350944", "0.53494227", "0.53490746", "0.53462017", "0.5334976", "0.53295326", "0.5327958", "0.53266513", "0.53214145", "0.5316301", "0.53146213", "0.5311877", "0.531114", "0.5304652", "0.52993983", "0.5286064", "0.52775073", "0.5271914", "0.52683204", "0.5264228", "0.5264228" ]
0.5278212
95
CRUD Model / CREATE Crea, inserisce, un record in tabella
static function create( $table_name, $values ) { global $wpdb; $result = $wpdb->insert( $table_name, $values ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate() {\n $model = new TabellePlattform();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n// $this->success = 2; // 2->insert erfolgreich\n \n// $model = $this->findModel($model->id);\n// $model->setIsNewRecord(false);\n \n return $this->redirect(['update','id'=>$model->id,'mySuccess' => 2]);\n// return $this->render('update', [\n// 'model' => $model,\n// ]);\n// $this->redirect(\\Yii::$app->urlManager->createUrl(\"test/show\"));\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function crud() {\n\t\t\n\t\t$this->load->model('Produttori_model','produttori');\n\t\t$data=array(\"produttore\" => \"franco\");\n\t\t$this->produttori->create($data);\n\t\t$this->produttori->update(array(),1);\n\t\t$this->produttori->delete(3);\n\t\tvar_dump ($this->produttori->read());\n\t\t$this->load->view('welcome_message');\n\t}", "function insert(){\n //Declarar variables para recibir los datos del formuario nuevo\n $nombre=$_POST['nombre'];\n $apellido=$_POST['apellido'];\n $telefono=$_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n $this->index();\n }", "public function crear()\n {\n\n try{\n $model = new \\App\\Models\\Pasientes();\n\n foreach ($_POST as $campo => $val){\n $model->$campo = $val;\n }\n\n $model::insert($model);\n $this->historico();\n\n }catch(\\Exception $e){\n\n $this->formularioCreacion(['_error' => $e]);\n\n }\n\n }", "public function create(){\n $alter = '';\n $crear = '';\n $creartablas = '';\n\n $a = '';\n if(!empty($_POST)){\n if( isset($_POST['creartabla']) )\n $a = $_POST['creartabla'];\n }\n if($a!=''):\n $array = explode(',', $a);\n $crear = '';\n $tablas = array();\n foreach ($array as $v): \n $v = trim($v);\n $inic = $crear;\n if( stristr($v, 'id_') ){ \n $tabla = str_replace('id_', '', $v);\n $crear.= 'CREATE TABLE IF NOT EXISTS '.$tabla.' ( ';\n $crear.= ' id_'.$tabla.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n }\n if( stristr( $v, '_id') ){\n $tablas[] = str_replace('_id', '', $v);\n $crear.= ','.$v.' INTEGER(10)'; \n } \n\n if( stristr($v, 'fecha' )or stristr($v, 'fecha') ) $crear.= ','.$v.' DATE NOT NULL '; \n if( stristr($v, '_nro' ) or stristr($v, 'nro_' ) ) $crear.= ','.$v.' INTEGER(10) NOT NULL '; \n if( stristr($v, 'text' ) or stristr($v, 'texto' ) ) $crear.= ','.$v.' TEXT NOT NULL COMMENT \\'col:12\\' '; \n if( stristr($v, 'timestamp' ) ) $crear.= ','.$v.' TIMESTAMP DEFAULT CURRENT_TIMESTAMP '; \n if($inic==$crear) $crear.= ','.$v.' VARCHAR(255) NOT NULL '; \n \n \n endforeach;\n\n $fk = '';\n $creartablas ='';\n foreach ($tablas as $value):\n $fk.=', FOREIGN KEY('.$value.'_id) REFERENCES '.$value.'(id_'.$value.') '; \n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$value.' ( ';\n $creartablas.= ' id_'.$value.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$value.' VARCHAR(99) NOT NULL';\n $creartablas.= ', detail_'.$value.' VARCHAR(99) NOT NULL ';\n $creartablas.= ') ENGINE = InnoDB; ';\n endforeach;\n $crear .= $fk.') ENGINE = InnoDB;';\n\n $a = $creartablas.$crear;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n $tables = $this -> Tables_model -> table_name();\n $this->session->set_userdata('tables', $tables);\n return $re;\n endif;\n }", "public function Crud(){\n $pvd = new alumno();\n\n //Se obtienen los datos del alumno a editar.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Alumno/editar-alumnos.php';\n\t}", "public function actionCreate() {\n \n $model = new Pago;\n $transaction=$model->dbConnection->beginTransaction();\n try\n {\n \n //Cargo datos en Pagos\n\n $recibo = $this->loadModelRecibo($_GET['id']);\n $importe = $recibo->importePendiente;\n \n if (isset($_GET['id'])) {\n $model->attributes = $_GET['id'];\n $model->idRecibo = $recibo->idRecibo;\n $model->fecha = date('Y-m-d H:i:s');\n $model->importe = $recibo->importePendiente;\n $model->idUsuario = Yii::app()->user->id;\n $model->idMedioPago = 1;\n \n \n if ($model->save()) {\n \n // Modifico Recibos actualizando datos\n\n $recibo->importePendiente = 0;\n $recibo->fechaCobroCompleto = $model->fecha;\n \n // Modifico la Cuenta con los saldos\n\n $recibo->idCuenta0->saldo = $recibo->idCuenta0->saldo - $importe;\n $recibo->save();\n \n $transaction->commit();\n \n Yii::app()->user->setFlash('success',\"El pago fue registrado.\");\n $this->redirect(array('view', 'id' => $model->idPago));\n }\n $transaction->rollback();\n }\n \n $this->render('update', array('model' => $model,));\n \n } \n catch(Exception $e)\n {\n $transaction->rollback();\n \n throw $e;\n }\n \n }", "public function createAction() {\n $model = new Application_Model_Compromisso();\n //persisto os dados no banco\n $model->insert($this->_getAllParams());\n //redireciono para o index\n $this->_redirect('compromisso/index');\n }", "public function actionCreate()\n {\n///\n$nombre=Yii::$app->user->identity->username;\n$connection = \\Yii::$app->db;\n$db = $connection->createCommand(\"INSERT INTO auditoria (id, user, modelo, accion, fechahora) VALUES (NULL, '$nombre', 'PropiedadDet', 'Crear', NOW());\")->execute();\n///\n\n $model = new PropiedadDet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n// return $this->redirect(['view', 'id' => $model->id_propiedad_det]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n //KEMUDIAN DI DALAMNYA KITA MENJALANKAN FUNGSI UNTUK MENGOSONGKAN FIELD\n $this->resetFields();\n //DAN MEMBUKA MODAL\n $this->openModal();\n }", "protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }", "private function create() {\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (!empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toCreat();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to create!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute insert.\n\t\t$this->objAccessCrud->setDateInsert(date(\"Y-m-d H:i:s\"));\n\t\t$id = $this->objAccessCrud->create ();\n\t\t// Check result.\n\t\tif ($id == 0) {\n \t\t\t$this->msg->setError ('There were issues on creating ther record!');\n\t\t\t\treturn;\n\t\t}\n\t\t// Save the id in the session to be used in the update.\n\t\t$_SESSION ['PK']['ACCESSCRUD'] = $id;\n\t\t\t\n\t\t$this->msg->setSuccess ( 'Created the record with success!' );\n\t\treturn;\n\t}", "public function create()\n {\n //este deriva a un formulario, el cual debe tomar todos\n //los parametros del bache (nombre, fecha_y_hora, ubicacion, object_state_id (recuperarlo y pasarlo), estado(mostrar opciones y tomar el elegido)) y luego de todo esto llama a store para ser almacenado en la base de datos\n\n }", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function actionCreate()\n {\n $model = new Planilla_entrega();\n $model->scenario = 'create';\n if ($model->load(Yii::$app->request->post())) {\n \n if ($model->validate() ){ \n \n \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n //Se guarda encabezado de la PLanilla\n $model->PE_PROCESADO = 0;\n if ($model->save()){\n $this->guardar_renglones($model);\n \n }else{\n $mensaje = \"\"; \n foreach ($model->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n\n $this->verificar_pedido_completo($model->PE_NUMVALE);\n\n $transaction->commit();\n Yii::$app->getSession()->setFlash('exito_deposito_central', 'Planilla de entrega creada con éxito.');\n return $this->redirect(['view', 'id' => $model->PE_NROREM]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n \n Yii::$app->getSession()->setFlash('error_deposito_central', $e->getMessage());\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new TBantuanData;\n\n\t\t$data = json_decode(stripslashes($_POST['data']));\n\n foreach ($data as $key => $val) {\n $model->$key = $val;\n }\n\t\t\t\t\n if ($model->save()) {\n echo json_encode(array(\n \"success\" => true,\n \"data\" => array(\n \"id\" => $model->id,\n )\n ));\n }\n\t}", "public function create(): void\n {\n\n $description = null;\n $image = null;\n $velo_id = null;\n\n if (!empty($_POST['description']) && $_POST['description'] != \"\") {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!empty($_POST['image'])) {\n $image = htmlspecialchars($_POST['image']);\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n\n if (!$description || !$image || !$velo_id) {\n die(\"formulaire mal rempli\");\n }\n\n $this->model->insert($description, $image, $velo_id);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function actionCreate()\n\t{\n $id_livro = $_REQUEST['id_livro'];\n\n $model=new emprestimo;\n\n if(isset($_POST['emprestimo']))\n {\n $emprestimo = $_POST['emprestimo'];\n $emprestimo['id_livro'] = $id_livro;\n $emprestimo['data_retirada'] = date('Y-m-d',strtotime(str_replace('/', '-', $emprestimo['data_retirada'])));\n $emprestimo['data_devolucao'] = date('Y-m-d',strtotime(str_replace('/', '-', $emprestimo['data_devolucao'])));\n \n $model->attributes=$emprestimo;\n \n if($model->save())\n $this->redirect(array('/bibliotecas/livro/view','id'=>$model->id_livro));\n }\n\n $aluno = aluno::model()->findByPk($model->id_aluno);\n $livro = livro::model()->findByPk($id_livro);\n \n $biblioteca = biblioteca::model()->findByPk($livro->id_biblioteca);\n\n $this->render('create',array(\n 'model'=>$model, 'aluno'=>$aluno,'livro'=>$livro,'biblioteca'=>$biblioteca,\n ));\n\t}", "public function actionCreate()\n {\n // var_dump(1);\n $request = Yii::$app->request;\n $model['tintuc'] = new TinTuc();\n $model['loaitin']= DmLoaitin::find()->orderBy('ten_loai')->all();\n \n if ($request->isPost && $model['tintuc']->load($request->post()) && $model['tintuc']->validate()) {\n // $model['tintuc']->taikhoan_id= Yii::$app->user->id;\n // dd($model['tintuc']);\n $model['tintuc']->save();\n\n return $this->redirect(['view', 'id' => $model['tintuc']->id_tintuc]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'const' => $this->const,\n 'categories' => $this->getCategories(),\n ]);\n \n }", "public function actionCreate()\r\n {\r\n $model = new Pelanggaran();\r\n $trans = Yii::$app->db->beginTransaction();\r\n\r\n if ($model->loadAll(Yii::$app->request->post()) && $model->save()) {\r\n $check = $this->checkDetailPoint($model, 'create');\r\n \r\n if( isset($check['failed']) ){\r\n $trans->rollBack();\r\n Yii::$app->session->setFlash('error', $check['failed'] );\r\n return $this->redirect(['index']);\r\n }\r\n\r\n $trans->commit();\r\n Yii::$app->session->setFlash('success','Pelanggaran berhasil ditambahkan.');\r\n return $this->redirect(['index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate() {\n $model = new TabelleRelease();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n\n return $this->redirect(['update', 'id' => $model->id, 'mySuccess' => 2]);\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function create()//what will happen when we press submit\r\n\t\t{\r\n\t\t\t$my_Array=array(\r\n\t\t\t\t\t\t\t\"firstname\" =>$this->input->post(\"firstName\"), \r\n\t\t\t\t\t\t\t\"email\"=>$this->input->post(\"email\")\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->model5->add_records($my_Array);\r\n\t\t\t$this->index();\r\n\t\t\t\t\t\r\n\t\t}", "public function actionCreate()\n {\n $model = new Data();\n $oldModel = $model->attributes;\n\n $model->discount = 0;\n $model->activation_date = date('Y-m-d');\n\n if ($model->load(Yii::$app->request->post()) /*&& $model->save()*/) {\n\n $check = self::check($model);\n\n if($check && $model->save()){\n $newModel = $model->attributes;\n (new History())->setRow(Yii::$app->controller, $oldModel, $newModel, 'Создан клиент '.$newModel['user_name']);\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n else{\n // сформируем номер новой карты клиента\n $next_card = Data::find()->max('card') + 1;\n $model->card = $next_card;\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function Crud(){\r\n \r\n // if(isset($_REQUEST['Seq_Registro'])){\r\n // $alm = $this->model->Obtener($_REQUEST['Seq_Registro']);\r\n // }\r\n \r\n // require_once 'view/header.php';\r\n // require_once 'view/Registro/Nuevo_registro.php';\r\n // require_once 'view/footer.php';\r\n require_once 'view/medics/create.php';\r\n }", "public function insert()\n\t{\n\t\t$crud = $this->crud->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->insert();\n\t\t$this->redirect('crud');\n\t}", "public function actionCreateDatos($id) {\n $traza = Traza::VerificarTraza($id); // verifica el guardado de la traza\n if ($traza != 2) {\n Generico::renderTraza($id); //renderiza a la traza\n }\n\n $model = Beneficiario::model()->findByPk($id);\n $estado = new Tblestado;\n $municipio = new Tblmunicipio;\n $parroquia = new Tblparroquia;\n $faovPromedio = ConsultaOracle::getFaov($id, 1); //consulta la funcion faov por id de persona, para mostrar el calculo de promedio\n $faovMensual = ConsultaOracle::getFaov($id, 2); //consulta la funcion faov por id de persona, para mostrar el calculo de ingreso mesual\n $model->ingreso_mensual = ($faovMensual) ? $faovMensual : '0.00';\n $model->ingreso_promedio_faov = ($faovPromedio) ? $faovPromedio : '0.00';\n\n// $consulta = UnidadFamiliar::model()->findByAttributes(array('beneficiario_id' => $id)); // consulta a Unidad Familiar por el id_beneficiario \n//\n// $sqlIngreso = \"select sum(ingreso_mensual) as ingreso from grupo_familiar where unidad_familiar_id=\".$consulta->id_unidad_familiar.\"\"; //consulta que suma cuanto es el ingreso de grupo familiar por id_beneficiario\n// $rowingreso = Yii::app()->db->createCommand($sqlIngreso)->queryRow();\n//// echo '<pre>'; var_dump($rowingreso); die(); \n// $consulta->ingreso_total_familiar=$rowingreso['ingreso']; //insert para unidad familiar ingreso_total_familiar\n// \n// $sqlFaov = \"select count(*) as faov from grupo_familiar where unidad_familiar_id=\".$consulta->id_unidad_familiar.\"\"; //consulta que suma cuantos cotizan en faov del grupo familiar por id_beneficiario\n// $rowFaov = Yii::app()->db->createCommand($sqlFaov)->queryRow();\n// \n// $consulta->total_personas_cotizando=$rowFaov['faov']; //insert para unidad familiar total de personas cotizando\n\n\n if (isset($_POST['Beneficiario']['parroquia_id'])) {\n $model->cedula = 'campo';\n $model->attributes = $_POST['Beneficiario'];\n $model->parroquia_id = $_POST['Beneficiario']['parroquia_id'];\n $model->urban_barrio = $_POST['Beneficiario']['urban_barrio'];\n $model->av_call_esq_carr = $_POST['Beneficiario']['av_call_esq_carr'];\n $model->zona = $_POST['Beneficiario']['zona'];\n $model->condicion_trabajo_id = $_POST['Beneficiario']['condicion_trabajo_id'];\n $model->fuente_ingreso_id = $_POST['Beneficiario']['fuente_ingreso_id'];\n $model->condicion_laboral = $_POST['Beneficiario']['condicion_laboral'];\n $model->sector_trabajo_id = $_POST['Beneficiario']['sector_trabajo_id'];\n $model->nombre_empresa = $_POST['Beneficiario']['nombre_empresa'];\n $model->direccion_empresa = $_POST['Beneficiario']['direccion_empresa'];\n $model->telefono_trabajo = $_POST['Beneficiario']['telefono_trabajo'];\n $model->gen_cargo_id = $_POST['Beneficiario']['gen_cargo_id'];\n $model->observacion = $_POST['Beneficiario']['observacion'];\n $model->estatus_beneficiario_id = 222;\n $model->usuario_id_actualizacion = Yii::app()->user->id;\n\n\n if ($model->save()) {\n\n $IdBeneficiarioTmp = $model->beneficiario_temporal_id;\n $n = BeneficiarioTemporal::model()->updateByPk($IdBeneficiarioTmp, array(\n 'estatus' => 79,\n 'usuario_id_actualizacion' => Yii::app()->user->id,\n 'fecha_actualizacion' => 'now()'\n ));\n\n $idtraza = Traza::ObtenerIdTraza($model->id_beneficiario); // pemite la busqueda de la id de la traza \n $delete = Traza::model()->findByPk($idtraza)->delete();\n\n $this->redirect(array('admin'));\n Yii::app()->end();\n }\n }\n\n $this->render('createDatos', array(\n 'model' => $model, 'municipio' => $municipio, 'estado' => $estado, 'parroquia' => $parroquia,\n ));\n }", "public function actionCreate()\n {\n\n $model = new Baocaokiemtra();\n $nguoinopthue = new Nguoinopthue();\n $quyetdinhkiemtra = new Quyetdinhkiemtra();\n $truongdoankiemtra = new Truongdoankiemtra();\n $lichsunopsaukiemtra = new Lichsunopsaukiemtra();\n $quyetdinhxuly = new Quyetdinhxuly();\n $datevalidation = new DateValidation();\n $lichsunopquyhoanthue = new Lichsunopquyhoanthue();\n\n if ($model->load(Yii::$app->request->post())) {\n $nguoinopthue->load(Yii::$app->request->post());\n $quyetdinhkiemtra->load(Yii::$app->request->post());\n $quyetdinhxuly->load(Yii::$app->request->post());\n $truongdoankiemtra->load(Yii::$app->request->post());\n $lichsunopsaukiemtra->load(Yii::$app->request->post());\n $lichsunopquyhoanthue->load(Yii::$app->request->post());\n $datevalidation->load(Yii::$app->request->post());\n\n if ($truongdoankiemtra->truongDoan) {\n $temp = Truongdoankiemtra::find()->where(['=', 'truongDoan', $truongdoankiemtra->truongDoan])->one();\n if (!$temp) {\n $truongdoankiemtra->save();\n $quyetdinhkiemtra->truongDoanId = $truongdoankiemtra->id;\n } else {\n $quyetdinhkiemtra->truongDoanId = $temp->id;\n }\n }\n\n $quyetdinhkiemtra->ngayQdKiemTra = $this->convertDatetime($datevalidation->ngayQdKiemTra);\n $quyetdinhkiemtra->ngayCongBoQdkt = $this->convertDatetime($datevalidation->ngayCongBoQdkt);\n $quyetdinhkiemtra->ngayTrinhVbTamDungKt = $this->convertDatetime($datevalidation->ngayTrinhVbTamDungKt);\n $quyetdinhkiemtra->ghiChu4 = $quyetdinhkiemtra->nienDoKiemTra;\n $quyetdinhkiemtra->ngayTao = date('Y-m-d 00:00:00', time() + 3600 * 7);\n $quyetdinhkiemtra->save();\n\n if ($datevalidation->soQdxl) {\n $quyetdinhxuly->soQdXuLy = $datevalidation->soQdxl;\n $quyetdinhxuly->ngayQdXuLy = $this->convertDatetime($datevalidation->ngayQdXuLy);\n $quyetdinhxuly->ngayTao = date('Y-m-d 00:00:00', time() + 3600 * 7);\n $quyetdinhxuly->save();\n }\n\n $model->soQdktId = $quyetdinhkiemtra->id;\n $model->soQdXuLyId = $quyetdinhxuly->id;\n\n $model->mst = $nguoinopthue->maSoThue;\n $model->ngayKyBbkt = $this->convertDatetime($datevalidation->ngayKyBbkt);\n\n if ($model->loaiKhuVucId == 0) {\n $model->loaiKhuVucId = null;\n }\n if ($model->loaiNdktId == 0) {\n $model->loaiNdktId = null;\n }\n if ($model->loaiQuyMoId == 0) {\n $model->loaiQuyMoId = null;\n }\n\n $model->save();\n\n $lichsunopsaukiemtra->soQdktId = $model->id;\n $lichsunopsaukiemtra->save();\n\n if ($model->soQdXuLyId) {\n preg_match('/^[0-9]{4}-[0-9]{4}$/', $quyetdinhkiemtra->nienDoKiemTra, $matches);\n\n if (count($matches)) {\n\n $baocaobaohiemxahoi = new Baocaobaohiemxahoi();\n\n $baocaobaohiemxahoi->soQdxlId = $quyetdinhxuly->id;\n $baocaobaohiemxahoi->mst = $nguoinopthue->maSoThue;\n $baocaobaohiemxahoi->truongDoan = $truongdoankiemtra->truongDoan;\n $baocaobaohiemxahoi->save();\n\n $year = explode('-', $quyetdinhkiemtra->nienDoKiemTra);\n\n for ($i = $year[0]; $i <= $year[1]; $i++) {\n $baocaobaohiemxahoitheonam = new Baocaobaohiemxahoitheonam();\n\n $baocaobaohiemxahoitheonam->mst = $nguoinopthue->maSoThue;\n $baocaobaohiemxahoitheonam->soQdxlId = $quyetdinhxuly->id;\n\n $baocaobaohiemxahoitheonam->bhxhId = $baocaobaohiemxahoi->id;\n $baocaobaohiemxahoitheonam->namKtbhxh = $i;\n\n $baocaobaohiemxahoitheonam->ghiChu3 = Nguoinopthue::findOne($nguoinopthue->maSoThue)->maSoThue;\n $baocaobaohiemxahoitheonam->ghiChu4 = $quyetdinhxuly->soQdXuLy;\n\n $baocaobaohiemxahoitheonam->save();\n\n }\n }\n\n }\n\n if ($model->loaiNdktId == 14 || $model->loaiNdktId == 15) {\n\n $sotheodoisauhoanthue = new Sotheodoisauhoanthue();\n\n $sotheodoisauhoanthue->truocHoanSauHoan = $model->loaiNdktId == 14 ? 0 : 1;\n\n $sotheodoisauhoanthue->mst = $model->mst;\n $sotheodoisauhoanthue->soQdKtId = $model->soQdktId;\n\n $quyetdinhxuphat = new Quyetdinhxuphat();\n if ($model->soQdXuLyId) {\n $quyetdinhxuphat->soQdXuPhat = $quyetdinhxuly->soQdXuLy;\n $quyetdinhxuphat->ngayQdXuPhat = $quyetdinhxuly->ngayQdXuLy;\n\n $sotheodoisauhoanthue->soQdXuPhatId = $quyetdinhxuphat->id;\n }\n\n $sotheodoisauhoanthue->chiTietHanhViViPham = $model->hanhViViPham;\n\n $sotheodoisauhoanthue->save();\n\n $lichsunopquyhoanthue = new Lichsunopquyhoanthue();\n $lichsunopquyhoanthue->soTheoDoiId = $sotheodoisauhoanthue->id;\n $lichsunopquyhoanthue->daNopThueThuHoi = $lichsunopsaukiemtra->daNopPhatSinhTruyHoan;\n $lichsunopquyhoanthue->daNopTienPhatViPham = $lichsunopsaukiemtra->daNopTienPhat;\n $lichsunopquyhoanthue->thoiDiemNop = date(\"Y-m-d H:i:s\", time() + 3600 * 7);\n\n $lichsunopquyhoanthue->save();\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'nguoinopthue' => $nguoinopthue,\n 'quyetdinhkiemtra' => $quyetdinhkiemtra,\n 'truongdoankiemtra' => $truongdoankiemtra,\n 'quyetdinhxuly' => $quyetdinhxuly,\n 'lichsunopsaukiemtra' => $lichsunopsaukiemtra,\n 'datevalidation' => $datevalidation\n ]);\n }\n\n }", "public function creer(){ /*** Cree un utilisateur par insertion d'un tuple dans la table UserTab ***/\r\n \r\n \r\n // $this -> setInscrit(1);\r\n $this -> insertDb();//Insertion en Bd d'un tuple user\r\n\t\t\t\r\n }", "public function criarAction() {\n if($this->usuario['tp_id']==5){\n $this->_redirect('index');\n }\n $this->modelColonia->insert($this->_getAllParams());\n\n $this->_redirect('colonia/index');\n }", "public function create()\n {\n //recupération des données en post\n $data = $this->request->data;\n\n //librerie de validation des champs\n $this->loadLibrary('checker');\n $this->checker->useInputField(true, $data);\n\n //vérification des champs necessaires pour la création de l'unité d'enseignement \n if(true !== $this->checker->inField('id_matiere','id_tranche','id_classe','id_utilisateur', 'date_jour')) {\n $this->_return('Veuillez remplir tous les champs du formulaire prefixés de * ', false);\n }\n\n try {\n\n if (true !== $this->model->exist('id_utilisateur', (int)$data['id_utilisateur'], 'Utilisateurs')) {\n $this->_return('l\\'utilisateur spécifié n\\existe pas. ', false);\n }\n if (true !== $this->model->exist('id_utilisateur', (int)$data['id_utilisateur'], 'Professeurs')) {\n $this->_return('l\\'utilisateur spécifié n\\'est pas un professeur', false);\n }\n if (true !== $this->model->exist('id_classe', (int)$data['id_classe'], 'Classes')) {\n $this->_return('la classe spécifiée n\\existe pas. ', false);\n }\n if (true !== $this->model->exist('id_matiere', (int)$data['id_matiere'], 'Matieres')) {\n $this->_return('la matière spécifiée n\\existe pas. ', false);\n }\n if (true !== $this->model->exist('id_tranche', (int)$data['id_tranche'], 'Tranches_horaires')) {\n $this->_return('la tranche horaire spécifiée n\\existe pas. ', false);\n }\n\n //conversion des données reçu par post\n $planing['id_matiere'] = (int)$data['id_matiere'];\n $planing['id_tranche'] = (int)$data['id_tranche'];\n $planing['id_classe'] = (int)$data['id_classe'];\n $planing['id_utilisateur'] = (int)$data['id_utilisateur'];\n $planing['date_jour'] = (string)$data['date_jour'];\n $planing['statut_existant'] = 1; \n \n if(true === $this->model->exist_classe_tranche($planing['id_classe'], $planing['id_tranche'], $planing['date_jour']))\n {\n $this->_return('cette classe a déja un cours programmer à cette heure', false);\n }\n\n if(true === $this->model->exist_professeurs_tranche($planing['id_utilisateur'], $planing['id_tranche'], $planing['date_jour']))\n {\n $this->_return('ce professeur a déja été programmer a cette heure dans une autre salle de classe', false);\n }\n\n //Aucune des informations n'existe deja en base de donnée\n $this->model->create($planing);\n $this->_return('Cours programmé avec succès!!',true);\n \n //code...\n } catch (Exception $e) {\n $this->_exception($e);\n }\n }", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create() //添加\n {\n\t\t//\n }", "public function crear() {\n /**\n * guardamos la consulta en $sql\n * ejecutamos la consulta en php \n * asignamos el id del objeto = al ultimo id que añadimos a la bd, asi coincidiran el id objeto con tupla\n * lista de atributos a introducir valores de atributos a introducir\n * formato insertar datos INSERT INTO NombreTabla (NombreAtributo1, NombreAtributo2) VALUES (ValorAtributo1, ValorAtributo2)\n */\n // para acceder a una cosntante de la clase NombreClase::NOMBRECONSTANTE\n \n try {\n $sql=\"INSERT INTO \".Bebidas::TABLA[0].\" (nombre, descripcion, tipo, estado, foto) VALUES ('$this->nombre', '$this->descripcion', '$this->tipo', '$this->estado', '$this->foto')\";\n $this->conexion->query($sql);\n $this->__set(\"id_bebida\", $this->conexion->insert_id);\n } catch (Exception $ex) {\n echo 'error '.$ex;\n }\n \n }", "public function actionCreate() {\n $model = new Recetastbl();\n $items = ArrayHelper::map(\\app\\models\\Usuariostbl::find()->all(), 'id', 'username');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n //Importante, verificar primero si la receta tienen ingredientes o no.\n if (Yii::$app->request->post('cantidad') && Yii::$app->request->post('unidad') ) \n {\n //la receta recibida, tiene ingredientes.\n \n //Se reciben los 3 arreglos enviados atraves de post\n $ingredientes = Yii::$app->request->post('ingrediente');\n $cantidades = Yii::$app->request->post('cantidad');\n $unidades = Yii::$app->request->post('unidad');\n\n //Al momento de hacer $model->save, el model contendra la ID AutoIncrementable asignada por la BD\n $index = 0; //contador usado para recorrer ciertos elementos de los arreglos\n //se corren todos los elementos correspondientes a los ingredientes\n foreach ($cantidades as $cantidad) {\n //para la lista de ingredientes inicia en 1 y no 0\n //se crea una nueva variable que guardara el nuevo ingrediente\n $ingredienteModel = new \\app\\models\\Recetasproducto();\n //se asocia a la receta usando la id\n $ingredienteModel->recetastbl_id = $model->id;\n //se asocia el producto (ingrediente) usando su id\n $ingredienteModel->productostbl_id = $ingredientes[$index + 1];\n //se agrega la cantidad\n $ingredienteModel->cantidad = $cantidad;\n //se agrega la unidad de medida\n $ingredienteModel->unidad = $unidades[$index];\n\n //se guarda el ingrediente en la BD\n $ingredienteModel->save();\n $index++;\n }\n }\n //Mensaje de exito, que se recupera en el index de Recetastbl o el view\n Yii::$app->getSession()->setFlash('success', 'Receta creada con exito.');\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'items' => $items\n ]);\n }\n }", "public function Crud(){\n $pvd = new tutoria();\n\n //Se obtienen los datos del tutoria a editar.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Tutoria/editar-tutorias.php';\n\t}", "function insert(){\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono]);\n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n // $this->index();\n }", "public function actionCreate()\n {\n $model = new Skripsi();\n $model->scenario = \"sidang\";\n\n if ($model->load(Yii::$app->request->post())) {\n $skripsi=Yii::$app->request->post('Skripsi');\n $model = $this->findModel($skripsi['id_skripsi']);\n $model->load(Yii::$app->request->post());\n $model->scenario = \"sidang\";\n \n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->detailskripsipengujis = Yii::$app->request->post('Detailskripsipenguji', []);\n $unit = isset($_COOKIE['kodeunit'])?$_COOKIE['kodeunit']:'';\n $model->kode_unit = $unit;\n if ($model->save() && (count($model->detailskripsipengujis) > 0)) {\n $transaction->commit();\n return $this->redirect(['index']);\n }\n } catch (\\Exception $ecx) {\n $transaction->rollBack();\n throw $ecx;\n }\n if (count($model->detailskripsipengujis) == 0) {\n $model->addError('penguji', 'Data Skripsi Harus Memiliki Dosen penguji');\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n \n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function add(){\n $tab = DB::table('student');\n $res = $tab -> insert(['name' => '小黑', 'age' => '18']);\n }", "public function actionCreate()\n { \n\t\t$query=Was27Inspeksi::findOne(['no_register'=>$_SESSION['was_register'],'id_tingkat'=>$_SESSION['kode_tk'],'id_kejati'=>$_SESSION['kode_kejati'],'id_kejari'=>$_SESSION['kode_kejari'],'id_cabjari'=>$_SESSION['kode_cabjari'],'id_wilayah'=>$_SESSION['was_id_wilayah'],'id_level1'=>$_SESSION['was_id_level1'],'id_level2'=>$_SESSION['was_id_level2'],'id_level3'=>$_SESSION['was_id_level3'],'id_level4'=>$_SESSION['was_id_level4']]);\n if(count($query)>0){\n\t\t\t$this->redirect(\\Yii::$app->urlManager->createUrl(\"pengawasan/was27-inspeksi/update?id=\".$query->id_was_27_inspeksi));\n }else{\n\t\t\t$model \t\t\t= new Was27Inspeksi();\n\t\t\t$modelTembusanMaster = TembusanWas::findBySql(\"select * from was.was_tembusan_master where for_tabel='was_27_inspeksi' or for_tabel='master'\")->all();\t\n\t\t\t$modelTerlapor \t= LWas2Terlapor::findAll(['saran_l_was_2'=>'2','no_register'=>$_SESSION['was_register'],'id_tingkat'=>$_SESSION['kode_tk'],'id_kejati'=>$_SESSION['kode_kejati'],'id_kejari'=>$_SESSION['kode_kejari'],'id_cabjari'=>$_SESSION['kode_cabjari'],'id_wilayah'=>$_SESSION['was_id_wilayah'],'id_level1'=>$_SESSION['was_id_level1'],'id_level2'=>$_SESSION['was_id_level2'],'id_level3'=>$_SESSION['was_id_level3'],'id_level4'=>$_SESSION['was_id_level4']]);\n\t\t\t$modelPelapor\t= Pelapor::findAll(['no_register'=>$_SESSION['was_register'],'id_tingkat'=>$_SESSION['kode_tk'],'id_kejati'=>$_SESSION['kode_kejati'],'id_kejari'=>$_SESSION['kode_kejari'],'id_cabjari'=>$_SESSION['kode_cabjari']]);\n\t\t\t$FungsiWas = new FungsiComponent();\n\t\t\t$filter = \"no_register='\".$_SESSION['was_register'].\"' and id_tingkat='\".$_SESSION['kode_tk'].\"' and id_kejati='\".$_SESSION['kode_kejati'].\"' and id_kejari='\".$_SESSION['kode_kejari'].\"' and id_cabjari='\".$_SESSION['kode_cabjari'].\"' and trx_akhir=1 and id_wilayah='\".$_SESSION['was_id_wilayah'].\"' and id_level1='\".$_SESSION['was_id_level1'].\"' and id_level2='\".$_SESSION['was_id_level2'].\"' and id_level3='\".$_SESSION['was_id_level3'].\"' and id_level4='\".$_SESSION['was_id_level4'].\"'\";\n\t\t\t$getId = $FungsiWas->FunctGetIdSpwas2($filter);\n\t\t\t$modelLapdu = Lapdu::findOne(['no_register'=>$_SESSION['was_register'],'id_tingkat'=>$_SESSION['kode_tk'],'id_kejati'=>$_SESSION['kode_kejati'],'id_kejari'=>$_SESSION['kode_kejari'],'id_cabjari'=>$_SESSION['kode_cabjari']]);\n\t\t\t$idbawas2\t\t= Lwas2Inspeksi::findOne(['no_register'=>$_SESSION['was_register'],'id_tingkat'=>$_SESSION['kode_tk'],'id_kejati'=>$_SESSION['kode_kejati'],'id_kejari'=>$_SESSION['kode_kejari'],'id_cabjari'=>$_SESSION['kode_cabjari'],'id_wilayah'=>$_SESSION['was_id_wilayah'],'id_level1'=>$_SESSION['was_id_level1'],'id_level2'=>$_SESSION['was_id_level2'],'id_level3'=>$_SESSION['was_id_level3'],'id_level4'=>$_SESSION['was_id_level4']]);\n\t\t\t\n\t\t\tif ($model->load(Yii::$app->request->post())){\n\t\t\t\t$connection = \\Yii::$app->db;\n\t\t\t\t$transaction = $connection->beginTransaction();\n\t\t\t\ttry { \n\t\t\t\t\t$model->id_tingkat \t= $_SESSION['kode_tk'];\n\t\t\t\t\t$model->id_kejati \t= $_SESSION['kode_kejati'];\n\t\t\t\t\t$model->id_kejari \t= $_SESSION['kode_kejari'];\n\t\t\t\t\t$model->id_cabjari \t= $_SESSION['kode_cabjari'];\n\t\t\t\t\t$model->no_register\t= $_SESSION['was_register'];\n\t\t\t\t\t$model->id_sp_was2 \t= $idbawas2['id_sp_was2'];\n\t\t\t\t\t$model->id_ba_was2\t= $idbawas2['id_ba_was2'];\n\t\t\t\t\t$model->id_l_was2\t= $idbawas2['id_l_was2'];\n\t\t\t\t\t$model->created_ip \t= $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t$model->created_time =date('Y-m-d h:i:sa');\n\t\t\t\t\t$model->created_by \t= \\Yii::$app->user->identity->id;\n\t\t\t\t\t \n\t\t\t\tif($model->save()) {\n\t\t\t\t\tfor($i=0;$i<count($_POST['nip_terlapor']);$i++){ \n\t\t\t\t\t\t$saveModel27terlapor=new Was27InspeksiDetailTerlapor();\n\t\t\t\t\t\t$saveModel27terlapor->id_tingkat \t= $_SESSION['kode_tk'];\n\t\t\t\t\t\t$saveModel27terlapor->id_kejati \t= $_SESSION['kode_kejati'];\n\t\t\t\t\t\t$saveModel27terlapor->id_kejari \t= $_SESSION['kode_kejari'];\n\t\t\t\t\t\t$saveModel27terlapor->id_cabjari \t= $_SESSION['kode_cabjari'];\n\t\t\t\t\t\t$saveModel27terlapor->no_register\t= $_SESSION['was_register'];\n\t\t\t\t\t\t$saveModel27terlapor->id_sp_was2 \t= $model->id_sp_was2;\n\t\t\t\t\t\t$saveModel27terlapor->id_ba_was2\t= $model->id_ba_was2;\n\t\t\t\t\t\t$saveModel27terlapor->id_l_was2\t\t= $model->id_l_was2;\n\t\t\t\t\t\t$saveModel27terlapor->id_was_27_inspeksi\t\t= $model->id_was_27_inspeksi;\n\t\t\t\t\t\t$saveModel27terlapor->nip_pegawai_terlapor\t= $_POST['nip_terlapor'][$i];\n\t\t\t\t\t\t$saveModel27terlapor->created_ip \t= $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\t$saveModel27terlapor->created_time \t= date('Y-m-d h:i:sa');\n\t\t\t\t\t\t$saveModel27terlapor->created_by \t= \\Yii::$app->user->identity->id;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$saveModel27terlapor->save();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$pejabat = $_POST['pejabat'];\n\t\t\t\t\tfor($z=0;$z<count($pejabat);$z++){\n\t\t\t\t\t\t$saveTembusan = new TembusanWas2;\n\t\t\t\t\t\t$saveTembusan->from_table = 'Was-27-inspeksi';\n\t\t\t\t\t\t$saveTembusan->pk_in_table = strrev($model->id_was_27_inspeksi);\n\t\t\t\t\t\t$saveTembusan->tembusan = $_POST['pejabat'][$z];\n\t\t\t\t\t\t$saveTembusan->created_ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t\t$saveTembusan->created_time = date('Y-m-d H:i:s');\n\t\t\t\t\t\t$saveTembusan->created_by = \\Yii::$app->user->identity->id;\n\t\t\t\t\t\t$saveTembusan->no_register = $_SESSION['was_register'];\n\t\t\t\t\t\t$saveTembusan->id_tingkat = $_SESSION['kode_tk'];\n\t\t\t\t\t\t$saveTembusan->id_kejati = $_SESSION['kode_kejati'];\n\t\t\t\t\t\t$saveTembusan->id_kejari = $_SESSION['kode_kejari'];\n\t\t\t\t\t\t$saveTembusan->id_cabjari = $_SESSION['kode_cabjari'];\n\t\t\t\t\t\t$saveTembusan->is_inspektur_irmud_riksa = $_SESSION['is_inspektur_irmud_riksa'];\n\t\t\t\t\t\t$saveTembusan->id_wilayah=$_SESSION['was_id_wilayah'];\n\t\t\t\t\t\t$saveTembusan->id_level1=$_SESSION['was_id_level1'];\n\t\t\t\t\t\t$saveTembusan->id_level2=$_SESSION['was_id_level2'];\n\t\t\t\t\t\t$saveTembusan->id_level3=$_SESSION['was_id_level3'];\n\t\t\t\t\t\t$saveTembusan->id_level4=$_SESSION['was_id_level4'];\n\t\t\t\t\t\t$saveTembusan->save();\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\tYii::$app->getSession()->setFlash('success', [\n\t\t\t\t 'type' => 'success',\n\t\t\t\t 'duration' => 3000,\n\t\t\t\t 'icon' => 'fa fa-users',\n\t\t\t\t 'message' => 'Data Ba-Was9 Berhasil Disimpan',\n\t\t\t\t 'title' => 'Simpan Data',\n\t\t\t\t 'positonY' => 'top',\n\t\t\t\t 'positonX' => 'center',\n\t\t\t\t 'showProgressbar' => true,\n\t\t\t\t ]);\n\t\t\t\t$transaction->commit();\n\t\t\t\treturn $this->redirect(['index']);\n\t\t\t\t } catch(Exception $e) {\n\n $transaction->rollback();\n }\n\t\t\t} else {\n\t\t\t\treturn $this->render('create', [\n\t\t\t\t\t'model' => $model,\n\t\t\t\t\t'modelTerlapor' => $modelTerlapor,\n\t\t\t\t\t'modelTembusanMaster' => $modelTembusanMaster,\n\t\t\t\t\t'modelPelapor' => $modelPelapor,\n\t\t\t\t\t'modelLapdu' => $modelLapdu,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n }", "public function create()\n\t{\t\n\t\t$modulos_list = Modulo::all()->lists('id', 'id');\n$professores_list = Professor::all()->lists('id', 'id');\n\n\t\t// load the create form (app/views/Turma/create.blade.php)\n\t\t$this->layout->content = View::make('Turma.create')\n->with('modulos_list', $modulos_list)\n->with('professores_list', $professores_list);\n\t}", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "public function actionCreate() {}", "public function actionCreate() {}", "public function actionCreate()\n {\n $model = new EnfermedadesSintomas([\n 'enfermedad_id' => Yii::$app->request->post('list'),\n 'sintoma_id' => Yii::$app->request->post('item'),\n ]);\n //dd($model->validate());\n if (!$model->save()) {\n throw new \\Exception('No se ha ppodido agregar el sintoma a la enfermedad', 1);\n }\n }", "public function actionCreate()\n {\n $model = new Pembelian();\n\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->jenis_ppn = 'NON-PPN';\n \n $model->listPembelian = Yii::$app->request->post('ItemPembelian', []);\n if (($model->save())) {\n $transaction->commit();\n return $this->redirect(['index']);\n }\n } catch (\\Exception $ecx) {\n $transaction->rollBack();\n throw $ecx;\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n return $this->redirect(['index']);\n } else {\n $model->tanggal = date(\"Y-m-d\");\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function action_create()\n {\n $this->action_edit(FALSE);\n }", "public function actionCreate() {\n $model = new Alocacao;\n $modelAmbienteUso = new Ambiente_Uso();\n $modelAmbienteRecurso = new Ambiente_Recurso();\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $model->HR_INI = intval(str_replace(':', '', $model->HR_INI));\n $model->HR_FIM = intval(str_replace(':', '', $model->HR_FIM));\n if ($model->HR_INI < $model->HR_FIM) {\n //verificar se está disponível\n if ($model->validate()) {\n $existAlocacao = Alocacao::model()->isEmpty($model->DT_DIA, $model->ID_AMBIENTE, $model->HR_INI, $model->HR_FIM);\n if ($existAlocacao == false) {\n\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }else {\n //senão apresentar flash\n MethodUtils::setMsgErro(false, 'horário não disponível', get_class($model));\n }\n }\n } else {\n MethodUtils::setMsgErro(false, 'Hora inicial maior que hora final', get_class($model));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelUsuario,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio,\n 'modelAR' => $modelAmbienteRecurso\n ));\n }", "public function add()\n {\n \n // 1 charge la class client dans models\n // 2 instantantie la class client (Cree objet de type client)\n $this->loadModel(\"Chambres\") ;\n // 3 apell de la methode getAll() display all room from database\n $datas = $this->model->getAll() ;\n \n //save room added \n $this->model->insert() ; \n \n // 4 Affichage du tableua\n \n $this->render('chambre',compact('datas')) ;\n }", "public function actionCreate()\n\t{\n\t\t$model=new Clausuras;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n \n \n\t\tif(isset($_POST['Clausuras']) )\n\t\t{ \n \n \n $mensaje1=1;\n if(!empty($_POST['Clausuras']['sub_tipo'])){\n $sql=\"select id, upper(nombre_variable) as nombre_variable from variable_subtipo_clausura where id_subtipo='\".$_POST['Clausuras']['sub_tipo'].\"'\";\n $resultado=YII::app()->db->createCommand($sql)->queryAll();\n // $transaction = Yii::app()->db->beginTransaction();\n try{\n \n \n foreach($resultado as $valor){\n \n //Verificando que no exista en la misma convencion clausuras con distinto numero e iguales caracteristicas\n $verificar=\"select id from clausuras where cod_convencion='\".$_POST['Clausuras']['cod_convencion'].\"' and nro_clausura='\".$_POST['Clausuras']['nro_clausura'].\"' and tipo_clausura='\".$_POST['Clausuras']['tipo_clausura'].\"' and sub_tipo='\".$_POST['Clausuras']['sub_tipo'].\"' and id_variable='\".$valor['id'].\"'\";\n $verificando=YII::app()->db->createCommand($verificar)->queryAll();\n \n if(count($verificando)>0){\n Yii::app()->user->setFlash('error',\"¡Error Al Registrar Clausura!, Ya Existe Una Clausura Con Estas Caracteristicas\");\n $mensaje1=1;\n \n }else{\n $model=new Clausuras;\n if(isset($_POST[str_replace(' ', '', $valor['nombre_variable'])])){\n $model->attributes=$_POST['Clausuras'];\n \n $model->id_variable=$valor['id'];\n $model->valor=$_POST[str_replace(' ', '', $valor['nombre_variable'])];\n \n $model->save();\n $mensaje1=0; \n \n \n }//si existe la variable se toma su valor e id de la variable en caso que no exista no se guardará\n // $transaction->commit();\n }//fin de verificar\n \n } \n } catch(CDbException $error){\n \n // Yii::app()->user->setFlash('error',$error);\n Yii::app()->user->setFlash('error',\"¡Error Al Registrar Clausura!, Verificar Si Ya Existe\");\n $mensaje1=1;\n // $transaction->rollback();\n }\n if($mensaje1==0)\n Yii::app()->user->setFlash('success',\"¡Datos grabados correctamente!\");\n \n \n\t\t\t//$model->attributes=$_POST['Clausuras'];\n\t\t\t//if($model->save())\n\t\t\t//\t$this->redirect(array('view','id'=>$model->id));\n }//fin del post sub\n else{\n $model->attributes=$_POST['Clausuras'];\n $model->validate();\n }\n }\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $this->checkPrivilege();\n $model = new Peneliti();\n $modelsPembimbing = [new PembimbingPenelitian];\n $modelsTempat = [new TempatPenelitianLain];\n\n if ($model->load(Yii::$app->request->post())) \n {\n $modelsPembimbing = Model::createMultiple(PembimbingPenelitian::classname());\n Model::loadMultiple($modelsPembimbing, Yii::$app->request->post());\n // validate all models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsPembimbing) && $valid;\n\n // var_dump($valid);die();\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n foreach ($modelsPembimbing as $modelPembimbing) {\n $modelPembimbing->id_peneliti = $model->id;\n if (! ($flag = $modelPembimbing->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n ////////post modelsTempat/////////\n\n $modelsTempat = Model::createMultiple(TempatPenelitianLain::classname());\n Model::loadMultiple($modelsTempat, Yii::$app->request->post());\n // validate all models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelsTempat) && $valid;\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $model->save(false)) {\n foreach ($modelsTempat as $modelTempat) {\n $modelTempat->id_peneliti = $model->id;\n if (! ($flag = $modelTempat->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['index']);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'modelsPembimbing' => (empty($modelsPembimbing)) ? [new PembimbingPenelitian] : $modelsPembimbing,\n 'modelsTempat' => (empty($modelsTempat)) ? [new TempatPenelitianLain] : $modelsTempat,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t\t{\n\t\t\tif (Yii::app()->request->isAjaxRequest) {\n\t\t\t\t$modelTopografi = new Topografi;\n\n\t\t\t\tif ($_POST) {\n\t\t\t\t\t$modelTopografi['datar']=$_POST['datar'];\n\t\t\t\t\t$modelTopografi['bergelombang']=$_POST['bergelombang'];\n\t\t\t\t\t$modelTopografi['curam']=$_POST['curam'];\n\t\t\t\t\t$modelTopografi['sgtcuram']=$_POST['sgtcuram'];\n\t\t\t\t\t$modelTopografi['tinggidpl']=$_POST['tinggidpl'];\n\t\t\t\t\t$modelTopografi->save();\n\t\t\t\t}\n\n\t\t\t\t$this->render('create');\n\t\t\t}\n\t\t}", "public function createAction(){\n\n //Mapeia a entradas de dados\n $inputMap = array('descricao', 'quilometragem');\n $data = array();\n $erros = array();\n $value = null;\n\n //Procura os dados informados a partir do mapa de entrada\n foreach ($inputMap as $key) {\n $value = Application::getParam($key);\n\n if($value === null) $erros[] = $key;\n else $data[$key] = $value;\n }\n\n //Retorna um erro para caso um campo tenha faltado\n if(!empty($erros)){\n return json_encode(array(\n 'success' => false,\n 'message' => 'Alguns campos estão vazios ou são inválidos.',\n 'extra' => $erros,\n 'code' => 0\n ));\n }\n\n //Instancia e inicializa uma model\n $model = new Veiculo();\n $model->setDescricao($data['descricao']);\n $model->setQuilometragem($data['quilometragem']);\n\n try{\n //Salva os dados no banco de dados\n $model->save();\n }\n catch(\\Exception $e){\n\n //Caso algo dê errado, retorna uma menssagem de erro\n return json_encode(array(\n 'success' => false,\n 'message' => $e->getMessage(),\n 'code' => $e->getCode()\n ));\n }\n\n //Retorna os dados que foram pessistidos no banco de dados\n return json_encode(array(\n 'success' => true,\n 'data' => $model->toArray()\n ));\n }", "public function createModel()\n {\n }", "public function actionCreate()\n {\n $model = new Documento();\n $modelsDocuasoci = [new Docuasoci];\n \t\t $model->fecha = date('Y-m-d');\n if ($model->load(Yii::$app->request->post())) {\n \t\n \t$modelsDocuasoci = Model::createMultiple(Docuasoci::classname());\n \tModel::loadMultiple($modelsDocuasoci, Yii::$app->request->post());\n \t \n \t// validate all models\n \t$valid = $model->validate();\n \t$valid = Model::validateMultiple($modelsDocuasoci) && $valid;\n \tif ($valid) {\n \t\t$transaction = \\Yii::$app->db->beginTransaction();\n \t\ttry {\n \t\t\t$model->userIns= Yii::$app->user->identity->username;\n \t\t\t$model->idEstadoDocumento=1; // ACTIVO\n \t\t\t$model->idMoneda=1; // COLONES\n \t\t\tif ($flag = $model->save(false)) {\n \t\t\t\tforeach ($modelsDocuasoci as $modelDocuasoci) {\n \t\t\t\t\t$modelDocuasoci->idDocumento = $model->id;\n \t\t\t\t\t$modelDocuasoci->userIns = Yii::$app->user->identity->username;\n \t\t\t\t\tif (! ($flag = $modelDocuasoci->save(false))) {\n \t\t\t\t\t\t$transaction->rollBack();\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tif ($flag) {\n \t\t\t\t$transaction->commit();\n \t\t\t//\treturn $this->redirect(['movimientos/update', 'id' => $model->id]);\n \t\t\t\treturn $this->redirect(['index']);\n \t\t\t}\n \t\t} catch (Exception $e) {\n \t\t\t$transaction->rollBack();\n \t\t}\n \t}\n } \t\n return $this->render('create', [\n 'model' => $model,\n \t'modelsDocuasoci' => (empty($modelsDocuasoci)) ? [new Docuasoci] : $modelsDocuasoci,\n \t\t\n \t\t\n ]);\n\n }", "public function actionCreate() {\r\n\t\t$model = new datHorario();\r\n $request = Yii::$app->request;\r\n $repetir = $request->post('repetir');\r\n $lunes \t\t= $request->post('cb-auto-1');\r\n $martes \t= $request->post('cb-auto-2');\r\n $miercoles\t= $request->post('cb-auto-3');\r\n $jueves\t\t= $request->post('cb-auto-4');\r\n $viernes\t= $request->post('cb-auto-5');\r\n $sabado \t= $request->post('cb-auto-6');\r\n $domingo\t= $request->post('cb-auto-7');\r\n $acl_user = $this->findAclUser($request->post('nombre_docente'));\r\n\r\n if($repetir!='on'){\r\n\t $model->id_materia = $request->post('nombre_materia');\r\n\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t $model->hora_inicio = $request->post('hora_inicio');\r\n\t $model->hora_fin \t\t= $request->post('hora_fin');\r\n $model->id_docente = $request->post('nombre_docente');\r\n\t $model->id_aula = $request->post('nombre_aula');\r\n\t $model->dia_semana = $request->post('dia');\r\n\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t if($request->post('periodo')!=''){\r\n\t if ($model->save()) {\r\n\t $result = new \\stdClass();\r\n\t $result->success = true;\r\n\t $result->msg = 'Se creó correctamente';\r\n\t echo json_encode($result);\r\n\t } \r\n\t }\r\n\t else {\r\n\t $result = new \\stdClass();\r\n\t $result->success = false;\r\n\t $result->msg = 'Ocurrió un error.';\r\n\t echo json_encode($result);\r\n\t }\r\n \t}\r\n \telse if($repetir=='on')\r\n \t{\r\n \t\t$error = false;\r\n if($lunes=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_lunes');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_lunes');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_lunes');\r\n\t\t $model->dia_semana = 'LUNES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($martes=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_martes');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_martes');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_martes');\r\n\t\t $model->dia_semana = 'MARTES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($miercoles=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_miercoles');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_miercoles');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_miercoles');\r\n\t\t $model->dia_semana = 'MIÉRCOLES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($jueves=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_jueves');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_jueves');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_jueves');\r\n\t\t $model->dia_semana = 'JUEVES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($viernes=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_viernes');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_viernes');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_viernes');\r\n\t\t $model->dia_semana = 'VIERNES';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($sabado=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_sabado');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_sabado');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_sabado');\r\n\t\t $model->dia_semana = 'SÁBADO';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($domingo=='on'){\r\n \t\t\t$model = new datHorario();\r\n \t\t\t$model->id_materia = $request->post('nombre_materia');\r\n\t\t $model->nombre_materia = $request->post('ext-comp-1002');\r\n\t\t $model->nombre_docente = $request->post('ext-comp-1003');\r\n\t\t $model->hora_inicio = $request->post('hora_inicio_domingo');\r\n\t\t $model->hora_fin \t\t= $request->post('hora_fin_domingo');\r\n\t\t $model->id_docente \t= $request->post('nombre_docente');\r\n\t\t $model->id_aula = $request->post('nombre_aula_domingo');\r\n\t\t $model->dia_semana = 'DOMINGO';\r\n\t\t $model->id_trimestre = $request->post('periodo');\r\n $model->modalidad = $request->post('modalidad');\r\n $model->tipo_docente = $request->post('tipo_docente');\r\n $model->id_acl_user = $acl_user;\r\n\r\n\t\t if($request->post('periodo')!=''){\r\n $model->save();\r\n }else{\r\n $error = true;\r\n }\r\n \t\t}\r\n \t\tif($error==false){\r\n $result = new \\stdClass();\r\n $result->success = true;\r\n $result->msg = 'Se creó correctamente';\r\n echo json_encode($result); \r\n }\r\n if($error==true){\r\n $result = new \\stdClass();\r\n $result->success = false;\r\n $result->msg = 'Ocurrió un error.';\r\n echo json_encode($result);\r\n }\r\n \r\n \t}\r\n\t}", "public function actionCreate()\n {\n $sysMenu = PdmSysMenu::findOne(['kd_berkas' => GlobalConstMenuComponent::BA14 ]);\n $model = new PdmBa14();\n $id_perkara = Yii::$app->session->get('id_perkara');\n\n $modeljaksi = $model->jaksaPelaksana($id_perkara);\n\n $modelRp9 = PdmRp9::findOne(['id_perkara' => $id_perkara]);\n \n\n \n $modelTersangka = $this->findModelTersangka($id_perkara);\n $modelSpdp = $this->findModelSpdp($id_perkara); \n $modelt8 = Pdmt8::findOne(['id_perkara' => $id_perkara]);\n \n\n if ($model->load(Yii::$app->request->post())) {\n $Input = Yii::$app->request->post();\n $id_tersangka = $Input['PdmBa14']['id_tersangka'];\n $modelRt3 = PdmRt3::findOne(['id_perkara' => $id_perkara, 'id_tersangka' => $id_tersangka]); \n $seq = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_ba14', 'id_ba14', '\".\\Yii::$app->globalfunc->getSatker()->inst_satkerkd.\"', '\".date('Y').\"')\")->queryOne();\n $model->id_ba14 = $seq['generate_pk'];\n $model->id_perkara = $id_perkara;\n $model->no_reg_tahanan= (string)$modelRt3['no_urut'];\n $model->save();\n \n $jaksa_pelaksana = explode(\"#\", $_POST['jaksa_pelaksana']); // [0] => nip, [1] => nama, [2] => jabatan, [3] => pangkat\n PdmJaksaSaksi::deleteAll(['id_perkara' => $model->id_perkara, 'code_table' => GlobalConstMenuComponent::BA14, 'id_table' => $model->id_ba14]);\n $modeljaksi2 = new PdmJaksaSaksi();\n $seqJpu = Yii::$app->db->createCommand(\"select public.generate_pk('pidum.pdm_jaksa_saksi', 'id_jpp', '\".\\Yii::$app->globalfunc->getSatker()->inst_satkerkd.\"', '\".date('Y').\"')\")->queryOne();\n $modeljaksi2->id_perkara = $model->id_perkara;\n $modeljaksi2->id_jpp = $seqJpu['generate_pk'];\n $modeljaksi2->code_table = GlobalConstMenuComponent::BA14;\n $modeljaksi2->id_table = $model->id_ba14;\n $modeljaksi2->nip = $jaksa_pelaksana[0];\n $modeljaksi2->nama = $jaksa_pelaksana[1];\n $modeljaksi2->jabatan = $jaksa_pelaksana[2];\n $modeljaksi2->pangkat = $jaksa_pelaksana[3];\n $modeljaksi2->save();\n \n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Simpan',\n 'title' => 'Simpan Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]); \n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'modelTersangka' => $modelTersangka,\n 'modelSpdp' => $modelSpdp,\n 'modeljaksi' => $modeljaksi, \n 'sysMenu' => $sysMenu,\n 'modelRp9' =>$modelRp9,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Empleado();\n $usuario = new Usuario();\n\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n if ($usuario->load(Yii::$app->request->post()) && $usuario->save()) {\n $model->load(Yii::$app->request->post());\n $model->usuario_idusuario = $usuario->idusuario;\n if ($model->save()) {\n //asigna el rol seleccionado\n $auth = \\Yii::$app->authManager;\n $role = $auth->getRole($model->tipo);\n $auth->assign($role, $usuario->idusuario);\n\n $estadoUsuario = new \\app\\models\\EstadoEmpleado();\n $estadoUsuario->fecha = date(\"Y-m-d\");\n $estadoUsuario->estado_idestado = 1;\n $estadoUsuario->empleado_idempleado = $model->idempleado;\n $estadoUsuario->save();\n\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->idempleado]);\n }\n }\n } catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n } catch (\\Throwable $e) {\n $transaction->rollBack();\n throw $e;\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'usuario' => $usuario,\n ]);\n\n }", "public function actionCreate()\n {\n $model = new CategoryTable();\n $model->category_table_create_by = Yii::$app->user->id;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n echo \"{'status':'success'}\";\n } else {\n echo \"{'status':'fail'}\";\n// return $this->render('create', [\n// 'model' => $model,\n// ]);\n }\n }", "public function modelDoAdd(){\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"insert into phongban set tenphongban=:ten\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban));\n\t\t}", "public function actionCreate() {\n $model = new PdmD1();\n $session = new session();\n $id_perkara = $session->get('id_perkara');\n $no_register_perkara = $session->get('no_register_perkara');\n $no_akta = $session->get('no_akta');\n $no_reg_tahanan = $session->get('no_reg_tahanan');\n $no_eksekusi = $session->get('no_eksekusi');\n\n $sysMenu = PdmSysMenu::findOne(['kd_berkas' => GlobalConstMenuComponent::D1]);\n //$modeljakpen = new PdmJaksaPenerima();\n //$modelSpdp = PdmSpdp::findOne($id);\n $searchJPU = new VwJaksaPenuntutSearch();\n $dataJPU = $searchJPU->search16a_new(Yii::$app->request->queryParams);\n $dataJPU->pagination->pageSize = 5;\n $modelTerpanggil = VwTerdakwaT2::findOne(['no_register_perkara'=>$no_register_perkara, 'no_reg_tahanan'=>$no_reg_tahanan]);\n //echo '<pre>';print_r($modelTerpanggil);exit;\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n //echo '<pre>';print_r($_POST);exit;\n $model->no_eksekusi = $no_eksekusi;\n $model->no_reg_tahanan = $no_reg_tahanan;\n $model->no_register_perkara = $no_register_perkara;\n $model->created_time=date('Y-m-d H:i:s');\n $model->created_by=\\Yii::$app->user->identity->peg_nip;\n $model->created_ip = \\Yii::$app->getRequest()->getUserIP();\n \n $model->updated_by=\\Yii::$app->user->identity->peg_nip;\n $model->updated_time=date('Y-m-d H:i:s');\n $model->updated_ip = \\Yii::$app->getRequest()->getUserIP();\n \n \n if(!$model->save()){\n var_dump($model->getErrors());exit;\n }else{\n $transaction->commit();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Simpan',\n 'title' => 'Simpan Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['update', 'no_surat' => $_POST['PdmD1']['no_surat']]);\n }\n } catch (Exception $ex) {\n $transaction->rollback();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'danger',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Gagal di Simpan',\n 'title' => 'Error',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect('create');\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'sysMenu' => $sysMenu,\n 'modeljakpen' => $modeljakpen,\n 'modelSpdp' => $modelSpdp,\n 'searchJPU' => $searchJPU,\n 'dataJPU' => $dataJPU,\n 'modelTerpanggil' => $modelTerpanggil\n ]);\n }\n }", "public function addAction(){\n\t\t\t$emp = new Empresa();\n\t\t\t//cargamos el objeto mediantes los metodos setters\n\t\t\t$emp->id = '0';\n\t\t\t$emp->nombre_empresa = $this->getPostParam(\"nombre_empresa\");\n\t\t\t$emp->nit = $this->getPostParam(\"nit\");\n\t\t\t$emp->direccion = $this->getPostParam(\"direccion\");\n\t\t\t$emp->logo = $this->getPostParam(\"imagen\");\n\t\t\t$emp->regimen_id = $this->getPostParam(\"regimen_id\");\n\t\t\t\t\t\t\t\t\n\t\t\tif($emp->save()){\n\t\t\t\tFlash::success(\"Se insertó correctamente el registro\");\n\t\t\t\tprint(\"<script>document.location.replace(\".core::getInstancePath().\"'empresa/mostrar/$emp->id');</script>\");\n\t\t\t}else{\n\t\t\t\tFlash::error(\"Error: No se pudo insertar registro\");\t\n\t\t\t}\n\t\t\t\t\t\n\t }", "public function actionCreate()\n {\n $model = new Ocorrencia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$this->updateOcorrenciaQueixa($_POST['Ocorrencia']['idQueixas'], $model->id);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createRecord();", "public function actionCreate()\n {\n $model = new Devolucion_salas_granel();\n $model->scenario = \"create_sobrante\";\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->validate() ){ \n $model->DE_SOBRAN = 1;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n //Se guarda encabezado Devolucion\n if ($model->save()){\n $this->guardar_renglones($model);\n }\n\n $this->generarPdf($model->DE_NRODEVOL);\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n \n }\n else{\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n \n } else {\n $model->DE_FECHA = date('Y-m-d');\n $model->DE_HORA = date('H:i:s');\n $model->DE_CODOPE = Yii::$app->user->identity->LE_NUMLEGA; //El usuario logueado\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n //Create new pdslidsurat\n $id=$_SESSION['idPdsLid'];\n \t$model = new PdsLidSurat();\n $model->id_jenis_surat='pidsus10';\n $model->id_pds_lid=$id;\n $model->create_by=(string)Yii::$app->user->identity->username;\n $model->save();\n //get latest idpdslidsurat\n $model= PdsLidSuratforPidsus10::findBySql(\"select * from pidsus.pds_lid_surat where id_pds_lid='\".$id.\"' and id_jenis_surat='pidsus10' and create_by='\".(string)Yii::$app->user->identity->username.\"' order by create_date desc limit 1\")->one();\n \n return $this->redirect(['update?id='.$model->id_pds_lid_surat]);\n }", "public function create(){\n\t\t$this->autenticate();\n\t\t$user_id = $_POST['id'];\n\t\t$nombre = \"'\".$_POST['nombre'].\"'\";\n\t\t$cedula = \"'\".$_POST['cedula'].\"'\";\n\t\t$nacimiento = \"'2000/1/1'\"; //fecha de nacimiento default, despues el mismo usuario la puede editar\n\t\trequire_once(\"../app/models/administrativo.php\");//conexion entre los controladores\n\t\t$administrativo=new Administrativo();// crea el perfil administrativo vacio\n\t\t$administrativo->new($nombre,$cedula,$nacimiento); // inserta la informacion antes ingresada en la base de datos\n\t\t$administrativo_id = $administrativo->where(\"cedula\",$cedula); // se trae el perfil administrativo recien creado con la cedula\n\t\t$administrativo_id = $administrativo_id[0][\"id\"];\n\t\t$administrativo->attach_user($user_id,$administrativo_id); // amarra el usuario a su nuevo perfil docente\n\t\t$administrativo_id = strval($user_id);//convierte el user_id de entero a string\n\t\theader(\"Location: http://localhost:8000/usuarios/show/$user_id\");\n\t\texit;\n\t\t$this->view('administrativos/index', []);\n\t}", "public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new EntOficiales();\n $model->uddi = Utils::generateToken();\n $model->fch_creacion = Calendario::getFechaActual();\n $model->txt_rol='oficial';\n $model->b_habilitado=1;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n // $program= TbMProgram::all();\n // $kejuruan= TbMKejuruan::all();\n // $subkejuruan= TbMSubKejuruan::all();\n // return view('program.create', compact('program','kejuruan','subkejuruan'));\n }", "public function run()\n {\n //creando varias instancias de la tabla cola\n // $cola= new cola;\n //$cola->id_cola=\"1\";\n //$cola->vehiculo_id=\"120\";\n // $cola->parqueo_id=\"1\";\n //$cola->save();\n\n\n }", "public function actionInsert()\n\t{\n\t\t$model=new Knowledgecatalogue();\n\t\t$model->fCatalogueNo=GuidUtil::getUuid();\n\t\t$model->fFatherCatalogueNo=$_POST['no'];\n\t\t$model->fCatalogueName=$_POST['name'];\n\t\t$model->fStatus=$_POST['statu'];\n\t\t$model->fIsDownLoad=$_POST['down'];\n\t\t$model->fCreateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fCreateDate=time();\n\t\t$model->fUpdateUser=Yii::app()->params->loginuser->fUserName;\n\t\t$model->fUpdateDate=time();\n\t\tif($model->save())\n\t\t{\n\t\t\t$this->renderPartial('update',array(\n\t\t\t\t\t'data'=>UFSBaseUtil::printJson(array(\n\t\t\t\t\t\t\t'fCatalogueNo'=>CHtml::encode($model->fCatalogueNo),\n\t\t\t\t\t\t\t'fIsDownLoad'=>CHtml::encode($model->fIsDownLoad),\n\t\t\t\t\t\t\t'fCatalogueName'=>CHtml::encode($model->fCatalogueName),\n\t\t\t\t\t\t\t'fFatherNo'=>$model->fFatherCatalogueNo,\n\t\t\t\t\t\t\t'fStatus'=>CHtml::encode($model->fStatus),\n\t\t\t\t\t\t\t'fCreateDate'=>CHtml::encode(empty($model->fCreateDate)?'':date('Y-m-d',$model->fCreateDate)),\n\t\t\t\t\t\t\t'fCreateUser'=>CHtml::encode($model->fCreateUser),\n\t\t\t\t\t\t\t'fUpdateDate'=>CHtml::encode(empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate)),\n\t\t\t\t\t\t\t'fUpdateUser'=>CHtml::encode($model->fUpdateUser),\n\t\t\t\t\t\t\t'msg'=>$this->FrameInfo(Yii::app()->params['layouttype']['top'],Yii::t('message','Add Success'),Yii::app()->params['notytype']['success']),\n\t\t\t\t\t))\n\t\t\t));\n\t\t}\n\t}", "public function actionCreate()\n {\n $modelRelatorio = new Relatorio();\n $modelsRelatorio_item = [new Relatorio_item];\n \n if ($modelRelatorio->load(Yii::$app->request->post())&& $modelRelatorio->save()) {\n\n $modelsRelatorio_item = ModelRelatorio::createMultiple(Relatorio_item::classname());\n ModelRelatorio::loadMultiple($modelsRelatorio_item, Yii::$app->request->post());\n\n // validate all models\n $valid = $modelRelatorio->validate();\n $valid = ModelRelatorio::validateMultiple($modelsRelatorio_item) && $valid;\n \n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if ($flag = $modelRelatorio->save(false)) {\n foreach ($modelsRelatorio_item as $modelRelatorio_item) {\n $modelRelatorio_item->relatorio_id = $modelRelatorio->idrelatorio;\n if (! ($flag = $modelRelatorio_item->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $modelRelatorio->idrelatorio]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n }\n else {\n return $this->renderAjax('create', [\n 'modelRelatorio' => $modelRelatorio,\n 'modelsRelatorio_item' => (empty($modelsRelatorio_item)) ? [new Relatorio_item] : $modelsRelatorio_item,\n 'listarTurmas_infantil' => $this->listarTurmas_infantil(),\n 'listarAlunos' => $this->listarAlunos(),\n ]);\n }\n}", "public function create()\n {\n return view(\"api.insert\");\n }", "public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new AcervoImpreso;\n\t\t$inventario = new Inventario;\n\n\t\tif(isset($_POST['AcervoImpreso'], $_POST['Inventario']))\n\t\t{\t\t\t\t\n\t\t\t\t\n\t\t\t\t$Criteria = new CDbCriteria();\t\t\t\t\t\t\t\t\n\t\t\t\t$Criteria -> limit = 1;\n\t\t\t\t$Criteria -> order = \"idacervo DESC\";\t\n\t\t\t\t$acervo = \tInventario::model()->find($Criteria);\n\t\t\t\t/*\t\t\t\n\t\t\t\techo '<pre>';\n\t\t\t\tprint_r($acervo);\n\t\t\t\techo '</pre>';\n\t\t\t\techo $acervo->idacervo;\t\t\t\t\n\t\t\t\tYii::app()->end(); // termino la aplicación para poder ver los resultados en pantalla \t\n\t\t\t\t*/\n\t\t\t\t$idacervo=(int)$acervo->idacervo;\n\t\t\t\t$idacervo=$idacervo+1; // Incrmento el valor de idaprendiente en UNO para insertar con el siguiente registro\n\t\t\t\t$model->idacervo = $idacervo;\t\t\t\n\t\t\t\t$model->catalogo = $_POST['AcervoImpreso']['catalogo']; //1- Mediateca, 2 - Acervo Asesores, 3 - Master, 4 - Bajas, 5 - CAD\n\t\t\t\t$model->material = $_POST['AcervoImpreso']['material'];\n\t\t\t\t$model->idioma = $_POST['AcervoImpreso']['idioma'];\n\t\t\t\t$model->titulo = $_POST['AcervoImpreso']['titulo'];\n\t\t\t\t$model->autor_personal = $_POST['AcervoImpreso']['autor_personal'];\n\t\t\t\t$model->autor_corporativo = $_POST['AcervoImpreso']['autor_corporativo'];\n\t\t\t\t$model->edicion = $_POST['AcervoImpreso']['edicion'];\n\t\t\t\t$model->isbn = strtoupper($_POST['AcervoImpreso']['isbn']);\t\t\t\n\t\t\t\t$model->descripcion_area = $_POST['AcervoImpreso']['descripcion_area'];\n\t\t\t\t$model->serie = $_POST['AcervoImpreso']['serie'];\t\t\t\t\n\t\t\t\t$model->fondo = $_POST['AcervoImpreso']['fondo'];\n\t\t\t\t$model->acento = $_POST['AcervoImpreso']['acento'];\n\t\t\t\t$model->tipo_formato = $_POST['AcervoImpreso']['tipo_formato'];\n\t\t\t\t\n\t\t\t\t$inventario->idacervo = (int)$model->idacervo;\n\t\t\t\t//$inventario->idacervo_anterior = 777;// Aquí recupero el idacervo de los ejemplares\n\t\t\t\t$inventario->idacervo_anterior = $idacervo;//\n\t\t\t\t$inventario->tipoacervo = 1;//tipo de acervo para Acervo Impreso = 1\n\t\t\t\t$inventario->clasificacion = $_POST['Inventario']['clasificacion'];\n\t\t\t\t$inventario->pie_imprenta = $_POST['Inventario']['pie_imprenta'];\t\t\t\t\n\t\t\t\t$inventario->descripcion_fisica = $_POST['Inventario']['descripcion_fisica'];\t\t\t\t\t\t\t\t\n\t\t\t\t$inventario->issn = $_POST['Inventario']['issn'];\n\t\t\t\t$inventario->dificultad = $_POST['Inventario']['dificultad'];\n\t\t\t\t$inventario->fecha_ingreso = date(\"Y-m-d\");\n\t\t\t\t$inventario->notas = $_POST['Inventario']['notas'];\n\t\t\t\t$inventario->catalogador = strtoupper(Yii::app()->user->name);//'Alex Rdz'\n\t\t\t\t$inventario->estatus = $_POST['Inventario']['estatus'];\n\t\t\t\t/*\n\t\t\t\techo '<pre>';\n\t\t\t\tprint_r($_POST);\n\t\t\t\techo '</pre>';\n\t\t\t\tYii::app()->end(); // termino la aplicación para poder ver los resultados en pantalla \n\t\t\t\t*/\n\t\t\t\t//validar ambos modelos\n\t\t\t\t$valid =$model->validate();\n\t\t\t\t$valid =$inventario->validate() && $valid;\n\n\t\t\t\tif($valid)\n\t\t\t\t{\n\t\t\t\t\t//usar falso para desactivar la validacion del modelo\n\t\t\t\t\t$model->save();\n\t\t\t\t\t$inventario->save();\n\t\t\t\t\t//if($model->save())\n\t\t\t\t\t$this->redirect(array('view', 'id'=>$model->idacervo, 'inventario'=>$inventario->idacervo));\n\t\t\t\t}\n\t\t}//cierre de isset()\n\t\t$this->render('create', array('model'=>$model, 'inventario'=>$inventario));\n\t}", "public function actionCreate()\n {\n $model = new Peticiones();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function actionCreate()\n {\n $model = new Plant();\n $modelChar = new PlantCharacteristic();\n $modelMap = new MapInformation();\n $modelPhoto = new Photo();\n\n $characteristicData = ArrayHelper::map(Characteristic::find()->all(),'IdCharacteristic', 'Name');\n $familyList = ArrayHelper::map(Botanicalfamily::find()->all(),'IdFamily', 'Name');\n $typeList = ArrayHelper::map(Planttype::find()->all(),'IdType', 'Name');\n\n if (Yii::$app->request->isPost){\n $commit = true;\n $transaction = Yii::$app->db->beginTransaction();\n $postValues = Yii::$app->request->post();\n if ($model->load(Yii::$app->request->post()) && $model->save()){\n (array_key_exists(\"PlantCharacteristic\",$postValues)) ? $commit = $this->InsertCharacteristics($model->IdPlant, $postValues[\"PlantCharacteristic\"]) : '';\n $commit = $this->InsertPhotos($modelPhoto, $model->IdPlant,explode(',',$postValues[\"uploadFilesNames\"]));\n (array_key_exists(\"MapInformation\",$postValues)) ? $commit = $this->InsertGeolocation($model->IdPlant, $postValues[\"MapInformation\"]) : '';\n }\n if ($commit){\n $transaction->commit();\n Yii::$app->session->setFlash('success', 'Planta creada correctamente.');\n return $this->redirect(['update', 'id' => $model->IdPlant]);\n }else{\n $transaction->rollback();\n Yii::$app->session->setFlash('success', 'Ocurrio un error al crear la planta.');\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'modelChar' => $modelChar,\n 'modelPhoto' => $modelPhoto,\n 'modelMap' => $modelMap,\n 'typeList' => $typeList,\n 'familyList' => $familyList,\n 'characteristicList' => $characteristicData\n ]);\n }", "public function actionCreate()\n {\n if (Yii::$app->user->can('paskibracreate')) {\n $model = new PaskibraModel;\n $model->setAttribute('create_et', date(\"Y-m-d H:i:s\"));\n $model->setAttribute('update_et', date(\"Y-m-d H:i:s\"));\n $model->setAttribute('type_member', MEMBER_TYPE_PASKIBRA);\n $model->setAttribute('user_created', Yii::$app->user->identity->getId());\n\n $param = Yii::$app->request->post('PaskibraModel');\n $this->langskill = $param['language_skill'];\n $this->lifeskill = $param['life_skill'];\n $this->otherlifeskill = $param['otherlifeskill'];\n $this->brevetaward = $param['brevet_award'];\n\n $this->photo->copyProntPhoto($param['front_photo']);\n $this->photo->copyProntPhotoThumb($param['front_photo']);\n $this->photo->copySidePhoto($param['side_photo']);\n $this->photo->copyCertificatePhoto($param['certificate_of_organization']);\n $this->photo->copyIdentityCardPhoto($param['identity_card']);\n\n\n if (null != $this->otherlifeskill) {\n $this->saveOtherLifeSkill($this->otherlifeskill);\n $this->other_skill = [$this->otherlifeskill];\n $other_skill_id = [(count($this->lifeskill) + 1) => $this->otherlifeskillid];\n array_push($this->lifeskill, $other_skill_id[(count($this->lifeskill) + 1)]);\n }\n\n if (null != $this->langskill) {\n $data_lang = $model->getAllLangSkillNameById($this->langskill);\n $model->setAttribute('languageskill', implode(', ', $data_lang));\n }\n\n if (null != $this->lifeskill) {\n $data_skill = $model->getAllSkillNameById($this->lifeskill);\n if (isset($this->other_skill[0])) {\n array_push($data_skill, $this->other_skill[0]);\n }\n $model->setAttribute('lifeskill', implode(', ', $data_skill));\n }\n\n\n if (null != $this->brevetaward) {\n $data_brevet = $model->getAllBrevetNameById($this->brevetaward);\n $model->setAttribute('brevetaward', implode(', ', $data_brevet));\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n if (null != $this->lifeskill) {\n $model->saveTaxRelation($this->lifeskill, $model->id);\n }\n\n if (null != $this->langskill) {\n $model->saveTaxRelation($this->langskill, $model->id);\n }\n\n if (null != $this->brevetaward) {\n $model->saveTaxRelation($this->brevetaward, $model->id);\n }\n return $this->redirect(['view', 'action' => 'member-paskibra-view', 'id' => $model->id]);\n } else {\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n throw new HttpException(403, 'You are not allowed to access this page', 0);\n }\n }", "public function actionCreate()\n {\n $model = new TaSasaran();\n $dataMisi = ArrayHelper::map(TaMisi::findAll(Yii::$app->levelcomponent->PosisiUnit()), 'No_Misi', 'Ur_Misi');\n\n $unit = Yii::$app->levelcomponent->getUnit();\n\n $model->Tahun=2019;\n $model->Kd_Urusan=$unit['Kd_Urusan'];\n $model->Kd_Bidang=$unit['Kd_Bidang'];\n $model->Kd_Unit=$unit['Kd_Unit'];\n $model->Kd_Sub=$unit['Kd_Sub_Unit'];\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub, 'No_Misi' => $model->No_Misi, 'No_Tujuan' => $model->No_Tujuan, 'No_Sasaran' => $model->No_Sasaran]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'dataMisi' => $dataMisi,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new TaKegiatan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Prog' => $model->Kd_Prog, 'Kd_Keg' => $model->Kd_Keg, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n // $model = new StSpd();\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // }\n\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n\n $model = new StSpd();\n $modelsAnggota = [new StSpdAnggota];\n $model->setScenario(StSpd::SCENARIO_INSERT);\n\n // Only admin can change pegawai instansi otherwise auto_fill_instansi_with_user\n if(Yii::$app->user->identity->role==99){\n $model->setScenario(StSpd::SCENARIO_ADMIN);\n $model->detachBehavior(\"auto_fill_instansi_with_user\");\n }\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n $model->createDocx();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'modelsAnggota' => (empty($modelsAnggota)) ? [new StSpdAnggota] : $modelsAnggota\n ]);\n }\n\n }", "public function actionCreate()\n {\n $model = new Tblofficials();\n\n // $levelbyplace = Tbllevelbyplace::find()->all();\n $querylevelbyposition = Tbllevelbyposition::find()->all();\n $party = Tblparty::find()->all();\n $queryposition = Tblpositions::find()->all();\n $queryregion = Tblregion::find()->all();\n $queryprovince = Tblprovince::find()->all();\n $querycitymun = Tblcitymun::find()->all();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->OFFICIAL_ID]);\n } else {\n\n \n return $this->render('create', [\n 'model' => $model,\n 'arrlevelbyposition'=>ArrayHelper::map($querylevelbyposition,'LEVELPOSIT_ID','LEVELPOSIT_NAME'),\n 'querylevelbyposition' => $querylevelbyposition,\n 'party'=>ArrayHelper::map($party,'PARTY_ID','PARTY_NAME'),\n 'queryposition'=> $queryposition,\n 'queryregion'=> $queryregion,\n 'queryprovince' => $queryprovince,\n 'querycitymun' => $querycitymun,\n ]);\n }\n }", "public function insertAction()\r\n\t{\r\n\t\tif ($this->request->getPost('submit')) {\r\n\t\t\t$name = $this->request->getPost('name');\r\n\t\t\t$phone = $this->request->getPost('phone');\r\n\t\t\t$arrPost = array('name' => $name, 'phone' => $phone);\r\n\t\t\t$room = new Room();\r\n\t\t\tif ($room->save($arrPost)) {\r\n\t\t\t\t$this->response->redirect(\"/users/index\", true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function actionCreate()\n {\n\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_postulacion = $request->get('id_postulacion');\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n\n if($buscaPostulacion != null){\n\n $model = new Tablapresupuesto();\n\n if ($model->load(Yii::$app->request->post())) {\n $cantidad = (float) preg_replace('/[^0-9.]/', '', $model->cantidad);\n $precioUni = (float) preg_replace('/[^0-9.]/', '', $model->precioUnitario);\n $total = $cantidad * $precioUni;\n $model->costoTotal = $total.'';\n if($model->save()){\n return $this->redirect(['/site/section4', 'id_postulacion' => $id_postulacion]);\n }else{\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n\n }", "function create()\r\n\t{\r\n\r\n\t\t$this->form_validation->set_rules('nom', 'le nom', 'trim|required|min_length[2]|max_length[12]');\r\n\r\n\t\tif ($this->form_validation->run() == TRUE ) {\r\n\t\t\r\n\t\t$this->e->ajouter($this->input->post());\r\n\r\n\t\t$this->_notice=\"Ajout effectué avec succéss\";\r\n\r\n\t\t$this->index();\r\n\t\t} \r\n\t\telse {\r\n\t\t\t$this->index();\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "function inserir()\n{\n $produto = new Produto();\n\n // Colocando os valores recebidos do formulário nos atributos do objeto $produto\n $produto->descricao = Input::get('descricao');\n $produto->quantidade = Input::get('quantidade');\n $produto->valor = Input::get('valor');\n $produto->data_vencimento = Input::get('data_vencimento');\n\n // Salvando no banco de dados\n $produto->save();\n\n // Criado uma mensagem para o usuário\n $mensagem = \"Produto inserido com sucesso\";\n\n // Chamando a view produto.inserir e enviando a mensagem criada\n return view('produto.inserir')->with('mensagem', $mensagem);\n}", "public function run()\n {\n Empleo::create( [\n 'ID'=>1,\n 'Titulo'=>'ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae mauris',\n 'Provincia'=>'Comunidad Valenciana',\n 'Ciudad'=>'Valencia',\n 'TipoContrato'=>'elit proin interdum mauris non',\n 'Salario'=>'€9961,38',\n 'Descripcion'=>'vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae mauris viverra diam vitae quam suspendisse potenti nullam porttitor lacus at turpis donec posuere metus vitae ipsum aliquam non mauris morbi non lectus aliquam sit amet diam in magna bibendum imperdiet nullam orci pede venenatis non sodales sed tincidunt eu felis fusce posuere felis sed lacus morbi sem mauris laoreet ut rhoncus aliquet pulvinar sed nisl nunc rhoncus dui vel sem sed sagittis nam congue risus semper porta volutpat quam pede lobortis ligula sit amet eleifend pede libero quis orci nullam molestie nibh in lectus pellentesque at nulla suspendisse potenti cras in purus eu magna vulputate luctus cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus vivamus vestibulum sagittis sapien cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus etiam vel augue vestibulum rutrum rutrum neque aenean',\n 'URL'=>'http://altervista.org/at.json?blandit=turpis&mi=integer&in=aliquet&porttitor=massa&pede=id&justo=lobortis&eu=convallis&massa=tortor&donec=risus&dapibus=dapibus&duis=augue&at=vel&velit=accumsan&eu=tellus&est=nisi&congue=eu&elementum=orci&in=mauris&hac=lacinia&habitasse=sapien&platea=quis&dictumst=libero&morbi=nullam&vestibulum=sit&velit=amet&id=turpis&pretium=elementum&iaculis=ligula&diam=vehicula&erat=consequat&fermentum=morbi&justo=a&nec=ipsum&condimentum=integer&neque=a&sapien=nibh&placerat=in&ante=quis&nulla=justo&justo=maecenas&aliquam=rhoncus'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>2,\n 'Titulo'=>'amet consectetuer adipiscing elit proin interdum mauris non ligula pellentesque ultrices',\n 'Provincia'=>'Comunidad Valenciana',\n 'Ciudad'=>'Elx/Elche',\n 'TipoContrato'=>'pellentesque ultrices mattis odio donec vitae nisi nam ultrices libero',\n 'Salario'=>'€6546,93',\n 'Descripcion'=>'vivamus in felis eu sapien cursus vestibulum proin eu mi nulla ac enim in tempor turpis nec euismod scelerisque quam turpis adipiscing lorem vitae mattis nibh ligula nec sem duis aliquam convallis nunc proin at turpis a pede posuere nonummy integer non velit donec diam neque vestibulum eget vulputate ut ultrices vel augue vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae donec pharetra magna vestibulum aliquet ultrices erat tortor',\n 'URL'=>'http://eepurl.com/amet/eleifend/pede/libero/quis/orci/nullam.jpg?donec=accumsan&dapibus=tellus&duis=nisi&at=eu&velit=orci&eu=mauris&est=lacinia&congue=sapien&elementum=quis&in=libero&hac=nullam&habitasse=sit&platea=amet&dictumst=turpis&morbi=elementum&vestibulum=ligula&velit=vehicula&id=consequat&pretium=morbi&iaculis=a&diam=ipsum&erat=integer&fermentum=a&justo=nibh&nec=in&condimentum=quis&neque=justo&sapien=maecenas&placerat=rhoncus&ante=aliquam&nulla=lacus&justo=morbi&aliquam=quis&quis=tortor&turpis=id&eget=nulla&elit=ultrices&sodales=aliquet&scelerisque=maecenas&mauris=leo&sit=odio&amet=condimentum&eros=id&suspendisse=luctus&accumsan=nec&tortor=molestie&quis=sed&turpis=justo&sed=pellentesque&ante=viverra&vivamus=pede&tortor=ac&duis=diam&mattis=cras&egestas=pellentesque&metus=volutpat&aenean=dui&fermentum=maecenas&donec=tristique&ut=est&mauris=et&eget=tempus&massa=semper&tempor=est&convallis=quam&nulla=pharetra&neque=magna&libero=ac&convallis=consequat&eget=metus&eleifend=sapien&luctus=ut&ultricies=nunc&eu=vestibulum&nibh=ante&quisque=ipsum&id=primis&justo=in&sit=faucibus&amet=orci&sapien=luctus&dignissim=et&vestibulum=ultrices&vestibulum=posuere&ante=cubilia&ipsum=curae&primis=mauris&in=viverra&faucibus=diam&orci=vitae&luctus=quam&et=suspendisse&ultrices=potenti&posuere=nullam&cubilia=porttitor&curae=lacus&nulla=at'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>3,\n 'Titulo'=>'sem mauris laoreet ut rhoncus aliquet pulvinar sed nisl nunc rhoncus',\n 'Provincia'=>'Murcia',\n 'Ciudad'=>'Cartagena',\n 'TipoContrato'=>'etiam faucibus cursus urna ut',\n 'Salario'=>'€4333,36',\n 'Descripcion'=>'eget vulputate ut ultrices vel augue vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae donec pharetra magna vestibulum aliquet ultrices erat tortor sollicitudin mi sit amet lobortis sapien sapien non mi integer ac neque duis bibendum morbi non quam nec dui luctus rutrum nulla tellus in sagittis dui vel nisl duis ac nibh fusce lacus purus aliquet at feugiat non pretium quis lectus suspendisse potenti in eleifend quam a odio in hac habitasse platea dictumst maecenas ut massa quis augue luctus tincidunt nulla mollis molestie lorem quisque ut erat curabitur gravida nisi at nibh in hac habitasse platea dictumst aliquam augue quam sollicitudin vitae consectetuer eget rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla integer pede justo lacinia eget tincidunt eget tempus vel pede morbi porttitor lorem id ligula suspendisse ornare consequat lectus in est risus auctor sed tristique in tempus sit amet sem fusce consequat nulla nisl nunc nisl duis bibendum felis sed interdum',\n 'URL'=>'https://ameblo.jp/pede.aspx?magna=blandit&ac=nam&consequat=nulla&metus=integer&sapien=pede&ut=justo&nunc=lacinia&vestibulum=eget&ante=tincidunt&ipsum=eget&primis=tempus&in=vel&faucibus=pede&orci=morbi&luctus=porttitor&et=lorem&ultrices=id&posuere=ligula&cubilia=suspendisse&curae=ornare&mauris=consequat&viverra=lectus&diam=in&vitae=est&quam=risus&suspendisse=auctor&potenti=sed&nullam=tristique&porttitor=in&lacus=tempus&at=sit&turpis=amet&donec=sem&posuere=fusce&metus=consequat&vitae=nulla&ipsum=nisl&aliquam=nunc&non=nisl&mauris=duis&morbi=bibendum&non=felis&lectus=sed&aliquam=interdum&sit=venenatis&amet=turpis&diam=enim&in=blandit&magna=mi&bibendum=in&imperdiet=porttitor&nullam=pede&orci=justo&pede=eu&venenatis=massa&non=donec&sodales=dapibus&sed=duis&tincidunt=at&eu=velit&felis=eu&fusce=est&posuere=congue&felis=elementum&sed=in&lacus=hac&morbi=habitasse&sem=platea&mauris=dictumst&laoreet=morbi&ut=vestibulum&rhoncus=velit&aliquet=id&pulvinar=pretium&sed=iaculis&nisl=diam&nunc=erat&rhoncus=fermentum&dui=justo&vel=nec&sem=condimentum&sed=neque&sagittis=sapien'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>4,\n 'Titulo'=>'quam sapien varius ut blandit non interdum in ante vestibulum ante ipsum primis in faucibus orci luctus et',\n 'Provincia'=>'Andalucia',\n 'Ciudad'=>'Almeria',\n 'TipoContrato'=>'faucibus orci luctus et ultrices posuere',\n 'Salario'=>'€8193,89',\n 'Descripcion'=>'fusce lacus purus aliquet at feugiat non pretium quis lectus suspendisse potenti in eleifend quam a odio in hac habitasse platea dictumst maecenas ut massa quis augue luctus tincidunt nulla mollis molestie lorem quisque ut erat curabitur gravida nisi at nibh in hac habitasse platea dictumst aliquam augue quam sollicitudin vitae consectetuer eget rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla integer pede justo lacinia eget tincidunt eget tempus vel pede morbi porttitor lorem id ligula suspendisse ornare consequat lectus in est risus auctor sed tristique in tempus sit amet sem fusce consequat nulla nisl nunc nisl duis bibendum felis sed interdum venenatis turpis enim blandit mi in porttitor pede justo eu massa donec dapibus duis at velit eu est congue elementum in hac habitasse platea dictumst morbi vestibulum velit id pretium iaculis diam erat fermentum justo nec condimentum neque sapien placerat ante nulla justo aliquam quis turpis eget elit sodales scelerisque mauris sit amet eros suspendisse accumsan tortor quis',\n 'URL'=>'http://alibaba.com/cras/mi/pede/malesuada/in/imperdiet.html?hac=lacinia&habitasse=eget&platea=tincidunt&dictumst=eget&etiam=tempus&faucibus=vel&cursus=pede&urna=morbi&ut=porttitor&tellus=lorem&nulla=id&ut=ligula&erat=suspendisse&id=ornare&mauris=consequat&vulputate=lectus&elementum=in&nullam=est&varius=risus&nulla=auctor&facilisi=sed&cras=tristique&non=in&velit=tempus&nec=sit&nisi=amet&vulputate=sem&nonummy=fusce&maecenas=consequat&tincidunt=nulla&lacus=nisl&at=nunc&velit=nisl&vivamus=duis&vel=bibendum&nulla=felis&eget=sed&eros=interdum&elementum=venenatis&pellentesque=turpis&quisque=enim&porta=blandit&volutpat=mi&erat=in&quisque=porttitor&erat=pede&eros=justo&viverra=eu&eget=massa&congue=donec&eget=dapibus&semper=duis&rutrum=at&nulla=velit&nunc=eu&purus=est&phasellus=congue&in=elementum&felis=in&donec=hac&semper=habitasse&sapien=platea&a=dictumst&libero=morbi&nam=vestibulum'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>5,\n 'Titulo'=>'maecenas leo odio condimentum id luctus nec molestie sed justo pellentesque viverra pede ac diam',\n 'Provincia'=>'Canarias',\n 'Ciudad'=>'Telde',\n 'TipoContrato'=>'purus eu magna vulputate luctus cum sociis',\n 'Salario'=>'€4287,68',\n 'Descripcion'=>'nulla tellus in sagittis dui vel nisl duis ac nibh fusce lacus purus aliquet at feugiat non pretium quis lectus suspendisse potenti in eleifend quam a odio in hac habitasse platea dictumst maecenas ut massa quis augue luctus tincidunt nulla mollis molestie lorem quisque ut erat curabitur gravida nisi at nibh in hac habitasse platea dictumst aliquam augue quam sollicitudin vitae consectetuer eget rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla integer pede justo lacinia eget',\n 'URL'=>'http://sbwire.com/quam/fringilla/rhoncus/mauris.jsp?turpis=eu&a=sapien&pede=cursus&posuere=vestibulum&nonummy=proin&integer=eu&non=mi&velit=nulla&donec=ac&diam=enim&neque=in&vestibulum=tempor&eget=turpis&vulputate=nec&ut=euismod&ultrices=scelerisque&vel=quam&augue=turpis&vestibulum=adipiscing&ante=lorem&ipsum=vitae&primis=mattis&in=nibh&faucibus=ligula&orci=nec&luctus=sem&et=duis&ultrices=aliquam&posuere=convallis&cubilia=nunc&curae=proin&donec=at&pharetra=turpis&magna=a&vestibulum=pede&aliquet=posuere&ultrices=nonummy&erat=integer&tortor=non&sollicitudin=velit&mi=donec&sit=diam&amet=neque&lobortis=vestibulum&sapien=eget&sapien=vulputate&non=ut&mi=ultrices&integer=vel&ac=augue&neque=vestibulum&duis=ante&bibendum=ipsum&morbi=primis&non=in&quam=faucibus&nec=orci&dui=luctus&luctus=et&rutrum=ultrices&nulla=posuere&tellus=cubilia&in=curae&sagittis=donec&dui=pharetra&vel=magna&nisl=vestibulum&duis=aliquet&ac=ultrices&nibh=erat&fusce=tortor&lacus=sollicitudin&purus=mi'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>6,\n 'Titulo'=>'tincidunt lacus at velit vivamus vel nulla eget eros elementum pellentesque quisque porta volutpat erat quisque erat eros viverra',\n 'Provincia'=>'Murcia',\n 'Ciudad'=>'Murcia',\n 'TipoContrato'=>'volutpat eleifend donec ut dolor',\n 'Salario'=>'€1927,42',\n 'Descripcion'=>'justo eu massa donec dapibus duis at velit eu est congue elementum in hac habitasse platea dictumst morbi vestibulum velit id pretium iaculis diam erat fermentum justo nec condimentum neque sapien placerat ante nulla justo aliquam quis turpis eget elit sodales scelerisque mauris sit amet eros suspendisse accumsan tortor quis turpis sed ante vivamus tortor duis mattis egestas metus aenean fermentum donec ut mauris eget massa tempor convallis nulla neque libero convallis eget eleifend luctus ultricies eu nibh quisque id justo sit amet sapien dignissim vestibulum vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae nulla dapibus dolor vel est donec odio justo sollicitudin ut suscipit a feugiat et eros vestibulum ac est lacinia nisi venenatis tristique fusce congue diam id ornare imperdiet sapien urna pretium nisl ut volutpat sapien arcu sed augue aliquam erat volutpat in congue etiam justo etiam pretium iaculis justo in hac habitasse platea dictumst etiam faucibus cursus urna ut tellus nulla ut erat id mauris vulputate elementum nullam varius nulla facilisi cras non velit nec nisi vulputate nonummy maecenas tincidunt lacus at velit vivamus vel nulla eget eros elementum pellentesque quisque porta volutpat',\n 'URL'=>'https://yellowpages.com/non.xml?condimentum=eros&curabitur=viverra&in=eget&libero=congue&ut=eget&massa=semper&volutpat=rutrum&convallis=nulla&morbi=nunc&odio=purus&odio=phasellus&elementum=in&eu=felis&interdum=donec&eu=semper&tincidunt=sapien&in=a&leo=libero&maecenas=nam&pulvinar=dui&lobortis=proin&est=leo&phasellus=odio&sit=porttitor&amet=id&erat=consequat&nulla=in&tempus=consequat&vivamus=ut&in=nulla&felis=sed&eu=accumsan&sapien=felis&cursus=ut&vestibulum=at&proin=dolor&eu=quis&mi=odio&nulla=consequat&ac=varius&enim=integer&in=ac&tempor=leo&turpis=pellentesque&nec=ultrices&euismod=mattis&scelerisque=odio&quam=donec&turpis=vitae&adipiscing=nisi&lorem=nam&vitae=ultrices&mattis=libero&nibh=non'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>7,\n 'Titulo'=>'justo maecenas rhoncus aliquam lacus morbi quis tortor id nulla ultrices aliquet maecenas',\n 'Provincia'=>'Castilla - La Mancha',\n 'Ciudad'=>'Toledo',\n 'TipoContrato'=>'suscipit a',\n 'Salario'=>'€8366,46',\n 'Descripcion'=>'eros vestibulum ac est lacinia nisi venenatis tristique fusce congue diam id ornare imperdiet sapien urna pretium nisl ut volutpat sapien arcu sed augue aliquam erat volutpat in congue etiam justo etiam pretium iaculis justo in hac habitasse platea dictumst etiam faucibus cursus urna ut tellus nulla ut erat id mauris vulputate elementum nullam varius nulla facilisi cras non velit nec nisi vulputate nonummy maecenas tincidunt lacus at velit vivamus vel nulla eget eros elementum pellentesque quisque porta volutpat erat quisque erat eros viverra eget congue eget semper rutrum nulla nunc purus phasellus in felis donec semper sapien a libero nam dui proin leo odio porttitor id consequat in consequat ut nulla sed accumsan felis ut at dolor quis odio consequat varius integer ac leo pellentesque ultrices mattis',\n 'URL'=>'https://parallels.com/a/suscipit/nulla/elit/ac/nulla/sed.aspx?potenti=nascetur&cras=ridiculus&in=mus&purus=vivamus&eu=vestibulum&magna=sagittis&vulputate=sapien&luctus=cum&cum=sociis&sociis=natoque&natoque=penatibus&penatibus=et&et=magnis&magnis=dis&dis=parturient&parturient=montes&montes=nascetur&nascetur=ridiculus&ridiculus=mus&mus=etiam&vivamus=vel&vestibulum=augue&sagittis=vestibulum&sapien=rutrum&cum=rutrum&sociis=neque&natoque=aenean&penatibus=auctor&et=gravida&magnis=sem&dis=praesent&parturient=id&montes=massa&nascetur=id&ridiculus=nisl&mus=venenatis&etiam=lacinia&vel=aenean&augue=sit&vestibulum=amet&rutrum=justo&rutrum=morbi&neque=ut&aenean=odio&auctor=cras&gravida=mi&sem=pede&praesent=malesuada&id=in&massa=imperdiet&id=et&nisl=commodo&venenatis=vulputate&lacinia=justo&aenean=in&sit=blandit&amet=ultrices&justo=enim&morbi=lorem&ut=ipsum&odio=dolor&cras=sit&mi=amet&pede=consectetuer&malesuada=adipiscing&in=elit&imperdiet=proin&et=interdum&commodo=mauris&vulputate=non&justo=ligula&in=pellentesque&blandit=ultrices&ultrices=phasellus&enim=id&lorem=sapien&ipsum=in&dolor=sapien&sit=iaculis&amet=congue'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>8,\n 'Titulo'=>'metus aenean fermentum donec ut mauris eget massa tempor convallis nulla neque libero convallis eget eleifend luctus ultricies eu nibh',\n 'Provincia'=>'Galicia',\n 'Ciudad'=>'Vigo',\n 'TipoContrato'=>'volutpat in congue etiam justo etiam pretium iaculis justo in',\n 'Salario'=>'€8967,47',\n 'Descripcion'=>'pretium quis lectus suspendisse potenti in eleifend quam a odio in hac habitasse platea dictumst maecenas ut massa quis augue luctus tincidunt nulla mollis molestie lorem quisque ut erat curabitur gravida nisi at nibh in hac habitasse platea dictumst aliquam augue quam sollicitudin vitae consectetuer eget rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla integer pede justo lacinia eget tincidunt eget tempus vel pede morbi porttitor lorem id ligula suspendisse ornare consequat lectus in est risus auctor sed tristique in tempus sit amet sem fusce consequat nulla nisl nunc nisl duis bibendum felis sed interdum venenatis',\n 'URL'=>'https://photobucket.com/magnis/dis/parturient/montes/nascetur/ridiculus.html?tristique=nisl&est=nunc&et=nisl&tempus=duis&semper=bibendum&est=felis&quam=sed&pharetra=interdum&magna=venenatis&ac=turpis&consequat=enim&metus=blandit&sapien=mi&ut=in&nunc=porttitor&vestibulum=pede&ante=justo&ipsum=eu&primis=massa&in=donec&faucibus=dapibus&orci=duis&luctus=at&et=velit&ultrices=eu&posuere=est&cubilia=congue&curae=elementum&mauris=in&viverra=hac&diam=habitasse&vitae=platea&quam=dictumst&suspendisse=morbi&potenti=vestibulum&nullam=velit&porttitor=id&lacus=pretium&at=iaculis&turpis=diam&donec=erat&posuere=fermentum&metus=justo&vitae=nec&ipsum=condimentum&aliquam=neque&non=sapien&mauris=placerat&morbi=ante&non=nulla&lectus=justo&aliquam=aliquam&sit=quis&amet=turpis&diam=eget&in=elit'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>9,\n 'Titulo'=>'metus arcu adipiscing molestie hendrerit at vulputate vitae nisl aenean lectus pellentesque eget nunc donec quis orci eget orci vehicula',\n 'Provincia'=>'Aragon',\n 'Ciudad'=>'Zaragoza',\n 'TipoContrato'=>'duis bibendum morbi non quam nec dui luctus',\n 'Salario'=>'€5949,47',\n 'Descripcion'=>'id ligula suspendisse ornare consequat lectus in est risus auctor sed tristique in tempus sit amet sem fusce consequat nulla nisl nunc nisl duis bibendum felis sed interdum venenatis turpis enim blandit mi in porttitor pede justo eu massa donec dapibus duis at velit eu est congue elementum in hac habitasse platea dictumst morbi vestibulum velit id pretium iaculis diam erat fermentum justo nec condimentum neque sapien placerat ante nulla justo aliquam quis turpis eget elit sodales scelerisque mauris sit amet eros suspendisse accumsan tortor quis turpis sed ante vivamus tortor duis mattis egestas metus aenean fermentum donec ut mauris eget massa tempor convallis nulla neque libero convallis eget eleifend luctus ultricies eu nibh quisque id justo sit amet sapien dignissim vestibulum vestibulum ante ipsum',\n 'URL'=>'http://google.com.au/imperdiet/et/commodo/vulputate/justo/in/blandit.png?massa=orci&tempor=pede&convallis=venenatis&nulla=non&neque=sodales&libero=sed&convallis=tincidunt&eget=eu&eleifend=felis&luctus=fusce&ultricies=posuere&eu=felis&nibh=sed&quisque=lacus&id=morbi&justo=sem&sit=mauris&amet=laoreet&sapien=ut&dignissim=rhoncus'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>10,\n 'Titulo'=>'blandit ultrices enim lorem ipsum dolor sit amet consectetuer adipiscing',\n 'Provincia'=>'Cataluna',\n 'Ciudad'=>'Barcelona',\n 'TipoContrato'=>'erat tortor sollicitudin mi sit amet lobortis',\n 'Salario'=>'€2089,86',\n 'Descripcion'=>'vivamus metus arcu adipiscing molestie hendrerit at vulputate vitae nisl aenean lectus pellentesque eget nunc donec quis orci eget orci vehicula condimentum curabitur in libero ut massa volutpat convallis morbi odio odio elementum eu interdum eu tincidunt in leo maecenas pulvinar lobortis est phasellus sit amet erat nulla tempus vivamus in felis eu sapien cursus vestibulum proin eu mi nulla ac enim in tempor turpis nec euismod scelerisque quam turpis adipiscing lorem vitae mattis nibh ligula nec sem duis aliquam convallis nunc proin at turpis a pede posuere nonummy integer non velit donec diam neque vestibulum eget vulputate ut ultrices vel augue vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae donec pharetra magna vestibulum aliquet ultrices erat tortor sollicitudin mi sit amet lobortis sapien sapien non mi integer ac neque duis bibendum morbi non quam nec dui luctus rutrum nulla tellus in sagittis dui vel nisl duis ac nibh fusce lacus purus aliquet at feugiat non pretium quis lectus suspendisse potenti',\n 'URL'=>'http://yale.edu/fusce/congue/diam.jsp?id=quis&sapien=orci&in=nullam&sapien=molestie&iaculis=nibh&congue=in&vivamus=lectus&metus=pellentesque&arcu=at&adipiscing=nulla&molestie=suspendisse&hendrerit=potenti&at=cras&vulputate=in&vitae=purus&nisl=eu&aenean=magna&lectus=vulputate&pellentesque=luctus&eget=cum&nunc=sociis&donec=natoque&quis=penatibus&orci=et&eget=magnis&orci=dis&vehicula=parturient&condimentum=montes&curabitur=nascetur&in=ridiculus&libero=mus&ut=vivamus&massa=vestibulum&volutpat=sagittis&convallis=sapien&morbi=cum&odio=sociis&odio=natoque&elementum=penatibus&eu=et'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>11,\n 'Titulo'=>'curabitur convallis duis consequat dui nec nisi volutpat eleifend donec ut dolor morbi vel lectus in quam fringilla rhoncus mauris',\n 'Provincia'=>'Asturias',\n 'Ciudad'=>'Gijon',\n 'TipoContrato'=>'massa donec dapibus duis at velit',\n 'Salario'=>'€4878,07',\n 'Descripcion'=>'lacinia aenean sit amet justo morbi ut odio cras mi pede malesuada in imperdiet et commodo vulputate justo in blandit ultrices enim lorem ipsum dolor sit amet consectetuer adipiscing elit proin interdum mauris non ligula pellentesque ultrices phasellus id sapien in sapien iaculis congue vivamus metus arcu adipiscing molestie hendrerit at vulputate vitae nisl aenean lectus pellentesque eget nunc donec quis orci eget orci vehicula condimentum curabitur in libero ut massa volutpat convallis morbi odio odio elementum eu interdum eu tincidunt in leo maecenas pulvinar lobortis est phasellus sit amet erat nulla tempus vivamus in felis eu sapien cursus vestibulum proin eu mi nulla ac enim in tempor turpis nec euismod scelerisque quam turpis adipiscing lorem vitae mattis nibh ligula nec sem duis aliquam convallis nunc proin at turpis a pede posuere nonummy integer non velit donec diam neque vestibulum eget vulputate ut ultrices vel augue vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae donec pharetra magna vestibulum aliquet ultrices erat tortor sollicitudin mi sit amet lobortis sapien sapien non mi integer ac neque duis bibendum morbi non quam nec dui luctus rutrum nulla tellus',\n 'URL'=>'http://reverbnation.com/justo/aliquam.aspx?primis=curabitur&in=convallis&faucibus=duis&orci=consequat&luctus=dui&et=nec&ultrices=nisi&posuere=volutpat&cubilia=eleifend&curae=donec&donec=ut&pharetra=dolor&magna=morbi&vestibulum=vel&aliquet=lectus&ultrices=in&erat=quam&tortor=fringilla&sollicitudin=rhoncus&mi=mauris&sit=enim&amet=leo&lobortis=rhoncus&sapien=sed&sapien=vestibulum&non=sit&mi=amet&integer=cursus&ac=id&neque=turpis&duis=integer&bibendum=aliquet&morbi=massa'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>12,\n 'Titulo'=>'potenti in eleifend quam a odio in hac habitasse platea dictumst maecenas ut',\n 'Provincia'=>'Galicia',\n 'Ciudad'=>'Pontevedra',\n 'TipoContrato'=>'nec molestie sed justo pellentesque viverra pede ac',\n 'Salario'=>'€2623,06',\n 'Descripcion'=>'orci luctus et ultrices posuere cubilia curae nulla dapibus dolor vel est donec odio justo sollicitudin ut suscipit a feugiat et eros vestibulum ac est lacinia nisi venenatis tristique fusce congue diam id ornare imperdiet sapien urna pretium nisl ut volutpat sapien arcu sed augue aliquam erat volutpat in congue etiam justo etiam pretium iaculis justo in hac habitasse platea dictumst etiam faucibus cursus urna ut tellus nulla ut erat id mauris vulputate elementum nullam varius nulla facilisi cras non velit nec nisi vulputate nonummy maecenas tincidunt lacus at velit vivamus vel nulla eget eros elementum pellentesque quisque porta volutpat erat',\n 'URL'=>'http://infoseek.co.jp/nam/dui.jpg?nulla=duis&ultrices=aliquam&aliquet=convallis&maecenas=nunc&leo=proin&odio=at&condimentum=turpis&id=a&luctus=pede&nec=posuere&molestie=nonummy&sed=integer&justo=non&pellentesque=velit&viverra=donec&pede=diam&ac=neque&diam=vestibulum&cras=eget&pellentesque=vulputate&volutpat=ut&dui=ultrices&maecenas=vel&tristique=augue&est=vestibulum&et=ante&tempus=ipsum&semper=primis&est=in&quam=faucibus&pharetra=orci&magna=luctus&ac=et&consequat=ultrices&metus=posuere&sapien=cubilia&ut=curae&nunc=donec&vestibulum=pharetra&ante=magna&ipsum=vestibulum&primis=aliquet&in=ultrices&faucibus=erat&orci=tortor&luctus=sollicitudin&et=mi&ultrices=sit&posuere=amet&cubilia=lobortis&curae=sapien&mauris=sapien&viverra=non&diam=mi&vitae=integer&quam=ac&suspendisse=neque&potenti=duis&nullam=bibendum&porttitor=morbi&lacus=non&at=quam&turpis=nec'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>13,\n 'Titulo'=>'lectus pellentesque eget nunc donec quis orci eget orci vehicula condimentum curabitur in',\n 'Provincia'=>'Galicia',\n 'Ciudad'=>'Vigo',\n 'TipoContrato'=>'eget',\n 'Salario'=>'€2761,16',\n 'Descripcion'=>'vitae ipsum aliquam non mauris morbi non lectus aliquam sit amet diam in magna bibendum imperdiet nullam orci pede venenatis non sodales sed tincidunt eu felis fusce posuere felis sed lacus morbi sem mauris laoreet ut rhoncus aliquet pulvinar sed nisl nunc rhoncus dui vel sem sed sagittis nam congue risus semper porta volutpat',\n 'URL'=>'http://amazon.com/ipsum/primis/in/faucibus/orci/luctus.jsp?dapibus=sapien&augue=placerat&vel=ante&accumsan=nulla&tellus=justo&nisi=aliquam&eu=quis&orci=turpis&mauris=eget&lacinia=elit&sapien=sodales&quis=scelerisque&libero=mauris&nullam=sit&sit=amet&amet=eros&turpis=suspendisse&elementum=accumsan&ligula=tortor&vehicula=quis&consequat=turpis&morbi=sed&a=ante&ipsum=vivamus&integer=tortor&a=duis&nibh=mattis&in=egestas&quis=metus&justo=aenean&maecenas=fermentum&rhoncus=donec&aliquam=ut&lacus=mauris&morbi=eget&quis=massa&tortor=tempor&id=convallis&nulla=nulla&ultrices=neque&aliquet=libero&maecenas=convallis&leo=eget&odio=eleifend&condimentum=luctus&id=ultricies&luctus=eu&nec=nibh&molestie=quisque&sed=id'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>14,\n 'Titulo'=>'aliquam augue quam sollicitudin vitae consectetuer eget rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat',\n 'Provincia'=>'Comunidad Valenciana',\n 'Ciudad'=>'Castellon De La Plana/Castello De La Pla',\n 'TipoContrato'=>'justo',\n 'Salario'=>'€8541,01',\n 'Descripcion'=>'a suscipit nulla elit ac nulla sed vel enim sit amet nunc viverra dapibus nulla suscipit ligula in lacus curabitur at ipsum ac tellus semper interdum mauris ullamcorper purus sit amet nulla',\n 'URL'=>'http://dion.ne.jp/massa/quis/augue.xml?mauris=curabitur&enim=convallis&leo=duis&rhoncus=consequat&sed=dui&vestibulum=nec&sit=nisi&amet=volutpat&cursus=eleifend&id=donec&turpis=ut&integer=dolor&aliquet=morbi&massa=vel&id=lectus&lobortis=in&convallis=quam&tortor=fringilla&risus=rhoncus&dapibus=mauris&augue=enim&vel=leo&accumsan=rhoncus&tellus=sed&nisi=vestibulum&eu=sit&orci=amet&mauris=cursus&lacinia=id&sapien=turpis&quis=integer&libero=aliquet&nullam=massa&sit=id&amet=lobortis&turpis=convallis&elementum=tortor&ligula=risus&vehicula=dapibus&consequat=augue&morbi=vel&a=accumsan&ipsum=tellus&integer=nisi&a=eu&nibh=orci&in=mauris&quis=lacinia&justo=sapien&maecenas=quis&rhoncus=libero&aliquam=nullam&lacus=sit&morbi=amet&quis=turpis&tortor=elementum&id=ligula&nulla=vehicula&ultrices=consequat'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>15,\n 'Titulo'=>'ligula nec sem duis aliquam convallis nunc proin at turpis a pede posuere nonummy',\n 'Provincia'=>'Andalucia',\n 'Ciudad'=>'Almeria',\n 'TipoContrato'=>'in hac habitasse platea dictumst aliquam augue quam',\n 'Salario'=>'€9770,39',\n 'Descripcion'=>'ultrices erat tortor sollicitudin mi sit amet lobortis sapien sapien non mi integer ac neque duis bibendum morbi non quam nec dui luctus rutrum nulla tellus in sagittis dui vel nisl duis ac nibh fusce lacus purus aliquet at feugiat non pretium quis lectus suspendisse potenti in eleifend quam a odio in hac habitasse platea dictumst maecenas ut massa quis augue luctus tincidunt nulla mollis molestie lorem quisque ut erat curabitur gravida nisi at nibh in hac habitasse platea dictumst aliquam augue quam sollicitudin vitae consectetuer eget rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla integer pede justo lacinia eget tincidunt eget tempus vel pede morbi porttitor lorem id ligula suspendisse ornare consequat lectus in est risus auctor sed tristique in tempus sit amet sem fusce consequat nulla nisl nunc nisl duis bibendum felis sed interdum venenatis turpis enim blandit mi in porttitor pede justo eu massa donec dapibus duis at velit eu est congue elementum in hac habitasse platea dictumst morbi vestibulum velit id pretium iaculis diam erat fermentum justo nec',\n 'URL'=>'https://linkedin.com/platea.aspx?etiam=lectus&justo=aliquam&etiam=sit&pretium=amet&iaculis=diam&justo=in&in=magna&hac=bibendum&habitasse=imperdiet&platea=nullam&dictumst=orci&etiam=pede&faucibus=venenatis&cursus=non&urna=sodales&ut=sed&tellus=tincidunt&nulla=eu&ut=felis&erat=fusce&id=posuere&mauris=felis&vulputate=sed&elementum=lacus&nullam=morbi&varius=sem&nulla=mauris&facilisi=laoreet&cras=ut&non=rhoncus&velit=aliquet&nec=pulvinar&nisi=sed&vulputate=nisl&nonummy=nunc&maecenas=rhoncus&tincidunt=dui&lacus=vel&at=sem&velit=sed&vivamus=sagittis&vel=nam&nulla=congue&eget=risus&eros=semper&elementum=porta&pellentesque=volutpat&quisque=quam&porta=pede&volutpat=lobortis&erat=ligula&quisque=sit&erat=amet&eros=eleifend&viverra=pede&eget=libero&congue=quis&eget=orci&semper=nullam&rutrum=molestie&nulla=nibh&nunc=in&purus=lectus&phasellus=pellentesque&in=at&felis=nulla'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>16,\n 'Titulo'=>'rutrum nulla tellus in sagittis dui vel nisl duis ac nibh fusce lacus',\n 'Provincia'=>'Canarias',\n 'Ciudad'=>'Santa Cruz De Tenerife',\n 'TipoContrato'=>'elit sodales scelerisque mauris sit amet',\n 'Salario'=>'€8516,56',\n 'Descripcion'=>'pede ac diam cras pellentesque volutpat dui maecenas tristique est et tempus semper est quam pharetra magna ac consequat metus sapien ut nunc vestibulum ante ipsum primis in faucibus orci',\n 'URL'=>'https://oracle.com/erat/vestibulum/sed.html?penatibus=in&et=ante&magnis=vestibulum&dis=ante&parturient=ipsum&montes=primis&nascetur=in&ridiculus=faucibus&mus=orci&vivamus=luctus&vestibulum=et&sagittis=ultrices&sapien=posuere&cum=cubilia&sociis=curae&natoque=duis&penatibus=faucibus&et=accumsan&magnis=odio&dis=curabitur&parturient=convallis&montes=duis&nascetur=consequat&ridiculus=dui&mus=nec&etiam=nisi&vel=volutpat&augue=eleifend&vestibulum=donec&rutrum=ut&rutrum=dolor&neque=morbi&aenean=vel&auctor=lectus&gravida=in&sem=quam&praesent=fringilla&id=rhoncus&massa=mauris&id=enim&nisl=leo&venenatis=rhoncus&lacinia=sed&aenean=vestibulum&sit=sit&amet=amet&justo=cursus&morbi=id&ut=turpis&odio=integer&cras=aliquet&mi=massa&pede=id&malesuada=lobortis&in=convallis&imperdiet=tortor&et=risus&commodo=dapibus&vulputate=augue&justo=vel&in=accumsan&blandit=tellus&ultrices=nisi&enim=eu&lorem=orci&ipsum=mauris&dolor=lacinia&sit=sapien&amet=quis&consectetuer=libero&adipiscing=nullam&elit=sit&proin=amet'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>17,\n 'Titulo'=>'quis tortor id nulla ultrices aliquet maecenas leo odio condimentum id luctus nec molestie',\n 'Provincia'=>'Asturias',\n 'Ciudad'=>'Gijon',\n 'TipoContrato'=>'nunc proin at',\n 'Salario'=>'€1715,07',\n 'Descripcion'=>'purus eu magna vulputate luctus cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus vivamus vestibulum sagittis sapien cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus etiam vel augue vestibulum rutrum rutrum neque aenean auctor gravida sem praesent id massa id nisl venenatis lacinia aenean sit amet justo morbi ut odio cras mi pede malesuada in imperdiet et commodo vulputate justo in blandit ultrices enim lorem ipsum dolor sit amet consectetuer adipiscing elit proin interdum mauris non ligula pellentesque ultrices phasellus id sapien in sapien iaculis congue vivamus metus arcu adipiscing molestie hendrerit at vulputate vitae nisl aenean lectus pellentesque eget nunc donec quis orci eget orci vehicula condimentum curabitur in libero ut massa volutpat convallis morbi odio odio elementum eu interdum eu tincidunt in leo maecenas pulvinar lobortis est phasellus sit amet erat nulla tempus vivamus in felis',\n 'URL'=>'https://google.es/et/ultrices.jsp?in=est&libero=lacinia&ut=nisi&massa=venenatis&volutpat=tristique&convallis=fusce&morbi=congue&odio=diam&odio=id&elementum=ornare&eu=imperdiet&interdum=sapien&eu=urna&tincidunt=pretium&in=nisl&leo=ut&maecenas=volutpat&pulvinar=sapien&lobortis=arcu&est=sed&phasellus=augue&sit=aliquam&amet=erat&erat=volutpat&nulla=in&tempus=congue&vivamus=etiam&in=justo&felis=etiam&eu=pretium&sapien=iaculis&cursus=justo&vestibulum=in&proin=hac&eu=habitasse&mi=platea&nulla=dictumst&ac=etiam&enim=faucibus&in=cursus&tempor=urna'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>18,\n 'Titulo'=>'ut dolor morbi vel lectus in quam fringilla rhoncus mauris enim leo rhoncus',\n 'Provincia'=>'Cataluna',\n 'Ciudad'=>'Tarragona',\n 'TipoContrato'=>'proin interdum mauris',\n 'Salario'=>'€7776,27',\n 'Descripcion'=>'ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae mauris viverra diam vitae quam suspendisse potenti nullam porttitor lacus at turpis',\n 'URL'=>'https://howstuffworks.com/integer/ac/neque/duis.xml?bibendum=morbi&imperdiet=porttitor&nullam=lorem&orci=id&pede=ligula&venenatis=suspendisse&non=ornare&sodales=consequat&sed=lectus&tincidunt=in&eu=est&felis=risus&fusce=auctor&posuere=sed&felis=tristique&sed=in&lacus=tempus&morbi=sit&sem=amet&mauris=sem&laoreet=fusce&ut=consequat&rhoncus=nulla&aliquet=nisl&pulvinar=nunc&sed=nisl&nisl=duis&nunc=bibendum&rhoncus=felis&dui=sed&vel=interdum&sem=venenatis&sed=turpis&sagittis=enim&nam=blandit&congue=mi&risus=in&semper=porttitor&porta=pede&volutpat=justo&quam=eu&pede=massa&lobortis=donec&ligula=dapibus&sit=duis&amet=at&eleifend=velit&pede=eu&libero=est&quis=congue&orci=elementum&nullam=in&molestie=hac&nibh=habitasse&in=platea&lectus=dictumst&pellentesque=morbi&at=vestibulum&nulla=velit&suspendisse=id&potenti=pretium&cras=iaculis&in=diam&purus=erat&eu=fermentum&magna=justo&vulputate=nec&luctus=condimentum&cum=neque&sociis=sapien&natoque=placerat&penatibus=ante&et=nulla&magnis=justo&dis=aliquam&parturient=quis&montes=turpis&nascetur=eget&ridiculus=elit&mus=sodales&vivamus=scelerisque&vestibulum=mauris&sagittis=sit&sapien=amet&cum=eros'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>19,\n 'Titulo'=>'non lectus aliquam sit amet diam in magna bibendum imperdiet nullam orci pede venenatis non sodales sed tincidunt eu felis',\n 'Provincia'=>'Murcia',\n 'Ciudad'=>'Murcia',\n 'TipoContrato'=>'tincidunt lacus at velit vivamus vel',\n 'Salario'=>'€4091,34',\n 'Descripcion'=>'mollis molestie lorem quisque ut erat curabitur gravida nisi at nibh in hac habitasse platea dictumst aliquam augue quam sollicitudin vitae consectetuer eget rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla integer pede justo lacinia eget tincidunt eget tempus vel pede morbi porttitor lorem id ligula suspendisse ornare consequat lectus in est risus auctor sed tristique in tempus sit amet sem fusce consequat nulla nisl nunc nisl duis bibendum felis sed interdum venenatis turpis enim blandit mi in porttitor pede',\n 'URL'=>'https://nih.gov/suscipit/nulla/elit/ac.json?quam=nisl&nec=venenatis&dui=lacinia&luctus=aenean&rutrum=sit&nulla=amet&tellus=justo&in=morbi&sagittis=ut&dui=odio&vel=cras&nisl=mi&duis=pede'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>20,\n 'Titulo'=>'eu magna vulputate luctus cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus',\n 'Provincia'=>'Castilla - Leon',\n 'Ciudad'=>'Leon',\n 'TipoContrato'=>'eu magna vulputate',\n 'Salario'=>'€8782,65',\n 'Descripcion'=>'massa id lobortis convallis tortor risus dapibus augue vel accumsan tellus nisi eu orci mauris lacinia sapien quis libero nullam sit amet turpis elementum ligula vehicula consequat morbi a ipsum integer a nibh in quis justo maecenas rhoncus aliquam lacus morbi quis tortor id nulla ultrices aliquet maecenas leo odio condimentum id luctus nec molestie sed justo pellentesque viverra pede ac diam cras pellentesque volutpat dui maecenas tristique est et tempus semper est quam pharetra magna ac consequat metus sapien ut nunc vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae mauris viverra diam vitae quam suspendisse potenti nullam porttitor lacus at turpis donec posuere metus vitae ipsum aliquam non mauris morbi non lectus aliquam sit',\n 'URL'=>'https://google.co.jp/ultrices/libero/non/mattis.xml?at=consequat&dolor=lectus&quis=in&odio=est&consequat=risus&varius=auctor&integer=sed&ac=tristique&leo=in&pellentesque=tempus&ultrices=sit&mattis=amet&odio=sem&donec=fusce&vitae=consequat&nisi=nulla&nam=nisl&ultrices=nunc&libero=nisl&non=duis&mattis=bibendum&pulvinar=felis&nulla=sed&pede=interdum&ullamcorper=venenatis&augue=turpis&a=enim&suscipit=blandit&nulla=mi&elit=in&ac=porttitor&nulla=pede&sed=justo&vel=eu&enim=massa&sit=donec&amet=dapibus&nunc=duis&viverra=at&dapibus=velit&nulla=eu&suscipit=est&ligula=congue&in=elementum&lacus=in&curabitur=hac&at=habitasse&ipsum=platea&ac=dictumst&tellus=morbi&semper=vestibulum&interdum=velit&mauris=id&ullamcorper=pretium&purus=iaculis&sit=diam&amet=erat&nulla=fermentum&quisque=justo&arcu=nec&libero=condimentum&rutrum=neque&ac=sapien&lobortis=placerat&vel=ante&dapibus=nulla&at=justo&diam=aliquam&nam=quis&tristique=turpis&tortor=eget'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>21,\n 'Titulo'=>'vitae ipsum aliquam non mauris morbi non lectus aliquam sit amet diam in',\n 'Provincia'=>'Cataluna',\n 'Ciudad'=>'Lleida',\n 'TipoContrato'=>'auctor sed tristique in tempus sit amet sem',\n 'Salario'=>'€2517,05',\n 'Descripcion'=>'rutrum at lorem integer tincidunt ante vel ipsum praesent blandit lacinia erat vestibulum sed magna at nunc commodo placerat praesent blandit nam nulla integer pede justo lacinia eget tincidunt eget tempus vel pede morbi porttitor lorem id ligula suspendisse ornare consequat lectus in est risus auctor sed tristique in tempus sit amet sem fusce consequat nulla nisl nunc nisl duis bibendum felis sed interdum venenatis turpis enim blandit mi in porttitor pede justo eu massa donec dapibus duis at velit eu est congue elementum in hac habitasse platea dictumst morbi vestibulum velit id pretium iaculis diam erat fermentum justo nec condimentum neque sapien placerat ante nulla justo aliquam quis turpis eget elit sodales scelerisque mauris sit amet eros suspendisse accumsan tortor quis turpis sed ante vivamus tortor duis mattis egestas metus aenean fermentum donec ut mauris eget massa tempor convallis',\n 'URL'=>'http://statcounter.com/cras.jpg?nulla=nulla&eget=tellus&eros=in&elementum=sagittis&pellentesque=dui&quisque=vel&porta=nisl&volutpat=duis&erat=ac&quisque=nibh&erat=fusce&eros=lacus&viverra=purus&eget=aliquet&congue=at&eget=feugiat&semper=non&rutrum=pretium&nulla=quis&nunc=lectus&purus=suspendisse&phasellus=potenti&in=in&felis=eleifend&donec=quam&semper=a&sapien=odio&a=in&libero=hac&nam=habitasse&dui=platea&proin=dictumst&leo=maecenas&odio=ut&porttitor=massa&id=quis&consequat=augue&in=luctus&consequat=tincidunt&ut=nulla&nulla=mollis&sed=molestie&accumsan=lorem&felis=quisque&ut=ut&at=erat&dolor=curabitur&quis=gravida&odio=nisi&consequat=at&varius=nibh&integer=in&ac=hac&leo=habitasse&pellentesque=platea'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>22,\n 'Titulo'=>'odio curabitur convallis duis consequat dui nec nisi volutpat eleifend donec ut dolor morbi',\n 'Provincia'=>'Andalucia',\n 'Ciudad'=>'Malaga',\n 'TipoContrato'=>'molestie lorem quisque ut erat curabitur',\n 'Salario'=>'€6084,31',\n 'Descripcion'=>'lacus at turpis donec posuere metus vitae ipsum aliquam non mauris morbi non lectus aliquam sit amet diam in magna bibendum imperdiet nullam orci pede venenatis non sodales sed tincidunt eu felis fusce posuere felis sed lacus morbi sem mauris laoreet ut rhoncus aliquet pulvinar sed nisl nunc rhoncus dui vel sem sed sagittis nam congue risus semper porta volutpat quam pede lobortis ligula sit amet eleifend pede libero quis orci nullam molestie nibh in lectus pellentesque at nulla suspendisse potenti cras in purus eu magna vulputate luctus cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus vivamus vestibulum sagittis sapien cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus etiam vel augue vestibulum rutrum',\n 'URL'=>'https://berkeley.edu/gravida/sem/praesent/id/massa/id.html?hac=aliquam&habitasse=lacus&platea=morbi&dictumst=quis&maecenas=tortor&ut=id&massa=nulla&quis=ultrices&augue=aliquet&luctus=maecenas&tincidunt=leo&nulla=odio&mollis=condimentum&molestie=id&lorem=luctus&quisque=nec&ut=molestie&erat=sed&curabitur=justo&gravida=pellentesque&nisi=viverra&at=pede&nibh=ac&in=diam&hac=cras&habitasse=pellentesque&platea=volutpat&dictumst=dui&aliquam=maecenas&augue=tristique&quam=est&sollicitudin=et&vitae=tempus&consectetuer=semper&eget=est&rutrum=quam&at=pharetra&lorem=magna'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>23,\n 'Titulo'=>'aliquet at feugiat non pretium quis lectus suspendisse potenti in eleifend quam a odio in',\n 'Provincia'=>'Pais Vasco',\n 'Ciudad'=>'Vitoria-Gasteiz',\n 'TipoContrato'=>'duis mattis egestas metus aenean fermentum donec ut mauris',\n 'Salario'=>'€3646,99',\n 'Descripcion'=>'pulvinar sed nisl nunc rhoncus dui vel sem sed sagittis nam congue risus semper porta volutpat quam pede lobortis ligula sit amet eleifend pede libero quis orci nullam molestie nibh in lectus pellentesque at nulla suspendisse potenti cras in purus eu magna vulputate luctus cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus vivamus vestibulum sagittis sapien cum sociis natoque penatibus et magnis dis parturient montes nascetur ridiculus mus etiam vel augue vestibulum rutrum rutrum neque aenean auctor gravida sem praesent id massa id nisl venenatis lacinia aenean sit amet justo morbi ut odio cras mi pede malesuada in imperdiet et commodo vulputate justo in blandit ultrices enim lorem ipsum dolor sit amet consectetuer adipiscing elit proin interdum mauris non ligula pellentesque ultrices phasellus id sapien',\n 'URL'=>'https://artisteer.com/cubilia/curae/duis/faucibus/accumsan/odio/curabitur.png?nunc=neque&nisl=duis&duis=bibendum&bibendum=morbi&felis=non&sed=quam&interdum=nec&venenatis=dui&turpis=luctus&enim=rutrum&blandit=nulla&mi=tellus&in=in&porttitor=sagittis&pede=dui&justo=vel'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>24,\n 'Titulo'=>'accumsan tortor quis turpis sed ante vivamus tortor duis mattis egestas metus aenean fermentum donec ut mauris eget',\n 'Provincia'=>'Canarias',\n 'Ciudad'=>'Santa Cruz De Tenerife',\n 'TipoContrato'=>'at lorem integer tincidunt',\n 'Salario'=>'€9688,60',\n 'Descripcion'=>'morbi a ipsum integer a nibh in quis justo maecenas rhoncus aliquam lacus morbi quis tortor id nulla ultrices aliquet maecenas leo odio condimentum id luctus nec molestie sed justo pellentesque viverra pede ac diam cras pellentesque volutpat dui maecenas tristique est et tempus semper est quam pharetra magna ac consequat metus sapien ut nunc vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae mauris viverra diam vitae quam suspendisse potenti nullam porttitor lacus at turpis donec posuere metus vitae ipsum aliquam non mauris morbi non lectus aliquam sit amet diam in magna bibendum imperdiet nullam orci pede venenatis non sodales sed tincidunt eu felis fusce posuere felis sed lacus morbi sem mauris laoreet ut rhoncus aliquet pulvinar sed nisl nunc rhoncus dui vel sem sed sagittis nam congue risus semper porta volutpat quam pede lobortis ligula sit amet eleifend pede libero quis',\n 'URL'=>'http://techcrunch.com/cras/in/purus.png?a=interdum&ipsum=mauris&integer=ullamcorper&a=purus&nibh=sit&in=amet&quis=nulla'\n ] );\n \n \n \n Empleo::create( [\n 'ID'=>25,\n 'Titulo'=>'proin interdum mauris non ligula pellentesque ultrices phasellus id sapien in sapien',\n 'Provincia'=>'Cataluna',\n 'Ciudad'=>'Hospitalet De Llobregat, L\\'',\n 'TipoContrato'=>'blandit',\n 'Salario'=>'€6043,96',\n 'Descripcion'=>'venenatis turpis enim blandit mi in porttitor pede justo eu massa donec dapibus duis at velit eu est congue elementum in hac habitasse platea dictumst morbi vestibulum velit id pretium iaculis diam erat fermentum justo nec condimentum neque sapien placerat ante nulla justo aliquam quis turpis eget elit sodales scelerisque mauris sit amet eros suspendisse accumsan tortor quis turpis sed ante vivamus tortor duis mattis egestas metus aenean fermentum donec ut mauris eget massa tempor convallis nulla neque libero convallis eget eleifend luctus ultricies eu',\n 'URL'=>'https://friendfeed.com/augue/quam.aspx?vestibulum=eu&vestibulum=mi&ante=nulla&ipsum=ac&primis=enim&in=in&faucibus=tempor&orci=turpis&luctus=nec&et=euismod&ultrices=scelerisque&posuere=quam&cubilia=turpis&curae=adipiscing&nulla=lorem&dapibus=vitae&dolor=mattis&vel=nibh&est=ligula&donec=nec&odio=sem&justo=duis&sollicitudin=aliquam&ut=convallis&suscipit=nunc&a=proin&feugiat=at&et=turpis&eros=a&vestibulum=pede&ac=posuere&est=nonummy&lacinia=integer&nisi=non&venenatis=velit&tristique=donec&fusce=diam&congue=neque&diam=vestibulum&id=eget&ornare=vulputate&imperdiet=ut&sapien=ultrices&urna=vel&pretium=augue&nisl=vestibulum&ut=ante&volutpat=ipsum&sapien=primis&arcu=in&sed=faucibus&augue=orci&aliquam=luctus&erat=et&volutpat=ultrices&in=posuere&congue=cubilia&etiam=curae'\n ] );\n \n \n }", "public function actionCreate()\n {\n $model = new MintaData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function registroMateriaModel($datosModel, $tabla){\r\n\r\n\t\t#prepare() Prepara una sentencia SQL para ser ejecutada por el método PDOStatement::execute(). La sentencia SQL puede contener cero o más marcadores de parámetros con nombre (:name) o signos de interrogación (?) por los cuales los valores reales serán sustituidos cuando la sentencia sea ejecutada. Ayuda a prevenir inyecciones SQL eliminando la necesidad de entrecomillar manualmente los parámetros.\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla ( id_maestro, nombre, horas, creditos,id_grupo) VALUES ( :id_maestro ,:nombre ,:horas ,:creditos,:id_grupo)\");\t\r\n\r\n\t\t#bindParam() Vincula una variable de PHP a un parámetro de sustitución con nombre o de signo de interrogación correspondiente de la sentencia SQL que fue usada para preparar la sentencia.\r\n\r\n\t\t$stmt->bindParam(\":id_maestro\", $datosModel[\"id_maestro\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":nombre\", $datosModel[\"nombre\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":horas\", $datosModel[\"horas\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":creditos\", $datosModel[\"creditos\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":id_grupo\", $datosModel[\"id_grupo\"], PDO::PARAM_STR);\r\n\r\n\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"success\";\r\n\r\n\t\t}\r\n\r\n\t\telse{\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}", "public function actionCreate() {\n $this->actionUpdate();\n }", "public function actionCreate()\n {\n $model = new TbDadosmes();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Was23a();\n $modelTembusanMaster = TembusanWas::find()->where(\"for_tabel=:condition1 OR for_tabel=:condition2\", [\":condition1\" => 'was_23a','condition2'=>'master'])->orderBy('id_tembusan desc')->all();\n \n\n if ($model->load(Yii::$app->request->post())){\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n try {\n \n $model->id_tingkat = $_SESSION['kode_tk'];\n $model->id_kejati = $_SESSION['kode_kejati'];\n $model->id_kejari = $_SESSION['kode_kejari'];\n $model->id_cabjari = $_SESSION['kode_cabjari'];\n $model->no_register = $_SESSION['was_register'];\n $model->created_ip = $_SERVER['REMOTE_ADDR'];\n $model->created_time = date('Y-m-d H:i:s');\n $model->created_by = \\Yii::$app->user->identity->id;\n if($model->save()) {\n\n $pejabat = $_POST['pejabat'];\n // TembusanWas2::deleteAll(['from_table'=>'Was-23b','no_register'=>$_SESSION['was_register'],'id_tingkat'=>$_SESSION['kode_tk'],'id_kejati'=>$_SESSION['kode_kejati'], 'id_kejari'=>$_SESSION['kode_kejari'],'id_cabjari'=>$_SESSION['kode_cabjari'],'pk_in_table'=>strrev($model->id_was_23b),'id_wilayah'=>$_SESSION['was_id_wilayah'],'id_level1'=>$_SESSION['was_id_level1'],'id_level2'=>$_SESSION['was_id_level2'],'id_level3'=>$_SESSION['was_id_level3'],'id_level4'=>$_SESSION['was_id_level4']]);\n for($z=0;$z<count($pejabat);$z++){\n $saveTembusan = new TembusanWas2;\n $saveTembusan->from_table = 'Was-23b';\n $saveTembusan->pk_in_table = strrev($model->id_was_23b);\n $saveTembusan->tembusan = $_POST['pejabat'][$z];\n $saveTembusan->created_ip = $_SERVER['REMOTE_ADDR'];\n $saveTembusan->created_time = date('Y-m-d H:i:s');\n $saveTembusan->created_by = \\Yii::$app->user->identity->id;\n // $saveTembusan->inst_satkerkd = $_SESSION['inst_satkerkd'];s\n $saveTembusan->no_register = $_SESSION['was_register'];\n $saveTembusan->id_tingkat = $_SESSION['kode_tk'];\n $saveTembusan->id_kejati = $_SESSION['kode_kejati'];\n $saveTembusan->id_kejari = $_SESSION['kode_kejari'];\n $saveTembusan->id_cabjari = $_SESSION['kode_cabjari'];\n $saveTembusan->is_inspektur_irmud_riksa = $_SESSION['is_inspektur_irmud_riksa'];\n $saveTembusan->id_wilayah=$_SESSION['was_id_wilayah'];\n $saveTembusan->id_level1=$_SESSION['was_id_level1'];\n $saveTembusan->id_level2=$_SESSION['was_id_level2'];\n $saveTembusan->id_level3=$_SESSION['was_id_level3'];\n $saveTembusan->id_level4=$_SESSION['was_id_level4'];\n $saveTembusan->save();\n }\n\n }\n\n $transaction->commit();\n \n $model->validate();\n $model->save();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success', //String, can only be set to danger, success, warning, info, and growl\n 'duration' => 5000, //Integer //3000 default. time for growl to fade out.\n 'icon' => 'glyphicon glyphicon-ok-sign', //String\n 'message' => 'Data Berhasil Disimpan', // String\n 'title' => 'Save', //String\n 'positonY' => 'top', //String // defaults to top, allows top or bottom\n 'positonX' => 'center', //String // defaults to right, allows right, center, left\n 'showProgressbar' => true,\n ]);\n\n return $this->redirect(['index']);\n } catch (Exception $e) {\n $transaction->rollback();\n if(YII_DEBUG){throw $e; exit;} else{return false;}\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'modelTembusanMaster' => $modelTembusanMaster,\n ]);\n }\n }", "public function creating($model)\n\t{\n\t}", "private function _create() {\n\n $this->db->insert(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->set(\"id\", $this->db->insert_id());\n\n }" ]
[ "0.73007846", "0.72547793", "0.7162722", "0.71258557", "0.7110825", "0.70045066", "0.69486874", "0.69453007", "0.6921083", "0.6898951", "0.6869784", "0.68677706", "0.6867472", "0.68591523", "0.68559134", "0.68339664", "0.6827887", "0.68038815", "0.67795926", "0.6775028", "0.67681515", "0.6760844", "0.67579913", "0.6727291", "0.67139614", "0.67136407", "0.66988134", "0.66918314", "0.6687102", "0.6667596", "0.66386837", "0.6634813", "0.66277766", "0.6626243", "0.66185546", "0.6618028", "0.66142523", "0.6610629", "0.6608166", "0.65912193", "0.6580196", "0.6575096", "0.6570892", "0.6561406", "0.65555406", "0.65544194", "0.65544194", "0.6552435", "0.6552205", "0.65519273", "0.6526834", "0.65217465", "0.6515569", "0.6508807", "0.6499684", "0.64989525", "0.64948845", "0.64934486", "0.64837116", "0.6480256", "0.64798975", "0.6477951", "0.64715147", "0.6461879", "0.6452508", "0.644662", "0.64464897", "0.6441493", "0.6441337", "0.6441068", "0.64406407", "0.6436712", "0.6431088", "0.6426924", "0.6424528", "0.6419302", "0.64117265", "0.6407029", "0.6403463", "0.64013636", "0.6396509", "0.63933915", "0.63927275", "0.63924044", "0.63895214", "0.63892347", "0.63869077", "0.6382373", "0.6380204", "0.6378503", "0.6374564", "0.6368522", "0.63661146", "0.6364736", "0.63643885", "0.6358759", "0.6357863", "0.63571167", "0.6356382", "0.63537943", "0.6350961" ]
0.0
-1
/ READ Estrae un singolo record
function record( $table_name, $record, $id_field = 'id', $output = OBJECT ) { global $wpdb; if ( is_numeric( $record ) ) { $id_record = $record; } elseif ( is_object( $record ) ) { $id_record = $record->$id_field; } elseif ( is_array( $record ) ) { $id_record = $record[$id_field]; } $sql = <<< SQL SELECT * FROM `{$table_name}` WHERE `{$id_field}` = {$id_record} SQL; $result = $wpdb->get_row( $sql, $output ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _readRecords() {}", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "public function read();", "abstract public function read();", "public function read() {\n\t\t\n\t}", "abstract function read();", "abstract protected function read ();", "public function read() {\r\n }", "public function read()\n {\n }", "public function getRecord();", "public function getRecord() {}", "public function getRecord() {}", "public function getRecord() {}", "protected function _readTable() {}", "protected function _readTable() {}", "public function read(){\n \treturn ser_read();\n }", "public function readObject();", "public function read()\n {\n }", "function readOne(){\n\t\t\n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE ID=? LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t$this->id = $row['ID'];\n\t\t$this->sms = $row['TextDecoded'];\n\t\t$this->by = $row['SenderNumber'];\n\t\t$this->recieve = $row['ReceivingDateTime'];\n\t\t// $this->update = $row['UpdateInDB'];\n\t}", "protected function readDataRecords()\n {\n \tparent::readDataRecords();\n\n \tforeach ($this->file_contents->Activities->Activity->Lap->Track->Trackpoint as $theSeg) {\n \t\n \t\t$data['Time']=$theSeg->Time;\n \t\t$data['Ele']=$theSeg->AltitudeMeters;\n \t\t$data['Dist']=$theSeg->DistanceMeters/1000;\n \t\t$data['Cadence']=$theSeg->Cadence;\n \t\t$data['Heart']=$theSeg->HeartRateBpm->Value;\n \t\t$data['Lat']=$theSeg->Position->LatitudeDegrees;\n \t\t$data['Long']=$theSeg->Position->LongitudeDegrees;\n \t\n \t\n \t\t$this->addData($data);\n \t\t\t\n \t}\n \t$this->makeSession();\n \n }", "function read()\n {\n }", "protected function _read() {\n\n $this->record->setVersion( $this->_readInt() );\n\n # There are some strange behaviours with protocols between 19 and 23\n # the INT ( count-of-collection-changes ) in documentation\n # is present, but don't know why,\n # not every time this INT is present\n # So, i double check for protocol here\n # and add a socket timeout.\n if ( $this->_transport->getProtocolVersion() > 21 ) {\n $changesNum = $this->_readInt();\n $changes = [ ];\n if ( $changesNum > 0 && $this->_transport->getProtocolVersion() > 23 ) {\n for ( $i = 0; $i < $changesNum; $i++ ) {\n $change = [\n 'uuid-most-sig-bits' => $this->_readLong(),\n 'uuid-least-sig-bits' => $this->_readLong(),\n 'updated-file-id' => $this->_readLong(),\n 'updated-page-index' => $this->_readLong(),\n 'updated-page-offset' => $this->_readInt(),\n ];\n $changes[ ] = $change;\n }\n }\n\n }\n\n return $this->record;\n }", "private function loadReadDataIntoMDR() {\r\n \r\n }", "function read()\n\t\t{\n\t\t\t$conn = getConnection();\n\t\t\t$query = \"SELECT * FROM student WHERE ID='\".$this->ID.\"'\";\n\t\t\t$result = mysql_query($query);\n\t\t\t\n\t\t\tif(!$result)return;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member = mysql_fetch_array($result);\n$this->setMainID(trim($member['mainID']));\t\t\n$this->setRollNo(trim($member['rollno']));\t\t\n$this->setGRno(trim($member['grno']));\n$this->setFirstName(trim($member['firstname']));\n$this->setLastName(trim($member['lastname']));\n$this->setFname(trim($member['Fname']));\n$this->setBatchObj(getBatch($member['batchID']));\n$this->setExamYear(trim($member['examyear']));\n$this->setActiveFlag(trim($member['activeflag']));\n$this->setClassObj(getBatchClass($member['classID']));\n$this->BranchObj=(getBranch($this->getBatchObj()->getID()));\n$this->setLoginFlag(trim($member['loginflag']));\n$this->setPhoneStu(trim($member['phone_stu']));\n$this->setPhoneFather(trim($member['phone_father']));\n$this->setPhoneMother(trim($member['phone_mother']));\n$this->setPicUrl(trim($member['picurl']));\n\t\t\t}\n\n\t\t}", "function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "public function readOne()\n {\n \n // zapytanie o pojedynczy rekord\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_offer = ?\";\n \n // przygotowanie zapytania\n $stmt = $this->pdo->prepare($query);\n \n // wiazemy id przedstawiciela do zaaktualizowania\n $stmt->bindParam(1, $this->id);\n \n // wykonanie zapytania\n $stmt->execute();\n \n // pobieramy otrzymany rekord\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // ustawienie wartosci dla własciwosci obiektu\n $this->name = $row['name'];\n $this->date_offer = $row['date_offer'];\n $this->start_date = $row['start_date'];\n $this->end_date = $row['end_date'];\n $this->description = $row['description'];\n $this->reduction = $row['reduction'];\n }", "public function readFromRow( $row );", "function readOne(){\n \n // query to read single record\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE ROId = ? LIMIT 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of roUnit to be updated\n $stmt->bindParam(1, $this->ROId);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->ROId = $row['ROId'];\n $this->unit = $row['unit'];\n $this->created_on = $row['created_on'];\n $this->modified_on = $row['modified_on'];\n }", "function read()\n\t\t{\n\t\t\t$conn = getConnection();\n\t\t\t$query = \"SELECT * FROM student WHERE ID='\".$this->ID.\"'\";\n\t\t\t$result = mysql_query($query);\n\t\t\t\n\t\t\tif(!$result)return;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member = mysql_fetch_array($result);\n$this->setMainID(trim($member['mainID']));\t\t\n$this->setRollNo(trim($member['rollno']));\t\t\n$this->setGRno(trim($member['grno']));\n$this->setFirstName(trim($member['firstname']));\n$this->setLastName(trim($member['lastname']));\n$this->setFname(trim($member['Fname']));\n$this->setBatchID($member['batchID']);\n$this->setExamYear(trim($member['examyear']));\n$this->setActiveFlag(trim($member['activeflag']));\n$this->setClassID($member['classID']);\n\n$this->setLoginFlag(trim($member['loginflag']));\n$this->setPhoneStu(trim($member['phone_stu']));\n$this->setPhoneFather(trim($member['phone_father']));\n$this->setPhoneMother(trim($member['phone_mother']));\n$this->setPicUrl(trim($member['picurl']));\n\t\t\t}\n\n\t\t}", "public function read_event_record()\n\t{\n\t\t$data['title'] = $this->Xin_model->site_title();\n\t\t$event_id = $this->input->get('event_id');\n\t\t$result = $this->Events_model->read_event_information($event_id);\n\t\t\n\t\t$data = array(\n\t\t\t\t'event_id' => $result[0]->event_id,\n\t\t\t\t'employee_id' => $result[0]->employee_id,\n\t\t\t\t'company_id' => $result[0]->company_id,\n\t\t\t\t'event_title' => $result[0]->event_title,\n\t\t\t\t'event_date' => $result[0]->event_date,\n\t\t\t\t'event_time' => $result[0]->event_time,\n\t\t\t\t'event_note' => $result[0]->event_note,\n\t\t\t\t'event_color' => $result[0]->event_color,\n\t\t\t\t'all_employees' => $this->Xin_model->all_employees(),\n\t\t\t\t'get_all_companies' => $this->Xin_model->get_companies()\n\t\t\t\t);\n\t\t$session = $this->session->userdata('username');\n\t\tif(!empty($session)){ \n\t\t\t$this->load->view('admin/events/dialog_events', $data);\n\t\t} else {\n\t\t\tredirect('admin/');\n\t\t}\n\t}", "public function read_single(){\n $query='SELECT * FROM '.$this->table.' WHERE id=?';\n\n $stmt = $this->conn->prepare($query);\n\n $stmt->bindparam(1,$this->id);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n \n }", "function readOne(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=? LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "public function read()\n {\n print_r($this->StudentsDetails->read());\n }", "function readOne() {\n\t\t\t$query = \"SELECT * FROM `\".$this->table_name.\"` WHERE id ='\".$this->id.\"'\";\n\t\t \n\t\t\t// prepare query statement\n\t\t\t$hasil = mysqli_query($this->conn, $query);\n\t\t\t \n\t\t\t$row = mysqli_fetch_array($hasil);\n\t\t\t\n\t\t\treturn $row;\n\t\t}", "function read()\n\t\t{\n\t\t\t$conn = getMainConnection();\n\t\t\t$query = \"SELECT * FROM student WHERE ID='\".$this->ID.\"'\";\n\t\t\t$result = mysql_query($query);\n\t\t\t\n\t\t\tif(!$result)return;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member = mysql_fetch_array($result);\n\n$this->setFirstName(trim($member['firstname']));\n$this->setLastName(trim($member['lastname']));\n$this->setPhoneStu(trim($member['phone_stu']));\n$this->setPhoneFather(trim($member['phone_father']));\n$this->setLoginFlag(trim($member['loginflag']));\n$this->setExamYear(trim($member['examyear']));\n$this->setActiveFlag(trim($member['activeflag']));\n$this->setActid(trim($member['actid']));\n$this->setDateOfBirth(trim($member['dateofbirth']));\n$this->setParentPass(trim($member['parentpass']));\n$this->setStudentPass(trim($member['studentpass']));\n$this->setLastLogin(trim($member['lastlogin']));\n$this->setInstituteIDs(trim($member['instituteIDs']));\n$this->setLoginIP(trim($member['loginip']));\n\t\t\t}\n\n\t\t}", "function readOne()\n {\n // query to read single record\n $query = \"SELECT\n s.id, s.email, s.name, s.state\n FROM\n \" . $this->table_name . \" s\n WHERE\n s.id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of subscriber to be updated\n $stmt->bindParam(1, $this->id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->email = $row['email'];\n $this->name = $row['name'];\n $this->state = $row['state'];\n }", "public function read(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function readDataField() {return $this->_datafield;}", "function _read($id) {\n $result = ee()->db->select('data')\n ->where('id', $id)\n ->get($this->table_name);\n\n if (!$result->num_rows()) {\n return '';\n }\n\n return $result->row()->data;\n }", "public function import_read_record()\n\t{\n // phpcs:enable\n\t\tglobal $conf;\n\n\t\t$arrayres=fgetcsv($this->handle, 100000, $this->separator, $this->enclosure, $this->escape);\n\n\t\t// End of file\n\t\tif ($arrayres === false) return false;\n\n\t\t//var_dump($this->handle);\n\t\t//var_dump($arrayres);exit;\n\t\t$newarrayres=array();\n\t\tif ($arrayres && is_array($arrayres))\n\t\t{\n\t\t\tforeach($arrayres as $key => $val)\n\t\t\t{\n\t\t\t\tif (! empty($conf->global->IMPORT_CSV_FORCE_CHARSET))\t// Forced charset\n\t\t\t\t{\n\t\t\t\t\tif (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8')\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t// Autodetect format (UTF8 or ISO)\n\t\t\t\t{\n\t\t\t\t\tif (utf8_check($val))\n\t\t\t\t\t{\n\t\t\t\t\t\t$newarrayres[$key]['val']=$val;\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\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$newarrayres[$key]['val']=utf8_encode($val);\n\t\t\t\t\t\t$newarrayres[$key]['type']=(dol_strlen($val)?1:-1);\t// If empty we considere it's null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->col=count($newarrayres);\n\t\t}\n\n\t\treturn $newarrayres;\n\t}", "public function getRecordInformation() {}", "function read($name);", "function read()\n\t{\n\t\tglobal $ilDB;\n\n\t\tif(!isset($this->data_record))\n\t\t{\n\t\t\t$query = \"SELECT * FROM tax_node WHERE obj_id = \".\n\t\t\t\t$ilDB->quote($this->id, \"integer\");\n\t\t\t$obj_set = $ilDB->query($query);\n\t\t\t$this->data_record = $ilDB->fetchAssoc($obj_set);\n\t\t}\n\t\t$this->setType($this->data_record[\"type\"]);\n\t\t$this->setTitle($this->data_record[\"title\"]);\n\t\t$this->setOrderNr($this->data_record[\"order_nr\"]);\n\t\t$this->setTaxonomyId($this->data_record[\"tax_id\"]);\n\t}", "abstract protected function _read($id = NULL);", "public function getReader();", "public function getReader();", "function get_assesment(){\n \n $assesm_db=$this->assesm_db;\n // query to read single record\n //It loads the data file and converts it to an array\n $assesm_data = file_get_contents($assesm_db);\n $assesm_json = json_decode($assesm_data, true);\n if (count($assesm_json)>0){\n $assesm_found=$assesm_json[$this->session_id];\n }else{\n $assesm_found=null;\n }\n \n // set values to object properties\n $this->session_id = $assesm_found['session_id'];\n $this->test = $assesm_found['test'];\n $this->taker = $assesm_found['taker'];\n }", "protected function _getNextRecord() {\n if ($this->stream->eof()) return FALSE;\n\n $row= $this->stream->readLine();\n while (0 !== substr_count($row, $this->escape) % 2)\n $row.= \"\\n\".$this->stream->readLine();\n\n $this->buffer= $row;\n \n return $this->buffer;\n }", "public function read_single() {\n $query = 'SELECT id, author\n FROM ' . $this->table . ' WHERE id = :id';\n\n //prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(':id', $this->id);\n\n //excuted query\n $stmt->execute();\n //GET the array \n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //set properties\n $this->id = $row['id'];\n $this->author = $row['author'];\n }", "public function readOne ()\n {\n $query = \"SELECT\n book_id,type_id,name,isbn,publisher,author,price\n FROM\n \" . $this->table_name . \"\n WHERE\n book_id = $this->book_id\";\n\n $stmt = $this->conn->prepare( $query );\n\n $stmt->execute();\n\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n $this->book_id = $row['book_id'];\n $this->type_id = $row['type_id'];\n $this->name = $row['name'];\n $this->isbn = $row['isbn'];\n $this->publisher=$row['publisher'];\n $this->author=$row['author'];\n $this->price=$row['price'];\n\n\n }", "public function getExcavRecord()\n {\n return $this->get(self::_EXCAV_RECORD);\n }", "private function _readSubTableData() {}", "private function readArticle() {\n switch( $this->status->code ) {\n case 220:\n case 221:\n case 222:\n $this->readLines();\n break;\n case 223:\n default:\n }\n }", "public function readerGetContent();", "public function testReadSingleRecord() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $po = $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestPersistentObject', $uuid);\r\n // Compare properties\r\n $this->assertEquals($uuid, $po->uuid, 'Uuid value from persistent object differs from the UUID value of the database.');\r\n $this->assertEquals($bool, $po->booleanValue, 'Boolean value from persistent object differs from the boolean value of the database.');\r\n $this->assertEquals($int, $po->intValue, 'Integer value from persistent object differs from the int value of the database.');\r\n $this->assertEquals($string, $po->stringValue, 'String value from persistent object differs from the string value of the database.');\r\n }", "public function getRecord()\n {\n return $this->get(self::_RECORD);\n }", "public function onRead();", "function readOne() {\n $query = \"SELECT\n id, name, description, created \n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n $stmt = $this->conn->prepare($query);\n \n $stmt->bindParam(1, $this->id); //ambil id dr bukunya\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC); //mengembalikan barisnya\n\n //set values objek bukunya berdasarkan id tadi\n $this->name = $row['name'];\n $this->description = $row['description'];\n $this->created = $row['created'];\n }", "function read($id)\n {\n }", "public function read_single()\n {\n // Create query\n $query = \"\n SELECT\n id,\n name\n FROM\n $this->table\n WHERE \n id = ?\n LIMIT 1;\";\n\n //Prepare statement\n $stmt = $this->conn->prepare($query);\n \n // Bind ID\n $stmt->bindParam(1, $this->id);\n \n // Execute query\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set properties\n $this->id = $row['id'];\n $this->name = $row['name'];\n }", "public function read(): array;", "public abstract function readObjects();", "public function readWellKnownRecord()\n {\n //Set up the correct collection:\n $collection = $this->mongoDbClient->gs1resolver->wellknown;\n\n //Search and retrieve the document\n try\n {\n $result = $collection->findOne(['_id' => 'gs1resolver.json']);\n }\n catch (MongoDB\\Driver\\Exception\\ConnectionTimeoutException $cte)\n {\n file_put_contents('php://stderr', \"Error calling MongodDB: \" . print_r($cte, true). PHP_EOL);\n return json_decode('{\"Error\", \"MongoDB Database Connection Failed. Please contact the Resolver administrator - error log on server for details\"}');\n }\n\n //Return the complete document as a result\n file_put_contents('php://stderr', \"JSON version of Well-Known record: \" . json_encode($result). PHP_EOL);\n return $result;\n }", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function getReader() {}", "public function read(): IVoucher;", "public function read()\n {\n $this->seen();\n }", "public function read($name);", "function read()\n\t\t{\n\t\t\t$conn = getConnection();\n\t\t\t$query = \"SELECT * FROM student WHERE ID='\".$this->ID.\"'\";\n\t\t\t$result = mysql_query($query);\n\t\t\t\n\t\t\tif(!$result)return;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member = mysql_fetch_array($result);\n$this->setMainID(trim($member['mainID']));\t\t\n$this->setRollNo(trim($member['rollno']));\t\t\n$this->setGRno(trim($member['grno']));\n$this->setFirstName(trim($member['firstname']));\n$this->setLastName(trim($member['lastname']));\n$this->setMname(trim($member['Mname']));\n$this->setFname(trim($member['Fname']));\n$this->setPicUrl(trim($member['picurl']));\n$this->setAddress(trim($member['address']));\n$this->setPhoneStu(trim($member['phone_stu']));\n$this->setPhoneFather(trim($member['phone_father']));\n$this->setPhoneMother(trim($member['phone_mother']));\n$this->setPhoneOther(trim($member['phone_other']));\n$this->setBatchObj(getBatch($member['batchID']));\n$this->setExamYear(trim($member['examyear']));\n\n$this->setActiveFlag(trim($member['activeflag']));\n$this->setLastEditedBy(trim($member['lasteditedby']));\n$this->setDateUpdated(trim($member['dateupdated']));\n$this->setComments(trim($member['comments']));\n$this->setActid(trim($member['actid']));\n$this->setClassObj(new BatchClass($member['classID']));\n$this->setLoginFlag(trim($member['loginflag']));\n$this->setGender(trim($member['gender']));\n$this->setDateOfBirth(trim($member['dateofbirth']));\n$this->setHscNo(trim($member['hscno']));\n$this->setCetNo(trim($member['cetno']));\n$this->setCollege(trim($member['college']));\n$this->setStudentPass(trim($member['studentpass']));\n$this->setEmail(trim($member['email']));\n$this->BranchObj=(getBranch($this->getBatchObj()->getID()));\n$this->setParentPass(trim($member['parentpass']));\n$this->setLastLogin(trim($member['lastlogin']));\n$this->setDateOfAdmission(trim($member['dateofadmission']));\n$this->setBoard10(trim($member['board10']));\n$this->setAggregate10(trim($member['agg10']));\n$this->setMathsScience10(trim($member['ms10']));\n//$this->marksObj=new Marks($this->ID);\n\t\t\t}\n\n\t\t}", "public function read() \n {\n\n if ($this->is_csv) \n {\n return $this->read_csv();\n }\n else\n {\n return $this->read_lines();\n }\n \n }", "public function getStorageRecord() {}", "public function readObject($_UUID) {\n $sql = \"SELECT * FROM spartandata WHERE UUID = '$_UUID'\";\n $dataEntry = self::$conn->query($sql);\n\n if ($dataEntry->num_rows > 0) {\n while ($row = $dataEntry->fetch_assoc()) {\n echo \" ID: \" . $row[\"ID\"] . \" UUID: \" . $row[\"UUID\"] . \" Color: \" . $row[\"Color\"] . \"<br>\";\n }\n } else {\n echo \"Element Not Found\";\n }\n }", "public function read_single() {\n // Create query\n $query = \"SELECT * FROM \" . $this->table . \n \" WHERE MID = :mid AND Spot = :spot \";\n\n // Prepare the statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the query\n $this->attr[\"mid\"] = htmlspecialchars(strip_tags($this->attr[\"mid\"]));\n $this->attr[\"spot\"] = htmlspecialchars(strip_tags($this->attr[\"spot\"]));\n\n // Bind the data\n $stmt->bindValue(\":mid\", $this->attr[\"mid\"]);\n $stmt->bindValue(\":spot\", $this->attr[\"spot\"]);\n \n // Execute the prepared statement and check for errors in running it\n if ($this->runPrepStmtChkErr($stmt) === false) {\n return false;\n }\n\n // Get the result of reading one of the rows of the relation\n return $row_res = $stmt->fetch(PDO::FETCH_ASSOC);\n }", "public function read ()\n {\n\n $query = \"SELECT type_id, type FROM \" . $this->table_namee .\" \". \"ORDER BY type_id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n\n }", "public function modelGetRecord(){\n $id = isset($_GET[\"id\"])&&$_GET[\"id\"] > 0 ? $_GET[\"id\"] : 0;\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select * from inventory where id=$id\");\n // tra ve mot ban ghi\n return $query->fetch();\n }", "public function readStream();", "private function readCurrentRecord()\n {\n if (!$this->valid()) {\n return false;\n }\n \n // === SHX ===\n if (!$this->getOption(Shapefile::OPTION_IGNORE_FILE_SHX)) {\n $this->setFilePointer(Shapefile::FILE_SHX, Shapefile::SHX_HEADER_SIZE + (($this->current_record - 1) * Shapefile::SHX_RECORD_SIZE));\n // Offset (stored as 16-bit words)\n $shp_offset = $this->readInt32B(Shapefile::FILE_SHX) * 2;\n } else {\n $shp_offset = $this->getFilePointer(Shapefile::FILE_SHP);\n }\n \n // === SHP ===\n $this->setFilePointer(Shapefile::FILE_SHP, $shp_offset);\n // Skip Record Number\n $this->setFileOffset(Shapefile::FILE_SHP, 4);\n // Content length (stored as 16-bit words and missing the record header size)\n $content_length = ($this->readInt32B(Shapefile::FILE_SHP) * 2) + Shapefile::SHP_REC_HEADER_SIZE;\n // Shape type\n $shape_type = $this->readInt32L(Shapefile::FILE_SHP);\n if ($shape_type != Shapefile::SHAPE_TYPE_NULL && $shape_type != $this->getShapeType()) {\n throw new ShapefileException(Shapefile::ERR_SHP_WRONG_RECORD_TYPE, $shape_type);\n }\n // Read Geometry\n $Geometry = $this->{self::$shp_read_methods[$shape_type]}();\n // Set SHP file pointer position to next record if there is no SHX file available\n if ($this->getOption(Shapefile::OPTION_IGNORE_FILE_SHX)) {\n $this->setFilePointer(Shapefile::FILE_SHP, $shp_offset + $content_length);\n }\n \n // === DBF ===\n if (!$this->getOption(Shapefile::OPTION_IGNORE_FILE_DBF)) {\n $dbf_file_position = $this->dbf_header_size + (($this->current_record - 1) * $this->dbf_record_size);\n // Check if DBF is not corrupted (some \"naive\" users try to edit the DBF separately...)\n // Some GIS do not include the last Shapefile::DBF_EOF_MARKER (0x1a) byte in the DBF file, hence the \"- 1\" in the following line\n if ($dbf_file_position - 1 >= $this->dbf_file_size - $this->dbf_record_size) {\n throw new ShapefileException(Shapefile::ERR_DBF_EOF_REACHED);\n }\n $this->setFilePointer(Shapefile::FILE_DBF, $dbf_file_position);\n $Geometry->setFlagDeleted($this->readChar(Shapefile::FILE_DBF) === Shapefile::DBF_DELETED_MARKER);\n foreach ($this->dbf_fields as $i => $f) {\n if ($f['ignored']) {\n $this->setFileOffset(Shapefile::FILE_DBF, $f['size']);\n } else {\n $type = $this->getField($f['name'])['type'];\n $value = $this->decodeFieldValue($f['name'], $type, $this->readString(Shapefile::FILE_DBF, $f['size'], true));\n // Memo (DBT)\n if ($type === Shapefile::DBF_TYPE_MEMO && $value) {\n $this->setFilePointer(Shapefile::FILE_DBT, intval($value) * Shapefile::DBT_BLOCK_SIZE);\n $value = '';\n do {\n if ($this->getFilePointer(Shapefile::FILE_DBT) >= $this->dbt_file_size) {\n throw new ShapefileException(Shapefile::ERR_DBT_EOF_REACHED);\n }\n $value .= $this->readString(Shapefile::FILE_DBT, Shapefile::DBT_BLOCK_SIZE, true);\n // Some software only sets ONE field terminator instead of TWO, hence the weird loop condition check:\n } while (ord(substr($value, -1)) != Shapefile::DBT_FIELD_TERMINATOR && ord(substr($value, -2, 1)) != Shapefile::DBT_FIELD_TERMINATOR);\n $value = substr($value, 0, -2);\n }\n $Geometry->setData($f['name'], $value);\n }\n }\n }\n \n // Pair Geometry with Shapefile and return it\n $this->pairGeometry($Geometry);\n return $Geometry;\n }", "public function _read($sesID) {\n\n\t\t echo \"_read\";\n\n\t\t$sessionStatement = \"SELECT * FROM sessions\".\" WHERE id = '$sesID'\";\n\t\t$result = $this->DB->query($sessionStatement);\n\t\tif ($result === false) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (count($result) > 0) {\n\n\t\t\treturn $result[0][\"value\"];\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function readOne(){\n\n\t\t// query to read single record\n\t\t$query = \"SELECT\n\t\t\t\t\ttype, color, price\n\t\t\t\tFROM\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tWHERE\n\t\t\t\t\tclothe_id = ?\n\t\t\t\tLIMIT\n\t\t\t\t\t0,1\";\n\n\t\t// prepare query statement\n\t\t$stmt = $this->conn->prepare( $query );\n\n\t\t// bind id of product to be updated\n\t\t$stmt->bindParam(1, $this->clothe_id);\n\n\t\t// execute query\n\t\t$stmt->execute();\n\n\t\t// get retrieved row\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t// set values to object properties\n\t\t$this->type = $row['type'];\n\t\t$this->color = $row['color'];\n\t\t$this->price = $row['price'];\n\t}", "function readOne(){\n\t $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ? LIMIT 0,1\";\n\t // prepare query statement\n\t $stmt = $this->conn->prepare( $query );\n\t // sanitize\n\t $this->id=htmlspecialchars(strip_tags($this->id));\n\t // bind product id value\n\t $stmt->bindParam(1, $this->id);\n\t // execute query\n\t $stmt->execute();\n\t // get row values\n\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t // assign retrieved row value to object properties\n\t $this->id = $row['id'];\n\t $this->created = $row['created'];\n\t $this->modified = $row['modified'];\n\t}", "public function readAction()\n {\n }", "public function getRecord()\n\t{\t\t\t\t\n\t\tif(isset($this->_handle))\n\t\t\treturn fgetcsv($this->_handle,null,$this->_columnDelimiter);\n\t\telse \n\t\t\treturn false;\n\t}", "public function modelReadSell($recordPerPage){\n\t\t\t//lay so trang hien tai truyen tu url\n\t\t\t$page = isset($_GET[\"p\"]) && $_GET[\"p\"] > 0 ? $_GET[\"p\"]-1 : 0;\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $page * $recordPerPage;\n\t\t\t//thuc hien truy van\n\t\t\t$conn = Connection::getInstance();\n\t\t\t$query = $conn->query(\"select * from order_detail order by id desc limit $from, $recordPerPage\");\n\t\t\t//tra ve tat ca cac ban truy van duoc\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function readMedicoEspecial(){\n $objM=new medicoDAO();\n $resul=$objM->readMedicoEspecialidad();\n return $resul;\n }", "public function read(){\n \n //select all data\n $query = \"SELECT\n id, id, num_compte, cle_rib, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n created\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "protected function readDevice()\n {\n $trame = '';\n $i=0;\n while (strlen($trame)==0 && $i < 3) {\n $trame = $this->readTrame();\n $i++;\n }\n\n echo date('Y-m-d H:i:s T').\" Read attempt : \".$i.\" for \".strlen($trame).\" octet(s)\\n\";\n\n $trame = chop(substr($trame, 1, -1)); // on supprime les caracteres de debut et fin de trame\n\n $messages = explode(chr(10), $trame); // on separe les messages de la trame\n $new = [];\n foreach ($messages as $msg) {\n $ligne = explode(' ', $msg, 3);\n if (count($ligne)<2) {\n continue;\n }\n $new[$ligne[0]] = $ligne[1];\n }\n return $new;\n }" ]
[ "0.68565536", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.683352", "0.67325187", "0.6684268", "0.6554877", "0.650271", "0.63477296", "0.63031524", "0.6286085", "0.6273067", "0.6273067", "0.62721264", "0.6256169", "0.62554437", "0.62373674", "0.62369305", "0.62162054", "0.6201236", "0.6074358", "0.6037398", "0.59362084", "0.592707", "0.5923977", "0.5902103", "0.5862763", "0.5859119", "0.583426", "0.5822087", "0.5821784", "0.5758528", "0.5727138", "0.5694166", "0.5677631", "0.56518286", "0.5645961", "0.5642292", "0.5642174", "0.56412643", "0.5630479", "0.5620944", "0.5605245", "0.5584228", "0.5577549", "0.55731845", "0.55731845", "0.5545632", "0.5535745", "0.5533468", "0.5530005", "0.552787", "0.55226314", "0.5521952", "0.5520097", "0.5517913", "0.5512288", "0.550909", "0.54914194", "0.54900926", "0.54624504", "0.5462231", "0.5439072", "0.543777", "0.54335934", "0.54335934", "0.54335934", "0.54335934", "0.54335934", "0.54335934", "0.54335934", "0.5424052", "0.54230076", "0.5414279", "0.5412667", "0.54109234", "0.5408921", "0.540456", "0.5390934", "0.5386516", "0.5371977", "0.5363865", "0.536326", "0.5354918", "0.53424686", "0.53274626", "0.5324634", "0.532073", "0.5314712", "0.5314019", "0.5293922", "0.5288489" ]
0.0
-1
Estrae un insieme di record
function records( $table_name, $where, $order_by = '', $output = OBJECT ) { global $wpdb; $where = self::where( $where ); $sql = <<< SQL SELECT * FROM `{$table_name}` {$where} ORDER BY {$order_by} SQL; $result = $wpdb->get_results( $sql, $output ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRecord() {}", "public function getRecord() {}", "public function getRecord() {}", "public function testRecord() {\n $this->markTestIncomplete('This test has not been implemented yet.');\n }", "public function getRecord();", "function importdata($id, $record) {\n // kalau blm ada, insert\n $this->_db->where('ID', $id);\n if ($this->_db->count_all_results($this->_table) > 0) {\n $this->update($id, $record);\n } else {\n $this->insert($record);\n }\n }", "public function getRecordInformation() {}", "public function getRecord(){\n return $this->record;\n }", "public function prepareRecord()\n {\n // Get specific record\n $requestParameters = $this->Request->all();\n $Model = clone $this->Model;\n if (request('action') == \"view\") {\n // Hook Filter viewModifyRecord\n $Model = $this->doFilter(\"viewPrepareRecord\", $Model);\n } else {\n $Model = $this->doFilter(\"prepareRecord\", $Model);\n }\n foreach ($requestParameters['indexes'] as $column => $value) {\n $Model = $Model->where($column, '=', $value);\n }\n $record = $Model->first();\n // Is valid record\n if (!$record) {\n // Redirect to List Page\n // Set session flash for notify Entry is not exist\n return redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_error', trans('dkscaffolding.no.entry'));\n }\n $this->Model->setRawAttributes($record->getAttributes(), true);\n }", "public function hydrate($row){\n $this->INE=$row['INE']; \n $this->name=$row['name']; \n $this->firstname=$row['firstname']; \n $this->mail=$row['mail'];\n $this->tel=$row['tel']; \n $this->adresse=$row['adresse']; \n }", "public function get_record($row) {\n return null;\n }", "function cc_insert_record($offerta){\n\t\t\n\t// recupero post_id dell'agenzia, agente e autore da rif (prime due cifre)\n\t$aau = cc_get_agency($offerta->Riferimento); \n\t$agenzia = $aau['fave_property_agency']; \n\t$agente = $aau['fave_agents']; \n\t$user_id = $aau['post_author'];\n\n\t\n\t// POSTMETA - INDIRIZZO\n\t$map_address = $indirizzo = \"\";\n\t\n\t//$indirizzo = solo indirizzo (via e civico), map_adress = indirizzo completo con cap località e provincia per mappa\n\tif(!empty($offerta->Indirizzo)){\n\t\t$map_address .= (string) $offerta->Indirizzo;\n\t\t$indirizzo .= (string) $offerta->Indirizzo;\n\t}\n\tif(!empty($offerta->NrCivico)){\n\t\t$map_address .= (string) \" \".$offerta->NrCivico;\n\t\t$indirizzo .= (string) \" \".$offerta->NrCivico;\n\t}\n\t\n\t// compilo map_address con cap, località e provincia solo se l'indirizzo (via + civico) è compilato\n\t// se non lo è vuol dire che non deve essere resa noto l'indirizzo esatto dell'immobile\n\tif(!empty($offerta->Comune) and !empty($map_address)){\n\t\t\n\t\t$comune = (string) $offerta->Comune;\n\t\t$comune = trim($comune);\n\t\t$map_address .= \", \";\n\t\t\n\t\t$cp = cc_get_cap_prov($comune);\n\t\tif(!empty($cp)) $map_address .= $cp['cap'].\" \"; \t\t\n\t\t\n\t\t$map_address .= $comune;\n\t\tif(!empty($cp)) $map_address .= \" (\".$cp['prov'].\")\"; \n\t\t\n\t}else{\n\t\t\n\t\t$cp = array();\n\t\t\n\t}\n\t\n\t$map_address = trim($map_address);\n\tif($map_address[0] == ',') $map_address = substr($map_address, 2);\t\n\t\n\t$latitudine = (string) $offerta->Latitudine;\n\t$longitudine = (string) $offerta->Longitudine;\n\t\n\t// da cometa arriva con virgola decimale\n\tif(!empty($latitudine)) $latitudine = str_replace(\",\", \".\", $latitudine);;\n\tif(!empty($longitudine)) $longitudine = str_replace(\",\", \".\", $longitudine);;\n\n\tif(!empty($latitudine) and !empty($longitudine)){\n\t\t$map_coords = $latitudine .\", \". $longitudine;\t\t\n\t}else{\n\t\t$map_coords = \"\";\n\t}\n\t\n\t// Caratteristiche aggiuntive\n\t$af = array();\n\tif(!empty($offerta->Locali)){\n\t\t$af[] = array( \"fave_additional_feature_title\" => \"Locali\", \"fave_additional_feature_value\" => (string) $offerta->Locali);\n\t}\n\tif(!empty($offerta->Cucina)){\n\t\t$af[] = array( \"fave_additional_feature_title\" => \"Cucina\", \"fave_additional_feature_value\" => (string) $offerta->Cucina);\n\t}\n\tif(!empty($offerta->Box)){\n\t\t$af[] = array( \"fave_additional_feature_title\" => \"Box\", \"fave_additional_feature_value\" => (string) $offerta->Box);\n\t}\n\t$fave_additional_features_enable = (empty($af)) ? \"disable\" : \"enable\";\n\t\n\t// controllo se questo nuovo immobile deve essere messo in vetrina o meno e se sì tolgo vetrina a quello precedente\n\t//$vetrina = cc_ho_vetrina( (string) $offerta->IdAgenzia, (string) $offerta->Riferimento);\n\t\n\t// GESTIONE PREZZO / TRATTATIVA RISERVATA\n\t$prezzo = (string) $offerta->Prezzo;\n\t$flag_trattativa_riservata = (string) $offerta->TrattativaRiservata;\n\t\n\tif($flag_trattativa_riservata == '1'){\n\t\t$prezzo = \"Trattativa Riservata\";\n\t\t$fave_private_note = \"Prezzo richiesto €\".$prezzo;\t\t\n\t}else{\n\t\t$fave_private_note = \"\";\n\t}\n\t\n\t\t\n\t// META INPUT VARIABILI\n\t$meta_input = array(\n\t\t//\"fave_featured\" => $vetrina,\n\t\t\"fave_property_size\" => (int) $offerta->Mq, \n\t\t\"fave_property_bedrooms\" => (int) $offerta->Camere, \n\t\t\"fave_property_bathrooms\" => (int) $offerta->Bagni, \n\t\t\"fave_property_id\" => (string) $offerta->Riferimento, \n\t\t\"fave_property_price\" => $prezzo, \n\t\t\"fave_property_map_address\" => (string) $map_address, \n\t\t\"fave_property_location\" => $map_coords, \n\t\t\"fave_additional_features_enable\" => $fave_additional_features_enable,\n\t\t\"additional_features\" => $af,\n\t\t\"fave_property_address\" => $indirizzo,\n\t\t\"houzez_geolocation_lat\" => $latitudine,\n\t\t\"houzez_geolocation_long\" => $longitudine,\n\t\t\"fave_energy_class\" => (string) $offerta->Classe,\n\t\t\"fave_energy_global_index\" => (string) $offerta->IPE.\" \".$offerta->IPEUm, \n\t\t\"fave_private_note\" => $fave_private_note, \n\t\t\"_id_cometa\" => (string) $offerta->Idimmobile\n\t\t\n\t);\t\n\n\tif(!empty($cp)) $meta_input['fave_property_zip'] = $cp['cap'];\n\t\n\t// META INPUT VALORI FISSI\n\t$meta_input['slide_template'] = \"default\";\n\t$meta_input['fave_property_size_prefix'] = \"M²\";\n\t$meta_input['fave_property_country'] = \"IT\";\n\t$meta_input['fave_agents'] = $agente;\n\t$meta_input['fave_property_agency'] = $agenzia;\n\t$meta_input['fave_floor_plans_enable'] = \"disabled\";\n\t$meta_input['fave_agent_display_option'] = \"agent_info\";\n\t$meta_input['fave_payment_status'] = \"not_paid\";\n\t$meta_input['fave_property_map_street_view'] = \"hide\";\n\t$meta_input['houzez_total_property_views'] = \"0\";\n\t$meta_input['houzez_views_by_date'] = \"\";\n\t$meta_input['houzez_recently_viewed'] = \"\";\n\t$meta_input['fave_multiunit_plans_enable'] = \"disable\";\n\t$meta_input['fave_multi_units'] = \"\";\n\t$meta_input['fave_single_top_area'] = \"v2\";\n\t$meta_input['fave_single_content_area'] = \"global\";\n\t$meta_input['fave_property_land_postfix'] = \"M²\";\n\t$meta_input['fave_property_map'] = \"1\";\n\t\n\t// MANCANO FOTO, LE METTO DOPO\n\t\n\t$DataAggiornamento = new DateTime( (string) $offerta->DataAggiornamento ); // $offerta->DataAggiornamento formato 2018-07-25T00:00:00+01:00\n\t$post_modified = $DataAggiornamento->format(\"Y-m-d H:i:s\"); \t\n\t\n\t\n\t$posts_arg = array(\n\t\t\"post_author\" \t=> $user_id, \n\t\t\"post_content\" \t=> (string) $offerta->Descrizione,\n\t\t\"post_title\" \t=> (string) $offerta->Titolo,\n\t\t\"post_excerpt\" \t=> (string) $offerta->Descrizione,\n\t\t\"post_status\" \t=> \"publish\", \n\t\t\"post_type\" \t=> \"property\",\n\t\t\"post_modified\" => (string) $post_modified,\n\t\t\"post_modified_gmt\" => (string) $post_modified,\n\t\t\"comment_status\" \t=> \"closed\",\n\t\t\"ping_status\" \t=> \"closed\",\n\t\t\"guid\" \t\t \t=> wp_generate_uuid4(),\n\t\t\"meta_input\" \t=> $meta_input\n\t);\n\t\n\t// Restituisce l'ID del post se il post è stato aggiornato con success nel DB. Se no restituisce 0.\n\t$post_id = wp_insert_post( $posts_arg, true ); \n\t\n\tif (is_wp_error($post_id)) {\n\t\t$errors = $post_id->get_error_messages();\n\t\t$dbg = \"Errore durante insert record\\n\";\n\t\tforeach ($errors as $error) {\n\t\t\t$dbg .= $error.\"\\n\";\n\t\t}\n\t\treturn $dbg;\t\t\n\t}\n\t\n\t// continuo con inseriemnto foto e categorie\n\t\n\t$foto = array();\n\tfor($nf = 1; $nf < 16; $nf++){\n\t\t\n\t\t$foto_field = \"FOTO\".$nf;\n\t\t$foto_url = (string) $offerta->$foto_field;\n\t\tif(!empty($foto_url)) $foto[] = $foto_url;\n\t\t\n\t}\n\t\n\t// inserisce solo se le foto non sono ancora presenti, restituisce array con id posts delle foto nuove\n\t$foto_nuove = cc_import_images($foto, $post_id, true);\n\t\n\t// Se vi sono nuove foto le aggiungo alla tabella postmeta \n\tif(!empty($foto_nuove)){\n\t\tcc_insert_images_meta($foto_nuove, $post_id); // Non restituisce feedback\n\t}\n\t\n\t\t\n\t// GESTIONE CATEGORIE - SE IL VALORE CATEGORIE (TERM) NON ESISTE ANCORA VIENE AGGIUNTO \n\t\n\t// Categoria \"property_type\" (Appartamento, villa, box etc) - SINGOLO\n\t$property_type = (string) $offerta->Tipologia;\n\tif(!empty($property_type)) $property_type_results = cc_add_term_taxonomy($post_id, \"property_type\", array( $property_type ));\n\t\n\t// Categoria \"property_city\" (Città) - SINGOLO\n\t$property_city = (string) $offerta->Comune;\n\tif(!empty($property_city)) $property_city_results = cc_add_term_taxonomy($post_id, \"property_city\", array( $property_city ));\n\t\n\t\n\t// Categoria \"property_area\" (Zona / Quartiere) - SINGOLO\n\t$property_area = (string) $offerta->Quartiere;\n\t$property_area = trim($property_area);\n\tif(!empty($property_area)) $property_area_results = cc_add_term_taxonomy($post_id, \"property_area\", array( $property_area ));\t\n\t\n\t// Categoria \"property_feature\" (caratteristiche) - MULTI\n\t$property_feature = array();\n\tif(!empty($offerta->Box)) $property_feature[] = \"Box Auto\";\n\tif(!empty($offerta->Box)) $property_feature[] = \"Posto Auto\";\n\tif((string) $offerta->Terrazzo == '-1') $property_feature[] = \"Terrazzo\";\n\tif((string) $offerta->Balcone == '-1') $property_feature[] = \"Balcone\";\n\tif((string) $offerta->GiardinoCondominiale == '-1' or (string) $offerta->GiardinoPrivato == '-1' ) $property_feature[] = \"Giardino\";\n\t//if((string) $offerta->GiardinoPrivato == '-1') $property_feature[] = \"Giardino Privato\";\n\t\n\tif(!empty($property_feature)) $property_feature_results = cc_add_term_taxonomy($post_id, \"property_feature\", $property_feature );\n\t\n\t// FINITO INSERT RECORD\n\t\n\t// update configs xml\n\tcc_update_configs(\"inserted\", 1, true);\t\n\tcc_import_immobili_error_log(\"Inserted: \".$post_id);\n\t\n\treturn \"inserted\";\n\t\n}", "public function iSaveRecordDetails()\n {\n preg_match('/UQ:(\\d+)/', $this->getSession()->getCurrentUrl(), $pid);\n $data = new Fez_Record_Searchkey($pid[0]);\n $this->_tempRecordStore = $data->getSekData();\n return;\n }", "function editRecord($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new updated values to table in database to location of given Primary key\r\n\t\t\t$this->update($rec[0]);\r\n\t\t}", "function inserisci_record(Spesa $spesa){\n //variaibili che arrivano dall'oggetto creato\n $titolo = $spesa->getTitoloSpesa();\n $tipologia = $spesa->getTipologiaSpesa();\n $data_p = converti_data_pagamento_spesa($spesa->getDataPagamentoSpesa());\n $data_s = converti_data_scadenza_spesa($spesa->getDataScadenzaSpesa());\n $autore = $spesa->getAutoreSpesa();\n $importo = verifica_importo_spesa($spesa->getImportoSpesa());\n\n $mysqli = connetti();\n\n $sql = \"INSERT INTO `spesa` (`titolo_spesa`, `tipologia_spesa`, `data_pagamento_spesa`, `data_scadenza_spesa`, `autore_spesa`, `importo_spesa`) \n VALUES('$titolo','$tipologia','$data_p','$data_s','$autore',$importo)\";\n\n if($mysqli->query($sql)){\n header(\"Location:index.php\");\n }else{\n header(\"Location:inserisci_spesa.php\");\n }\n chiudi_connessione($mysqli);\n}", "protected function _readRecords() {}", "private function analyzeRecord($record) {\n\t\tif (! isset ( $this->recordNum )) {\n\t\t\t$this->recordNum = 0;\n\t\t\t$this->_phaseImport = new PhaseImport ();\n\t\t}\n\t\t\n\t\t// count records\n\t\t++ $this->recordNum;\n\t\t\n\t\t// echo \" recordNum = $this->recordNum <br/>\"; //debug\n\t\t\n\t\tif (! isset ( $this->_mission )) {\n\t\t\t// start a new mission\n\t\t\t$this->_mission = new TaxibotMission ();\n\t\t\t$startDateTime = $this->GetDateTimeFromCsvFormat ( $this->_currentRowDateTime );\n\t\t\t$this->_mission->setStartTime ( $startDateTime );\n\t\t\t$this->_mission->setBlfName($this->_blfName);\n\t\t\t$this->missionStarted ();\n\t\t}\n\t\t\n\t\t// mission non changing data : flight number, tail number, AC weight etc.\n\t\t$this->examineMissionData ( $record );\n\t\t\n\t\t// phase\n\t\t$this->_phaseImport->readRow ( $record, $this->_currentRowDateTime );\n\t\t\n\t\t// position\n\t\t$this->saveTrailPosition ( $record );\n\t\t\n\t\t// forces on Landing Gear\n\t\tif (isset ( $this->limitExceedImport )) {\n\t\t\t$this->limitExceedImport->readRowData ( $record, $this->_currentRowDateTime, $this->_lastLatitude, $this->_lastLongitude );\n\t\t}\n\t\t\n\t\t/* if($this->_phaseImport->veolcity != null){\n\t\t\tdd($this->_currentRowDateTime);\n\t\t} */\n\t\t\n\t\tif (isset ( $this->fatigueHistoryImport )) {\n\t\t\t$this->fatigueHistoryImport->readRowData ( $record, $this->_phaseImport->veolcity );\n\t\t}\n\t}", "public function modelGetRecord(){\n $id = isset($_GET[\"id\"])&&$_GET[\"id\"] > 0 ? $_GET[\"id\"] : 0;\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select * from inventory where id=$id\");\n // tra ve mot ban ghi\n return $query->fetch();\n }", "private function __construct($record) {\n $this->record = $record;\n }", "function singleRecord() {\n $this->Record = mysqli_fetch_array($this->result, MYSQLI_ASSOC);\n $this->rs = $this->Record;\n $stat = is_array($this->Record);\n return $stat;\n }", "public function incluir(){\n header(\"Content-type: text/html;charset=utf-8\");\n $sql = \"SHOW FULL FIELDS FROM \" . $this->table;\n $execute = conexao::toConnect()->executeS($sql);\n $atributos = \"\";\n $values = \"\";\n $id_registro = \"\";\n $contador = count($execute) - 1;\n foreach ($execute as $key => $attr){\n if ($attr->Key != 'PRI') {\n $atributos_field = $attr->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($contador != $key) {\n $atributos .= $attr->Field . ',';\n $values .= \"'\".$this->$get() .\"',\";\n } else {\n $atributos .= $attr->Field;\n $values .= \"'\".$this->$get() .\"'\";\n }\n }else{\n $id_registro = $attr->Field;\n }\n }\n $insert = \"INSERT INTO \".$this->table.\" (\".$atributos.\") VALUES($values)\";\n $execute_into = conexao::toConnect()->executeQuery($insert);\n if (count($execute_into) > 0) {\n $sql = \"SELECT \".$id_registro.\" FROM \".$this->table.\" ORDER BY \".$id_registro.\" DESC LIMIT 1\";\n $id_r = conexao::toConnect()->executeS($sql);\n return $id_r[0]->$id_registro;\n }else{\n return false;\n }\n\n }", "public function getRecord(){\n \n return $this->record;\n }", "public function CopyRecord()\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n foreach ($rec as $k=>$v)\n $rec[$k] = addslashes($v);\n global $g_BizSystem;\n // get new record array\n $recArr = $this->GetDataObj()->NewRecord();\n\n $rec[\"Id\"] = $recArr[\"Id\"]; // replace with new Id field. TODO: consider different ID generation type\n $this->m_RecordRow->SetRecordArr($rec);\n $ok = $this->GetDataObj()->InsertRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n return $this->ReRender();\n }", "public function recInsert($record) {\n $conn = Query::connect();\n $col = $conn->SelectLimit(\"select*from \".static::getTable(),1);\n $sql = $conn->GetInsertSQL($col,$record);\n $rs = $conn->Execute($sql);\n return $conn->ErrorNo();\n }", "public function pushRecord()\r\n {\r\n\r\n }", "public function setRecordLog() {\n \t$msg = '';\n \t$defaultFilterFields = array( 'id', 'modify_user_id' ,'modify_time', 'create_user_id', 'create_time','check_user_id','check_time');\n \t$addFilterFields = !empty($this->filterFields) ? $this->filterFields : array();\n \t$filterFields = array_merge($defaultFilterFields,$addFilterFields);\n \tforeach ( $this->getAttributes() as $key => $val ) {\n \t\tif ( ! $this->getIsNewRecord() && $val == $this->beforeSaveInfo[$key] ) {\n \t\t\tcontinue;\n \t\t}\n// \t\t$label = $this->getAttributeLabel($key);\n $label = get_class($this) . ':'.$key; //by shenll\n \t\tif (in_array($key, $filterFields)) {\n \t\t\tcontinue;\n \t\t}else {\n \t\t\tif ( $this->getIsNewRecord() ) {\n \t\t\t\t$msg .= MHelper::formatInsertFieldLog($label, $val);\n \t\t\t} else {\n \t\t\t\t$msg .= MHelper::formatUpdateFieldLog($label, $this->beforeSaveInfo[$key], $val);\n \t\t\t}\n \t\t}\n \t}\n //\treturn $msg;\n \t$this->addLogMsg($msg);\n }", "public function record() {\n $data = array(\n \"name\" => $this->name,\n \"description\" => $this->description,\n \"image\" => $this->image,\n \"type\" => $this->type,\n \"discount\" => $this->discount_offer,\n \"code\" => $this->coupon_code,\n \"expiration\" => $this->expiration\n );\n return $this->db->insert(\"trade\", $data);\n }", "public function getRecord()\r\n\t{\r\n\t\treturn $this->record;\r\n\t}", "public function __construct($record)\n {\n $this->record = $record;\n }", "function insert_record()\n\t{\n\t $dbname=$this->dbname;\n\t $DB1=$this->__connect($dbname,$this->table_name);\n $fields_data=$this->__list_fields_data($dbname,$this->table_name);\n // echo_array($fields_data);\n $index=$this->_get_primary($fields_data);\n //echo $index;\n //echo_array($_POST);\n \n \n //since we are coming from a form there\n //are $_POST values\n foreach ($fields_data->name as $key=>$value)\n {\n $data[$value['name']]=$_POST[$value['name']];\n }\n\n //needs checking if a FOREIGN FIELD\n //insert into database \n $this->db->insert($this->table_name, $data);\n\n $keys=(array_keys($data));\n $values=(array_values($data));\n\n //prepare some data for the form controls\n //in this case the Tdataset control\n \n $i=0;\n $num_fields=count($keys);\n for ($i=0;$i<$num_fields;$i++){\n $this->table->add_row($keys[$i],$values[$i]);\n }\n $this->table->set_heading('field','Value');\n $this->table->set_caption('Insert');\n $this->table->set_template($this->tmpl);\n $s=$this->table->generate();\n $s.='<a href=\"http://localhost/CodeIgniter/admin/dbutil/browse/'.$dbname.'/'.$this->table_name.'\">Click to Edit More</a>';\n return $s;\n\t}", "public function addRecordInDB($data, $numero_posti, $id_sede, $id_tipologia_prenotazione, $id_utente_registrato){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $data = DB_Functions::esc($data);\r\n $numero_posti = DB_Functions::esc($numero_posti);\r\n $id_sede = DB_Functions::esc($id_sede);\r\n $id_tipologia_prenotazione = DB_Functions::esc($id_tipologia_prenotazione);\r\n $id_utente_registrato = DB_Functions::esc($id_utente_registrato);\r\n $query = \"INSERT INTO PRENOTAZIONE (DATA, NUMERO_POSTI, ID_SEDE, ID_TIPOLOGIA_PRENOTAZIONE, ID_UTENTE_REGISTRATO)\r\n\t VALUES ($data, $numero_posti, $id_sede, $id_tipologia_prenotazione, $id_utente_registrato)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_PRENOTAZIONE) FROM PRENOTAZIONE;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_prenotazione = $resQuery2[\"response\"][0][0];\r\n $this->data = $data;\r\n $this->numero_posti = $numero_posti;\r\n $this->id_sede = $id_sede;\r\n $this->id_tipologia_prenotazione = $id_tipologia_prenotazione;\r\n $this->id_utente_registrato = $id_utente_registrato;\r\n }\r\n return $resQuery1;\r\n }", "function writeRecord($record) { //{{{\n global $map;\n \n $arr = array();\n \n // loop over fields in record\n foreach (array_keys($map) as $tag) {\n $value = $record[$tag];\n \n // handle empty RIS values here\n if (2 == strlen($tag) && !$value) {\n $arr[$tag] = '';\n continue;\n }\n \n switch ($tag) {\n // semi colon delimit authors\n // and create primary author and presentation author fields\n case 'A1':\n $arr[$tag] = implode('; ', $value);\n $arr['primary_author'] = $value[0];\n $arr['presentation_authors'] = normaliseNames($value);\n $arr['author_count'] = count($value);\n break;\n \n // should only be 1 title/abstract\n case 'T1':\n case 'N2':\n case 'DO':\n $arr[$tag] = $value[0];\n break;\n \n // normalise capitalisation of journal names\n case 'JF':\n $arr[$tag] = normaliseJournal($value[0]);\n break;\n \n // year - want first 4 digits\n case 'Y1':\n $arr[$tag] = substr($value[0], 0, 4);\n break;\n \n // URL - leave as array\n case 'UR':\n foreach ($value as $i => $url) {\n $arr[sprintf('%s%d', $tag, $i)] = $url;\n }\n break;\n }\n }\n \n return $arr;\n}", "function readOne(){\n \n // query to read single record\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE ROId = ? LIMIT 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of roUnit to be updated\n $stmt->bindParam(1, $this->ROId);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->ROId = $row['ROId'];\n $this->unit = $row['unit'];\n $this->created_on = $row['created_on'];\n $this->modified_on = $row['modified_on'];\n }", "private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }", "public function addRecordInDB($nome, $nome_icona, $nome_immagine, $quantita, $id_sede){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $nome = DB_Functions::esc($nome);\r\n $nome_icona = DB_Functions::esc($nome_icona);\r\n $nome_immagine = DB_Functions::esc($nome_immagine);\r\n $quantita = DB_Functions::esc($quantita);\r\n $id_sede = DB_Functions::esc($id_sede);\r\n\r\n //inserimento nuova ENTITA\r\n $query = \"INSERT INTO ENTITA (NOME, NOME_ICONA, NOME_IMMAGINE, QUANTITA, ID_SEDE)\r\n\t VALUES ($nome, $nome_icona, $nome_immagine, $id_sede)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_ENTITA) FROM ENTITA;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_entita = $resQuery2[\"response\"][0][0];\r\n $this->nome = $nome;\r\n $this->nome_icona = $nome_icona;\r\n $this->nome_immagine = $nome_immagine;\r\n $this->quantita = $quantita;\r\n $this->id_sede = $id_sede;\r\n }\r\n return $resQuery1;\r\n }", "public final function onNextRecord()\n {\n $this->lots = false;\n $this->setRecord($this->getCurrentRecord(), true);\n if ($this->isLoaded()) {\n $this->transactionId = $this->getId() . date('YmdHis');\n $this->addresses = false;\n }\n }", "function wv_commission_table_record($oid) {\n global $wpdb;\n $orderid = $oid;\n $this->wv_commission_get_order_item_record($orderid);\n }", "public function dsp_single_record()\n {\n $v_record_id = get_post_var('hdn_item_id',0);\n $VIEW_DATA['arr_single_record'] = $this->model->qry_single_record($v_record_id);\n $this->view->render('dsp_single_record',$VIEW_DATA);\n }", "public function isValidRecord()\n {\n // Get specific record\n $Model = $this->setWhereIndexes(clone $this->Model);\n $record = $Model->first();\n // Is valid record\n if (!$record) {\n // Redirect to List Page\n // Set session flash for notify Entry is not exist\n return redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_error', trans('dkscaffolding.no.entry'));\n }\n return $record;\n }", "function stdRec_loadRow($row, $flags=0) {\n $this->rstKid_kidId = $row['rKd:KidId'];\n $this->rstParent_name[] = $row['rPU:FirstName'] . ' ' . $row['rPU:LastName'];\n $this->rstParent_home[] = $row['rPU:HomePhone'];\n $this->rstParent_cell[] = $row['rPU:CellPhone'];\n $this->rstParent_work[] = $row['rPU:WorkPhone'];\n $this->rstParent_emergency_name = $row['rFa:EmergencyPhone'];\n $this->rstParent_emergency_phone = $row['rFa:EmergencyName'];\n}", "function readOne() {\n $query = \"SELECT\n id, name, description, created \n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n $stmt = $this->conn->prepare($query);\n \n $stmt->bindParam(1, $this->id); //ambil id dr bukunya\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC); //mengembalikan barisnya\n\n //set values objek bukunya berdasarkan id tadi\n $this->name = $row['name'];\n $this->description = $row['description'];\n $this->created = $row['created'];\n }", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function getExcavRecord()\n {\n return $this->get(self::_EXCAV_RECORD);\n }", "public function setRecord($record){\n $this->record = $record;\n }", "function readOne(){\r\n // query to read single record\r\n $query = \"SELECT\r\n id_pelanggan, nama_pelanggan, alamat, telepon, email, tgl_lahir\r\n FROM\r\n \" . $this->table_name . \"\r\n WHERE\r\n id_pelanggan = ?\";\r\n\r\n // prepare query statement\r\n $stmt = $this->conn->prepare($query);\r\n \r\n // bind id of product to be updated\r\n $stmt->bindParam(1, $this->id);\r\n \r\n // execute query\r\n $stmt->execute();\r\n \r\n // get retrieved row\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n // set values to object properties\r\n $this->nama_pelanggan = $row['nama'];\r\n $this->alamat = $row['alamat'];\r\n $this->telepon = $row['telepon'];\r\n $this->email = $row['email'];\r\n $this->tgl_lahir = $row['tgl_lahir'];\r\n }", "public function hasRecord() {}", "function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "function readOne(){\n\n $query = \"SELECT ordine.id_ordine, ordine.articolo, fornitore.nome as 'fornitore', ordine.stato \n FROM \". $this->table_name . \" INNER JOIN fornitore \n ON ordine.id_fornitore = fornitore.id_fornitore\n WHERE ordine.id_ordine = ?\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->bindParam(1, $this->id_ordine);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n if($row){\n\n $this->id_ordine = $row['id_ordine'];\n $this->articolo = $row['articolo'];\n $this->fornitore = $row['fornitore'];\n $this->stato = $row['stato'];\n\n }\n else{\n\n $query = \"SELECT ordine.id_ordine, ordine.articolo, ordine.stato \n FROM \". $this->table_name . \" WHERE ordine.id_ordine = ?\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->id_ordine);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n if($row){\n $this->id_ordine = $row['id_ordine'];\n $this->articolo = $row['articolo'];\n $this->stato = $row['stato'];\n }\n }\n }", "protected function _getRecordByKey($key)\n {\n }", "protected function loadRow() {}", "public function createRecord();", "function readOne(){\n \n // query to read single record\n $query = \"SELECT * FROM trabajo where id_Trabajo = ? LIMIT 0,1;\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of product to be updated\n $stmt->bindParam(1, $this->id_Trabajo);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->Nombre = $row['Nombre'];\n $this->Requisitos = $row['Requisitos'];\n $this->Conocimientos = $row['Conocimientos'];\n $this->Beneficios = $row['Beneficios'];\n $this->Fecha_Publicacion = $row['Fecha_Publicacion'];\n }", "public function addRecordInDB($id_entita, $id_sezione){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $id_entita = DB_Functions::esc($id_entita);\r\n $id_sezione = DB_Functions::esc($id_sezione);\r\n\r\n //inserimento nuovo PROTAGONISTA\r\n $query = \"INSERT INTO PROTAGONISTA (ID_ENTITA, ID_SEZIONE)\r\n\t VALUES ($id_entita, $id_sezione)\";\r\n $resQuery = $db->executeQuery($query);\r\n\r\n // Se la query ha esito positivo\r\n if ($resQuery[\"state\"]) {\r\n $this->id_entita = $id_entita;\r\n $this->id_sezione = $id_sezione;\r\n }\r\n return $resQuery;\r\n }", "function populateRecordEpic($lineEx, $recordNumber, $exportData, $fileData, $counter){\r\n\t\tif(strlen($lineEx[150])>0){ //we know that we have the larger HAL number in field number 1 - populate the record\r\n\t\t\t//////////////////////////////////////////////\r\n\t\t\t//check for duplicate phone numbers\r\n\t\t\t//for 'debtor phone' and 'phone at discharge'\r\n\t\t\t$debtorPhone = \"\";\r\n\t\t\t$rpPhone = \"\";\r\n\t\t\t$debtorPoePhone = \"\";\r\n\r\n\t\t\t$debtorPhone = preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[23]);\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorPhone'] = $debtorPhone;\r\n\r\n\t\t\t/*if( $debtorPhone != $rpPhone ){ //these numbers are different so we need to check to see if the other non-debtor phones match between rpPhone and POE\r\n\t\t\t\t$debtorPoePhone = preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[162]);\r\n\t\t\t\tif( preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[24]) != preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[162]) ){ //these numbers are not the same so we need to populate the RP phone as well\r\n\t\t\t\t\t$rpPhone = preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[24]);\r\n\t\t\t\t}\r\n\t\t\t}*/\r\n\t\t\tif( $debtorPhone != $rpPhone ){ //these numbers are different so we need to check to see if the other non-debtor phones match between rpPhone and POE\r\n\t\t\t\t$debtorPoePhone = preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[171]);\r\n\t\t\t\tif( preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[24]) != preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[171]) ){ //these numbers are not the same so we need to populate the RP phone as well\r\n\t\t\t\t\t$rpPhone = preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[24]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/////////////////////////////////////////////\r\n\t\t\t$nameRaw = strtoupper($lineEx[6]);\r\n\t\t\t$nameRawEx = explode(\",\", $nameRaw);\r\n\t\t\t$nameRaw = $nameRawEx[0].\",\".$nameRawEx[1];\r\n\t\t\t\tif(strlen($nameRawEx[1])>0){ //we have a middle initial so list it\r\n\t\t\t\t\t$nameRaw .= \" \".$nameRawEx[2];\r\n\t\t\t\t}\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorName'] = $nameRaw;\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorSs'] = $lineEx[7];\r\n\t\t\tif($this->exportData[$recordNumber][01]['debtorSs'] == '123456789'){ $this->exportData[$recordNumber][01]['debtorSs'] = 999999999; }\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorAddress1'] = strtoupper($lineEx[17]);\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorAddress2'] = strtoupper($lineEx[18]);\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorCity'] = strtoupper($lineEx[19]);\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorState'] = strtoupper($lineEx[20]);\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorZip'] = $lineEx[21];\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorNumber'] .= \"/\".$lineEx[150];\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorDob'] = $lineEx[8];\r\n\t\t\t$this->exportData[$recordNumber][01]['balance'] += $lineEx[73];\r\n\t\t\t$balance = str_replace(\".\", \"\", $lineEx[73]);\r\n\t\t\t$balance = str_replace(\",\", \"\", $balance);\r\n\t\t\t$this->exportData[$recordNumber][01]['balance'] = $balance;\r\n\t\t\t$this->exportData[$recordNumber][01]['dateOfService'] = $lineEx[14];\r\n\t\t\t$this->exportData[$recordNumber][01]['dateOfService'] = $this->processEpicDate($this->exportData[$recordNumber][01]['dateOfService']);\r\n\t\t\t$this->exportData[$recordNumber][01]['listDate'] = $lineEx[14];\r\n\t\t\t$this->exportData[$recordNumber][01]['listDate'] = $this->processEpicDate($this->exportData[$recordNumber][01]['listDate']);\r\n\r\n\r\n\t\t\t//prep info for notes\r\n\t\t\tif(strstr($lineEx[16], \"WSM PROVIDENCE SAINT MARY MEDICAL CENTER\")){\r\n\t\t\t\t$lineEx[16] = 'prov-st-mary';\r\n\t\t\t}\r\n\r\n\r\n\t\t\t\t//if(strstr($lineEx[69], \"Medicare\")) { echo $lineEx[69].\"<br />\"; }\r\n\r\n\t\t\t\t$noteString\t=\t$lineEx[66];\r\n\t\t\t\t$noteString\t.=\t\"/CL:\".$lineEx[69];\r\n\r\n\t\t\t\tif(trim($lineEx[69])==\"Medicare\"){\r\n\t\t\t\t\t$this->exportData = $this->populateWindow($recordNumber,104, \"04\", \"MEDICARE\");\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t$noteString\t.=\t\" Charge:\".number_format( preg_replace(\"/[^0-9.]/\", \"\", $lineEx[70]), 2);\r\n\t\t\t\t$noteString\t.=\t\" Pmt:\".number_format( preg_replace(\"/[^0-9.]/\", \"\", $lineEx[242]), 2);\r\n\t\t\t\t$noteString\t.=\t\" Adj:\".number_format( preg_replace(\"/[^0-9.]/\", \"\", $lineEx[243]), 2);\r\n\t\t\t\t$noteString\t.=\t\" Bal:\".number_format( preg_replace(\"/[^0-9.]/\", \"\", $lineEx[73]), 2);\r\n\r\n\t\t\t\t$noteString\t.=\t\" Provider:\".strtoupper($lineEx[213]);\r\n\t\t\t\t$noteString\t.=\t\" Facility:\".strtoupper($lineEx[16]);\r\n\t\t\t\t$noteString\t.=\t\" Guar Ph:\".preg_replace(\"/[^0-9,.]/\", \"\", $lineEx[87]);\r\n\r\n\t\t\t\tif(strlen($lineEx[164])>0) $noteString\t.=\t\" Guar POE:\".ucfirst(str_replace(\"OTHER (\", \"\", str_replace(\")\",\"\",$lineEx[164])));\r\n\t\t\t\tif(strlen($lineEx[165])>0) $noteString\t.=\t\", \".$lineEx[165];\r\n\t\t\t\tif(strlen($lineEx[166])>0) $noteString\t.=\t\", \".$lineEx[166];\r\n\t\t\t\tif(strlen($lineEx[167])>0) $noteString\t.=\t\", \".$lineEx[167];\r\n\t\t\t\tif(strlen($lineEx[168])>0) $noteString\t.=\t\", \".$lineEx[168];\r\n\t\t\t\tif(strlen($lineEx[169])>0) $noteString\t.=\t\", \".$lineEx[169];\r\n\r\n\t\t\t$this->exportData[$recordNumber][02]['debtorPoe'] = str_replace(\"OTHER (\", \"\", strtoupper($lineEx[164]));\r\n\t\t\t$this->exportData[$recordNumber][02]['debtorPoeAddress'] = strtoupper($lineEx[165]);\r\n\t\t\t$this->exportData[$recordNumber][02]['debtorPoeCity'] = strtoupper($lineEx[167]);\r\n\t\t\t$this->exportData[$recordNumber][02]['debtorPoeState'] = strtoupper($lineEx[168]);\r\n\t\t\t$this->exportData[$recordNumber][02]['debtorPoeZip'] = $lineEx[169];\r\n\t\t\t$this->exportData[$recordNumber][02]['debtorPoePhone'] = $debtorPoePhone;\r\n\r\n\t\t\t\tif(strstr(strtolower($lineEx[27]), \"spouse\")){ //add spouse info to the data array\r\n\t\t\t\t\t$this->exportData[$recordNumber][02]['spouseName'] = strtoupper($lineEx[26]);\r\n\t\t\t\t\tif( $lineEx[28] != strtoupper($this->exportData[$recordNumber][01]['debtorAddress1']) ){\r\n\t\t\t\t\t $this->exportData[$recordNumber][02]['spouseAddress1'] = strtoupper($lineEx[28]);\r\n\t\t\t\t\t $this->exportData[$recordNumber][02]['spouseAddress2'] = strtoupper($lineEx[29]);\r\n\t\t\t\t\t $this->exportData[$recordNumber][02]['spouseCity'] = strtoupper($lineEx[30]);\r\n\t\t\t\t\t $this->exportData[$recordNumber][02]['spouseState'] = strtoupper($lineEx[31]);\r\n\t\t\t\t\t $this->exportData[$recordNumber][02]['spouseZip'] = $lineEx[32];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$debtorDobEx = explode(\"/\", $this->exportData[$recordNumber][01]['debtorDob']);\r\n\t\t\t///////////////////////////////////////////////////////////\r\n\t\t\t$birthDateForAgeCheck = $debtorDobEx[2].$debtorDobEx[0].$debtorDobEx[1]; //this is for the new age function so we're shifting in a new variable - eventually we should eliminate the birthDate variable\r\n\r\n\t\t\tswitch($this->clientId){ //we have differing formats between clients for client Dob so we need to fit the format to the client\r\n\t\t\t\tcase \"Y9658\":\r\n\t\t\t\t\t$birthDateForAgeCheck = $debtorDobEx[2].$debtorDobEx[0].$debtorDobEx[1];\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorDob'] = $this->processEpicDate($birthDateForAgeCheck);\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"Y3401\":\r\n\t\t\t\t\t$thisYearLastTwo = substr(date(\"Y\"), 2, 2);\r\n\t\t\t\t\t$thisPersonsBirthDay = $this->exportData[$recordNumber][01]['debtorDob'];\r\n\t\t\t\t\t$thisMonth = substr($thisPersonsBirthDay, 0, 2);\r\n\t\t\t\t\t$thisDay = substr($thisPersonsBirthDay, 2, 2);\r\n\t\t\t\t\t$thisYear = substr($thisPersonsBirthDay, 4, 2);\r\n\t\t\t\t\t\tif($thisYear > $thisYearLastTwo){\r\n\t\t\t\t\t\t\t$thisYearNew = \"19\".$thisYear;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$thisYearNew = \"20\".$thisYear;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t$birthDateForAgeCheck = $thisYearNew.$thisMonth.$thisDay;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t///////////////////new date check to check the person's birthdate against the list date\r\n\t\t\t $date = new DateTime($birthDateForAgeCheck);\r\n\t\t\t $now = new DateTime($this->exportData[$recordNumber][01]['listDate']);\r\n\t\t\t $interval = $now->diff($date);\r\n\t\t\t $age = $interval->y;\r\n\t\t\t ///////////////////\r\n\t\t\t if($age < 18){ //this is a minor\r\n\t\t\t\t$noteString .= \" PT BD:\".$this->exportData[$recordNumber][01]['debtorDob'].\" \"; //store minor DOB in the notestring\r\n\t\t\t\t$this->exportData[$recordNumber][01]['rpName'] = $lineEx[151];\r\n\t\t\t\t$this->exportData[$recordNumber][01]['rpSs'] = $lineEx[152];\r\n\t\t\t\t\tif($this->exportData[$recordNumber][01]['rpSs'] == '123456789'){ $this->exportData[$recordNumber][01]['rpSs'] = 999999999; }\r\n\r\n\t\t\t\tif($this->clientId == \"Y9658\"){ //case for Y9658 client\r\n\t\t\t\t\t$rpDobEx = explode(\"/\", $lineEx[153]);\r\n\t\t\t\t\t$Y9658RPDOB = $rpDobEx[2].$rpDobEx[0].$rpDobEx[1];\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorDob'] = $this->processEpicDate($Y9658RPDOB);\r\n\t\t\t\t}\r\n\t\t\t\t$this->exportData[$recordNumber][02]['debtorPoePhone'] = trim($lineEx[171]);\r\n\t\t\t\t$this->exportData[$recordNumber][01]['rpPhone'] = $rpPhone;\r\n\t\t\t\t$this->exportData[$recordNumber][01]['rpNumber'] = $lineEx[150];\r\n\t\t\t\t$this->exportData[$recordNumber][01]['debtorAddress1'] = $lineEx[155];\r\n\t\t\t\t$this->exportData[$recordNumber][01]['debtorAddress2'] = $lineEx[156];\r\n\t\t\t\t$this->exportData[$recordNumber][01]['debtorCity'] = $lineEx[157];\r\n\t\t\t\t$this->exportData[$recordNumber][01]['debtorState'] = $lineEx[158];\r\n\t\t\t\t$this->exportData[$recordNumber][01]['debtorZip'] = $lineEx[159];\r\n\t\t\t }\r\n\t\t\t///////////////////////////////////////////////////////////\r\n\t\t\t$this->exportData = $this->breakAddress($this->exportData, $recordNumber, 1); //splits the address to second line if longer than given length\r\n\t\t\t$this->exportData = $this->splitNotes($noteString, $recordNumber); //now split the notes to fit on the 4 note lines in the FACS file\r\n\t\t\t\r\n\r\n\t\t\tif(strlen($lineEx[26])>0){\r\n\t\t\t\t$thisRelative = array('recordId'=>$recordNumber,\r\n\t\t\t\t\t'Name'=>$lineEx[26],\r\n\t\t\t\t\t'Relation'=>\"REL\",\r\n\t\t\t\t\t'Address'=>$lineEx[27].\", \".$lineEx[28].\" \".$lineEx[30].\" \".$lineEx[31],\r\n\t\t\t\t\t'Phone'=>str_replace(\"-\", \"\", $lineEx[33]),\r\n\t\t\t\t\t'PhoneFlag'=>\"\",\r\n\t\t\t\t\t/*'LengthOfService'=>\"\",\r\n\t\t\t\t\t'Unused'=>\"\"*/\r\n\t\t\t\t);\r\n\t\t\t\tarray_push($this->exportData[$recordNumber][11], $thisRelative);\r\n\r\n\t\t\t}\r\n\t\t\tif(strlen($lineEx[36])>0){\r\n\t\t\t\t$thisRelative = array('recordId'=>$recordNumber,\r\n\t\t\t\t\t'Name'=>$lineEx[36],\r\n\t\t\t\t\t'Relation'=>\"REL\",\r\n\t\t\t\t\t'Address'=>$lineEx[37].\", \".$lineEx[38].\" \".$lineEx[40].\" \".$lineEx[41],\r\n\t\t\t\t\t'Phone'=>str_replace(\"-\", \"\", $lineEx[43]),\r\n\t\t\t\t\t'PhoneFlag'=>\"\",\r\n\t\t\t\t\t'LengthOfResidence'=>\"\",\r\n\t\t\t\t\t'Unused'=>\"\"\r\n\t\t\t\t);\r\n\t\t\t\tarray_push($this->exportData[$recordNumber][11], $thisRelative);\r\n\t\t\t}\r\n\t\t\tif(strlen($lineEx[46])>0){\r\n\t\t\t\t$thisRelative = array('recordId'=>$recordNumber,\r\n\t\t\t\t\t'Name'=>$lineEx[46],\r\n\t\t\t\t\t'Relation'=>\"REL\",\r\n\t\t\t\t\t'Address'=>$lineEx[47].\", \".$lineEx[48].\" \".$lineEx[50].\" \".$lineEx[51],\r\n\t\t\t\t\t'Phone'=>str_replace(\"-\", \"\", $lineEx[53]),\r\n\t\t\t\t\t'PhoneFlag'=>\"\",\r\n\t\t\t\t\t'LengthOfResidence'=>\"\",\r\n\t\t\t\t\t'Unused'=>\"\"\r\n\t\t\t\t);\r\n\t\t\t\tarray_push($this->exportData[$recordNumber][11], $thisRelative);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->exportData;\r\n\t}", "function &returnRecord()\n\t{\n\t\treturn $this->record;\n\t}", "public function edit(Record $record)\n {\n //\n }", "public function isNewRecord(){\n return !isset($this->data['id']);\n }", "function readOne(){\n\t\t\n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE ID=? LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t$this->id = $row['ID'];\n\t\t$this->sms = $row['TextDecoded'];\n\t\t$this->by = $row['SenderNumber'];\n\t\t$this->recieve = $row['ReceivingDateTime'];\n\t\t// $this->update = $row['UpdateInDB'];\n\t}", "function addRecord()\n {\n global $invenArray;\n // Add the new information into the array\n $invenArray[] = array($_POST[\"empID\"],$_POST[\"fName\"],$_POST[\"lName\"],$_POST[\"truckNum\"],$_POST[\"phoneNum\"],$_POST[\"yrsOfSen\"]);\n // The sort will be on the first column (part number) so use this to re-order the displays\n sort($invenArray);\n // Save the updated array in its session variable\n $_SESSION[\"serializedArray\"] = urlencode(serialize($invenArray));\n }", "public function __toString() {\n return \"@\".$this->record;\n }", "private function processRow($row)\n {\n $dbTable = $this->osoby;\n $data = array(\n 'imie' => $row[0],\n 'nazwisko' => $row[1],\n 'stanowisko' => $row[2],\n 'umowa' => $row[3],\n 'dzial' => $row[4],\n 'email' => $row[5],\n 'notification_email' => $row[6],\n 'telefon_stacjonarny' => $row[7],\n 'telefon_komorkowy' => $row[8],\n 'generate_documents' => 1,\n 'login_do_systemu' => false,\n );\n $id = $dbTable->save($data);\n\n $modelDoc = Application_Service_Utilities::getModel('Doc');\n $modelDoc->clearDocs($id);\n\n $this->getRepository()->getOperation()->operationBegin(Application_Service_Repository::OPERATION_IMPORTANT);\n\n //$this->osoby->remove($id);\n\n $this->personsService->clearRoles($id);\n $this->personsService->clearKlucze($id);\n\n $this->getRepository()->getOperation()->operationComplete('zbiory.remove', $id);\n \n if (empty($id)) {\n throw new Exception('Error in inserting Row');\n try {\n $this->db->beginTransaction();\n\n $dbTable = $this->osoby;\n $data = array(\n 'imie' => $row[0],\n 'nazwisko' => $row[1],\n 'stanowisko' => $row[2],\n 'umowa' => $row[3],\n 'dzial' => $row[4],\n 'email' => $row[5],\n 'notification_email' => $row[6],\n 'telefon_stacjonarny' => $row[7],\n 'telefon_komorkowy' => $row[8],\n 'generate_documents' => 1,\n 'login_do_systemu' => false,\n );\n $id = $dbTable->save($data);\n\n $modelDoc = Application_Service_Utilities::getModel('Doc');\n $modelDoc->clearDocs($id);\n $this->getRepository()->getOperation()->operationBegin(Application_Service_Repository::OPERATION_IMPORTANT);\n\n //$this->osoby->remove($id);\n $this->personsService->clearRoles($id);\n $this->personsService->clearKlucze($id);\n\n $this->getRepository()->getOperation()->operationComplete('zbiory.remove', $id);\n\n // $this->getRepository()->getOperation()->operationComplete('osoby.update', $id, false);\n\n if (empty($id)) {\n throw new Exception('Error in inserting Row');\n }\n $this->db->commit();\n } catch (Exception $e) {\n Throw new Exception($e->getMessage(), 500, $e);\n }}\n return $id;\n }", "function addNew($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new values to table in database\r\n\t\t\t$this->insert();\r\n\t\t}", "function getFromDatabase($row) {\r\n\t\t//id\r\n\t\t$this->id = $row['id'];\r\n\t\t//eventDateTime\r\n\t\t$this->event_date_time = $row['eventDateTime'];\r\n\t\t//time before\r\n\t\t$this->time_before = $row['timeBefore'];\r\n\t\t//frequency\r\n\t\t$this->freq = $row['frequency'];\r\n\t\t//method\r\n\t\t$this->notif_method = $row['method'];\r\n\t}", "function store()\n\t{\t\n\t\t//$row =& $this->getTable();\n\t\t$db\t\t= JFactory::getDbo();\n\t\t\n\t\t$data = JRequest::get( 'post' );\n\t\t\n\t\tif($data[\"dsr_txt_prename\"] == '' ||\n\t\t\t$data[\"dsr_txt_name\"] == '' ||\n\t\t\t$data[\"dsr_txt_address\"] == '' ||\n\t\t\t$data[\"dsr_txt_plz\"] == '' ||\n\t\t\t$data[\"dsr_txt_city\"] == '' ||\n\t\t\t$data[\"dsr_txt_phone\"] == '' ||\n\t\t\t$data[\"dsr_txt_email\"] == '' ||\n\t\t\t$data[\"dsr_chk_AGB\"] == \"\" ||\n\t\t\t$data[\"dsr_title\"] == \"\" ||\n\t\t\t!filter_var($_POST[\"dsr_txt_email\"], FILTER_VALIDATE_EMAIL) ){\n\t\t\t\n\t\t\tJError::raiseWarning( 500, JText::_('COM_JEVENT_LBL_CORRECT_ERRORS') );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/*if(!$this->check($data[\"dsr_txt_email\"] )){\n\t\t\tJError::raiseWarning( 500, JText::_('Email not valid!') );\n\t\t\treturn false;\n\t\t}*/\n\t\t\t\n\t\t$insData =new stdClass();\n\t\t//$insData->idt_drivin_event_apply = $_POST['id_upt'];\n\t\t$insData->idt_drivin_event = $_POST[\"applyEventId\"];\n\t\t\n\t\t$insData->s_name = $data[\"dsr_txt_name\"];\n\t\t$insData->s_prename = $data[\"dsr_txt_prename\"];\n\t\t$insData->s_address = $data[\"dsr_txt_address\"];\n\t\t$insData->s_plz = $data[\"dsr_txt_plz\"] ;\n\t\t$insData->s_city = $data[\"dsr_txt_city\"];\n\t\t$insData->s_phone = $data[\"dsr_txt_phone\"];\n\t\t$insData->s_email = $data[\"dsr_txt_email\"];\n\t\t$insData->dt_cancel = null;\n\t\t$insData->s_title = $data[\"dsr_title\"];\n\t\t\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->insertObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $db->stderr();\n\t\t\t//return false;\n\t\t\t$bSQLOk = false;\n\t\t}else{\n\t\t\t$bSQLOk = true;\n\t\t\t//test();\n\t\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select($db->nameQuote('s_name'));\n\t\t$query->select($db->nameQuote('s_prename'));\n\t\t$query->select($db->nameQuote('s_address'));\n\t\t$query->select($db->nameQuote('s_plz'));\n\t\t$query->select($db->nameQuote('s_city'));\n\t\t$query->select($db->nameQuote('s_phone'));\n\t\t$query->select($db->nameQuote('s_email'));\n\t\t$query->select($db->nameQuote('idt_drivin_event_apply')); \n\t\t$query->select($db->nameQuote('s_title'));\n\t\t$query->from($db->nameQuote('#__jevent_events_apply'));\n\t\t$query->where($db->nameQuote('idt_drivin_event_apply') . '=' . $db->insertid());\n\t\tif(!$bCanceled)\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is null');\n\t\telse\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is not null');\n\n\t\t$db->setQuery($query);\n\t\t//if ($link = $db->loadRowList()) {\n\t\t$link = $db->loadRowList();\n\t\t\t$mailer = new jEventMailer();\n\t\t\t//$mailer->test();\n\t\t\tif(!$mailer->sendApplicationEmail2($db->insertid(), $link, $this->getEventById())){\n\t\t\t\t$this->setError($mailer->error);\n\t\t\t\techo \"Eroooor \" . $mailer->error;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//if($bSQLOk)\n\t\t//\t$bMailOk = sendApplicationEmail($_POST[\"dsr_txt_email\"], $_POST[\"applyEventId\"]);\n\t\t//else\n\t\t//\t$bMailOk = false;\n\t\t//$mailer = new jEventMailer();\n\t\t//$mailer->test();\n\n\t\t// Bind the form fields to the hello table\n\t\t/*if (!$row->bind($data)) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make sure the hello record is valid\n\t\tif (!$row->check()) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Store the web link table to the database\n\t\tif (!$row->store()) {\n\t\t\t$this->setError( $row->getErrorMsg() );\n\t\t\treturn false;\n\t\t}*/\n\n\t\treturn true;\n\t}", "function xmlAddRecord($table, $row, $conf, $img) {\n\t\t// language setting\n\t\tif ($GLOBALS['TSFE']->sys_language_content && $this->conf['getRecordOverlay'] == 1) {\n\t\t\t$OLmode = ($this->sys_language_mode == 'strict'?'hideNonTranslated':'');\n\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($table, $row, $GLOBALS['TSFE']->sys_language_content, $OLmode);\n\t\t}\n\t\t$uid2 = $this->helperJsKey($row['table'], $row['uid']);\n\n\t\t$attributes = array(\n\t\t\t'cat' => $row['rggmcat'],\n\t\t\t'uid2' => $uid2,\n\t\t\t'uid' => $row['uid'],\n\t\t\t'lng' => $row['lng'],\n\t\t\t'lat' => $row['lat'],\n\t\t\t'img' => $img,\n\t\t\t'table' => $row['table'],\n\t\t);\n\t\t$this->xmlStartLevel('marker', $attributes);\n\t\t$this->xmlGetRowInXML($row, $conf);\n\t\t$this->xmlEndLevel('marker');\n\t}", "function readOne(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=? LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "public function modifyRecord($record)\n {\n return $record;\n }", "abstract protected function map_reford_to_object( $record );", "function beforeSave() {\n\t\t$this->getFile();\n\t\t/** Si no cargo el documento, lo obtengo desde el cuit. */\n\t\tif (empty($this->data['Trabajador']['numero_documento']) && !empty($this->data['Trabajador']['cuil'])) {\n\t\t\t$this->data['Trabajador']['numero_documento'] = substr(str_replace('-', '', $this->data['Trabajador']['cuil']), 2, 8);\n\t\t}\n\t\t\n\t\treturn parent::beforeSave();\n\t}", "protected function get_record()\n\t{\n\t\treturn $this->key ? parent::get_record() : null;\n\t}", "function modifica_record($id,Spesa $spesa){\n //campi della spesa\n $titolo_modificato = $spesa->getTitoloSpesa();\n $tipologia_modificata = $spesa->getTipologiaSpesa();\n $data_pagamento_modificata = $spesa->getDataPagamentoSpesa();\n $data_scadenza_modificata = $spesa->getDataScadenzaSpesa();\n $autore_modificato = $spesa->getAutoreSpesa();\n $importo_modificato = verifica_importo_spesa($spesa->getImportoSpesa());\n\n $mysqli = connetti();\n\n $sql = \"UPDATE spesa SET \n titolo_spesa = '\".$titolo_modificato.\"',\n tipologia_spesa = '\".$tipologia_modificata.\"',\n data_pagamento_spesa = '\".$data_pagamento_modificata.\"',\n data_scadenza_spesa = '\".$data_scadenza_modificata.\"',\n autore_spesa = '\".$autore_modificato.\"',\n importo_spesa = \".$importo_modificato.\" \n WHERE id = \" . $id;\n\n if($mysqli->query($sql)){\n header(\"Location:index.php\");\n }else{\n header(\"Location:errore.php\");\n }\n\n chiudi_connessione($mysqli);\n}", "private function addDescriptiveRecord()\n {\n // Record Type\n $line = self::DESCRIPTIVE_TYPE;\n\n if ($this->includeAccountNumberInDescriptiveRecord) {\n // BSB\n $line .= $this->bsb;\n\n // Account Number\n $line .= str_pad($this->accountNumber, 9, ' ', STR_PAD_LEFT);\n\n // Reserved - must be a single blank space\n $line .= ' ';\n } else {\n // Reserved - must be 17 blank spaces\n $line .= str_repeat(' ', 17);\n }\n\n // Sequence Number\n $line .= '01';\n\n // Bank Name\n $line .= $this->bankName;\n\n // Reserved - must be seven blank spaces\n $line .= str_repeat(' ', 7);\n\n // User Name\n $line .= str_pad($this->userName, 26, ' ', STR_PAD_RIGHT);\n\n // User ID\n $line .= $this->directEntryUserId;\n\n // File Description\n $line .= str_pad($this->description, 12, ' ', STR_PAD_RIGHT);\n\n // Processing Date\n $line .= date('dmy', is_numeric($this->processingDate) ? $this->processingDate : strtotime($this->processingDate));\n\n // Reserved - 40 blank spaces\n $line .= str_repeat(' ', 40);\n\n $this->addLine($line);\n }", "function __construct($row) {\n\t\t $this->id = $row ['id'];\n\t\t $this->name = $row ['name'];\n\t\t $this->city = $row ['city'];\n\t\t $this->street = $row ['street'];\n\t\t $this->contact = $row ['contact'];\t\t \t\n\t }", "function show_new_record() {\r\n if ($this->allow_new) {\r\n #~ echo \"<p><a href='{$_SERVER['PHP_SELF']}?m={$this->module}&amp;act=new&amp;go=\".urlencode($GLOBALS['full_self_url']).\"'>Insert new row</a>\";\r\n echo '<form method=POST action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n echo '<input type=hidden name=\"m\" value=\"'.$this->module.'\">';\r\n echo '<input type=hidden name=\"act\" value=\"new\">';\r\n echo '<input type=hidden name=\"go\" value=\"'.htmlentities($GLOBALS['full_self_url']).'\">'; # url to go after successful submitation\r\n # if i'm a detail, get master-detail field's value and pass it to new-form\r\n if ($this->logical_parent) {\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->parentkey) { # foreign key always int\r\n echo '<input type=hidden name=\"sugg_field['.$colvar.']\" value=\"'.htmlentities($col->parentkey_value).'\">';\r\n }\r\n }\r\n }\r\n echo '<p>'.lang('Add').' <input type=text name=\"num_row\" size=2 value=\"1\"> '.lang($this->unit).' <input type=submit value=\"'.lang('Go').'\">';\r\n echo '</form>';\r\n }\r\n }", "protected function fijarSentenciaInsert(){}", "function readOne()\n {\n // query to read single record\n $query = \"SELECT\n s.id, s.email, s.name, s.state\n FROM\n \" . $this->table_name . \" s\n WHERE\n s.id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of subscriber to be updated\n $stmt->bindParam(1, $this->id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->email = $row['email'];\n $this->name = $row['name'];\n $this->state = $row['state'];\n }", "public function getRecord()\n {\n return $this->get(self::_RECORD);\n }", "function ooffice_write_etablissement( $record ) {\r\n // initial string;\r\n\t\tglobal $odt;\r\n\t\tif ($record){\r\n\t\t\t$id = trim( $record->id );\r\n\t\t\t$num_etablissement = trim( $record->num_etablissement);\r\n\t\t\t$nom_etablissement = recode_utf8_vers_latin1(trim( $record->nom_etablissement));\r\n\t\t\t$adresse_etablissement = recode_utf8_vers_latin1(trim( $record->adresse_etablissement));\r\n\t\t\t$logo=$record->logo_etablissement;\r\n\t\t\t\r\n\t\t\t// $odt->SetFont('Arial','I',10);\r\n\t\t\t// $texte=get_string('etablissement','referentiel').' <b>'.$nom_etablissement.'</b><br />'.get_string('num_etablissement','referentiel').' : <i>'.$num_etablissement.'</i> <br />'.$adresse_etablissement;\r\n\t\t\t$texte='<b>'.$nom_etablissement.'</b><br />'.get_string('num_etablissement','referentiel').' : <i>'.$num_etablissement.'</i> <br />'.$adresse_etablissement;\r\n\t\t\t$texte=recode_utf8_vers_latin1($texte);\r\n\t\t\t$odt->WriteParagraphe(0,$texte);\r\n\t\t\treturn true;\r\n }\r\n\t\treturn false;\r\n}", "function singleRecord() {\r\n $this->Record = mysql_fetch_assoc( $this->Query_ID );\r\n $stat = is_array( $this->Record );\r\n return $stat;\r\n }", "function clsRecordSeGeUs_mant()\n {\n\n global $FileName;\n $this->Visible = true;\n $this->Errors = new clsErrors();\n $this->ErrorBlock = \"Record SeGeUs_mant/Error\";\n $this->ds = new clsSeGeUs_mantDataSource();\n $this->InsertAllowed = true;\n $this->UpdateAllowed = true;\n $this->DeleteAllowed = true;\n if($this->Visible)\n {\n $this->ComponentName = \"SeGeUs_mant\";\n $CCSForm = split(\":\", CCGetFromGet(\"ccsForm\", \"\"), 2);\n if(sizeof($CCSForm) == 1)\n $CCSForm[1] = \"\";\n list($FormName, $FormMethod) = $CCSForm;\n $this->EditMode = ($FormMethod == \"Edit\");\n $this->FormEnctype = \"application/x-www-form-urlencoded\";\n $this->FormSubmitted = ($FormName == $this->ComponentName);\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\n $this->lbTitulo = new clsControl(ccsLabel, \"lbTitulo\", \"lbTitulo\", ccsText, \"\", CCGetRequestParam(\"lbTitulo\", $Method));\n $this->usu_login = new clsControl(ccsTextBox, \"usu_login\", \"Usu Login\", ccsText, \"\", CCGetRequestParam(\"usu_login\", $Method));\n $this->usu_login->Required = true;\n $this->usu_Password = new clsControl(ccsTextBox, \"usu_Password\", \"Usu Password\", ccsText, \"\", CCGetRequestParam(\"usu_Password\", $Method));\n $this->usu_Nombre = new clsControl(ccsTextBox, \"usu_Nombre\", \"Usu Nombre\", ccsText, \"\", CCGetRequestParam(\"usu_Nombre\", $Method));\n $this->usu_Grupo = new clsControl(ccsListBox, \"usu_Grupo\", \"Usu Grupo\", ccsText, \"\", CCGetRequestParam(\"usu_Grupo\", $Method));\n $this->usu_Grupo->DSType = dsListOfValues;\n $this->usu_Grupo->Values = array(array(\"10\", \"Usuarios\"), array(\"1000\", \"Supervisor\"), array(\"10000\", \"Administrador\"), array(\"20000\", \"Admin. de Seguridad\"));\n $this->usu_Activo = new clsControl(ccsListBox, \"usu_Activo\", \"Usu Activo\", ccsInteger, \"\", CCGetRequestParam(\"usu_Activo\", $Method));\n $this->usu_Activo->DSType = dsListOfValues;\n $this->usu_Activo->Values = array(array(\"0\", \"Inactivo\"), array(\"1\", \"Activo\"));\n $this->usu_Activo->Required = true;\n $this->usu_PagInicial = new clsControl(ccsTextBox, \"usu_PagInicial\", \"Usu Pag Inicial\", ccsText, \"\", CCGetRequestParam(\"usu_PagInicial\", $Method));\n $this->usu_AuxId = new clsControl(ccsTextBox, \"usu_AuxId\", \"Usu Aux Id\", ccsInteger, \"\", CCGetRequestParam(\"usu_AuxId\", $Method));\n $this->usu_ValidoDesde = new clsControl(ccsTextBox, \"usu_ValidoDesde\", \"Usu Valido Desde\", ccsDate, Array(\"dd\", \"/\", \"mmm\", \"/\", \"yyyy\"), CCGetRequestParam(\"usu_ValidoDesde\", $Method));\n $this->usu_ValidoDesde->Required = true;\n $this->usu_ValidoHasta = new clsControl(ccsTextBox, \"usu_ValidoHasta\", \"Usu Valido Hasta\", ccsDate, Array(\"dd\", \"/\", \"mmm\", \"/\", \"yyyy\"), CCGetRequestParam(\"usu_ValidoHasta\", $Method));\n $this->usu_ValidoHasta->Required = true;\n $this->Button_Insert = new clsButton(\"Button_Insert\");\n $this->Button_Update = new clsButton(\"Button_Update\");\n $this->Button_Delete = new clsButton(\"Button_Delete\");\n $this->Button_Cancel = new clsButton(\"Button_Cancel\");\n $this->btRegresar = new clsButton(\"btRegresar\");\n $this->Button1 = new clsButton(\"Button1\");\n if(!$this->FormSubmitted) {\n if(!is_array($this->usu_Activo->Value) && !strlen($this->usu_Activo->Value) && $this->usu_Activo->Value !== false)\n $this->usu_Activo->SetText(0);\n if(!is_array($this->usu_ValidoDesde->Value) && !strlen($this->usu_ValidoDesde->Value) && $this->usu_ValidoDesde->Value !== false)\n $this->usu_ValidoDesde->SetValue(time());\n if(!is_array($this->usu_ValidoHasta->Value) && !strlen($this->usu_ValidoHasta->Value) && $this->usu_ValidoHasta->Value !== false)\n $this->usu_ValidoHasta->SetText(2005-12-31);\n }\n }\n }", "public function readOne()\n {\n \n // zapytanie o pojedynczy rekord\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_offer = ?\";\n \n // przygotowanie zapytania\n $stmt = $this->pdo->prepare($query);\n \n // wiazemy id przedstawiciela do zaaktualizowania\n $stmt->bindParam(1, $this->id);\n \n // wykonanie zapytania\n $stmt->execute();\n \n // pobieramy otrzymany rekord\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // ustawienie wartosci dla własciwosci obiektu\n $this->name = $row['name'];\n $this->date_offer = $row['date_offer'];\n $this->start_date = $row['start_date'];\n $this->end_date = $row['end_date'];\n $this->description = $row['description'];\n $this->reduction = $row['reduction'];\n }", "private function _serializeOrderDetail($record)\n {\n $order_details = new Order_Details();\n $order_details->Discount = $record['Discount'];\n $order_details->OrderID = $record['OrderID'];\n $order_details->ProductID = $record['ProductID'];\n $order_details->Quantity = $record['Quantity'];\n $order_details->UnitPrice = $record['UnitPrice'];\n return $order_details; \n }", "public function getRecordId()\n {\n return $this->record_id;\n }", "public function onSaveNewRecord()\n {\n $this->created = $this->updated = new \\DateTime();\n $this->rev = 1;\n }", "function import_surat_keputusan_pemutih_penyalur() {\n//\t\tif (! $this->get_permission('fill_this')) return $this->intruder();\n\t\tglobal ${$GLOBALS['post_vars']}, ${$GLOBALS['files_vars']};\n\t\t$pk = array (\n\t\t\t'id_surat_keputusan_pemutih_penyalur' => TRUE\n\t\t);\n\t\t$label_arr = $this->surat_keputusan_pemutih_penyalur_label;\n\n\t\t$fd = fopen(${$GLOBALS['files_vars']}['userfile']['tmp_name'], \"r\");\n\t\twhile (! feof($fd)) {\n\t\t\t$buffer = fgets($fd, 4096);\n\t\t\t$piece = split(\",\", $buffer);\n\t\t\tif (empty($field_arr)) {\n\t\t\t\t$insert_key = \"\";\n\t\t\t\tfor ($i=0;$i<count($piece);$i++) {\n\t\t\t\t\t$buffer2 = trim(preg_replace(\"/^\\\"(.*)\\\"$/\", \"\\\\1\", $piece[$i]), \"\\xA0 \\t\\n\\r\\0\\x0B\");\n\t\t\t\t\t$field_arr[$i] = array_search($buffer2, $label_arr);\n\t\t\t\t\tif ($field_arr[$i]) {\n\t\t\t\t\t\tif ($insert_key) $insert_key .= ',';\n\t\t\t\t\t\t$insert_key .= $field_arr[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$count_piece++;\n\t\t\t\t}\n\t\t\t\tif ($insert_key) $insert_key = \"(\".$insert_key.\")\";\n\t\t\t} else if (count($piece) == $count_piece) {\n\t\t\t\tfor ($i=0;$i<count($piece);$i++) {\n\t\t\t\n\n\t\t$buffer2 = trim(preg_replace(\"/^\\\"(.*)\\\"$/\", \"\\\\1\", $piece[$i]), \"\\xA0 \\t\\n\\r\\0\\x0B\");\n\t\t\t\t\tif ($field_arr[$i]) {\n\t\t\t\t\t\tif ($insert_extra) $insert_extra .= ',';\n\t\t\t\t\t\t$insert_extra .= '\\''.$buffer2.'\\'';\n\t\t\t\t\t\tif ($pk[$field_arr[$i]]) {\n\t\t\t\t\t\t\tif ($delete_extra) $delete_extra .= \" AND \";\n\t\t\t\t\t\t\t$delete_extra .= $field_arr[$i].'=\\''.$buffer2.'\\'';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($insert_extra) {\n\t\t\t\t\t$insert_extra = \"(\".$insert_extra.\")\";\n\t\t\t\t\tif ($insert_value) $insert_value .= \",\";\n\t\t\t\t\t$insert_value .= $insert_extra;\n\t\t\t\t\tunset($insert_extra);\n\t\t\t\t}\n\t\t\t\tif ($delete_extra) {\n\t\t\t\t\t$delete_extra = \"(\".$delete_extra.\")\";\n\t\t\t\t\tif ($delete_where) $delete_where .= \" OR \";\n\t\t\t\t\t$delete_where .= $delete_extra;\n\t\t\t\t\tunset($delete_extra);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfclose($fd);\n\t\tunlink(${$GLOBALS['files_vars']}['userfile']['tmp_name']);\n\n\t\tglobal $adodb;\n\t\tif ($delete_where) $delete_query = \"DELETE FROM surat_keputusan_pemutih_penyalur WHERE \".$delete_where.\" ;\";\n\t\t$adodb->Execute($delete_query);\n\n\t\tif ($insert_key && $insert_value) {\n\n\t\t\tsrand((double)microtime()*1000000);\n\t\t\t$output_file = '/tmp/'.md5(rand()).'.output.txt';\n\t\t\t$all_query = $insert_value;\n\n\t\t\t$all_query = str_replace(\"),\", \")\\n\", $all_query);\n\t\t\tif (strstr($GLOBALS['adodb_type'], 'mysql')) {\n\t\t\t\t$piece = explode(\"\\n\", $all_query);\n\t\t\t\tforeach ($piece as $key => $value) {\n\t\t\t\t\t$value = str_replace('(\\'', '', $value);\n\t\t\t\t\t$value = str_replace('\\',\\'', \"\\t\", $value);\n\t\t\t\t\t$value = str_replace('\\')', '', $value);\n\t\t\t\t\tif ($data_file) $data_file .= \"\\n\";\n\t\t\t\t\t$data_file .= $value;\n\t\t\t\t}\n\t\t\t\t$fl = fopen($output_file.'.mysql', 'w');\n\t\t\t\tfwrite($fl, $data_file);\n\t\t\t\tfclose($fl);\n\t\t\t\t$adodb->Execute('LOAD DATA INFILE \\''.$output_file.'.mysql'.'\\' INTO TABLE surat_keputusan_pemutih_penyalur '.$insert_key);\n\t\t\t\tunlink($output_file.'.mysql');\n\t\t\t} else if (strstr($GLOBALS['adodb_type'], 'postgres')) {\n\n\t\t\t $piece = explode(\"\\n\", $all_query);\n\t\t\t\tforeach ($piece as $key => $value) {\n\t\t\t\t\t$value = str_replace('(\\'', '', $value);\n\t\t\t\t\t$value = str_replace('\\',\\'', \"\\t\", $value);\n\t\t\t\t\t$value = str_replace('\\')', '', $value);\n\t\t\t\t\tif ($data_file) $data_file .= \"\\n\";\n\t\t\t\t\t$data_file .= $value;\n\t\t\t\t}\n\t\t\t\t$fl = fopen($output_file.'.pgsql', 'w');\n\t\t\t\tfwrite($fl, $data_file);\n\t\t\t\tfclose($fl);\n\t\t\t\t$adodb->Execute('COPY surat_keputusan_pemutih_penyalur '.$insert_key.' FROM \\''.$output_file.'.pgsql'.'\\'');\n\t\t\t\tunlink($output_file.'.pgsql');\n\t\t\t} else {\n\t\t\t\t$piece = explode(\"\\n\", $all_query);\n\t\t\t\tforeach ($piece as $key => $value) {\n\t\t\t\t\t$adodb->Execute('INSERT INTO surat_keputusan_pemutih_penyalur '.$insert_key.' VALUES '.$value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$_block = new block();\n\t\t$_block->set_config('title', ('Import Surat Keputusan Pemutihan Izin Penyalur Status'));\n\t\t$_block->set_config('width', 595);\n\t\tif (! $adodb->ErrorMsg()) {\n\t\t\t$_block->parse(array('+<font color=green><b>'.__('Successfull Import').'</b></font>'));\n\t\t\treturn $_block->get_str();\n\t\t}\n\t\t$GLOBALS['self_close_js'] = $GLOBALS['adodb']->ErrorMsg();\n\t\t$_block->parse(array('+<font color=red><b>'.__('Failed Import').'</b></font>'));\n\t\treturn $_block->get_str();\n\t}", "function populateRecord_Y6051($lineEx, $recordNumber, $original){\r\n\t\t\t########################################################################################\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorName'] = $lineEx[16].\", \".$lineEx[17];\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorAddress1'] = $lineEx[18];\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorAddress2'] = $lineEx[19];\r\n\r\n\t\t\t///////////////////\r\n\t\t\tif(strlen($this->exportData[$recordNumber][01]['debtorAddress1']) > 20){\r\n\t\t\t\t$addySnippet = substr($this->exportData[$recordNumber][01]['debtorAddress1'], 0 ,20);\r\n\t\t\t\t$restSnippet = substr($this->exportData[$recordNumber][01]['debtorAddress1'], 20 , strlen($this->exportData[$recordNumber][01]['debtorAddress1']) );\r\n\t\t\t\t$this->exportData[$recordNumber][01]['debtorAddress1'] = $addySnippet;\r\n\t\t\t\t$this->exportData[$recordNumber][01]['debtorAddress2'] = $restSnippet.\" \".$this->exportData[$recordNumber][01]['debtorAddress2'];\r\n\t\t\t}\r\n\t\t\t///////////////////\r\n\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorCity'] = $lineEx[20];\r\n\t\t\t$stateZip = explode(\" \", $lineEx[21]);\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorState'] = $stateZip[0];\r\n\t\t\t$zipEx = str_replace(\"-\", \"\", $stateZip[2]);\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorZip'] = $zipEx;\r\n\r\n\t\t\t$this->exportData[$recordNumber][01]['balance'] = number_format($lineEx[15], 2);\r\n\r\n\t\t\t$dateOfService = $this->checkDateWithSlashes($lineEx[11]);\r\n\t\t\t$this->exportData[$recordNumber][01]['dateOfService'] = $dateOfService;\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorDob'] = $this->checkDateWithSlashes($lineEx[22]);\r\n\r\n\t\t\t$noteString = \"\";\r\n\r\n\t\t\t$this->exportData[$recordNumber][01]['rpPhone'] = str_replace(\"-\", \"\", $lineEx[6]);\r\n\t\t\t$this->exportData[$recordNumber][01]['rpSs'] = str_replace(\"-\", \"\", $lineEx[7]);\r\n\r\n\t\t\t\tif($lineEx[23]==\"Y\"){ //we have a minor - replace the RP info for the minor's\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorAddress1'] = $lineEx[2];\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorAddress2'] = $lineEx[3];\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorCity'] = $lineEx[4];\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorState'] = '';\r\n\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['rpName'] = $lineEx[0].\", \".$lineEx[1];\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['rpPhone'] = str_replace(\"-\", \"\", $lineEx[6]);\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['rpSs'] = str_replace(\"-\", \"\", $lineEx[7]);\r\n\r\n\t\t\t\t\t/////\r\n\t\t\t\t\t$stateZip = explode(\" \", $lineEx[5]);\r\n\t\t\t\t\t$zipEx = str_replace(\"-\", \"\", $stateZip[2]);\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorState'] = $stateZip[0];\r\n\t\t\t\t\t/////\r\n\r\n\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorZip'] = $zipEx;\r\n\t\t\t\t\tif(strlen($lineEx[7])>0){\r\n\t\t\t\t\t\t$this->exportData[$recordNumber][01]['debtorSs'] = str_replace(\"-\", \"\", $lineEx[0]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$noteString = \"PT DB:\".$this->exportData[$recordNumber][01]['debtorDob'].\" | \";\r\n\t\t\t\t}\r\n\r\n\t\t\t$dateLastPayment = $this->checkDateWithSlashes($lineEx[12]);\r\n\t\t\t$this->exportData[$recordNumber][01]['dateLastPayment'] = $dateLastPayment;\r\n\t\t\t$this->exportData[$recordNumber][01]['listDate'] = $dateOfService;\r\n\r\n\t\t\t$this->exportData[$recordNumber][01]['debtorPhone'] = $lineEx[6];\r\n\t\t\t$noteString .= \"Run Number: \".trim($lineEx[9]).\" | P/U: \".trim($lineEx[24],'\"').\" | DROP: \".trim($lineEx[25],'\"');\r\n\t\t\t$this->exportData = $this->splitNotes($noteString, $recordNumber);\r\n\t\t\treturn $this->exportData;\r\n\t}", "abstract public function setRecordEntity();", "function LoadRowValues(&$rs) {\n\t\tglobal $planilla;\n\t\t$planilla->idPlanilla->setDbValue($rs->fields('idPlanilla'));\n\t\t$planilla->Nombre->setDbValue($rs->fields('Nombre'));\n\t}", "function NewRow() {\n\t\t$row = array();\n\t\t$row['id'] = NULL;\n\t\t$row['nombre_contacto'] = NULL;\n\t\t$row['name'] = NULL;\n\t\t$row['lastname'] = NULL;\n\t\t$row['email'] = NULL;\n\t\t$row['address'] = NULL;\n\t\t$row['phone'] = NULL;\n\t\t$row['cell'] = NULL;\n\t\t$row['is_active'] = NULL;\n\t\t$row['created_at'] = NULL;\n\t\t$row['id_sucursal'] = NULL;\n\t\t$row['documentos'] = NULL;\n\t\t$row['DateModified'] = NULL;\n\t\t$row['DateDeleted'] = NULL;\n\t\t$row['CreatedBy'] = NULL;\n\t\t$row['ModifiedBy'] = NULL;\n\t\t$row['DeletedBy'] = NULL;\n\t\t$row['latitud'] = NULL;\n\t\t$row['longitud'] = NULL;\n\t\t$row['tipoinmueble'] = NULL;\n\t\t$row['id_ciudad_inmueble'] = NULL;\n\t\t$row['id_provincia_inmueble'] = NULL;\n\t\t$row['imagen_inmueble01'] = NULL;\n\t\t$row['imagen_inmueble02'] = NULL;\n\t\t$row['imagen_inmueble03'] = NULL;\n\t\t$row['imagen_inmueble04'] = NULL;\n\t\t$row['imagen_inmueble05'] = NULL;\n\t\t$row['imagen_inmueble06'] = NULL;\n\t\t$row['imagen_inmueble07'] = NULL;\n\t\t$row['imagen_inmueble08'] = NULL;\n\t\t$row['tipovehiculo'] = NULL;\n\t\t$row['id_ciudad_vehiculo'] = NULL;\n\t\t$row['id_provincia_vehiculo'] = NULL;\n\t\t$row['imagen_vehiculo01'] = NULL;\n\t\t$row['imagen_vehiculo02'] = NULL;\n\t\t$row['imagen_vehiculo03'] = NULL;\n\t\t$row['imagen_vehiculo04'] = NULL;\n\t\t$row['imagen_vehiculo05'] = NULL;\n\t\t$row['imagen_vehiculo06'] = NULL;\n\t\t$row['imagen_vehiculo07'] = NULL;\n\t\t$row['imagen_vehiculo08'] = NULL;\n\t\t$row['tipomaquinaria'] = NULL;\n\t\t$row['id_ciudad_maquinaria'] = NULL;\n\t\t$row['id_provincia_maquinaria'] = NULL;\n\t\t$row['imagen_maquinaria01'] = NULL;\n\t\t$row['imagen_maquinaria02'] = NULL;\n\t\t$row['imagen_maquinaria03'] = NULL;\n\t\t$row['imagen_maquinaria04'] = NULL;\n\t\t$row['imagen_maquinaria05'] = NULL;\n\t\t$row['imagen_maquinaria06'] = NULL;\n\t\t$row['imagen_maquinaria07'] = NULL;\n\t\t$row['imagen_maquinaria08'] = NULL;\n\t\t$row['tipomercaderia'] = NULL;\n\t\t$row['imagen_mercaderia01'] = NULL;\n\t\t$row['documento_mercaderia'] = NULL;\n\t\t$row['tipoespecial'] = NULL;\n\t\t$row['imagen_tipoespecial01'] = NULL;\n\t\t$row['email_contacto'] = NULL;\n\t\treturn $row;\n\t}", "function readOne(){\n \n // query to read single record\n $query = \"SELECT\n g.name as group_name, u.id, u.name, u.surname, u.email, u.group_id, u.created\n FROM\n \" . $this->table_name . \" u\n LEFT JOIN\n groups g\n ON u.group_id = g.id\n WHERE\n u.id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of user to be updated\n $stmt->bindParam(1, $this->id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n // set values to object properties\n $this->name = $row['name'];\n $this->surname = $row['surname'];\n $this->email = $row['email'];\n $this->group_id = $row['group_id'];\n $this->created = $row['created'];\n \n }", "public function rechercherUn() {\n\n // query to read single record\n $query = \"SELECT * FROM \" . $this->sNomTable . \"\n LEFT JOIN produit ON idProduit = iNoProduit\n WHERE idContenuCommande = :idContenuCommande\";\n\n // prepare query statement\n $stmt = $this->oConnexion->prepare($query);\n\n // bind id of product to be updated\n $stmt->bindParam(\":idContenuCommande\", $this->idContenuCommande);\n\n // execute query\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->idContenuCommande = $row['idContenuCommande'];\n $this->iQteProduitCommande = $row['iQteProduitCommande'];\n $this->fPrixCommande = $row['fPrixCommande'];\n $this->iNoCommande = $row['iNoCommande'];\n\n // Produit\n $this->iNoProduit = $row['iNoProduit'];\n $this->sSKUProduit = $row['sSKUProduit'];\n $this->sNomProduit = $row['sNomProduit'];\n $this->sMarque = $row['sMarque'];\n $this->fPrixProduit = $row['fPrixProduit'];\n $this->fPrixSolde = $row['fPrixSolde'];\n $this->sDescCourteProduit = $row['sDescCourteProduit'];\n $this->sCouleur = $row['sCouleur'];\n $this->sCapacite = $row['sCapacite'];\n }", "protected function SaveNewRecord()\n\t{\n\t\t//class\n\t\treturn false;\n\t}", "function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\t$this->_data[$key] = $record;\n\n\t\t$this->store();\n\t}", "public function addRecordInDB($nome, $titolo, $testo_presentazione, $prezzo, $id_sede){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $nome = DB_Functions::esc($nome);\r\n $titolo = DB_Functions::esc($titolo);\r\n $testo_presentazione = DB_Functions::esc($testo_presentazione);\r\n $prezzo = DB_Functions::esc($prezzo);\r\n $id_sede = DB_Functions::esc($id_sede);\r\n\r\n //inserimento nuova SEZIONE\r\n $query = \"INSERT INTO SEZIONE (NOME, TITOLO, TESTO_PRESENTAZIONE, PREZZO, ID_SEDE)\r\n\t VALUES ($nome, $titolo, $testo_presentazione, $prezzo, $id_sede)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_SEZIONE) FROM SEZIONE;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_sezione = $resQuery2[\"response\"][0][0];\r\n $this->nome = $nome;\r\n $this->titolo = $titolo;\r\n $this->testo_presentazione = $testo_presentazione;\r\n $this->prezzo = $prezzo;\r\n $this->id_sede = $id_sede;\r\n }\r\n return $resQuery1;\r\n }", "function TransactionRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_transaction\";\n\t\t\n\t\t$pDataHash['data_store']['ticket_id'] = $data[0];\n\t\t$pDataHash['data_store']['transact_no'] = $data[1];\n\t\t$pDataHash['data_store']['transact'] = $data[2];\n\t\t$pDataHash['data_store']['ticket_ref'] = $data[3];\n\t\t$pDataHash['data_store']['staff_id'] = $data[4];\n\t\t$pDataHash['data_store']['previous'] = $data[5];\n\t\t$pDataHash['data_store']['room'] = $data[6];\n\t\t$pDataHash['data_store']['applet'] = $data[7];\n\t\t$pDataHash['data_store']['office'] = $data[8];\n\t\t$pDataHash['data_store']['ticket_no'] = $data[9];\n\t\tif ( $data[10] == '[null]' )\n\t\t\t$pDataHash['data_store']['proom'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['proom'] = $data[10];\n\t\tif ( $data[11] == '[null]' )\n\t\t\t$pDataHash['data_store']['tags'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['tags'] = $data[11];\n\t\tif ( $data[12] == '[null]' )\n\t\t\t$pDataHash['data_store']['clearance'] = 0;\n\t\telse\n\t\t\t$pDataHash['data_store']['clearance'] = $data[12];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "function nextRecord(){\r\n @ $this->Record = mysql_fetch_assoc( $this->Query_ID );\r\n $this->Row += 1;\r\n $this->Errno = mysql_errno();\r\n $this->Error = mysql_error();\r\n $stat = is_array( $this->Record );\r\n if( !$stat ) {\r\n @ mysql_free_result( $this->Query_ID );\r\n $this->Query_ID = 0;\r\n }\r\n return $stat;\r\n }", "public function reset() {\r\n\t\tforeach ($this->_metadata->getNames() as $name){\r\n\t\t\tif($this->isPrimaryKey($name)){\r\n\t\t\t\t$this->_record[$name] = $this->getPrimaryKey() ;\r\n\t\t\t}else{\r\n\t\t\t\t$this->_record[$name] = $this->{$name} ;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->_record ;\r\n\t}", "public function recordGeneral()\n {\n return Datatables()->of(Record::with(\"user\")\n )\n ->editColumn('updated_at', function ($record) {\n return [\n 'display' => $record->updated_at->format('Y-m-d, G:i:s'), //, G:i:s\n 'timestamp' => $record->updated_at->timestamp\n ];\n })\n ->rawColumns(['descripcion', 'descripcion'])\n ->toJson();\n }", "private function getData()\n\t{\n\t\t// get the record\n\t\t$this->record = (array) BackendBannersModel::get($this->id);\n\n\t\t// no item found, throw an exceptions, because somebody is fucking with our URL\n\t\tif(empty($this->record)) $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');\n\t}", "public function addRecordInDB($nome, $id_luogo){\r\n include_once './db_functions.php';\r\n $db = new DB_Functions();\r\n //Escaping\r\n $nome = DB_Functions::esc($nome);\r\n $id_luogo = DB_Functions::esc($id_luogo);\r\n\r\n //inserimento nuova SEDE\r\n $query = \"INSERT INTO SEDE (NOME, ID_LUOGO)\r\n\t VALUES ($nome, $id_luogo)\";\r\n $resQuery1 = $db->executeQuery($query);\r\n\r\n // Se la query ha esito positivo\r\n if ($resQuery1[\"state\"]) {\r\n //Salva valore ID del record creato\r\n $query = \"SELECT max(ID_SEDE) FROM SEDE;\";\r\n $resQuery2 = $db->executeQuery($query);\r\n $this->id_sede = $resQuery2[\"response\"][0][0];\r\n $this->nome = $nome;\r\n $this->id_luogo = $id_luogo;\r\n }\r\n return $resQuery1;\r\n }" ]
[ "0.61961204", "0.61961204", "0.61941385", "0.6107577", "0.6107471", "0.60220647", "0.57134855", "0.5671722", "0.5654312", "0.56349427", "0.5618366", "0.5563854", "0.5544497", "0.55356586", "0.55282825", "0.552464", "0.5518784", "0.55033314", "0.5501368", "0.54788524", "0.54714376", "0.5441823", "0.5437857", "0.54345924", "0.5386232", "0.5369957", "0.5365617", "0.5353112", "0.53477913", "0.5307622", "0.53047574", "0.5291391", "0.5276148", "0.5269582", "0.52652436", "0.5264663", "0.5261405", "0.52603984", "0.5260017", "0.5258661", "0.524404", "0.5236702", "0.52305174", "0.5224158", "0.5204484", "0.5202895", "0.5196187", "0.5191599", "0.51847565", "0.51728463", "0.5170276", "0.5163528", "0.51590264", "0.5141126", "0.51358706", "0.5129737", "0.5128119", "0.5126575", "0.5116898", "0.51047003", "0.5101281", "0.5101178", "0.51011395", "0.50915426", "0.50913244", "0.50881976", "0.5087036", "0.50786775", "0.50731677", "0.5066488", "0.5061727", "0.50578713", "0.50554323", "0.5054964", "0.505113", "0.5049948", "0.50386554", "0.5038384", "0.5035655", "0.50352895", "0.5034741", "0.5025326", "0.50244623", "0.5021357", "0.50185657", "0.5010786", "0.50085354", "0.50023913", "0.50018513", "0.5000844", "0.50007933", "0.50005525", "0.49994403", "0.49993357", "0.49968886", "0.49957624", "0.49945417", "0.49907878", "0.49865174", "0.49839216", "0.49808556" ]
0.0
-1
/ UPDATE Esegue l'update di un record
static function update( $table_name, $record, $values, $id_field = 'id', $formats = array() ) { global $wpdb; if ( is_numeric( $record ) ) { $id_record = $record; } elseif ( is_object( $record ) ) { $id_record = $record->$id_field; } elseif ( is_array( $record ) ) { $id_record = $record[$id_field]; } $where = array( $id_field => $id_record ); if ( empty( $formats ) ) { $result = $wpdb->update( $table_name, $values, $where ); } else { $where_formats = array( '%d' ); $result = $wpdb->update( $table_name, $values, $where, $formats, $where_formats ); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($record);", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function SQL_UPDATE() {\r\n\t}", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function db_update() {}", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "public function updateRecord(){\n\t\tglobal $db;\n $data = array('email'=>$this->email);\n\t\t\t\t$response = $db->update($this->table,$data,\"id = $this->id\");\n\t\treturn $response;\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function update(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check permission to update.\n\t\t$result = $this->clsAccessPermission->toUpdate();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to update!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute Update.\n\t\tif (! $this->objAccessCrud->update ()) {\n\t\t\t$this->msg->setError (\"There were issues on update the record!\");\n\t\t\treturn;\n\t\t}\n\t\t$this->msg->setSuccess (\"Updated the record with success!\");\n\t\treturn;\n\t}", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email1=\\\"$this->email1\\\",address1=\\\"$this->address1\\\",lastname=\\\"$this->lastname\\\",phone1=\\\"$this->phone1\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update($entity){ \n //TODO: Implement update record.\n }", "function update_record () {\n\t\t\n\t\t// validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // update data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"UPDATE customers SET name = ?, email = ?, mobile = ? WHERE id=\".$_GET['id'];\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->update();\n }\n\t\n\t}", "public function update(){\n $sql = \"update \".self::$tablename.\" set correlativo=\\\"$this->correlativo\\\",nombre_instalador=\\\"$this->nombre_instalador\\\",nombre_proyecto=\\\"$this->nombre_proyecto\\\",localizacion=\\\"$this->localizacion\\\",contrato_orden_trabajo=\\\"$this->contrato_orden_trabajo\\\",sector_trabajo=\\\"$this->sector_trabajo\\\",area_aceptada=\\\"$this->area_aceptada\\\",fecha_proyecto=\\\"$this->fecha_proyecto\\\" where id_usuario=$this->id_usuario\";\n Executor::doit($sql);\n }", "public function update(){\r\n\t\tif (!$this->hasChanged) return self::RES_UNCHANGED;\r\n\t\t$table = $this->getTable();\r\n\t\tif ($this->new){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the record doesn't exist.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\tif (!$table->hasPrimaryKey()){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the table does not have a primary key.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$where = array();\r\n\t\t$changeCount = 0;\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\tif ($value->hasChanged()){\r\n\t\t\t\t$vals[] = \"`$name` = \".$value->getSQLValue();\r\n\t\t\t\t$changeCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\t$where[] = \"`$name` = \".$this->values[$name]->getSQLValue();\r\n\t\t}\r\n\t\t$sql = 'UPDATE '.$this->getFullTableName().' SET '.implode(', ',$vals).' WHERE '.implode(' AND ',$where).' LIMIT 1';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to update record in '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function updateRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getEditRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// update\n\t\t\t\t$this->getHandler()->update($record);\n\n\n\t\t\t\t$msg = new Message('You have successful edit a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function testUpdate()\n {\n $id = $this->tester->grabRecord('common\\models\\Comentario', ['id_receita' => 2]);\n $receita = Comentario::findOne($id);\n $receita->descricao = 'novo Comentario';\n $receita->update();\n $this->tester->seeRecord('common\\models\\Comentario', ['descricao' => 'novo Comentario']);\n }", "public function update($tblUpdate);", "private function Update() {\n $Update = new Update;\n $Update->ExeUpdate(self::Entity, $this->Data, \"WHERE id = :id\", \"id={$this->Post}\");\n if ($Update->getResult()):\n $this->Error = [\"As informações de <b>contato</b> foram atualizadas com sucesso!\", WS_ACCEPT];\n $this->Result = true;\n endif;\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function update() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE $this->sqlTable SET \";\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$sql .= \"lp_userid = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$sql .= \"lp_random = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$sql .= \"lp_deadline = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = preg_replace ( '/, $/', '', $sql);\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\t\t\t$arrBindings[] = $this->id;\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "function update($idMedicalRecord) // Implementation \r\n\t\t{\r\n\t\t\t$this->idMedicalRecord = $idMedicalRecord;\r\n\t\t\t$dbo = database::getInstance(); // pass back that database object already created perhaps\r\n\t\t\t$sql = $this->buildQuery('update'); // what we want to do (update records)\r\n\r\n\t\t\t$dbo->doQuery($sql); // execute query statement\r\n\t\t}", "function update(){\n\t\t$this->model->update();\n\t}", "public function update()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_POST['id']);\n $tacgia->anh = $_POST['anh'];\n $tacgia->ten = $_POST['ten'];\n $tacgia->thongtin = $_POST['thongtin'];\n $tacgia->update();\n\n go_back();\n }", "function updateRecord($id, $name, $position, $team, $age, $dateofarticle, $projdraftround, $injsus, $href, $newssrc, $notes, $status)\n\t {\n\t\t //open database connection\n\t\t $conn = $this->openDBConnection();\n\t\t\t\n\t\t\t//update record in database\n\t\t\t$query = \"UPDATE players SET\n \t\tname='$name', \n\t\t\t\t\tposition='$position',\n\t\t\t\t\tteam='$team',\n\t\t\t\t\tage='$age',\n\t\t\t\t\tdateofarticle='$dateofarticle',\n\t\t\t\t\tprojdraftround='$projdraftround',\n\t\t\t\t\tinjsus='$injsus',\n\t\t\t\t\thref='$href',\n\t\t\t\t\tnewssrc='$newssrc',\n\t\t\t\t\tnotes='$notes',\n\t\t\t\t\tstatus='$status'\n\t\t WHERE id = {$id}\";\n\t\t\n\t\t \n\t\t\tif(mysqli_query($conn, $query))\n\t\t\t{\n\t\t\t\t//echo '<script type=\"text/javascript\">eval(alert(\"Success, '.$name.'\\'s record has been updated. You will be notified on '.$this->createTargetDate($timespan).' to contact this person!\"));</script>';\n\t\t\t\t//header('Location: http://localhost/FantasyFootballDraft/');\n\t\t\t} else {\n\t\t\t echo 'Error: '. mysqli_error($conn);\t\n\t\t\t}\n\t\t\t\n\t\t\t//close connection\n\t\t mysqli_close($conn);\n\t\t \n\t }", "public function update($data) {}", "public function update($data) {}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",short_name=\\\"$this->short_name\\\",is_active=\\\"$this->is_active\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set Origen='$this->Origen',Fechap='$this->Fechap',Horap='$this->Horap',Cod_Referencia='$this->Referencia',Nombre_Referencia='$this->Nombre',Ref_Tela='$this->Reftela',Pinta='$this->Pinta',Color='$this->Color',Proceso='$this->Proceso',Ubicacion='$this->Ubicacion',SKU='$this->Sku',Maquina='$this->Maquina',Longitud_Inicial='$this->Longitudini',Longitud_Final='$this->Longitudfin',Peso='$this->Peso',Grados_PFoAT800K='$this->Plancha',Grados_Plato='$this->Plato',Grados_Pie='$this->Pie',Grados_Aire_S='$this->Airesup',Grados_Aire_I='$this->Aireinf',Caudal_Sup='$this->Caudalsup',Caudal_Inf='$this->Caudalinf',Presion='$this->Presion',Velocidad='$this->Velocidad',Velocidad_Sup='$this->Velocidad_Sup',Velocidad_Inf='$this->Velocidad_Inf',Intensidad='$this->Intensidad',Tiempo_Exp='$this->Tiempo',Resultado='$this->Resultado',Dinamometro='$this->Dinamometro',Observaciones1='$this->Observaciones' where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function UpdateRecord($id,$param) {\n $this->db->where('id_form_bd',$id);\n $this->db->update('form_bd',$param);\n }", "public function update()\n\t{\n\t\t$crud = $this->crud->find($_POST['id']);\n\t\t$curd->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->update();\n\t\t$this->redirect('crud');\n\t}", "public function updateRow($row);", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set nombre=\\\"$this->name\\\", razon_social=\\\"$this->razon\\\", status=$this->is_active where id_banco=$this->id_banco\";\n\t\tExecutor::doit($sql);\n\t}", "function update(){\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t//Variables for holding entity data\n\t\t\t\t$i = $_POST['i'];\n\t\t\t\t$cr = $_POST['creator'];\n\t\t\t\t$ti = $_POST['title'];\n\t\t\t\t$ty = $_POST['type'];\n\t\t\t\t$id = $_POST['identifier'];\n\t\t\t\t$da = $_POST['date'];\n\t\t\t\t$la = $_POST['language'];\n\t\t\t\t$de = $_POST['description'];\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\t\tif($conn){\n\t\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE eBook_MetaData SET creator='$cr', title='$ti', type='$ty', identifier='$id', date='$da', language='$la', description='$de' WHERE id='$i'\";\n\t\t\t\t\t$data = mysqli_query($conn, $sql);\n\n\t\t\t\t\tif(!$data){\n\t\t\t\t\t\techo \"error\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"data updated\";\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$conn = null;\n\t\t\t\t}", "function UpdateRecord($tabel_name='',$where='', $param)\n {\n $this->db\n ->where($where)\n ->update($tabel_name, $param);\n }", "protected function update()\n\t{\n\t\t//append ID to fields\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tupdate Booth\n\t\t\tset BoothNum = ?\n\t\t\twhere BoothID = ?\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "public function update()\n\t{\n\t\t$this->user->db_update();\n\t}", "public function testUpdate(): void { }", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update() {\n global $db;\n $this->_preupdate();\n $sql_set = '';\n $data = array();\n foreach($this->_magicProperties as $key=>$value)\n {\n $sql_set .= \"`\".addslashes($key).\"`=\";\n $sql_set .= \"?,\";\n $data[] = $value;\n }\n $sql_set = substr($sql_set, 0, -1);\n\n $query = \"UPDATE {$this->table} SET $sql_set WHERE \".$this->id_field.\"=?;\";\n $data[] = $this->{'get'.$this->id_field}();\n\n $result = $db->query($query,$data);\n $this->_postupdate($result);\n return $result;\n }", "function update($id, $data)\n {\n $this->db->where($this->id,$id);\n $this->db->update($this->table, $data);\n }", "public function update(Tinebase_Record_Interface $_record) {\n }", "public function update() {\n\t\t$date = date(\"Y-m-d H:i:s\");\n\n\t\t$query=mysql_query(\"update \".$this->table.\" set \".$this->column.\" = '\".mysql_escape_string($this->value).\"', modified_by = \".$this->userID.\", modified='\".$date.\"' where id=\".$this->id);\n\n\t}", "function updateRecord()\n{\n\n // Connect to DB\n require('connect.php');\n\n //User inputs for id, idiom, occurence and translation \n // in the record they'd like to edit \n\n $id = $_POST['update-id'];\n $idiom = $_POST['update-idiom'];\n $occurence = $_POST['update-occurence'];\n $translation = $_POST['update-translation'];\n\n // Update query\n $sql = \"UPDATE `meno` \n SET\n `idiom` = '$idiom',\n `occurence` = '$occurence',\n `translation` = '$translation',\n `commentary` = '$commentary'\n WHERE `id` = '$id' \";\n\n $update_query = mysqli_query($connection, $sql);\n\n if (!$update_query) {\n echo \"Error: \" . $sql . mysqli_error($connection);\n }\n\n mysqli_close($connection);\n\n header('Location: index.php');\n\n // check if save button has been clicked \n}", "public function update()\n\t{\n\t\t$mytable = WikiRevision::$table;\n\t\t$buf = \"UPDATE $mytable SET \";\n\t\tfor ($i = 0; $i < count(WikiRevision::$fields); $i++) {\n\t\t\t$buf .= WikiRevision::$fields[$i] . \" = '\" . DBConnection::get()->handle()->real_escape_string($this->data[$fields[$i]]) . \"'\" . ($i == count(WikiRevision::$fields) - 1)?(', '):(' ');\n\t\t}\n\t\t$buf .= \"WHERE rev_id = \" . $data['rev_id'];\n\t\tDBConnection::get()->handle()->query($buf);\n\t}", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}", "function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }", "public function update($param)\n {\n $row = Budget::find($param);\n if (!$row) return abort(404);\n\n # update data \n $row->update([\n // 'kode' => request('kode'),\n // 'uraian' => request('uraian'),\n 'pagu' => request('pagu'),\n // 'realisasi' => request('realisasi'),\n // 'sisa' => request('pagu'),\n 'keterangan' => request('keterangan'),\n ]);\n \n # Tampilin flash message\n flash('Selamat data telah berhasil di update')->success();\n # Kalo udah insert data, redirect ke halaman anggaran\n return redirect()->route('budget.index');\n\n }", "abstract protected function updateModel();", "public function update() {\n if (!$this->id) {\n //echo \"No se tiene referencia al ID del objeto a actulizar.\";\n throw new Exception(\"No se tiene referencia al ID del objeto a actulizar.\");\n }\n\n $sql = \"UPDATE contratos SET numero_contrato=:numero_contrato, objeto_contrato=:objeto_contrato, presupuesto=:presupuesto, fecha_estimada_finalizacion=:fecha_estimada_finalizacion WHERE id=:id\";\n $args = array(\n \":id\" => $this->id,\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n return !$stmt ? false : true;\n }", "public function update() {\n $this->connection->update(\n \"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), array(\"idchangemoney\" => $this->observer->idchangemoney), $this->user->iduser\n );\n }", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function update($id);", "public function update($id);", "public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function updateRecord() {\r\n\t\tif (isset($_POST['level']) && $_POST['level']=='header') $this->updateHeader();\r\n\t\tif (isset($_POST['level']) && $_POST['level']=='detail') $this->updateDetail();\r\n\t}", "public function update($id) {\r\n //\r\n }", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "function updateRecord($table_name,$uid,$update_field,$update_value,$conn){\n\t\t$update_echo = '';\n\n\t\tfor($i=0;$i<count($update_field);$i++){\n\n\t\t\tif ($i==(count($update_field)-1)) {\n\t\t\t\t$update_echo = $update_echo.$update_field[$i].\"='\".$update_value[$i].\"'\";\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$update_echo = $update_echo.$update_field[$i].\"='\".$update_value[$i].\"', \";\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$sql = \"UPDATE $table_name SET $update_echo WHERE uid=$uid\";\n\n\t\techo $sql;\n\t\t\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t echo \"Record updated successfully\";\n\t\t} else {\n\t\t echo \"Error updating record: \" . $conn->error;\n\t\t}\n\t}", "protected function _update()\n\t{\n\t}", "public function update($id) //Ändra befintlig boking\n\t{\n\t\t//\n\t}", "public function update($id){\n\t\t//\n\t}", "public function update($id){\n\t\t//\n\t}", "abstract public function updateRecord($tableName, $record, $where = '');", "function update($taak)\n {\n $this->db->where('id', $taak->id);\n $this->db->update('taak', $taak);\n }", "public function Do_update_Example1(){\n\n\t}", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$this->featured_image->OldUploadPath = \"../uploads/product/\";\n\t\t\t$this->featured_image->UploadPath = $this->featured_image->OldUploadPath;\n\t\t\t$rsnew = array();\n\n\t\t\t// cat_id\n\t\t\t$this->cat_id->SetDbValueDef($rsnew, $this->cat_id->CurrentValue, 0, $this->cat_id->ReadOnly || $this->cat_id->MultiUpdate <> \"1\");\n\n\t\t\t// company_id\n\t\t\t$this->company_id->SetDbValueDef($rsnew, $this->company_id->CurrentValue, 0, $this->company_id->ReadOnly || $this->company_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_model\n\t\t\t$this->pro_model->SetDbValueDef($rsnew, $this->pro_model->CurrentValue, NULL, $this->pro_model->ReadOnly || $this->pro_model->MultiUpdate <> \"1\");\n\n\t\t\t// pro_name\n\t\t\t$this->pro_name->SetDbValueDef($rsnew, $this->pro_name->CurrentValue, NULL, $this->pro_name->ReadOnly || $this->pro_name->MultiUpdate <> \"1\");\n\n\t\t\t// pro_description\n\t\t\t$this->pro_description->SetDbValueDef($rsnew, $this->pro_description->CurrentValue, NULL, $this->pro_description->ReadOnly || $this->pro_description->MultiUpdate <> \"1\");\n\n\t\t\t// pro_condition\n\t\t\t$this->pro_condition->SetDbValueDef($rsnew, $this->pro_condition->CurrentValue, NULL, $this->pro_condition->ReadOnly || $this->pro_condition->MultiUpdate <> \"1\");\n\n\t\t\t// pro_features\n\t\t\t$this->pro_features->SetDbValueDef($rsnew, $this->pro_features->CurrentValue, NULL, $this->pro_features->ReadOnly || $this->pro_features->MultiUpdate <> \"1\");\n\n\t\t\t// post_date\n\t\t\t$this->post_date->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['post_date'] = &$this->post_date->DbValue;\n\n\t\t\t// ads_id\n\t\t\t$this->ads_id->SetDbValueDef($rsnew, $this->ads_id->CurrentValue, NULL, $this->ads_id->ReadOnly || $this->ads_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_base_price\n\t\t\t$this->pro_base_price->SetDbValueDef($rsnew, $this->pro_base_price->CurrentValue, NULL, $this->pro_base_price->ReadOnly || $this->pro_base_price->MultiUpdate <> \"1\");\n\n\t\t\t// pro_sell_price\n\t\t\t$this->pro_sell_price->SetDbValueDef($rsnew, $this->pro_sell_price->CurrentValue, NULL, $this->pro_sell_price->ReadOnly || $this->pro_sell_price->MultiUpdate <> \"1\");\n\n\t\t\t// featured_image\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->ReadOnly && strval($this->featured_image->MultiUpdate) == \"1\" && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->Upload->DbValue = $rsold['featured_image']; // Get original value\n\t\t\t\tif ($this->featured_image->Upload->FileName == \"\") {\n\t\t\t\t\t$rsnew['featured_image'] = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$rsnew['featured_image'] = $this->featured_image->Upload->FileName;\n\t\t\t\t}\n\t\t\t\t$this->featured_image->ImageWidth = 875; // Resize width\n\t\t\t\t$this->featured_image->ImageHeight = 665; // Resize height\n\t\t\t}\n\n\t\t\t// folder_image\n\t\t\t$this->folder_image->SetDbValueDef($rsnew, $this->folder_image->CurrentValue, \"\", $this->folder_image->ReadOnly || $this->folder_image->MultiUpdate <> \"1\");\n\n\t\t\t// pro_status\n\t\t\t$tmpBool = $this->pro_status->CurrentValue;\n\t\t\tif ($tmpBool <> \"Y\" && $tmpBool <> \"N\")\n\t\t\t\t$tmpBool = (!empty($tmpBool)) ? \"Y\" : \"N\";\n\t\t\t$this->pro_status->SetDbValueDef($rsnew, $tmpBool, \"N\", $this->pro_status->ReadOnly || $this->pro_status->MultiUpdate <> \"1\");\n\n\t\t\t// branch_id\n\t\t\t$this->branch_id->SetDbValueDef($rsnew, $this->branch_id->CurrentValue, NULL, $this->branch_id->ReadOnly || $this->branch_id->MultiUpdate <> \"1\");\n\n\t\t\t// lang\n\t\t\t$this->lang->SetDbValueDef($rsnew, $this->lang->CurrentValue, \"\", $this->lang->ReadOnly || $this->lang->MultiUpdate <> \"1\");\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->UploadPath = \"../uploads/product/\";\n\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file)) {\n\t\t\t\t\t\t\t\t$OldFileFound = FALSE;\n\t\t\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < $OldFileCount; $j++) {\n\t\t\t\t\t\t\t\t\t$file1 = $OldFiles[$j];\n\t\t\t\t\t\t\t\t\tif ($file1 == $file) { // Old file found, no need to delete anymore\n\t\t\t\t\t\t\t\t\t\tunset($OldFiles[$j]);\n\t\t\t\t\t\t\t\t\t\t$OldFileFound = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($OldFileFound) // No need to check if file exists further\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx($this->featured_image->PhysicalUploadPath(), $file); // Get new file name\n\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\n\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1) || file_exists($this->featured_image->PhysicalUploadPath() . $file1)) // Make sure no file name clash\n\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename($this->featured_image->PhysicalUploadPath(), $file1, TRUE); // Use indexed name\n\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file, ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1);\n\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\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\t$this->featured_image->Upload->DbValue = empty($OldFiles) ? \"\" : implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $OldFiles);\n\t\t\t\t\t$this->featured_image->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\n\t\t\t\t\t$this->featured_image->SetDbValueDef($rsnew, $this->featured_image->Upload->FileName, \"\", $this->featured_image->ReadOnly || $this->featured_image->MultiUpdate <> \"1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t\t\t$NewFiles2 = array($rsnew['featured_image']);\n\t\t\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $NewFiles[$i];\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t\t\t\t\t\tif (@$NewFiles2[$i] <> \"\") // Use correct file name\n\t\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $NewFiles2[$i];\n\t\t\t\t\t\t\t\t\t\tif (!$this->featured_image->Upload->ResizeAndSaveToFile($this->featured_image->ImageWidth, $this->featured_image->ImageHeight, EW_THUMBNAIL_DEFAULT_QUALITY, $NewFiles[$i], TRUE, $i)) {\n\t\t\t\t\t\t\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UploadErrMsg7\"));\n\t\t\t\t\t\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$NewFiles = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\tfor ($i = 0; $i < $OldFileCount; $i++) {\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\n\t\t\t\t\t\t\t\t@unlink($this->featured_image->OldPhysicalUploadPath() . $OldFiles[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\n\t\t// featured_image\n\t\tew_CleanUploadTempPath($this->featured_image, $this->featured_image->Upload->Index);\n\t\treturn $EditRow;\n\t}", "function adv_update($table, array $data, array $where);", "public function actionUpdate() //update value from default page to DB\n {\n\n\n $model = $this->findModel($_POST['ExamRoomDetail']['rooms_detail_date'],\n $_POST['ExamRoomDetail']['rooms_detail_time'],\n $_POST['ExamRoomDetail']['rooms_id']\n );\n if(isset($_POST)) {\n $model->load(Yii::$app->request->post());\n $update = $model;\n $update->exam_room_status = $_POST['ExamRoomDetail']['exam_room_status'];\n $update->save();\n }\n\n }", "function upd($id=NULL){\r\n\t\t$ID = $id ? $id : $this->Id;\r\n\t\tif(!$ID)return false;\r\n\t\tif($ID)$this->HDB->q(\"update Objects set Updated = \".time().\" where Id = $ID\");\r\n\t}", "public function update($id)\n {\n\n\n }", "public function update($id)\n\t {\n\t //\n\t }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($entity);", "public function update($entity);", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_identification \n\t \t\t\tSET\tidf_identification_detail_en=?, idf_identification_detail_th=?, idf_pos_id=?, idf_ctg_id=? \n\t \t\t\tWHERE idf_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id, $this->idf_id));\n\t\t\n\t }", "static function update($connection, $id, $data, $new_value)\n {\n }", "public function update($id){\n //\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function update($id) {\n \n }", "public function update($id) {\n \n }", "function updateRecord()\n\t{\n\t\t$data['roleName'] = $this->roleName;\n\t\t$data['roleDesc'] = $this->roleDesc;\n\t\t\n\t $this->db->where('roleID', $this->roleID);\n\t\t$this->db->update('roles', $data); \n\t\t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function update($id)\r\n {\r\n //\r\n }", "public function update($modelData) {\n// codigoCliente = ? ,\n// codigoPedido = ?, \n// monto = ? WHERE codigo = ?\"; \n// \n// $stmt = $this->mysql->getStmt($sql);\n// $stmt->bind_param(\"iidi\", $modelData['codigoCliente'], \n// $modelData['codigoPedido'], \n// $modelData['monto'],\n// $modelData['codigo']);\n// $stmt->execute();\n }", "public function update($id, $input);" ]
[ "0.8098108", "0.7908936", "0.77089304", "0.75681126", "0.7560004", "0.7507582", "0.7496554", "0.7477524", "0.7468781", "0.7454863", "0.7438649", "0.74355865", "0.7403584", "0.73910785", "0.7337663", "0.7326156", "0.7275012", "0.72730994", "0.72026724", "0.7195757", "0.7190759", "0.7186", "0.71605784", "0.7152011", "0.7152011", "0.7116226", "0.71125215", "0.7111802", "0.71093476", "0.7106103", "0.71054775", "0.71054775", "0.70712775", "0.7069314", "0.70679003", "0.7058791", "0.7047369", "0.7020814", "0.7019939", "0.69958687", "0.69891566", "0.69762546", "0.69725704", "0.69499767", "0.69495565", "0.6947121", "0.6944687", "0.6936271", "0.69171846", "0.69166964", "0.69140065", "0.690633", "0.6903723", "0.6903723", "0.6903723", "0.6903723", "0.6903723", "0.6891146", "0.6885901", "0.687891", "0.6875839", "0.68755937", "0.6871203", "0.68601966", "0.6860042", "0.6860042", "0.68464285", "0.6844419", "0.68433166", "0.68324906", "0.68255883", "0.6818899", "0.6808579", "0.68032867", "0.6792663", "0.6792663", "0.6790989", "0.67882913", "0.67862386", "0.6780273", "0.677443", "0.6767436", "0.67633563", "0.67591166", "0.67526084", "0.67484486", "0.67484486", "0.67484486", "0.67484486", "0.6747335", "0.6747335", "0.6741863", "0.67405576", "0.6739708", "0.6737177", "0.6737143", "0.6737143", "0.6730911", "0.67281204", "0.67265946", "0.67210853" ]
0.0
-1
Extra Restituisce il numero di record della tabella
static function count( $table_name ) { global $wpdb; $sql = <<< SQL SELECT COUNT(*) AS count FROM `{$table_name}` SQL; return absint( $wpdb->get_var( $sql ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNbrecord(): int\n {\n return 5;\n }", "public function getRecordsNumbers() {}", "public function fetchNrRecordsToGet();", "function idData($table){\n $array=get($table,'id');\n $id=max($array)+1;\n return $id;\n }", "public function modelTotalRecord(){\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select id from inventory\");\n // tra ve so ban ghi\n return $query->rowCount();\n }", "public function modelTotalRecord(){\n\t\t\t$key = isset($_GET[\"key\"])?$_GET[\"key\"]:\"\";\n\t\t\t//lay bien ket noi\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->prepare(\"select id from products where name like '%$key%' or description like '%$key%'\");\n\t\t\t//thuc thi truy van. Neu khong co tham so o cau truy van thi ghi array rong\n\t\t\t$query->execute(array());\n\t\t\t//tra ve so luong ban ghi\n\t\t\treturn $query->rowCount() > 0 ? $query->rowCount() : 1;\n\t\t}", "public function getNumberOfRecords() {}", "public function countEtat_compte(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "function getIDTabelRiwayatPangkat(){\n\t$query = mysql_query(\"SELECT MAX(id_data) as 'Max' FROM tbl_riwayat_pangkat\") or die(mysql_error());\n\t$row = mysql_fetch_array($query);\n\t$maks = $row['Max'];\n\t$ID = \"\";\n\t\n\tif($maks > 0){\n\t\t$ID = $maks + 1;\n\t}else{\n\t\t$ID = 1;\n\t}\n\t\n\treturn $ID;\n}", "public function numerodocumento(){\n\n $row = DocumentoCabecera::where('id_tipodocumento', '=', '1')->orderbyDesc('fechaemision')->select('numero')->first();\n\n if($row == null){\n $numero = 100;\n }else {\n $numero = $row->numero + 1;\n }\n\n\n return response()->json([\n 'data' => $numero\n ], 200);\n\n }", "function numRecord($tabla,$where){\n\t$query=$GLOBALS['cn']->query('SELECT id FROM '.$tabla.' '.$where);\n\treturn mysql_num_rows($query);\n}", "function numRecord($tabla,$where){\n\t$query=$GLOBALS['cn']->query('SELECT id FROM '.$tabla.' '.$where);\n\treturn mysql_num_rows($query);\n}", "function obtenirNbEtab ($connexion) {\r\n\r\n $req = \"SELECT COUNT(*) FROM Etablissement\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt -> fetchColumn ();\r\n\r\n }", "abstract public function recordCount(): int;", "public function generatenewidBarang()\n {\n // mengambil seluruh isi tabel\n $temp = $this->findAll();\n // mengambil row terakhir \n \t$last = end($temp); \n\n // jika $last kosong (jika tabel masih kosong)\n if ($last == Null){\n // mengenerate id baru dengan nilai 1\n $new_id = 1;\n }else{\n // mengenerate id baru dengan nilai id terakhir + 1\n $new_id = $last['id_barang']+1;\n }\n\n // mengembalikan nilai \n return $new_id;\n }", "abstract protected function _recordcount($rs);", "function numfiche($pdo){\n\t$testnum=1;\n\twhile($testnum>0){\n\t\t\t$val1=lettre_mdp(3);\n\t\t\t$val2=chiffre_mdp(999);\n\t\t$val3=lettre_mdp(3);\n\t\t$numfiche1=$val1.$val2.$val3;\n\t\t$testnum=numRowTableDataWhere('inscription','num_inscription',$numfiche1,$pdo);\n\t}\n\treturn $numfiche1;\n}", "public function nombreTotalTableau(){\n $req = $this->db->query(\"SELECT COUNT(*) AS nb FROM tableau\");\n $sortie = $req->fetch(PDO::FETCH_OBJ);\n return $sortie->nb;\n }", "function NumRows() {}", "function trovaNuovoNumero($gTables) {\n\t// https://sourceforge.net/p/gazie/discussion/468173/thread/572dcb76/\n\t//\n\t$orderBy = \"datemi desc, numdoc desc\";\n\tparse_str(parse_url($_POST['ritorno'],PHP_URL_QUERY),$output);\n\t$rs_ultimo_documento = gaz_dbi_dyn_query(\"numdoc\", $gTables['tesbro'], $gTables['tesbro'].\".tipdoc=\".\"'\".$output['auxil'].\"'\", $orderBy, 0, 1);\n\t$ultimo_documento = gaz_dbi_fetch_array($rs_ultimo_documento);\n\t// se e' il primo documento dell'anno, resetto il contatore\n\tif ($ultimo_documento) {\n\t/*$orderBy = \"datemi desc, numdoc desc\";\n\t$rs_ultimo_documento = gaz_dbi_dyn_query(\"numdoc\", $gTables['tesbro'], 1, $orderBy, 0, 1);\n\t$ultimo_documento = gaz_dbi_fetch_array($rs_ultimo_documento);\n\tse e' il primo documento dell'anno, resetto il contatore\n\tif ($ultimo_documento) {\n\t*/\n $numdoc = $ultimo_documento['numdoc'] + 1;\n } else {\n $numdoc = 1;\n }\n return $numdoc;\n}", "public function numFields();", "function numero()\r\n {\r\n \r\n $numrec = $this->db->query(\"SELECT * FROM parametros\")->result_array();\r\n return $numrec;\r\n }", "private function record_count() {\n\t\t//Currently id is assumed\n\t\t$sql = \"SELECT COUNT(id) FROM {$this->table_name}\";\n\t\t$r = $this->do_query($sql);\n\t\t\n\t\twhile($row = mysql_fetch_array($r)) {\n\t\t\treturn $row[0];\n\t\t}\n\t}", "public function record_count()\n {\n return $this->db->count_all('punti_spesi');\n }", "public function totalRecord(){\n\t\t\t//lay bien ket noi csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc thi truy van\n\t\t\t$query = $conn->query(\"select * from work inner join content_time on work.id=content_time.fk_work_id inner join work_time on work_time.id=content_time.fk_worktime_id\");\n\t\t\t//tra ve tong so luong ban ghi\n\t\t\treturn $query->rowCount();\n\t\t}", "public function numberOfRecords(): int\n {\n return $this->number_of_records;\n }", "public function countProduit(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "function nombrecampo($numcampo){return mysqli_field_name($this->Consulta_ID, $numcampo);}", "public function modelTotalRecord(){\n\t\t\t$total = DB::rowCount(\"select id from products\");\n\t\t\treturn $total;\n\t\t}", "public function numberOfFields();", "public function getNumRows();", "function RowCount() {}", "function nombreTabla($result,$indice){\n\t if (isset($result) and isset ($indice)){\n\t\treturn mysql_field_table($result, $indice);\n\t }\n\t}", "abstract function result_row_by_number($res,$rowid,$fld=null);", "public function modelTotalRecord(){\r\n\t\t\t//lay bien ket noi\r\n\t\t\t$conn = Connection::getInstance();\r\n\t\t\t//truy van csdl, tra ket qua ve boen object\r\n\t\t\t$query = $conn->query(\"select category_id from tbl_category\");\r\n\t\t\t// dem so luong ket qua -> dem so luong ban ghi \r\n\t\t\t$total = $query->rowCount();\r\n\t\t\t//----\r\n\t\t\t//tra ve ket qua \r\n\t\t\treturn $total;\r\n\t\t}", "public function rows(){\n return $this->rowNum(\"SELECT * FROM Anuncios\");\n }", "public function NumberOfPrimaryKeyFields() {\n return 1;\n }", "public function NumberOfPrimaryKeyFields() {\n return 1;\n }", "function tailleTab($valeur){\r\n $taille = 0;\r\n foreach($valeur as $element){\r\n $taille++;\r\n }\r\n return $taille;\r\n }", "public function numOfRows();", "function obtenirNbEtabOffrantChambres ($connexion) {\r\n\r\n $req = \"SELECT COUNT(DISTINCT idEtab) FROM Offre\";\r\n $stmt = $connexion -> prepare ($req);\r\n $stmt -> execute ();\r\n return $stmt -> fetchColumn ();\r\n\r\n }", "function RecordCount() {}", "function record_count()\n\t{\n\t\t $sql = \"SELECT COUNT(*) As cnt FROM pof\";\n\t $q = $this->db->query($sql);\n\t $row = $q->row();\n\t return $row->cnt;\n\t}", "public function getDataEditeur1($num) {\r\n\t\t$this->load->database('default');\r\n\t\t$sql=\"select count(editeur.numEditeur) as temp from editeur,reservation,festival where editeur.numEditeur=reservation.numEditeur and reservation.numFestival=?\";\r\n\t\t$res=$this->db->query($sql,$num);\r\n\t\t$row = $res->row_array();\r\n\t\treturn $row ;\r\n}", "abstract public function getNumRows();", "abstract public function getNumRows();", "abstract public function getNumFields();", "function ifx_num_fields($result_id)\n{\n}", "public function getRowNumber()\n {\n $this->sql_query->count($this->tableName);\n $result = $this->sql_query->getSingleResult();\n return $result[0];\n }", "public function getNumRows(){\n return $this->numrows;\n }", "public function getNumber()\n {\n return $this->model->count();\n }", "function countData($table) {\n global $conn;\n $sql = \"SELECT * FROM\". \" \" . $table;\n $result = $conn->query($sql);\n if($result->num_rows > 0) {\n $totalno = $result->num_rows;\n } else {\n $totalno = 0;\n }\n return $totalno;\n }", "public function numOfFields();", "public function rowCounter($table,$id_field){\n\t\t$query=\"SELECT \".$id_field.\" FROM \".$table;\n\t\t$numRows=$this->rows($query);\n\t\treturn $numRows;\n\t}", "function get_nombre_mapa($num)\n {\n $this->db->where('nu_tabulado',$num);\n $q = $this->db->get('tabulados_nombre_mapa');\n return $q;\n }", "public function record_count() {\r\n return $this->db->count_all(\"pessoafisica\");\r\n }", "function SelectRecordCount1($istanza) {\n $sSql = $istanza->SelectSQL();\n $cnt = $istanza->TryGetRecordCount($sSql);\n if ($cnt == -1) {\n $conn = &$istanza->Connection();\n if ($rs = $conn->Execute($sSql)) {\n $cnt = $rs->RecordCount();\n $rs->Close();\n }\n }\n return intval($cnt);\n }", "protected function IdTableTiene ($nombreCancion,$nombreLista)\n {\n $lista = Model_tiene::find('all', array\n (\n 'where' => array\n (\n array('id_lista'=>$this->idNameList($nombreLista)),\n array('id_cancion'=>$this->idNameSong($nombreCancion))\n )\n ));\n if(!empty($lista))\n {\n $id1=0;\n $id2=0;\n \n foreach ($lista as $key => $value)\n {\n $id2 = $lista[$key]->id_cancion;\n } \n\n return $id2; \n }\n }", "public function newContactsNumber()\n {\n // On calcule le nombre de recontacs demandés\n $sql = 'SELECT `item_id`\n FROM `items`\n WHERE `mission_id` = :mission\n AND `item_statut` = 4';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);\n $query->execute();\n\n // On récupère le nombre demandé\n return $query->rowCount();\n }", "public function get_siswa_numbers() {\n $this->db->select('id');\n $this->db->from('tb_siswa');\n $query = $this->db->get();\n return $query->num_rows();\n }", "public function getRecordsTotal(): int;", "public function ultimoID()\n {\n $sentencia = \"SELECT id, clNumReporte FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n\n return $registros;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "function modeling_publicusershistoriakses_createid( $tbl_publicusers_historiakses ){\n$sql = mysql_query(\"SELECT * FROM $tbl_publicusers_historiakses ORDER BY id DESC\");\n$result = mysql_fetch_object($sql);\n$id = $result->id + 1;\nreturn $id;\n}", "public function countt($info)\r\n{\t\t\t$stmt = $this->_db->prepare(\"SELECT COUNT(*) FROM Trajet where ID_conducteur=:id\");\r\n\t\t $stmt->bindValue(\":id\",$info); \r\n\t\t $stmt->execute();\r\n\treturn $stmt->fetchColumn();\r\n}", "function recuperaDatosMetasId(){\n $folio=0;\n $tmp=array();\n if(trim($this->data['folio'])!= \"\"){\n $tmp=explode('-',$this->data['folio']);\n $folio= $tmp[0] + 0;\n if($folio > 0){\n $this->arrayDatosMetas=$this->regresaMetasActividad($folio);\n }\n }\n }", "function jumlahdata() {\r\n\t\t\treturn $this->db->count_all('tb_kelas');\t\t\t\r\n\t\t\t}", "public function examenes_tatalExamenes(){ \t\n\n\t\t\t$resultado = array();\n\t\t\t\n\t\t\t$query = \"Select count(idExamen) as cantidadExamenes from tb_examenes \";\n\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado['cantidadExamenes'];\t\t\t\n\t\t\t\n\t\t\t\n }", "static function getNum($id_lang=null, $table=null)\n {\n global $config;\n return parent::getNum($id_lang, $config->prefix.self::$table);\n }", "public function jumlahSiswa(){\n $sql = \"SELECT count(id) as id FROM db_data_siswa\";\n $result = $this->db->query($sql);\n return $result->row()->id;\n }", "public function getFieldCount() {}", "function getNumRowsData($data,$table)\n {\n $this->db->where(array('role_id'=>$data));\n return $this->db->count_all_results($table);\n }", "function getTableSize(){\n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT count(id) as IDcount\n\t\t FROM \".$this->penelopeTabID.\"\n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql);\n\t\t if($result){\n\t\t\t\t$this->recordCount = $result[0][\"IDcount\"]+0;\n\t\t }\n\t\t else{\n\t\t\t\treturn false;\n\t\t }\n\t }", "public function rowCount() {}", "function setID(){\n $getid = getData();\n $id = 0;\n if($getid){\n while ($row = mysqli_fetch_assoc($getid)){\n $id = $row['FacID'];\n }\n }\n return ($id + 1);\n }", "static public function CountRecord()\n {\n }", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mailingdataavmedgroupinvoicesrecord30\");\n\t}", "function tabledata_Fiche($table, $serveur, $field, $key , $idLigne, $modeFiche =\"voir\")\r\n{\r\n\r\n $nombre_Enregistrements = 0;\r\n\r\n // $mode : possible ajout, modif, voir , effacer\r\n switch ($modeFiche)\r\n {\r\n case \"ajout\" :\r\n $boolSQL = false;\r\n $txtReadonly = \"\";\r\n $nombre_Enregistrements = 1; // pour forcer passage car pas de requete\r\n break;\r\n case \"effacer\" :\r\n $boolSQL = true;\r\n $txtReadonly = \" READONLY \";\r\n break;\r\n case \"modif\" :\r\n $boolSQL = true;\r\n $txtReadonly = \"\";\r\n break;\r\n case \"voir\" :\r\n $boolSQL = true;\r\n $txtReadonly = \" READONLY \";\r\n break;\r\n default :\r\n $boolSQL = false;\r\n $txtReadonly = \" READONLY \";\r\n }\r\n\r\n if ($boolSQL)\r\n {\r\n $sqlResult = tabledata_Cde_select($table , $field,\"\",\"\", $key, $idLigne);\r\n $nombre_Enregistrements = sql_count($sqlResult); //2.0\r\n }\r\n\r\n if ($nombre_Enregistrements>0)\r\n {\r\n $total = '';\r\n $hiddens = '';\r\n\r\n if ($boolSQL)\r\n {\r\n $tabUnEnregistrement = sql_fetch($sqlResult);\r\n }\r\n else\r\n {\r\n foreach ($field as $k => $v)\r\n {\r\n $tabUnEnregistrement[$k] = \"\";\r\n }\r\n }\r\n\r\n foreach ($field as $k => $v)\r\n {\r\n if (array_search($k, $key) == \"PRIMARY KEY\")\r\n {\r\n if ($boolSQL)\r\n {\r\n $strDebut = \"Enregistrement ayant comme cl&#233; primaire :<br/><i><b>\"\r\n .$k.\"='\".$tabUnEnregistrement[$k].\"'</b></i><br/>\";\r\n }\r\n }\r\n else\r\n {\r\n preg_match(\"/^ *([A-Za-z]+) *(\\(([^)]+)\\))?(.*DEFAULT *'(.*)')?/\", $v, $m);\r\n $type = $m[1];\r\n $s = ($m[5] ? \" value='$m[5]' \" : '');\r\n $t = $m[3];\r\n if ($m[2])\r\n {\r\n if (is_numeric($t))\r\n {\r\n if ($t <= 32)\r\n {\r\n $s .= \" sizemax='$t' size='\" . ($t * 2) . \"'\";\r\n }\r\n else\r\n {\r\n $type = 'BLOB';\r\n }\r\n }\r\n else\r\n {\r\n preg_match(\"/^ *'?(.*[^'])'? *$/\", $t, $m2); $t = $m2[1];\r\n }\r\n }\r\n\r\n switch (strtoupper($type))\r\n {\r\n case TINYINT:\r\n if ($t==1)\r\n {\r\n $checked = \"\";\r\n if ($tabUnEnregistrement[$k] == 1)\r\n {\r\n $checked = \" checked\";\r\n }\r\n $s = \"<td>\"\r\n .\"<input type='checkbox' name='\".$k.\"'\"\r\n .\" value='1'\".$checked.$txtReadonly.\"/>\"\r\n .\"</td>\\n\";\r\n break;\r\n }\r\n case INT:\r\n case INTEGER:\r\n case BIGINT:\r\n case TINYINT:\r\n case CHAR:\r\n case VARCHAR:\r\n case TEXT:\r\n case TINYTEXT:\r\n case TINYBLOB:\r\n case YEAR:\r\n case DATETIME:\r\n case DATE:\r\n case TIME:\r\n $s = \"<td>\"\r\n .\"<input type='text'\".$s.\" name='\".$k.\"'\"\r\n .\" value='\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES)\r\n .\"'\".$txtReadonly.\"/>\"\r\n .\"</td>\\n\";\r\n break;\r\n case ENUM:\r\n case SET: //ajout JFM\r\n $s = \"<td><select name='\".$k.\"'\".$txtReadonly.\">\\n\";\r\n foreach (preg_split(\"/'? *, *'?/\",$t) as $v)\r\n {\r\n if ($tabUnEnregistrement[$k]==$v)\r\n {\r\n $s .= \"<option selected>\".$v.\"</option>\\n\";\r\n }\r\n else\r\n {\r\n $s .= \"<option>\".$v.\"</option>\\n\";\r\n }\r\n } //foreach (preg_split(\"/'? *, *'?/\",$t) as $v)\r\n $s .= \"</select></td>\\n\";\r\n break;\r\n case TIMESTAMP:\r\n $s = '';\r\n if ($mode==\"ajout\")\r\n {\r\n $hiddens .= \"<input type='hidden' name='\".$k.\"' value='NOW()'/>\\n\";\r\n }\r\n else\r\n {\r\n $hiddens .= \"<input type='hidden' name='\".$k.\"' value='\".$v.\"'/>\\n\";\r\n }\r\n break;\r\n case LONGBLOB:\r\n $s = \"<td><textarea name='$k' cols='45' rows='20'\".$txtReadonly.\">\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES ).\"</textarea></td>\\n\"; //modif. JFM\r\n break;\r\n default:\r\n $t = floor($t / 45)+1;\r\n $s = \"<td><textarea name='$k' cols='45' rows='$t'\".$txtReadonly.\">\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES ).\"</textarea></td>\\n\";\r\n break;\r\n } //switch (strtoupper($type))\r\n if ($s)\r\n $total .= \"<tr><td>$k</td>\\n$s</tr>\\n\";\r\n }\r\n }\r\n $hiddens .= \"<input type='hidden' name='serveur' value='\".$serveur.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='table' value='\".$table.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='mode' value='\".$mode.\"'/>\\n\";\r\n\r\n\r\n // $idLigne = htmlentities(stripcslashes($idLigne), ENT_QUOTES );\r\n $idLigne = htmlentities($idLigne, ENT_QUOTES );\r\n\r\n switch ($modeFiche)\r\n {\r\n case \"ajout\" :\r\n $txtbouton =\"Ajouter\";\r\n break;\r\n case \"effacer\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='ordresuplig'/>\\n\";\r\n $txtbouton =\"Effacer d&#233;finitivement\";\r\n break;\r\n case \"modif\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='maj'/>\\n\";\r\n $txtbouton =\"Modifier\";\r\n break;\r\n case \"voir\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='AUCUN'/>\\n\";\r\n $txtbouton =\"--\";\r\n break;\r\n default:\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='AUCUN'/>\\n\";\r\n $txtbouton =\"AUCUN\";\r\n }\r\n\r\n return \"\\n\\n\\n\".tabledata_url_generer_post_ecrire(\r\n 'tabledata'\r\n , \"<table>\\n\".$strDebut.$total\r\n .\"</table>\".$hiddens,$txtbouton);\r\n } // if ($nombre_Enregistrements>0)\r\n\r\n}", "public function numero_filas($resultado){\r\n\t\tmysqli_num_rows($resultado);\r\n\t}", "function autonumber(){\n $field_id = 'id_kain';\n $len = 3;\n $query = $this->db->query(\"SELECT MAX(RIGHT(\".$field_id.\",\".$len.\")) as kode FROM \".$this->table); \n\n if($query->num_rows() <> 0){ \n //cek dulu apakah ada sudah ada kode di tabel. \n //jika kode ternyata sudah ada. \n $data = $query->row();\n $last = intval($data->kode); \n $kode = $last + 1; \n }else{ \n //jika kode belum ada \n $kode = 1; \n }\n\n $kodemax = str_pad($kode, $len, \"0\", STR_PAD_LEFT); \n $kodejadi = $kodemax; \n return $kodejadi;\n }", "public function numberOfRows();", "public function calcularId(){\n\n $registros = PorcentajeBecaArancel::All();\n\n $max_valor = count($registros);\n\n\n if($max_valor > 0){\n\n $max_valor++;\n\n } else {\n\n $max_valor = 1;\n }\n\n return $max_valor;\n\n }", "abstract public function getFieldCount(): int;", "static function get_Count($table) {\r\n $rekete = \"SELECT COUNT(*) as NOMBRE FROM \" . $table;\r\n $result = Functions::commit_sql($rekete, \"\");\r\n $list = $result->fetch();\r\n if ($list[\"NOMBRE\"] != NULL)\r\n return $list[\"NOMBRE\"];\r\n else\r\n return 0;\r\n }", "function budynekKoncowy(){\r\n\t\t$this->retriveDataRow();\r\n\t\treturn $this->data['id_budynku_koncowego'];\r\n\t}", "public function getNumTables() {}", "public function getNumTables() {}", "public function getNumTables() {}", "public abstract function row_count();", "public function getCountRowsOfTable ($tableName,$fieldname='*');", "public abstract function GetNumRows();", "function nombrecampo($numcampo) {\r\n\r\n return mysql_field_name($this->Consulta_ID, $numcampo);\r\n\r\n}", "public function GetRecordCount($file1){\r\n\t\t\r\n\t\tif($file1 != '' && $file1 != '-1' && $file1 != null) {\r\n\t\t\t$this->db->where(\"kode_e1\",$file1);\r\n\t\t}\r\n\t\t$query=$this->db->from('tbl_sasaran_program');\r\n\t\treturn $this->db->count_all_results();\r\n\t\t$this->db->free_result();\r\n\t}", "function total_records($recordType)\n{\n return get_db()->getTable($recordType)->count();\n}", "function get_num_records()\n\t{\n\t\t$this->sql = 'SELECT COUNT(*) FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\treturn db_getOne($this->sql, $this->use_db);\n\t}", "private function recordNumber($tablename)\t{\n\t\t$query = \"show table status where Name=\\\"\".$tablename.\"\\\"\";\n\t\tif ($result = $this->db_conn->query($query))\t{\n if ($result->num_rows > 0) {\n $row = $result->fetch_assoc();\n return (int) $row[\"Rows\"];\n }\n else {\n return 0;\n }\n\t\t}\n\t\telse\t{\n\t\t\tdie (\"Error sending the query '\".$query.\"' to MySQL: \".$this->db_conn->error.\"\\n\");\n\t\t}\n\t}", "public function rowCount(): int\n {\n }", "public function id_tarjeta();", "public function id_nilai_alternatif()\n {\n $q = $this->db->query(\"select MAX(RIGHT(id_nilai_alternatif,5)) as id_max from tbl_nilai_alternatif\");\n $id = \"\";\n if ($q->num_rows() > 0) {\n foreach ($q->result() as $k) {\n $tmp = ((int) $k->id_max) + 1;\n $id = sprintf(\"%05s\", $tmp);\n }\n } else {\n $id = \"00001\";\n }\n return \"NAL-\" . $id;\n }", "public function nbRows();", "function getNumero() {\n return $this->numero;\n }", "public function getRecordCount()\n {\n return $this->count(self::_RECORD);\n }" ]
[ "0.69371665", "0.65506494", "0.6534342", "0.641006", "0.6355791", "0.6237237", "0.61505365", "0.6072489", "0.6032277", "0.60253376", "0.60146123", "0.60146123", "0.59759796", "0.5887752", "0.5873198", "0.58723134", "0.5868918", "0.58665466", "0.58415", "0.58321255", "0.5831465", "0.58208865", "0.58120733", "0.58039343", "0.5793534", "0.5777621", "0.5758638", "0.5740005", "0.57230395", "0.5720538", "0.57180613", "0.5709501", "0.57062805", "0.57054484", "0.5701065", "0.57008713", "0.5700691", "0.5700691", "0.5700005", "0.5693564", "0.5691754", "0.56899256", "0.5688115", "0.5684384", "0.56709594", "0.56709594", "0.5656878", "0.56545067", "0.5646766", "0.5642462", "0.5627271", "0.56257576", "0.5615112", "0.561412", "0.56097394", "0.5609034", "0.560717", "0.5600668", "0.5589124", "0.5555513", "0.55507445", "0.5539259", "0.5535559", "0.55318016", "0.55281115", "0.5515976", "0.5514002", "0.5510529", "0.5502671", "0.54840165", "0.5480924", "0.54807824", "0.54791653", "0.54766005", "0.54752356", "0.54718447", "0.5466999", "0.5466461", "0.5460455", "0.54573894", "0.5452519", "0.5441972", "0.5430546", "0.5427861", "0.5423936", "0.5423936", "0.5423936", "0.54235435", "0.5423463", "0.5410791", "0.54029536", "0.5400726", "0.540065", "0.54005474", "0.53981036", "0.5397472", "0.53956556", "0.53844786", "0.5383646", "0.53718716", "0.53694034" ]
0.0
-1
Restituisce un array in formato SDF
function arrayStatusesForSDF( $statuses ) { $result = array(); if ( !empty( $statuses ) ) { $result = array(); foreach ( $statuses as $key => $status ) { $result[$key] = $status['label']; } /* @todo Questi? */ unset( $result['all'] ); unset( $result['trash'] ); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toArray() ;", "function toArray() ;", "function toArray();", "abstract public function array2Data($arr);", "abstract public function data2Array($data);", "public function normalizeData() : array;", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "abstract protected function toArray();", "public function AsArray();", "public function convertItemArray() {}", "public function toArray():array;", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "public function getAsArray();", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function getData(): array;", "public function _getData(): array\n {\n $result = [\n ];\n\n return parent::normalizeData($result);\n }", "function acf_unarray($val)\n{\n}", "public function convertTypoScriptArrayToPlainArrayTestdata() {}", "public function importArray($data);", "public function convertPlainArrayToTypoScriptArrayTestdata() {}", "public function toArray()\n\t{\n\t\treturn $this->_d;\n\t}", "abstract public function getArray();", "public function getData() : array;", "public function getData() : array;", "function getArray();", "public abstract function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.67741084", "0.67741084", "0.6531139", "0.65087754", "0.64228487", "0.63815826", "0.6368659", "0.6368659", "0.6368659", "0.6368659", "0.63685125", "0.63685125", "0.6367259", "0.6367259", "0.6367259", "0.6367259", "0.6367259", "0.6367259", "0.6367259", "0.6367259", "0.6367259", "0.6367259", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.63598555", "0.6334811", "0.6334811", "0.6334811", "0.6334811", "0.6334811", "0.6334811", "0.62937963", "0.6261605", "0.62059873", "0.6200786", "0.6186054", "0.6186054", "0.6186054", "0.6186054", "0.6186054", "0.6179473", "0.61333007", "0.61333007", "0.61333007", "0.61333007", "0.6131082", "0.6123877", "0.60815126", "0.6071777", "0.60656947", "0.6017335", "0.5979505", "0.5975754", "0.5975754", "0.5959141", "0.5949077", "0.59456015", "0.59456015", "0.59456015", "0.59456015", "0.59456015", "0.59456015", "0.59456015", "0.59456015" ]
0.0
-1
WordPress WP List Table Restituisce un array con il tipo di status, la sua label e la count sul database
function statusesWithCount( $table_name, $statuses, $field_name = 'status' ) { global $wpdb; $sql = <<< SQL SELECT DISTINCT( `{$field_name}` ), COUNT(*) AS count FROM `{$table_name}` GROUP BY `{$field_name}` SQL; $result = $wpdb->get_results( $sql, ARRAY_A ); foreach ( $result as $status ) { if ( !empty( $status['status'] ) ) { $statuses[$status['status']]['count'] = $status['count']; } } $statuses['all']['count'] = self::count( $table_name ); return $statuses; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statuses() {\n //return parent::statusesWithCount( self::tableName(), self::arrayStatuses() );\n\n global $wpdb;\n\n $table_name = self::tableName();\n $statuses = self::arrayStatuses();\n $field_name = 'status';\n /*\n * @ToDo Decommentare qui se non vogliamo i conteggi dinamici in base al filtro\n * @ToDo La query è molto onerosa\n *\n *\n */\n $table_orders = BNMExtendsOrders::tableName();\n $sql = <<< SQL\n SELECT DISTINCT( {$table_orders}.{$field_name} ),\n COUNT(*) AS count\n FROM `{$table_name}`\n LEFT JOIN `{$table_orders}`\n ON {$table_orders}.id = {$table_name}.id_order\n GROUP BY {$table_orders}.{$field_name}\nSQL;\n\n\n\n $result = $wpdb->get_results( $sql, ARRAY_A );\n\n foreach ( $result as $status ) {\n if ( !empty( $status['status'] ) ) {\n $statuses[$status['status']]['count'] = $status['count'];\n }\n }\n\n $statuses['all']['count'] = self::count( $table_name );\n\n return $statuses;\n }", "public static function arrayStatuses() {\n\n /*\n $statuses = array(\n 'all' => array(\n 'label' => __( 'All', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'publish' => array(\n 'label' => __( 'Publish', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'trash' => array(\n 'label' => __( 'Trash', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n )\n );*/\n $statuses = array(\n 'all' => array(\n 'label' => __( 'All', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_PENDING => array(\n 'label' => __( 'Pending', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_CONFIRMED => array(\n 'label' => __( 'Confirmed', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_CANCELLED => array(\n 'label' => __( 'Cancelled', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n WPXSMARTSHOP_ORDER_STATUS_DEFUNCT => array(\n 'label' => __( 'Defunct', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n ),\n 'trash' => array(\n 'label' => __( 'Trash', WPXSMARTSHOP_TEXTDOMAIN ),\n 'count' => 0\n )\n );\n return $statuses;\n }", "public function getStatusesList(){\n return $this->_get(1);\n }", "private function get_status_counts_data() {\n\n\t\t// Get my complete dataset.\n\t\t$dataset = $this->table_data();\n\n\t\t// Return false without any data.\n\t\tif ( empty( $dataset ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Trim my list to just the status.\n\t\t$status_ids = wp_list_pluck( $dataset, 'review_status' );\n\n\t\t// Set up the return structure.\n\t\t$setup['all'] = array(\n\t\t\t'label' => __( 'All', 'woo-better-reviews' ),\n\t\t\t'count' => count( $status_ids ),\n\t\t\t'setup' => 'status',\n\t\t);\n\n\t\t// Get my statuses.\n\t\t$statuses = Helpers\\get_review_statuses();\n\n\t\t// If we have no statuses, just return the 'all'.\n\t\tif ( empty( $statuses ) ) {\n\t\t\treturn $setup;\n\t\t}\n\n\t\t// Now loop the statuses we have and handle the counts.\n\t\tforeach ( $statuses as $status_key => $status_label ) {\n\n\t\t\t// Handle the individual count by using the array keys and status.\n\t\t\t$setup[ $status_key ] = array(\n\t\t\t\t'label' => $status_label,\n\t\t\t\t'count' => count( array_keys( $status_ids, $status_key ) ),\n\t\t\t\t'setup' => 'status',\n\t\t\t);\n\t\t}\n\n\t\t// If we have a single product, show that.\n\t\tif ( ! empty( $_GET['wbr-review-filter'] ) && ! empty( $_GET['wbr-product-id'] ) ) {\n\n\t\t\t// Set my product ID.\n\t\t\t$product_id = absint( $_GET['wbr-product-id'] );\n\n\t\t\t// Handle the individual count by using the array keys and status.\n\t\t\t$setup['filtered'] = array(\n\t\t\t\t'label' => get_the_title( $product_id ),\n\t\t\t\t'count' => Queries\\get_review_count_for_product( $product_id ),\n\t\t\t\t'setup' => 'single',\n\t\t\t);\n\t\t}\n\n\t\t// Return it, filtered.\n\t\treturn apply_filters( Core\\HOOK_PREFIX . 'status_counts_data', $setup );\n\t}", "function by_status_berlaku()\n {\n $this->db->select(\"COUNT(id) AS total,COUNT( CASE WHEN status_berlaku = '1' THEN 1 END ) AS berlaku,COUNT( CASE WHEN status_berlaku = '0' THEN 1 END ) AS tidak_berlaku\");\n $this->db->from($this->table);\n return $this->db->get()->row();\n }", "public function getItemStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = array('id' => 0,\r\n\t\t\t\t\t\t\t'name' => 'Sold',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'sold'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[1] = array('id' => 1,\r\n\t\t\t\t\t\t\t'name' => 'Available',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'available'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[2] = array('id' => 2,\r\n\t\t\t\t\t\t\t'name' => 'Out on Job',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_job'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[3] = array('id' => 3,\r\n\t\t\t\t\t\t\t'name' => 'Pending Sale',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_sale'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[4] = array('id' => 4,\r\n\t\t\t\t\t\t\t'name' => 'Out on Memo',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'out_on_memo'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[5] = array('id' => 5,\r\n\t\t\t\t\t\t\t'name' => 'Burgled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'burgled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[6] = array('id' => 6,\r\n\t\t\t\t\t\t\t'name' => 'Assembled',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'assembled'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[7] = array('id' => 7,\r\n\t\t\t\t\t\t\t'name' => 'Returned To Consignee',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'return_to_consignee'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[8] = array(\r\n\t\t\t\t\t\t\t'id' => 8,\r\n\t\t\t\t\t\t\t'name' => 'Pending Repair Queue',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'pending_repair'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[91] = array('id' => 91,\r\n\t\t\t\t\t\t\t'name' => 'Francesklein Import',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'francesklein_import'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[98] = array('id' => 98,\r\n\t\t\t\t\t\t\t'name' => 'Never Going Online',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'never_going_online'\r\n\t\t\t\t\t\t);\r\n\t\t\t$status[99] = array('id' => 99,\r\n\t\t\t\t\t\t\t'name' => 'Unavailable',\r\n\t\t\t\t\t\t\t'checked' => false,\r\n\t\t\t\t\t\t\t'field_name' => 'unavailable'\r\n\t\t\t\t\t);\r\n\t\treturn $status;\r\n\t}", "public static function list() {\n self::init();\n $columns = self::getListTableColumns();\n $columns = array_map(function($object) {\n return $object['label'];\n }, $columns);\n $columns = array_values($columns);\n\n $columnsSql = implode(', ', self::$listTableColumnsKeys);\n $data = self::$wpdb->get_results(\n self::$wpdb->prepare(\n \"SELECT {$columnsSql}\n FROM \" . self::$table . \"\n ORDER BY id ASC\"\n )\n );\n return $data;\n }", "public function getStatusList()\n {\n return ['0' => __('修改'), '1' => __('提议'), '2' => __('新增'), '3' => __('废止')];\n }", "public static function getStatuses(): array;", "function monitor_list_statuses() {\n $query = \"select distinct(`wf_status`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_status'];\n }\n return $ret;\n }", "function getStatus() {\n \t\n \t$status = array();\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_contacter'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"to_contact\"] = $result['num_contact'];\n\n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'contacte'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"contacted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'a_rappeler'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"call_back\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_contact FROM mp_pile WHERE `statut` = 'termine'\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n \n $status[\"deleted\"] = $result['num_contact'];\n \n $sql = \"SELECT COUNT(*) as num_motif FROM mp_activation_motifs\";\n $sel = mysql_query($sql);\n $result = mysql_fetch_array($sel);\n\n $status[\"number_motif\"] = $result['num_motif'];\n \n \n return $status;\n }", "public function getCountsList(){\n return $this->_get(6);\n }", "public function getStatuses() {\n\t}", "public function getDeliveryStatusList(){\n\t\t/* variable initialization */\n\t\t$strReturnArr\t= $strQueryArr\t= array();\n\t\t\n\t\t/* Creating query array */\n\t\t$strQueryArr\t= array(\n\t\t\t\t\t\t\t\t\t'table'=>$this->_strTableName,\n\t\t\t\t\t\t\t\t\t'column'=>array('id','description'),\n\t\t\t\t\t\t\t\t\t'where'=>array('attribute_code'=>DELIVERY_STATUS_WIDGET_ATTR_CODE),\n\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t \n\t\t/* Get data from dataset */\n\t\t$strResultSetArr\t= $this->_databaseObject->getDataFromTable($strQueryArr);\n\t\t/* removed used variable */\n\t\tunset($strQueryArr);\n\t\t\n\t\t/* if status found teh do needful */\n\t\tif(!empty($strResultSetArr)){\n\t\t\t/* Iterting the loop */\n\t\t\tforeach($strResultSetArr as $strResultSetArrKey => $strResultSetArrValue){\n\t\t\t\t/* setting the key value paris */\n\t\t\t\t$strReturnArr['keyvalue'][$strResultSetArrValue['id']]\t= $strResultSetArrValue['description'];\n\t\t\t}\n\t\t}\n\t\t/* set the default result set */\n\t\t$strReturnArr['defaultvalue']\t= $strResultSetArr;\n\t\t/* removed used variable */\n\t\tunset($strResultSetArr);\n\t\t\n\t\t/* return the status result set */\n\t\treturn $strReturnArr;\n\t}", "function statuses_table() {\n\n\t$table = array('papi_type_statuses',\"\n\t\tid INT AUTO_INCREMENT primary key NOT NULL,\n\t\tdate DATETIME NOT NULL,\n\t\tstatus TEXT NOT NULL,\n\t\torg_service VARCHAR(32),\n\t\torg_id VARCHAR(32)\n\t\");\n\n\treturn $table;\n\n}", "abstract protected function getStatusesInfos();", "public static function getStatusList()\n {\n return array(\n self::STATUS_TRASH => 'trash',\n self::STATUS_DRAFT => 'draft',\n self::STATUS_PUBLISHED => 'published',\n );\n }", "function all_kontrak(){\n $this->db->select(\"count(status_aktif) as Kontrak \");\n $this->db->from('tb_pegawai');\n $this->db->where('status_aktif', 1);\n $this->db->where('status_peg', 2);\n $this->db->where('status_profesi', 4);\n $result = $this->db->get()->result();\n return $result;\n }", "function toListWithCount($jsonArray){\n $list = array();\n //echo $jsonArray;\n $bindings= $jsonArray['results']['bindings'];\n foreach ($bindings as $binding){\n if(isset($binding['count']['value'])){\n $tmp['value'] = $binding['suggest']['value'];\n\n $tmp['type'] = $binding['suggest']['type'];\n\n $tmp['lang'] = @$binding['suggest']['xml:lang'];\n $tmp['datatype'] = @$binding['suggest']['datatype'];\n\n $tmp['count'] = $binding['count']['value'];\n\n\n $list[] = $tmp;\n }\n }\n return $list;\t\n }", "public function getStatusArray()\n\t{\n\t\treturn $this->makeReturnTable();\n\t}", "public function getCountList(){\n\t\t$select = $this->getListSelect();\n\t\t$stmt = $select->query();\n\t\t$objects = array();\n\t\treturn count($stmt->fetchAll());\n\t}", "function jumlahdata() {\r\n\t\t\treturn $this->db->count_all('tb_kelas');\t\t\t\r\n\t\t\t}", "public function listing() {\n return array(\n '#header' => array($this->t('Title'), $this->t('Description'), $this->t('Operations')),\n '#type' => 'table',\n ) + $this->listingLevel($this->paymentStatusManager->hierarchy(), 0);\n }", "public static function getStatusesList()\n {\n $sql = 'SELECT id AS value, display_name AS text '\n . 'FROM location_status '\n . 'WHERE active = 1';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "public function getCount();", "public function getCount();", "public function getCount();", "function count_new_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 3');\n\t}", "abstract public static function getStatuses();", "public static function getStatusList() {\r\n return [\r\n self::STATUS_ACTIVE => 'Active',\r\n self::STATUS_RETIRED => 'Retired'\r\n ];\r\n }", "public function toArray()\n\t{\n\t\t$result = array();\n\t\t\n\t\t$data = Mage::getModel('sales/order_status')->getResourceCollection()->getData();\n \n if(!is_null($data))\n {\n\t\t\tforeach($data as $row)\n\t\t\t\t$result[$row['status']] = $row['label'];\t\t\t\n\t\t}\n \n return $result;\n\t}", "function count_archived_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 0');\n\t}", "public function count_lists(){\n $cart_result = @mysqli_query($this->dbc, \"SELECT SUM(state='draft') as draft, SUM(article_type='news' and state='published') as news, SUM(article_type='guidance' and state='published') as guidance from `news_advice`\") or die(\"Couldn't ViewSql page USERS lists()\");\n $this->num_rows = mysqli_num_rows($cart_result);\n while ($row = mysqli_fetch_assoc($cart_result)) {\n $this->draft = $row[\"draft\"];\n $this->news = $row[\"news\"];\n $this->guidance = $row[\"guidance\"];\n }// end while\n mysqli_close($this->dbc);\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "static public function getStatusList() {\n return array(\n self::STATUS_SHOW => Yii::t('main', 'Show'),\n self::STATUS_HIDE => Yii::t('main', 'Hide'),\n );\n }", "function getCount ($data){\nreturn count($data);\n \n}", "function getStatusList() {\n $statusList = array();\n foreach (Constants::$statusNames as $id => $name) {\n $statusList[$id] = \"$id - $name\";\n }\n return $statusList;\n}", "public function getAllType()\n {\n $q=\"SELECT type_id FROM `status`\";\n $result = $this->fetchAll($q);\n return $result;\n }", "public static function getStatusList()\n {\n return [\n self::STATUS_ACTIVE => 'Active',\n self::STATUS_RETIRED => 'Retired'\n ];\n }", "function _list_meta_row($entry, &$count)\n {\n }", "public function lists()\n {\n return $this->statuses;\n }", "function count_active_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 1');\n\t}", "protected function CltvoGetItems(){\n return [\n [\n \"active\" => true,\n \"paid\" => false,\n \"cancel\" => false,\n \"slug\" => \"activo\",\n \"label\" => \"Activo\"\n ],\n [\n \"active\" => false,\n \"paid\" => false,\n \"cancel\" => false,\n \"slug\" => \"pago-pendiente\",\n \"label\" => \"Pago pendiente\"\n ],\n [\n \"active\" => false,\n \"paid\" => true,\n \"cancel\" => false,\n \"slug\" => \"pagado\",\n \"label\" => \"Pagado\"\n ],\n [\n \"active\" => false,\n \"paid\" => true,\n \"cancel\" => false,\n \"slug\" => \"en-proceso\",\n \"label\" => \"En proceso\"\n ],\n [\n \"active\" => false,\n \"paid\" => true,\n \"cancel\" => false,\n \"slug\" => \"entregado\",\n \"label\" => \"Entregado\"\n ],\n\n [\n \"active\" => false,\n \"paid\" => true,\n \"cancel\" => true,\n \"slug\" => \"cancelado\",\n \"label\" => \"Cancelado\"\n ],\n\n [\n \"active\" => false,\n \"paid\" => true,\n \"cancel\" => true,\n \"slug\" => \"devuelto\",\n \"label\" => \"Devuelto\"\n ],\n\n [\n \"active\" => false,\n \"paid\" => false,\n \"cancel\" => true,\n \"slug\" => \"expirado\",\n \"label\" => \"Expirado\"\n ],\n\n\n\n\n ];\n }", "public function getStatusHistories();", "function get_loop_stats()\n {\n $this->db->select('status, count(status) as counts, substr(loop_id, 1, 2) as loop_type',FALSE)\n ->from('loop_qa')\n ->group_by(array('status', 'loop_type'));\n $query = $this->db->get();\n\n foreach ($query->result() as $row) {\n $results[$row->loop_type][$row->status] = $row->counts;\n }\n\n foreach (array_keys($results) as $loop_type) {\n $tables[$loop_type][] = array(\n array_sum(array_values($results[$loop_type])),\n $this->make_view_loops_link($results,$loop_type,1),\n $this->make_view_loops_link($results,$loop_type,2),\n $this->make_view_loops_link($results,$loop_type,3),\n $this->make_view_loops_link($results,$loop_type,4),\n $this->make_view_loops_link($results,$loop_type,5),\n $this->make_view_loops_link($results,$loop_type,6));\n }\n\n return $tables;\n }", "public function datatablesCatalogStatus()\n { \n DB::statement(DB::raw('set @rownum=0'));\n $tblCatalogStatus = TblCatalogStatus::select(\n [DB::raw('@rownum := @rownum + 1 AS rownum'),'id as tbl_catalog_status_id','status','description','created_at']);\n \n return Datatables::of($tblCatalogStatus)\n ->editColumn('description', '<span class=\"description\">{{$description}}</span><span style=\"right: 13px;position: absolute;\"><kbd class=\"kbd-danger hover cpointer delete-cs\" data-id=\"{{$tbl_catalog_status_id}}\">DELETE</kbd> <kbd class=\"kbd-primary hover cpointer edit-cs\" data-id=\"{{$tbl_catalog_status_id}}\">EDIT</kbd></span>')\n ->setRowId('tbl_catalog_status_id')\n ->make(true);\n }", "public function get_stats()\n { \n $sql = \"SELECT COUNT(CASE WHEN `status` = 'Enabled' THEN 1 END) AS 'Enabled',\n COUNT(CASE WHEN `status` = 'Disabled' THEN 1 END) AS 'Disabled'\n FROM findmymac\n LEFT JOIN reportdata USING (serial_number)\n \".get_machine_group_filter();\n\n $queryobj = new Findmymac_model();\n $out = [];\n foreach($queryobj->query($sql)[0] as $label => $value){\n $out[] = ['label' => $label, 'count' => $value];\n }\n \n jsonView($out);\n }", "public static function status()\n {\n return [\n 'ati' => 'Ativo',\n 'ina' => 'Inativo'\n ];\n }", "public function actionIndex()\n {\n $query = new Query();\n $query->select(['COUNT(*)','value'=>'status']);\n $query->from([Status::tableName()]);\n $query->groupBy('value');\n $query->orderBy(['count'=>SORT_ASC]);\n return $query->all();\n // return $query->createCommand()->sql;\n }", "function wlms_book_categories_list()\n{\n global $wpdb;\n \n $get_book_categories_sql = $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}wlms_book_categories ORDER BY id DESC\", '');\n $entries_for_book_categories = $wpdb->get_results( $get_book_categories_sql );\n \n ?>\n <table id=\"bookCategoriesTable\" class=\"wlmsTablesorter\">\n <thead> \n <tr> \n <th>SN.</th> \n <th>NAME</th>\n <th>STATUS</th>\n <th class=\"last-column\">ACTION</th>\n </tr> \n </thead>\n <tbody>\n <?php \n $i = 1;\n if( $entries_for_book_categories ){\n foreach( $entries_for_book_categories as $rows ){\t\n ?> \n <tr>\n <td><?php echo $i;?></td>\n <td><?php echo esc_html( $rows->name );?></td>\n <?php if($rows->status == 1){?>\n <td>Active</td>\n <?php } else {?>\n <td>Banned</td>\n <?php }?>\n <td class=\"wlms-action\">\n <div class=\"wlms_list_btn\">\n <a class=\"wlms_list_update\" href=\"<?php echo esc_url_raw( add_query_arg( array( 'update_id' => $rows->id ), admin_url( 'admin.php?page=wlms-pages&wlms-tab=wlms-book-categories&manage=add-book-categories' ) ) );?>\"><div class=\"wlms_update_icon_from_list\"></div></a>\n </div>&nbsp;&nbsp;&nbsp;\n <div class=\"wlms_list_btn\">\n <a data-id=\"<?php echo $rows->id;?>\" data-name=\"wlms_book_categories\" class=\"wlms_list_delete\" href=\"#\"><div class=\"wlms_delete_icon_from_list\"></div></a>\n </div>\n </td>\n </tr>\n <?php $i ++;}}else{?>\n <tr>\n <td colspan=\"4\">No data yet</td>\n </tr>\n <?php }?>\n </tbody>\n </table>\n\n <div class=\"wlms_delete_popup_main\">\n <div class=\"wlms_delete_popup_header_main\">\n <div class=\"wlms_delete_popup_header\">Delete Confirmation</div>\n <div class=\"wlms_delete_popup_close_icon\"><button type=\"button\">x</button></div>\n </div>\n <div class=\"wlms_delete_popup_content\">Are you sure to delete this information ?</div>\n <div class=\"wlms_delete_popup_footer\">\n <div class=\"wlms_btn_delete_popup\"><button class=\"button-primary wlms-delete-btn\" type=\"button\">Delete</button></div>\n &nbsp;&nbsp;<div class=\"wlms_btn_delete_popup\"><button class=\"button-primary wlms_cancel\" type=\"button\">Cancel</button></div>\n &nbsp;&nbsp;<div class=\"wlms_loader_delete_panel\"></div> \n </div>\n </div>\n <div class=\"wlms_overlay\"></div>\n \n <input type=\"hidden\" name=\"wlms_deleted_str\" id=\"wlms_deleted_str\" />\n <input type=\"hidden\" name=\"wlms_selected_button\" id=\"wlms_selected_button\" />\n <?php \n}", "private function fetchStatuses()\n {\n // if the tag indicates that we should archive the statuses, it's a waste of an SQL\n // call otherwise.\n if ($this->archive) {\n $limit_clause = \" LIMIT \";\n if($this->paging) {\n $limit_clause .= ($this->page * $this->limit).\",\";\n }\n $limit_clause .= $this->limit;\n\n $query = sprintf(\"SELECT * FROM `%s` WHERE id IN (SELECT status_id FROM `%s` WHERE search_id = %s)%s\",\n TasForWp::$StatusByIdTableName,\n TasForWp::$StatusSearchTableName,\n $this->_id,\n $limit_clause\n );\n $rows = $this->_wpdb->get_results($query);\n $this->_nextPage = (count($rows) < $this->limit) ? null : true;\n foreach ($rows as $row) {\n $status_obj = new TwitterStatus($row->id);\n $status_obj->load_json($row->status_json);\n #$status_obj->process_entities();\n $this->_statuses[] = $status_obj;\n }\n } else {\n try {\n $params = array('q' => $this->term, 'include_entities' => 1);\n if($this->limit > 0) {\n $params['rpp'] = $this->limit;\n }\n if(isset($this->page)) {\n $params['page'] = $this->page;\n }\n if(isset($this->max_status_id)) {\n $params['max_id'] = $this->max_status_id;\n }\n $response = $this->tapi->search($params);\n\n $this->_nextPage = $response->next_page;\n $this->_refresh_url = $response->refresh_url; \n\n foreach($response->results as $result)\n {\n $status_obj = new TwitterStatus($this->_wpdb, $this->tapi);\n $status_obj->load_json($result);\n #$status_obj->process_entities();\n $this->_statuses[] = $status_obj;\n }\n } catch (Exception $e) {\n // TODO: Should elegantly inform the user\n }\n }\n }", "function displayStatusList($data) {\n\t\t\n\t\t$display = '';\n\t\t\n\t\tforeach($data as $value) {\n\t\t\t$id = $value['id'];\n\t\t\t$from_id = $value['from_id'];\n\t\t\t$from_name = $value['from_name'];\n\t\t\t$type = $value['type'];\n\t\t\t$message = $value['message'];\n\t\t\t$picture = $value['picture'];\n\t\t\t$link = $value['link'];\n\t\t\t$source = $value['source'];\n\t\t\t$name = $value['name'];\n\t\t\t$caption = $value['caption'];\n\t\t\t$description = $value['description'];\n\t\t\t$icon = $value['icon'];\n\t\t\t$created = $value['created'];\n\t\t\t$attribution = $value['attribution'];\n\t\t\t$likes_nb = $value['likes_nb'];\n\t\t\t$comments = $value['comments'];\n\t\t\t$comments_nb = $value['comments_nb'];\n\t\t\t$action_comment = $value['action_comment'];\n\t\t\t$picture_url = $value['picture_url'];\n\t\t\t$profile_url = $value['profile_url'];\n\t\t\t\n\t\t\t$display .= '<table id=\"itemBox\" value=\"'.$id.'\" border=0 style=\"padding-top: 0px;padding-bottom: 10px;border-bottom: 1px solid #cfcfcf;\" width=100% cellpadding=0 cellspacing=0><tr>';\n\t\t\t\n\t\t\t$display .= '<td width=20 valign=\"top\">';\n\t\t\t$display .= '<a href=\"'.$profile_url.'\" title=\"'.$from_name.'\" target=\"_blank\"><img src=\"'.$picture_url.'\" style=\"padding-right:10px;\"></a>';\n\t\t\t$display .= '</td>';\n\t\t\t\n\t\t\t$display .= '<td valign=\"top\">';\n\t\t\t\t\n\t\t\t\t$display .= '<table width=100% cellpadding=0 cellspacing=0><tr><td>';\n\t\t\t\t$display .= '<p style=\"padding-bottom:8px;\"><a href=\"'.$profile_url.'\" title=\"'.$from_name.'\" target=\"_blank\">'.$from_name.'</a> ';\n\t\t\t\tif($message!='') $display .= ''.$message.'';\n\t\t\t\t$display .= '</p>';\n\t\t\t\t\t\t\n\t\t\t\tif($type=='status') {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if($type=='photo') {\n\t\t\t\t\t$display .= '<a href=\"'.$link.'\" target=\"_blank\"><img src=\"'.$picture.'\" style=\"padding-right:10px;\" align=\"left\"></a>';\n\t\t\t\t\tif($name!='') $display .= '<a href=\"'.$link.'\" target=\"_blank\">'.$name.'</a><br>';\n\t\t\t\t\tif($caption!='') $display .= '<small><span>'.$caption.'</a></small>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if($type=='link') {\n\t\t\t\t\tif($picture!='') $display .= '<a href=\"'.$link.'\" target=\"_blank\" title=\"'.$name.'\"><img src=\"'.$picture.'\" style=\"padding-right:10px;\" align=\"left\"></a>';\n\t\t\t\t\t$display .= '<a href=\"'.$link.'\" target=\"_blank\" title=\"'.$caption.'\">'.$name.'</a><br>';\n\t\t\t\t\tif($caption!='') $display .= '<small><span>'.$caption.'</a></small><br>';\n\t\t\t\t\tif($description!='') $display .= '<small><span>'.$description.'</a></small>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\t\n\t\t\t\t\t$display .= '<div id=\"domImage\" class=\"videoPlayBox\" style=\"float:left;\" >';\n\t\t\t\t\t\t$display .= '<a href=\"'.$link.'\" target=\"_blank\" title=\"'.$name.'\">';\n\t\t\t\t\t\t\tif($picture!='') {\n\t\t\t\t\t\t\t\t$display .= '<img src=\"'.$picture.'\" width=80 height=55 style=\"padding-right:10px;\"/>';\n\t\t\t\t\t\t\t\t$display .= '<span class=\"play\"></span>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$display .= '</a>';\n\t\t\t\t\t$display .= '</div>';\n\t\t\t\t\t\n\t\t\t\t\tif($name!='') $display .= '<a href=\"'.$link.'\" target=\"_blank\">'.$name.'</a><br>';\n\t\t\t\t\tif($description!='') $display .= '<small><span>'.$description.'</span></small>';\n\t\t\t\t}\n\t\t\t\t$display .= '</td></tr>';\n\t\t\t\t\n\t\t\t\t$display .= '<tr><td style=\"padding-top:5px;\">';\n\t\t\t\tif($icon!='') $display .= '<img src=\"'.$icon.'\"> ';\n\t\t\t\t$display .= '<small>';\n\t\t\t\t$display .= '<a href=\"'.$action_comment.'\" target=\"_blank\" title=\"'.$created.'\" class=\"grey prettyDate\">'.$created.'</a>';\n\t\t\t\t//if($attribution!='') $display .= '<span> via '.$attribution.'</span>';\n\t\t\t\t$display .= '</small>';\n\t\t\t\t\n\t\t\t\t//$display .= ' - <small><a id=\"openCloseAddComment\" href=\"#\">Comment</a></small> - <a href=\"comments.php\" rel=\"external\" data-transition=\"slide\">gogogo</a>';\n\t\t\t\t\n\t\t\t\t// ##################### //\n\t\t\t\t// START Comment Section //\n\t\t\t\t// ##################### //\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t$commentCriteria = array();\n\t\t\t\t$commentCriteria['resourceid'] = $id;\n\t\t\t\t$commentCriteria['commentCount'] = $comments_nb;\n\t\t\t\t$commentCriteria['collapse'] = 1; //comments collapsed\n\t\t\t\t$commentCriteria['hideOnAction'] = 1;\n\t\t\t\t\n\t\t\t\t//comments display\n\t\t\t\t$display .= '<div id=\"domAddCommentBox\" style=\"padding-top:10px;display:none;\">';\n\t\t\t\t\t$display .= $this->displayAddComment($commentCriteria);\n\t\t\t\t$display .= '</div>';\n\t\t\t\t$display .= '<div style=\"padding-top:5px;\">';\n\t\t\t\t\t$display .= $this->displayComments($commentCriteria);\n\t\t\t\t$display .= '</div>';\n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t// ################### //\n\t\t\t\t// END Comment Section //\n\t\t\t\t// ################### //\n\t\t\t\t\n\t\t\t\t$display .= '</td></tr></table>';\n\t\t\t\t\n\t\t\t$display .= '</td>';\n\t\t\t$display .= '</tr></table><br>';\n\t\t}\n\t\t\n\t\treturn $display;\n\t}", "function allposts_count($tabel)\n { \n $query = $this->db->where(array(\"fc_status\" => \"F\",\"fc_approve\" => \"0\"))->get($tabel);\n return $query->num_rows(); \n }", "public function countEtat_compte(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "public function getData()\n {\n return Datatables::of(App\\Models\\LabelStatus::all())->make(true);\n }", "function getAllAlerts(){\r\n /*for testing purposes only, replace with request to db\r\n return array(\r\n array('id' => 1,'title' => 'Attaque extraterrestres', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' => 'Active'),\r\n array('id' => 2,'title' => 'Fin du monde', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' => 'Inactive'),\r\n array('id' => 3,'title' => 'Vaches dans le Bureau', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' => 'Inactive'),\r\n array('id' => 4,'title' => 'Paysan pas content', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' => 'Active')\r\n );*/\r\n //$GLOBALS['link'] = connect();\r\n $res = mysqli_query($GLOBALS['link'], 'select `id`, `title`, `text`, `status` from alerts;');\r\n\r\n return fetch_result($res);\r\n}", "private function table_data()\n {\n $data = array();\n $args = array( \n 'post_type' => 'sutabu_ppdb',\n 'post_status' => 'publish',\n 'orderby' => 'title', \n 'order' => 'ASC', \n );\n\n $the_query = new WP_Query( $args );\n\n if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();\n $data[] = array(\n 'id' => $dt->ID,\n 'perusahaan' => the_title(),\n 'total_ken' => the_content(),\n 'total_pen' => 'ok',\n 'tanggal' => 'ok'\n ); \n endwhile; endif;\n wp_reset_postdata();\n\n return $data;\n }", "public static function getStatuses()\n {\n $sql = 'SELECT * FROM location_status';\n $command = Yii::app()->db->createCommand($sql);\n return $command->queryAll(true);\n }", "function getStatistic() {\n\t\t$ret = array();\n\t\tforeach ($this->data as $entry) {\n\t\t\tif (array_key_exists($entry['entryType'], $ret)) {\n\t\t\t\t$ret[$entry['entryType']]++;\n\t\t\t} else {\n\t\t\t\t$ret[$entry['entryType']] = 1;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function getAllStatus()\n {\n $sql = \"SELECT s.id, s.status_name , s.color FROM status AS s ORDER BY s.id ASC\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n // fetchAll() is the PDO method that gets all result rows, here in object-style because we defined this in\n // core/controller.php! If you prefer to get an associative array as the result, then do\n // $query->fetchAll(PDO::FETCH_ASSOC); or change core/controller.php's PDO options to\n // $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ...\n return $query->fetchAll();\n }", "function olc_get_customers_statuses() {\n\n\t$customers_statuses_array = array(array());\n\t$customers_statuses_query = olc_db_query(SELECT.\"customers_status_id, customers_status_name, customers_status_image, customers_status_discount, customers_status_ot_discount_flag, customers_status_ot_discount\".SQL_FROM . TABLE_CUSTOMERS_STATUS . SQL_WHERE.\"language_id = '\" . SESSION_LANGUAGE_ID . \"' order by customers_status_id\");\n\t$i=1; // this is changed from 0 to 1 in cs v1.2\n\twhile ($customers_statuses = olc_db_fetch_array($customers_statuses_query)) {\n\t\t$i=$customers_statuses['customers_status_id'];\n\t\t$customers_statuses_array[$i] = array('id' => $customers_statuses['customers_status_id'],\n\t\t'text' => $customers_statuses['customers_status_name'],\n\t\t'csa_public' => $customers_statuses['customers_status_public'],\n\t\t'csa_image' => $customers_statuses['customers_status_image'],\n\t\t'csa_discount' => $customers_statuses['customers_status_discount'],\n\t\t'csa_ot_discount_flag' => $customers_statuses['customers_status_ot_discount_flag'],\n\t\t'csa_ot_discount' => $customers_statuses['customers_status_ot_discount'],\n\t\t'csa_graduated_prices' => $customers_statuses['customers_status_graduated_prices']\n\t\t);\n\t}\n\treturn $customers_statuses_array;\n}", "private function getLabelsArray()\n{\n \n $returnArray=array();\n \n //set up labels array.\n if (isset($this->tableStructure)) {\n foreach ($this->tableStructure as $ind => $fieldArray) {\n $returnArray[$fieldArray['columnName']]=isset($fieldArray['label']) ? $fieldArray['label'] : $fieldArray['columnName'];\n }\n }\n \n return $returnArray; \n}", "function tep_get_orders_status() {\n global $languages_id;\n\n $orders_status_array = array();\n $orders_status_query = tep_db_query(\"select orders_status_id, orders_status_name from \" . TABLE_ORDERS_STATUS . \" where language_id = '\" . $languages_id . \"' order by orders_status_id\");\n while ($orders_status = tep_db_fetch_array($orders_status_query)) {\n $orders_status_array[] = array('id' => $orders_status['orders_status_id'],\n 'text' => $orders_status['orders_status_name']\n );\n }\n\n return $orders_status_array;\n}", "public function getListingInfoTable(){\n return [\n /** STATUS **/\n [\n 'title' => $this->app->lang->translate('admin_bar_status'),\n 'value' => $this->listing->status,\n 'link' => false\n ],\n /** Duplicates **/\n [\n 'title' => $this->app->lang->translate('admin_bar_duplicates'),\n 'value' => $this->getDuplicatesInfo()['title'],\n 'link' => $this->getDuplicatesInfo()['link']\n ],\n /** Last updated **/\n [\n 'title' => $this->app->lang->translate('admin_bar_last_updated'),\n 'value' => \\Lib\\Dates::formatToTpl($this->listing->date_update),\n 'link' => $this->app->urlFor('cp.listings_changelog', ['set_domain'=>true]).'?filter[listing_id]='.$this->listing->getId(),\n /** CP changelog of this listing **/\n 'linkTitle'=>$this->app->lang->translate('admin_bar_cp_changelog'),\n 'target'=>'_blank'\n ],\n /** Claimed **/\n [\n 'title' => $this->app->lang->translate('admin_bar_claimed'),\n 'value' => $this->alternateValue($this->listing->claimed),\n 'link' => false\n ],\n /** User **/\n [\n 'title' => $this->app->lang->translate('admin_bar_user'),\n 'value' => $this->listing->user->user_email.' ('.$this->listing->user_id.')',\n 'link' => $this->app->urlFor('cp.users_edit', ['id' => $this->listing->user_id, 'set_domain'=>true]),\n /** CP Edit User Page **/\n 'linkTitle'=>$this->app->lang->translate('admin_bar_user_cp_edit_user_page'),\n 'target'=>'_blank'\n ],\n /** User Country **/\n [\n 'title' => $this->app->lang->translate('admin_bar_user_country'),\n 'value' => $this->getUserCountryInfo($this->listing->user),\n 'link' => false\n ],\n /** Remaining listings **/\n [\n 'title' => $this->app->lang->translate('admin_bar_remaining_listings'),\n 'value' => $this->redirectStatus['count'],\n 'link' => false\n ],\n\n ];\n }", "public function totalOrdersByStatus()\n {\n $ano = date('Y');\n $mes = date('m');\n $dia = date('d');\n $inicioMes = \"{$ano}-{$mes}-01 00:00:00\";\n\n $pedidos = Pedido\n ::selectRaw('status, marketplace, COUNT(*) as count')\n ->whereNotNull('status')\n ->where('status', '!=', 5)\n ->where('created_at', '>=', $inicioMes)\n ->groupBy('status')\n ->groupBy('marketplace')\n ->orderBy('status', 'ASC')\n ->orderBy('marketplace', 'ASC')\n ->get();\n\n /**\n * Organiza os marketplaces\n */\n $marketplaces = [];\n foreach ($pedidos as $pedido) {\n if (!in_array(strtoupper($pedido->marketplace), $marketplaces)) {\n $marketplaces[] = strtoupper($pedido->marketplace);\n }\n }\n\n /**\n * Status possíveis\n */\n $status = \\Config::get('core.pedido_status');\n\n /**\n * Prepara a lista para quando não existir preenche corretamente com 0\n */\n $list = [];\n foreach ($status as $state) {\n foreach ($marketplaces as $marketplace) {\n $list[strtolower($state)][] = 0;\n }\n }\n\n /**\n * Organiza os dados pra mostrar no gráfico\n */\n foreach ($pedidos as $pedido) {\n $list[strtolower($status[$pedido->status])][array_search(strtoupper($pedido->marketplace), $marketplaces)] = $pedido->count;\n }\n\n /**\n * Altera o nome do marketplace\n */\n if ($index = array_search('MERCADOLIVRE', $marketplaces)) {\n $marketplaces[$index] = 'M.LIVRE';\n }\n\n $list['marketplaces'] = $marketplaces;\n\n return $this->listResponse($list);\n }", "function ocupados($data,$clinica){\n $sql = mysql_query(\"SELECT COUNT(status) as status FROM paciente WHERE status = '1' and clinica = '$clinica' \");\n\t$query = mysql_fetch_assoc($sql);\n\treturn $query['status'];\n }", "public function getStatusList()\n {\n return [\n self::STATUS_CREATED,\n self::STATUS_SUCCESS,\n self::STATUS_FAIL\n ];\n }", "public function count(){\n $obj=Indicadores::all();\n return response()->json(['registros'=>$obj->count()]);\n }", "public function get_all_status()\n {\n $this->db->order_by('idstatus', 'asc');\n return $this->db->get('cat_status')->result_array();\n }", "function allposts_count_Detail($nopo)\n { \n $query = $this->db->query(\"select a.fc_id,a.fc_branch,a.fc_nopo,a.fc_stock,b.fv_stock,CONCAT(b.fv_size,' | ',b.fv_warna) as variant,c.fv_satuan,rupiah(a.fn_price) as price,a.fn_qty,c.fn_uom,(a.fn_qty * c.fn_uom) as konversi,rupiah(a.fn_total) as total from td_po a LEFT OUTER JOIN v_variant b ON b.fc_stock=a.fc_stock AND b.fc_variant=a.fc_variant LEFT OUTER JOIN v_uom c ON c.fc_uom=a.fc_satuan WHERE a.fc_nopo='\".$nopo.\"'\");\n return $query->num_rows(); \n }", "function get_page_statuses()\n {\n }", "function allposts_count($tabel)\n { $query_select = \"SELECT \n a.fc_branch,a.fc_nik,a.fv_sname,a.fv_lname,\n CASE \n WHEN fc_sex = 'L' THEN 'LAKI-LAKI'\n WHEN fc_sex = 'P' THEN 'PEREMPUAN' \n END as sex,\n fc_ktp,fv_tmp_lahir,DATE_FORMAT(fd_lahir,'%d-%m-%Y') as fd_lahir\n ,fc_hp,fc_hp2,fv_addr_ktp,fv_addr,DATE_FORMAT(fd_masuk,'%d-%m-%Y') as fd_masuk,\n b.fv_jabatan,fv_pict,a.fc_status\n FROM tm_karyawan a\n LEFT JOIN tm_jabatan b ON b.fc_jabatan=a.fc_jabatan\";\n $query = $this->db->query($query_select);\n return $query->num_rows(); \n }", "public function getPayoneStatusList() \n {\n $aPayoneStatusList = $this->_oFcpoHelper->fcpoGetPayoneStatusList();\n \n $aNewList = array();\n foreach ($aPayoneStatusList as $sStatusId) {\n $oStatus = new stdClass();\n $oStatus->sId = $sStatusId;\n $oStatus->sTitle = $this->_oFcpoHelper->fcpoGetLang()->translateString('fcpo_status_'.$sStatusId, null, true);\n $aNewList[] = $oStatus;\n }\n \n return $aNewList;\n }", "public function getCount() {}", "public function getCount() {}", "public function getCount() {}", "function apachesolr_index_status($env_id) {\n $remaining = 0;\n $total = 0;\n\n foreach (entity_get_info() as $entity_type => $info) {\n $bundles = apachesolr_get_index_bundles($env_id, $entity_type);\n if (empty($bundles)) {\n continue;\n }\n\n $table = apachesolr_get_indexer_table($entity_type);\n $query = db_select($table, 'aie')\n ->condition('aie.status', 1)\n ->condition('aie.bundle', $bundles)\n ->addTag('apachesolr_index_' . $entity_type);\n\n $total += $query->countQuery()->execute()->fetchField();\n\n $query = _apachesolr_index_get_next_set_query($env_id, $entity_type);\n $remaining += $query->countQuery()->execute()->fetchField();\n }\n return array('remaining' => $remaining, 'total' => $total);\n}", "function getTermStatuses(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getTermStatuses();\r\n }", "function submssion_count_allFunc() {\n\n\tglobal $wpdb;\n\t$table_name = $wpdb->prefix . 'submissions';\n\n\t$Countjournal = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'journal' AND Approval = 1\");\n\t$Countevent = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'event' AND Approval = 1\");\n\t$Counttraining = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'training' AND Approval = 1\");\n\t$Countreports = $wpdb->get_results(\"SELECT * FROM $table_name where type = 'reports' AND Approval = 1\");\n\n\t$output = '<ul class=\"submissions\">';\n\n\t$output .= \"<li><span>\" . count($Countjournal) . \"</span> Journal article or conference pape Submissions</li>\";\n\t$output .= \"<li><span>\" . count($Countevent) . \"</span> Event or Campaign Submissions</li>\";\n\t$output .= \"<li><span>\" . count($Counttraining) . \"</span> Training Submissions</li>\";\n\t$output .= \"<li><span>\" . count($Countreports) . \"</span> Reports Submissions</li>\";\n\n\t$output .= '</ul>';\n\n\treturn $output;\n\n}", "function acadp_get_listing_status_i18n( $status ) {\n\n\t$post_status = get_post_status_object( $status );\n\treturn $post_status->label;\n\n}", "public function listsstatusget()\r\n {\r\n $response = Status::all();\r\n return response()->json($response,200);\r\n }", "public function getAprovados()\n\t{\n\t\t \n\t\treturn $this->countByAttributes(array('status'=>2));\n\t}", "private function _countTags($param) {\n\n\t\t$output = ['all' => 0 ];\n\t\t$param['select'] = 'type, count(`type`) as count';\n\t\t$param['group_by'] = 'type';\n\n\t\tunset($param['limit']);\n\n\t\t$count = $this->CI->model->get($param);\n\n\t\tforeach($count as $c) {\n\t\t\t$c['count'] = (int) $c['count'];\n\t\t\t$output['all'] += $c['count'];\n\t\t\tif (!isset($output[$c['type']])) {\n\t\t\t\t$output[$c['type']] = 0;\n\t\t\t}\n\t\t\t$output[$c['type']] += $c['count'];\n\t\t}\n\t\treturn $output;\n\t}", "public function admin_getList()\n {\n $sql = 'select * from '.$this->table.' where status >= 0';\n return $this->query($sql);\n }", "public function status()\n {\n return [\n 'publish' => trans('dashboard::post/base.status_list.publish'),\n 'draft' => trans('dashboard::post/base.status_list.draft'),\n ];\n }", "private function table_data(){\n $data = array();\n\n global $wpdb;\n\n $data = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}lic_activations ORDER BY ID ASC\", ARRAY_A);\n \n return $data;\n }", "public static function getNbType()\n {\n \n \t$conn = Connection::get();\n \t$select = $conn->query (\"SELECT type_presentation.id_type as id, type_presentation.nom_type as type, count(presentation.id_presentation) as nb from type_presentation LEFT JOIN presentation on type_presentation.id_type = presentation.id_type GROUP BY type_presentation.id_type ORDER BY type_presentation.nom_type\");\n \n \t$result = array ();\n \n \t$result = $select->fetchAll(PDO::FETCH_ASSOC);\n \n \treturn $result;\n }", "function listing_status_taxonomy() {\n\n\t\t$name = __( 'Status', 'wp_listings' );\n\t\t$singular_name = __( 'Status', 'wp_listings' );\n\n\t\treturn array(\n\t\t\t'status' => array(\n\t\t\t\t'labels' => array(\n\t\t\t\t\t'name'\t\t\t\t\t=> strip_tags( $name ),\n\t\t\t\t\t'singular_name' \t\t=> strip_tags( $singular_name ),\n\t\t\t\t\t'menu_name'\t\t\t\t=> strip_tags( $name ),\n\n\t\t\t\t\t'search_items'\t\t\t=> sprintf( __( 'Search %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'popular_items'\t\t\t=> sprintf( __( 'Popular %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'all_items'\t\t\t\t=> sprintf( __( 'All %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'edit_item'\t\t\t\t=> sprintf( __( 'Edit %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'update_item'\t\t\t=> sprintf( __( 'Update %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'add_new_item'\t\t\t=> sprintf( __( 'Add New %s', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'new_item_name'\t\t\t=> sprintf( __( 'New %s Name', 'wp_listings' ), strip_tags( $singular_name ) ),\n\t\t\t\t\t'add_or_remove_items'\t=> sprintf( __( 'Add or Remove %s', 'wp_listings' ), strip_tags( $name ) ),\n\t\t\t\t\t'choose_from_most_used'\t=> sprintf( __( 'Choose from the most used %s', 'wp_listings' ), strip_tags( $name ) )\n\t\t\t\t),\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'rewrite' => array( __( 'status', 'wp_listings' ), 'with_front' => false ),\n\t\t\t\t'editable' => 0\n\t\t\t)\n\t\t);\n\n\t}", "function get_status_count(){\n global $db_db;\n $query = \"SELECT * FROM users WHERE status = :status\";\n $statement = $db_db->prepare($query);\n $statement->bindValue(':status', 'F');\n $statement->execute();\n $results = $statement->rowcount();\n $statement->closeCursor();\n return $results;\n }", "function getOrderStatusList(){\n\treturn [\n\t\t\"NEW\" => [\n\t\t\t'code' => 1,\n\t\t\t'text' => \"Yet to Start\"\n\t\t],\n\t\t\"IN_PROGRESS\" => [\n\t\t\t'code' => 2,\n\t\t\t'text' => \"Working\"\n\t\t],\n\t\t\"DELIVERED\" => [\n\t\t\t'code' => 3,\n\t\t\t'text' => \"Delivered\"\n\t\t],\n\t\t\"IN_REVIEW\" => [\n\t\t\t'code' => 4,\n\t\t\t'text' => \"In review\"\n\t\t],\n\t\t\"COMPLETED\" => [\n\t\t\t'code' => 5,\n\t\t\t'text' => \"Completed\"\n\t\t],\n\t\t\"CANCELLED\" => [\n\t\t\t'code' => 6,\n\t\t\t'text' => \"Cancelled\"\n\t\t],\n\t\t\"PENDIND_REQUIREMENT\" => [\n\t\t\t'code' => 7,\n\t\t\t'text' => \"Pending Requirement\"\n\t\t]\n\t];\n}", "public function getStatuses()\n {\n return $this->statuses;\n }", "public static function listAll()\n\t{\n\t\t$sql = new Sql();\n\t\treturn $sql->select(\"SELECT * FROM tb_ordersstatus ORDER BY desstatus\");\n\t}", "function get_all_jemaat_count_waiting()\n {\n //$this->db->from('jemaat');\n //return $this->db->query(\"select COUNT(*) as jumlah FROM jemaat WHERE status_jemaat = 'waiting'\")->num_rows();\n return $this->db->where(['status_jemaat'=>'waiting'])->from(\"jemaat\")->count_all_results();\n //return $this->db->count_all_results();\n }", "public function labels()\r\n {\r\n \treturn array(\r\n\t\t\t 'id_post'\t\t=> 'Id post',\r\n\t\t\t 'id_user'\t\t=> 'Id user',\r\n\t\t\t 'id_category'\t=> 'Id category',\r\n\t\t\t 'id_location'\t=> 'Id location',\r\n\t\t\t 'type'\t\t\t=> 'Type',\r\n\t\t\t 'title'\t\t\t=> 'Title',\r\n\t\t\t 'seotitle'\t\t=> 'SEO title',\r\n\t\t\t 'description'\t=> 'Description',\r\n\t\t\t 'adress'\t\t=> 'Adress',\r\n\t\t\t 'price'\t\t\t=> 'Price',\r\n\t\t\t 'phone'\t\t\t=> 'Phone',\r\n\t\t\t 'ip_address'\t=> 'Ip address',\r\n\t\t\t 'created'\t\t=> 'Created',\r\n\t\t\t 'published'\t\t=> 'Published',\r\n\t\t\t 'status'\t\t=> 'Status',\r\n\t\t\t 'has_images'\t=> 'Has images',\r\n\t\t\t );\r\n }", "public function getListOff()\n {\n $db = $this->dblocal;\n try\n {\n $stmt = $db->prepare(\"SELECT @rownum := @rownum + 1 AS urutan,t.* FROM m_offtaker t, \n (SELECT @rownum := 0) r ORDER BY id_off ASC\");\n $stmt->execute();\n $stat[0] = true;\n $stat[1] = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $stat;\n }\n catch(PDOException $ex)\n {\n $stat[0] = false;\n $stat[1] = $ex->getMessage();\n return $stat;\n }\n }", "public function wilayah($status,$cabang)\n {\n $wilayah = User::select('wilayah')->where('status',$status)->where('cabang',$cabang)->groupBy('wilayah')->get();\n if($wilayah != null){\n $wilayah['count'] = $wilayah->count();\n }\n return $wilayah;\n }", "function getUserStatus(){\n\t\t//$org_id=$this->session->userdata('organisation_id');\n\t\t//$qry=$this->db->where( 'organisation_id', $org_id );\n\t\t//---\n\t\t$qry=$this->db->get('user_statuses');\n\t\t$count=$qry->num_rows();\n\t\t\t$s= $qry->result_array();\n\t\t\n\t\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\n\t\t\t$status[$s[$i]['id']]=$s[$i]['name'];\n\t\t\t}\n\t\t\treturn $status;\n\t}", "public static function getAllStatus(): array\n {\n $statuses = array();\n //====================================================================//\n // Complete Status Informations\n foreach (SplashStatus::getAll() as $status) {\n $statuses[] = array(\n 'code' => $status,\n 'field' => 'SPLASH_ORDER_'.strtoupper($status),\n 'name' => str_replace(\"Order\", \"Status \", $status),\n 'desc' => 'Order Status for '.str_replace(\"Order\", \"\", $status)\n );\n }\n\n return $statuses;\n }", "protected function _getItemsData()\n {\n $data = array();\n $status = $this->_getCount();\n if (isset($status['yes']) && $status['yes'] > 0) {\n $data[] = array(\n 'label' => Mage::helper('vs7_saleattribute')->__('Sale'),\n 'value' => 1,\n 'count' => isset($status['yes']) ? $status['yes'] : 0,\n );\n }\n\n return $data;\n }", "function get_all_mstlokasipelayanan_count()\n {\n $mstlokasipelayanan = $this->db->query(\"\n SELECT\n count(*) as count\n\n FROM\n `mstlokasipelayanan`\n \")->row_array();\n\n return $mstlokasipelayanan['count'];\n }" ]
[ "0.73178685", "0.6528165", "0.62678427", "0.6252064", "0.62262625", "0.622553", "0.6109378", "0.60659975", "0.6047154", "0.60281193", "0.6000045", "0.5978296", "0.594938", "0.59173304", "0.5899136", "0.58824915", "0.58711296", "0.58551526", "0.58247805", "0.58225137", "0.58197767", "0.5815149", "0.57987577", "0.57867324", "0.5769284", "0.5769284", "0.5769284", "0.57653", "0.57541025", "0.5742261", "0.57326335", "0.5728725", "0.56934875", "0.56826156", "0.56826156", "0.5662754", "0.56583875", "0.5644782", "0.5644637", "0.5642891", "0.5635598", "0.5623905", "0.5613674", "0.5608143", "0.56081134", "0.55940706", "0.559146", "0.5578722", "0.5562358", "0.5544172", "0.5525039", "0.5521281", "0.5516148", "0.55157125", "0.5511527", "0.5502084", "0.54874384", "0.5487327", "0.54870397", "0.5486792", "0.5481156", "0.5479582", "0.5454614", "0.545404", "0.54525137", "0.5452201", "0.54511636", "0.5441136", "0.5432598", "0.5423444", "0.54225194", "0.5421873", "0.5421584", "0.54209256", "0.54209256", "0.54199904", "0.54185134", "0.5407486", "0.5390879", "0.53655565", "0.5364516", "0.5364379", "0.5356917", "0.5348503", "0.53468597", "0.5346646", "0.53405315", "0.5339988", "0.53283185", "0.5326857", "0.53242165", "0.5322067", "0.5320086", "0.5318477", "0.53165144", "0.5306746", "0.53048295", "0.5303715", "0.53013796", "0.530113" ]
0.68093413
1
Get the stub file for the generator.
protected function getStub(): string { return __DIR__ . '/partial_stubs/model.stub'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStubFile(): string\n {\n return $this->getStubFileFromPresetStorage($this->preset, 'seeder.stub');\n }", "protected function getStub()\n {\n return $this->files->get($this->getStubPath().'/default.stub');\n }", "public function getStubFile(): string\n {\n return $this->getStubFileFromPresetStorage($this->preset, 'console.stub');\n }", "protected function getStub()\n {\n if ($this->option('view')) {\n return __DIR__ . '/stubs/view.stub';\n }\n\n return __DIR__ . '/stubs/table.stub';\n }", "private function getStub()\n {\n return $this->files->get($this->stubPath);\n }", "protected function getStub()\n {\n if ($stub = $this->option('stub')) {\n return $stub;\n }\n\n if ($this->option('model')) {\n return __DIR__.'/stubs/controller.stub';\n }\n\n return __DIR__.'/stubs/blank.stub';\n }", "protected function getStub()\n {\n return config('crudgenerator.custom_template')\n ? config('crudgenerator.path') . '/acl-migration.stub'\n : __DIR__ . '/../stubs/acl-migration.stub';\n }", "protected function getStub()\n {\n return $this->collection()\n ? __DIR__.'/stubs/resource-collection.stub'\n : __DIR__.'/stubs/resource.stub';\n }", "protected function getStub() {\n $stub = null;\n\n if ($this->option('crud')) {\n return __DIR__ . '/stubs/schema.crud.stub';\n }else if ($this->option('progressive')) {\n return __DIR__ . '/stubs/schema.progressive.stub';\n }else if ($this->option('report')) {\n return __DIR__ . '/stubs/schema.report.stub';\n }else if ($this->option('chart')) {\n return __DIR__ . '/stubs/schema.chart.stub';\n }\n return __DIR__.$stub;\n }", "protected function getStub()\n {\n $stub = '/stubs/form.stub';\n\n return __DIR__.$stub;\n }", "protected function getStub()\n {\n if ($this->option('validator')) {\n return __DIR__.'/stubs/factory-validator.stub';\n } else {\n return __DIR__.'/stubs/factory-no-validator.stub';\n }\n }", "protected function getStub()\n {\n return base_path() . '/resources/stubs/model.stub';\n }", "protected function getStub()\n {\n return resource_path('stubs/view.stub');\n }", "protected function getStub()\n {\n return $this->option('model')\n ? __DIR__ . '/stubs/service.stub'\n : __DIR__ . '/stubs/service_default.stub';\n }", "protected function getStub()\n {\n $stub = __DIR__.'/../stubs/contracts/contract';\n\n if ($this->option('extends')) {\n $stub .= '.extends';\n }\n\n return $stub.'.stub';\n }", "protected function getStub()\n {\n return $this->files->get($this->getStubPath().\"/create.attribute.stub\");\n }", "protected function getStub()\n {\n $dir = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..';\n// if ($this->option('unit')) {\n// return $dir.'/stubs/unit-test.stub';\n// }\n\n return $dir. DIRECTORY_SEPARATOR .'stubs'. DIRECTORY_SEPARATOR .'test.stub';\n }", "protected function getStub()\n {\n if ($this->option('component')) {\n return __DIR__ . '/Stubs/FacadeComponent.stub';\n }\n return __DIR__ . '/Stubs/Facade.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/views/plain.stub';\n }", "protected function getStub()\n {\n return $this->getStubDir() . '/model.stub';\n }", "protected function getStub(): string\n {\n return __DIR__ . '/stubs/Factory.stub';\n }", "protected function getStub()\n {\n if ($this->option('plain')) {\n return __DIR__.'/stubs/base-controller.plain.stub';\n }\n\n return __DIR__.'/stubs/base-controller.stub';\n }", "protected function getStub()\n {\n $stub = null;\n\n if ($this->option('parent')) {\n $stub = '/stubs/controller.nested.stub';\n } elseif ($this->option('model')) {\n $stub = '/stubs/controller.model.stub';\n } elseif ($this->option('resource')) {\n $stub = '/stubs/controller.stub';\n }\n\n if ($this->option('api') && is_null($stub)) {\n $stub = '/stubs/controller.api.stub';\n } elseif ($this->option('api') && ! is_null($stub)) {\n $stub = str_replace('.stub', '.api.stub', $stub);\n }\n\n $stub = $stub ?? '/stubs/controller.plain.stub';\n\n return __DIR__.$stub;\n }", "protected function getStub(): string\n {\n return $this->resolveStubPath(\n $this->option('markdown') !== false\n ? '/stubs/markdown-mail.stub'\n : '/stubs/mail.stub');\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/kompo-'.($this->option('demo') ? 'demo-' : '').'form.stub';\n }", "protected function getStub(): string\n {\n return __DIR__ . '/../../../resources/stubs/views/view.stub';\n }", "protected function getStub()\n {\n $type = (!is_null($this->option('type')) && in_array($this->option('type'), ['plain', 'extended']))\n ? $this->option('type')\n : 'plain';\n\n return __DIR__ . \"/stubs/responder/{$type}.stub\";\n }", "protected function getStub()\n {\n if ($this->option('pivot')) {\n return parent::getStub();\n }\n\n return __DIR__ . '/stubs/model.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/interface.php.stub';\n }", "protected function getStub()\n {\n if ($this->option('trait')) {\n return __DIR__.'/../Stubs/Trait.stub';\n }\n if ($this->option('interface')) {\n return __DIR__.'/../Stubs/Interface.stub';\n }\n\n return __DIR__.'/../Stubs/Class.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../stubs/seed.stub';\n }", "protected function getStub()\n\t{\n\t\treturn $this->resolveStubPath('/stubs/integration-manifest.stub');\n\t}", "protected function getStub()\n {\n return config('laravel-crud-generator.custom_template')\n ? config('laravel-crud-generator.path') . '/model.stub'\n : __DIR__ . '/../stubs/model.stub';\n }", "protected function getStub()\n {\n return $this->resolveStubPath('/stubs/bfg-component.stub');\n }", "protected function getStub()\n {\n if ($this->option('request')) {\n return __DIR__.'/stubs/mutator-request.stub';\n } elseif ($this->option('clean')) {\n return __DIR__.'/stubs/mutator-clean.stub';\n } else {\n return __DIR__.'/stubs/mutator.stub';\n }\n }", "protected function getStub()\n {\n if ($this->option('service')) {\n return __DIR__.'/stubs/controller.service.stub';\n } elseif($this->option('base')) {\n return __DIR__.'/stubs/controller.base.stub';\n } elseif($this->option('otp')) {\n return __DIR__.'/stubs/controller.service.otp.stub';\n }\n return __DIR__.'/stubs/controller.plain.stub';\n }", "protected function getStub()\n {\n return file_get_contents(__DIR__ . '/../../Stubs/' . ucfirst($this->type() . 'Task.php'));\n }", "protected function getStub()\n {\n $stub = '/stubs/class.stub';\n\n if ($this->option('constructor')) {\n $stub = '/stubs/class.constructor.stub';\n }\n\n return __DIR__.$stub;\n }", "protected function getStub()\n {\n $stub = '/stubs/class.stub';\n\n if ($this->option('constructor')) {\n $stub = '/stubs/class.constructor.stub';\n }\n\n return __DIR__.$stub;\n }", "public function getStub()\n {\n return File::get(__DIR__.'/../stubs/migrations/migration.stub');\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/bond.stub';\n }", "private function getStub()\n {\n return app_path() . '\\Stubs\\repository_contract.stub';\n }", "protected function getStub()\n {\n if ($this->option('view')) {\n return __DIR__.'/stubs/controller/controller.view.stub';\n }\n\n return __DIR__.'/stubs/controller/controller.api.stub';\n }", "protected function getStub()\n {\n return realpath(__DIR__) .str_replace('/', DS, '/stubs/reminders.stub');\n }", "protected function getStub()\n {\n return $this->getStubsPath() . 'controller.stub';\n }", "protected function getStub(): string\n {\n return __DIR__ . '/../stubs/abstract/iservice.stub';\n }", "protected function getStub()\n {\n if ($this->option('model')) {\n return __DIR__ . '/Stubs/CrudRepository.stub';\n }\n\n return __DIR__ . '/Stubs/Repository.stub';\n }", "protected function getStub(): string\n {\n return __DIR__.'/stubs/php_cs.stub';\n }", "protected function getStub()\n {\n return app_path('Console/Commands/stubs/form-request.stub');\n }", "protected function getStub()\n {\n return $this->resolveStubPath('/stubs/service.stub');\n }", "protected function getStub()\n {\n return $this->option('pivot')\n ? $this->resolveStubPath('/stubs/base_stubs/model.pivot.stub')\n : $this->resolveStubPath('/stubs/base_stubs/model.stub');\n }", "protected function getStub(): string\n {\n return __DIR__.'/stubs/interaction.stub';\n }", "protected function getStub(): string\n\t{\n\t\treturn __DIR__ . '/../../../stubs/action.interface.stub';\n\t}", "protected function getStub():string\n {\n return __DIR__ . '/stubs/controller.stub';\n }", "protected function getStub()\n {\n return $this->option('model')\n ? $this->resolveStubPath('/stubs/observer.stub')\n : $this->resolveStubPath('/stubs/observer.plain.stub');\n }", "protected function getStub()\n {\n return app_path() . '\\Console\\stubs\\controller.stub';\n }", "public function getStub()\n {\n if ($this->option('pivot')) {\n return __DIR__.'/../../stubs/pivot.model.stub';\n }\n\n return __DIR__.'/../../stubs/model.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../stubs/model.stub';\n }", "protected function getStub()\n {\n if (!$this->option('pivot')) {\n return __DIR__.'/stubs/model.stub';\n }\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/repository-interface.stub';\n }", "protected function getStub()\n {\n return base_path('resources' . DIRECTORY_SEPARATOR . 'stubs' . DIRECTORY_SEPARATOR . 'SystemParameter.stub');\n }", "protected function getStub(): string\n {\n return base_path('stubs/vue-component.stub');\n }", "protected function getStub()\n {\n return app_path('Core/Stub/Migration.stub');\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/form-request.stub';\n }", "protected function getStub()\n {\n return base_path('stubs\\service.stub');\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/service.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/../stubs/' . '/' . 'request.stub';\n }", "protected function getStub()\n {\n if ($this->option('array')) {\n return $this->copyFrom('/stubs/export.array.stub');\n } elseif ($this->option('model')) {\n return $this->copyFrom('/stubs/export.model.stub');\n } elseif ($this->option('query')) {\n return $this->copyFrom('/stubs/export.query.stub');\n }\n\n return $this->copyFrom('/stubs/export.collection.stub');\n }", "protected function getStub()\n {\n return __DIR__ . '/../stubs/transformer.stub';\n }", "protected function getStub()\n\t{\n\t\treturn __DIR__.'/stubs/api.stub';\n\t}", "protected function getStub()\n {\n return __DIR__ . '/../stubs/repository.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/api-consumer-endpoint.stub';\n }", "protected function getStub()\n {\n return app_path('Stubs/migration.stub');\n }", "protected function getStub()\n {\n return realpath(__DIR__.'/stubs/dashboard.stub');\n }", "protected function getStub()\n {\n return __DIR__.'/../stubs/' . '/' . 'model.stub';\n }", "protected function getStub(): string\n {\n return __DIR__ . '/stubs/authServiceProvider.stub';\n }", "public function getStub()\n {\n return app()->basePath('vendor/samuel-nunes/lumen-form-request-validation/src/Console/Stubs/'.$this->stubName.'.stub');\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/entity_controller.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/action.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/../stubs/composer.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../stubs/serviceProvider.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/command.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/command.stub';\n }", "protected function getStub() {\n return __DIR__ . '/stubs/trait.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../../stubs/modelValidator.stub';\n }", "protected function getStub()\n {\n return $this->resolveStubPath('/stubs/cast.stub');\n }", "public function generate()\n {\n return $this->templateStub;\n }", "protected function getStub()\n {\n return realpath(__DIR__ . '/../stubs/Filter.stub');\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/factory.stub';\n }", "protected function getStub()\n {\n return app_path('Core/Stub/HTML/Views/index.stub');\n }", "protected function getStub()\n\t{\n\t\treturn $this->getStubDirectory('Service.stub');\n\t}", "protected function getStub()\n {\n return __DIR__. '/stubs/facade.base.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/stubs/trait.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../Stubs/RepositoryInterface.stub';\n }", "protected function getStub()\n {\n return __DIR__.'/stubs/LICENSE.stub';\n }", "protected function getStub(): string\n {\n return __DIR__ . '/stubs/filter.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/../Stubs/ServiceInterface.stub';\n }", "protected function getStub()\n {\n return __DIR__ . '/Stubs/ServiceProvider.stub';\n }", "public function getStub()\n\t{\n\t\treturn $this->getStubDirectory('Policy.stub');\n\t}", "protected function getStub()\n {\n return __DIR__.'/stubs/make/request.stub';\n }" ]
[ "0.83577883", "0.81976575", "0.8165961", "0.8129762", "0.80362254", "0.8004043", "0.7957915", "0.79415196", "0.7873869", "0.786923", "0.7858761", "0.78551805", "0.7849868", "0.78463316", "0.7844067", "0.78299034", "0.7825267", "0.7817042", "0.7811249", "0.77900445", "0.77872264", "0.77837694", "0.7760309", "0.77581644", "0.7754458", "0.77445877", "0.77365917", "0.7732039", "0.7720171", "0.7709344", "0.77078307", "0.7707502", "0.77062076", "0.7699731", "0.7692721", "0.76793903", "0.7678674", "0.76660573", "0.76660573", "0.7661029", "0.76586574", "0.76545906", "0.7647792", "0.7642207", "0.76334095", "0.76285094", "0.7623656", "0.75976866", "0.7591955", "0.7584828", "0.757906", "0.7578946", "0.75774294", "0.7572424", "0.75610656", "0.75471556", "0.75387335", "0.7538311", "0.75273174", "0.75223684", "0.7514447", "0.7509941", "0.750659", "0.75012517", "0.7496333", "0.7490246", "0.74879473", "0.7484044", "0.74791336", "0.7475106", "0.74690765", "0.74296206", "0.7424854", "0.7412223", "0.7403515", "0.73910695", "0.7386576", "0.73790276", "0.73647326", "0.7356742", "0.7351666", "0.73302424", "0.73302424", "0.73188674", "0.73129016", "0.73026514", "0.7296533", "0.7286266", "0.72750676", "0.7273454", "0.7264225", "0.7261402", "0.72608393", "0.7242524", "0.72250617", "0.7224597", "0.71739674", "0.7159979", "0.7157228", "0.7153293" ]
0.79104775
8
Define the application's command schedule.
protected function schedule(Schedule $schedule) { $schedule->call(function(){ $context = stream_context_create(array( "http" => array( "header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36" ) ) ); $books = Book::where('available', false)->get(); foreach($books as $book) { try{ $page = file_get_contents($book->url, false, $context); }catch(\Exception $e){ continue; } if(Str::contains($book->url, 'mackbooks')){ if(Str::contains($page, 'Available to pre-order')){ $book->available = false; $book->save(); }else{ $book->available = true; $book->save(); Mail::to(env('NOTIFICATION_RECIPIENT'))->send(new BookAvailable($book)); } }else{ preg_match('/<div class=\"headline headline\-left\">(.*?)<\/div>/s', $page, $matches); if(Str::contains($matches[0], 'Not yet published')){ $book->available = false; $book->save(); }elseif(Str::contains($matches[0], 'Free shipping')){ $book->available = true; $book->save(); Mail::to(env('NOTIFICATION_RECIPIENT'))->send(new BookAvailable($book)); } } $page = null; } })->dailyAt('09:00'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->sendOutputTo('/Users/gumoon/Desktop/testcommand.txt', true)\n// ->everyMinute();\n $logFile = env('CRONTAB_LOG_DIR') . 'zoglo.txt';\n $schedule->command('news:fetch 10')->sendOutputTo($logFile, true)->everyMinute();\n// $schedule->exec('date')->everyMinute()->sendOutputTo('/Users/gumoon/Desktop/testcommand.txt', true);\n }", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->everyMinute();\n// $schedule->command('process:timers')->everyMinute();\n// $schedule->command('travel_sender')->everyFiveMinutes();\n// $schedule->command('travel_cleaner')->everyFiveMinutes();\n// $schedule->command('auction:purchases')->everyFiveMinutes();\n//\n }", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')->hourly();\n }", "protected function schedule(Schedule $schedule)\n {\n //$schedule->command('clickm')->everyMinute();\n }", "protected function schedule(Schedule $schedule)\n {\n //* * * * * /usr/bin/php /your/projectPath/artisan schedule:run >> /dev/null 2>&1\n\n //买格子后的日志,记录到数据库\n $schedule->command('Grid:TradeInfo')->everyMinute()->withoutOverlapping();\n\n //延时统计用户成就\n $schedule->command('Grid:Achievement')->everyFiveMinutes()->withoutOverlapping();\n\n //延时更新用户头像\n $schedule->command('Grid:ChangeAvatar')->everyMinute()->withoutOverlapping();\n\n //排行榜统计\n $schedule->command('Grid:RankList')->everyFiveMinutes()->withoutOverlapping();\n\n //n天不交易的格子自动降价m%\n $schedule->command('Grid:ReducePrice')->cron('30 2 * * *')->withoutOverlapping();\n\n\n\n\n //后台发的系统通知\n $schedule->command('Admin:SystemMessage')->everyMinute()->withoutOverlapping();\n\n //后台admin的控制面板,计算cpu,内存,硬盘占用\n $schedule->command('Admin:ServerInfoNew')->everyMinute()->withoutOverlapping();\n\n //后台admin的控制面板,统计用户分布情况\n $schedule->command('Admin:UserDistribution')->daily()->withoutOverlapping();\n\n //后台的数据统计\n $schedule->command('Admin:userData1')->everyThirtyMinutes()->withoutOverlapping();\n $schedule->command('Admin:gridData1')->everyThirtyMinutes()->withoutOverlapping();\n\n\n\n //处理探索世界迷雾\n $schedule->command('Tssj:FogUpload0')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload1')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload2')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload3')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload4')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload5')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload6')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload7')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload8')->everyMinute()->withoutOverlapping();\n $schedule->command('Tssj:FogUpload9')->everyMinute()->withoutOverlapping();\n\n //处理我的路迷雾\n $schedule->command('Wodelu:FogUpload0')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload1')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload2')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload3')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload4')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload5')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload6')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload7')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload8')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:FogUpload9')->everyMinute()->withoutOverlapping();\n\n //处理我的路足迹\n $schedule->command('Wodelu:TrackFogUploadForZUJI0')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI1')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI2')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI3')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI4')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI5')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI6')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI7')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI8')->everyMinute()->withoutOverlapping();\n $schedule->command('Wodelu:TrackFogUploadForZUJI9')->everyMinute()->withoutOverlapping();\n\n //计算昨日繁荣度 联盟的\n $schedule->command('Aliance:Flourish')->cron('1 0 * * *')->withoutOverlapping();\n //计算昨日繁荣度 用户的\n $schedule->command('Aliance:FlourishForUser')->cron('1 0 * * *')->withoutOverlapping();\n\n //每月第一天计算联盟战绩\n $schedule->command('Aliance:PKinfo')->cron('30 0 1 */1 *')->withoutOverlapping();\n\n\n\n //每分钟刷拍卖行物品,过期的返回给用户\n $schedule->command('FoodMap:AuctionHouse')->everyMinute()->withoutOverlapping();\n\n\n\n\n $schedule->command('Tssj:OneJoke')->everyFifteenMinutes()->withoutOverlapping();\n }", "public function setScheduler() {}", "protected function schedule(Schedule $schedule)\n {\n// $file = fopen(public_path('demo.txt'),'a');\n// fwrite($file,'1'.chr(10));\n// fclose($file);\n // $schedule->command('inspire')\n // ->hourly();\n $schedule->command('command:AllMatchIng')\n ->everyMinute();\n $schedule->command('command:AllMatch')\n ->everyTenMinutes();\n $schedule->command('command:ScoreNot')\n ->everyTenMinutes();\n $schedule->command('command:ScoreOver')\n ->everyTenMinutes();\n $schedule->command('command:ScoreIng')\n ->everyMinute();\n $schedule->command('command:Today')\n ->everyFifteenMinutes();\n $schedule->command('command:After')\n ->daily();\n// $schedule->command('command:AllSchedule')\n// ->everyThirtyMinutes();\n $schedule->command('command:LOL')\n ->everyTenMinutes();\n $schedule->command('command:DOTA')\n ->everyTenMinutes();\n $schedule->command('command:gok')\n ->everyTenMinutes();\n $schedule->command('command:cs')\n ->everyTenMinutes();\n }", "protected function registerAndScheduleCommands(): void\n {\n // Only register and schedule commands if we are running in CLI mode\n if ( ! $this->app->runningInConsole()) {\n return;\n }\n\n // Add all commands to Artisan\n $this->commands([\n Commands\\RequestInsuranceService::class,\n Commands\\UnlockBlockedRequestInsurances::class,\n Commands\\CleanUpRequestInsurances::class,\n Commands\\FailOrReadyProcessingRequestInsurances::class,\n ]);\n\n // Add specific commands to the schedule\n $this->callAfterResolving(Schedule::class, function (Schedule $schedule) {\n $schedule->command('unlock:request-insurances')->everyFiveMinutes();\n $schedule->command('clean:request-insurances')->everyTenMinutes();\n $schedule->command('request-insurance:unstuck-processing')->everyTenMinutes();\n });\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n $schedule->command('test-command1')->everyMinute();\n// $schedule->command('test-command')\n// ->everyMinute()\n// ->fridays()\n// ->between(\"12:00\", \"15:00\")\n// ->when(function(){\n// return true;\n// })\n// ->withoutOverlapping() //не запускать если еще предыдущий звапуск работает\n// ->before(function () {\n// // Перед запуском задачи...\n// })\n// ->after(function () {\n// // Задача завершена...\n// })\n// ->sendOutputTo($filePath);\n }", "protected function schedule(Schedule $schedule)\n {\n $logPath = storage_path('logs/commands-' . date('Y-m-d') . '.log');\n\n// $schedule->command('send:mail')->everyFiveMinutes()->withoutOverlapping();\n// $schedule->command('wechat:message')->everyFiveMinutes()->withoutOverlapping();\n $schedule->command('attendanceapi:count')\n ->appendOutputTo($logPath)\n ->dailyAt(\"06:00\")->withoutOverlapping();\n $schedule->command('set:achievements')\n ->appendOutputTo($logPath)\n ->dailyAt(\"14:30\")->withoutOverlapping();\n $schedule->command('send:meetingnews')\n ->appendOutputTo($logPath)\n ->dailyAt(\"13:00\")->withoutOverlapping();\n //$schedule->command('Entry:contract')->daily(\"06:00\");\n $schedule->command('set:task_score')\n ->appendOutputTo($logPath)\n ->dailyAt(\"06:30\")->withoutOverlapping();\n $schedule->command('user_vacation:init')\n ->appendOutputTo($logPath)\n ->everyThirtyMinutes()->withoutOverlapping();\n $schedule->command('push:message')\n ->appendOutputTo($logPath)\n ->everyMinute()->withoutOverlapping();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('autoBanSubscribeJob')->everyThirtyMinutes();\n $schedule->command('autoBanUserJob')->everyTenMinutes();\n $schedule->command('autoCheckNodeStatusJob')->everyMinute();\n $schedule->command('autoClearLogJob')->everyThirtyMinutes();\n $schedule->command('autoCloseOrderJob')->everyMinute();\n $schedule->command('autoDecGoodsTrafficJob')->everyTenMinutes();\n $schedule->command('autoDisableExpireUserJob')->everyMinute();\n $schedule->command('autoDisableUserJob')->everyMinute();\n $schedule->command('autoExpireCouponJob')->everyThirtyMinutes();\n $schedule->command('autoExpireInviteJob')->everyThirtyMinutes();\n $schedule->command('autoReleasePortJob')->everyMinute();\n $schedule->command('autoReopenUserJob')->everyMinute();\n $schedule->command('autoResetUserTrafficJob')->everyFiveMinutes();\n $schedule->command('autoStatisticsNodeDailyTrafficJob')->dailyAt('04:30');\n $schedule->command('autoStatisticsNodeHourlyTrafficJob')->hourly();\n $schedule->command('autoStatisticsUserDailyTrafficJob')->dailyAt('03:00');\n $schedule->command('autoStatisticsUserHourlyTrafficJob')->hourly();\n $schedule->command('userExpireWarningJob')->daily();\n $schedule->command('userTrafficWarningJob')->daily();\n $schedule->command('autoStatisticsNodeHourlyTestJob')->hourlyAt(10);\n// $schedule->command('autoStatisticsNodeHourlyTestJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpJob')->dailyAt('00:00');\n// $schedule->command('autoMysqlBackUpJob')->everyMinute();//测试用\n $schedule->command('autoMysqlBackUpRemoteJob')->dailyAt('00:30');\n $schedule->command('cPJob')->everyMinute();\n $schedule->command('deleteAuthJob')->everyMinute();\n $schedule->command('pushJob')->dailyAt('13:37');\n $schedule->command('telegramJob')->everyMinute();\n $schedule->command('autoCountNodeFlow')->everyMinute();\n\n\n\n }", "protected function schedule(Schedule $schedule)\n {\n\n /* Funciona */ \n $schedule->command('usuarios:cumples')->timezone('America/Lima')->at('08:00');\n\n $schedule->command('estado:cumples')->timezone('America/Lima')->at('08:00');\n \n $schedule->command('active:cumples')->timezone('America/Lima')->monthly(); \n $schedule->command('deleted:comcumple')->timezone('America/Lima')->monthly(); \n $schedule->command('deleted:tarjeta')->timezone('America/Lima')->monthly(); \n\n\n $schedule->command('estado:conferencias')->timezone('America/Lima')->hourly();\n\n \n }", "protected function schedule(Schedule $schedule)\n\t{\n\t\t//Runs daily, every 5 minutes from 03:00\n\t\t$schedule->command(TranslationsBackup::class)->dailyAt('03:00'); // Dispatching a Job that will create a CSV File with the translations\n\t\t$schedule->command(RemoveCsvFiles::class, ['1', '--queue'])->dailyAt('03:05'); // Remove CSV Files older than x months (default 1) from /var/www/public/admin/reports/csv\n\t\t$schedule->command(DeleteOldTokens::class, ['1'])->dailyAt('03:10'); // Deletes the tokens that are older than x (default 1) days\n\t\t$schedule->command(DeleteUselessTransactions::class, ['3', '1000'])->dailyAt('03:15'); //Delete a number of created transactions older than 3 months\n\t\t//$schedule->command(DeleteExpiredClients::class, ['1000'])->dailyAt('03:20'); // TODO: This comes from V1, why do we do it? Clear expired maestro clients\n\n\t\t//Runs every hour\n\t\t$schedule->command(ActivateVouchers::class)->hourly(); // Activate vouchers that are inactive and startDate < now()\n\t\t$schedule->command(DeactivateVouchers::class)->hourly(); // Deactivate vouchers that are active and stopDate < now()\n\t\t//$schedule->command(ClearPasswordAttempts::class, ['3'])->hourly(); // Update reminder table where there are more than 2 attempts and updated < last x (default 3) hours\n\t\t//$schedule->command(ClearHheClients::class)->hourly(); // TODO: This comes from V1, why do we do it? Clear expired hhe clients\n\n\t\t//Runs every 10 minutes\n\t\t//$schedule->command(MerakiCheck::class)->everyTenMinutes(); // Update airhealth.hardware based on a xml taken from a URL from site_attribute having \"meraki_network\"\n\t\t//$schedule->command(DestroyGhostSessions::class, ['10'])->everyTenMinutes(); // 1. Cleaning up NULL Connectinfo_Start records; 2. Cleaning up NULL Connectinfo_Stop records and acctstoptime; 3. Removing records stale for x (default 10) minutes\n\t\t//$schedule->command(ShutdownIdle::class, ['20'])->everyTenMinutes(); // Shuts down sessions older than x (default 20) minutes where IP is 192.168.1.2 by adding a acctstoptime | Might be CC only\n\t\t//$schedule->command(UpdateGender::class)->everyTenMinutes(); // Checks the name with the names that we have in our DB to return the gender\n\t\t$schedule->command(UpdatePmsDynamicIp::class)->everyTenMinutes(); // Updates the IP of site attributes that have dynamic_ip enabled (for UPMS and Captive PMS)\n\n\t\t//Runs every minute\n\t\t$schedule->command(DeleteTransactionReceipts::class, ['2', '10000'])->everyMinute(); // Delete a number of transaction receipts older than x (default 2) months\n\n\t\t// These are the SSID scheduling and was never implemented (unless it was)\n//\t\t$schedule->command(RevertScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n//\t\t$schedule->command(ChangeScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('play:adzan')->everyMinute();\n //$schedule->command('play:hadist')->everyMinute();\n\t $schedule->command('play:audio')->everyMinute();\n $schedule->command('hadist:rand')->everyMinute();\n $schedule->command('play:hadist')->dailyAt('02:00');\n $schedule->command('updateapi')->dailyAt('02:00');\n }", "public function getCronCmd() {}", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyFiveMinutes();\n }", "protected function schedule(Schedule $schedule)\n {\n /* $schedule->command('inspire')\n ->hourly();\n */ \n $schedule->command('sync:sfa')\n \t\t\t->dailyAt('3:00')\n \t\t\t//->withoutOverlapping()\n \t\t\t->appendOutputTo(storage_path('logs/cron').'/sync1.log');\n \n// \t\t$schedule->command('sync:sfa')\n// \t\t\t->dailyAt('12:00')\n// \t\t\t//->withoutOverlapping()\n// \t\t\t->appendOutputTo(storage_path('logs/cron').'/sync2.log');\n \n $schedule->command('reset:admin_password')\n\t\t\t ->weekly()\n\t\t\t ->mondays()\n\t\t\t ->at('2:30')\n\t\t\t ->withoutOverlapping()\n\t\t\t ->appendOutputTo(storage_path('logs/cron').'/password.log');\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n $schedule->command('openexchangerates:sync')->dailyAt('16:00')->withoutOverlapping();\n $schedule->command('reservations:room:schedule-reminder')->everyMinute()->withoutOverlapping();\n $schedule->command('subscriptions:reset-complimentary')->dailyAt('16:00')->between('16:00', '18:00')->everyMinute()->withoutOverlapping();\n \n if(config('features.subscription.invoice')) {\n \t\n\t $schedule->command('subscriptions:generate-invoice')->dailyAt('17:00')->between('17:00', '19:00')->everyFiveMinutes()->withoutOverlapping();\n\t $schedule->command('subscriptions:pay-invoice')->dailyAt('20:00')->between('20:00', '23:00')->everyTenMinutes()->withoutOverlapping();\n\t \n }\n\n //$schedule->command('recommendations:job')->hourly()->withoutOverlapping();\n\n $schedule->command('recommendations:business-opportunity')->cron('*/15 * * * *')->withoutOverlapping();\n\n $schedule->command('broadcasts:activity')->everyMinute()->withoutOverlapping();\n $schedule->command('clear:group')->dailyAt('16:00')->everyFiveMinutes()->withoutOverlapping();\n\n }", "protected function schedule(Schedule $schedule)\n {\n Log::info('=====定时任务开始====');\n // 定时发券\n $schedule->command('set:coupon')->everyMinute();\n $schedule->command('delay:coupon')->everyMinute();\n //活动开启和失效\n $schedule->command('period:active')->daily();\n //优惠券模板失效\n $schedule->command('period:coupon')->daily();\n //发券过期失效\n $schedule->command('period:coupon_grand')->daily();\n // 个人优惠券失效\n $schedule->command('invalid:coupon_library')->daily();\n //清理订单锁\n $schedule->command('clr:orderLock')->everyMinute();\n //快递单的状态\n $schedule->command('delay:express')->daily();\n // 积分商城商品过期定时下架\n $schedule->command('period:mall')->daily();\n //个人优惠券延迟失效\n $schedule->command('delay_period_coupon_library')->everyMinute();\n // 星球会员过期\n $schedule->command('expire:star')->daily();\n // 星球会员生日好礼\n $schedule->command('star:birthday')->monthlyOn(1, '0:0');\n // 星球会员每月福利\n $schedule->command('star:welfare')->everyThirtyMinutes();\n // 星球会员升级券包 处理\n $schedule->command('gift:handle')->everyMinute();\n // 关闭星球会员购买订单\n $schedule->command('close:card_order')->everyMinute();\n // 积分经验值补录定时器\n $schedule->command('add:record')->everyMinute();\n // 查询未核销券进行核销\n $schedule->command('cancel:coupon_library')->everyMinute();\n // go定时升级\n $schedule->command('go_level:trigger')->everyMinute();\n // 星球定时升级\n $schedule->command('star_level:trigger')->everyMinute();\n //使用优惠券通知小游戏\n $schedule->command('mini_game_notify')->everyMinute();\n //凌晨积分经验值补录\n $schedule->command('dirly:record')->daily();\n //优惠券到期提示通知\n $schedule->command('period:message')->daily();\n // go会员升级提醒\n $schedule->command('remind:go:upgrade')->everyMinute();\n // 星球会员升级提醒\n $schedule->command('remind:star:upgrade')->everyMinute();\n // 星球会员过期提醒\n $schedule->command('remind:star:overdue')->daily()->at('5:28');\n Log::info('=====定时任务结束====');\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n $schedule->command('init:attendance')->monthlyOn(1);\n }", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('regverification:clean')\n// ->daily();\n// $schedule->command('activity:begin:remind')\n// ->dailyAt('12:30');\n// $schedule->command('teammember:report:pendingenrollmentrequests')\n// ->dailyAt('22:00');\n// // not need to remind\n//// $schedule->command('activity:report:pendingalbumimages')\n//// ->dailyAt('09:10');\n// $schedule->command(\"storage:tmp:clean -e '3 days'\")\n// ->dailyAt('03:00');\n// $schedule->command(\"attendant:export -l gaoxin_attendants -t [email protected]\")\n// ->dailyAt('08:00');\n }", "protected function schedule(Schedule $schedule)\n {\n $date = now();\n\n /**\n * Employees\n * -------------------------------------------------------------------------------------------------------------\n */\n $schedule->command(\\App\\Console\\Commands\\EmployeesHired::class, [\n $date->copy()->subDay()->format('Y-m-d'),\n '--site' => 'santiago-hq',\n ])->dailyAt('05:55'); // Daily for the previous day\n $schedule->command(\\App\\Console\\Commands\\EmployeesHired::class, [\n $date->copy()->subDay()->startOfWeek()->format('Y-m-d') . ',' . $date->copy()->subDay()->endOfWeek()->format('Y-m-d'),\n '--site' => 'santiago-hq',\n ])->weeklyOn(1, '05:56'); // Every monday for the previous week\n $schedule->command(\\App\\Console\\Commands\\EmployeesHired::class, [\n now()->subMonth()->startOfMonth()->format('Y-m-d') . ',' . now()->subMonth()->endOfMonth()->format('Y-m-d'),\n '--site' => 'santiago-hq',\n ])->monthlyOn(1, '05:57'); // Monthly for the previous month\n\n $schedule->command(\\App\\Console\\Commands\\EmployeesTerminated::class, [\n $date->copy()->subDay()->format('Y-m-d'),\n '--site' => 'santiago-hq',\n ])->dailyAt('05:55'); // Daily for the previous day\n $schedule->command(\\App\\Console\\Commands\\EmployeesTerminated::class, [\n $date->copy()->subDay()->startOfWeek()->format('Y-m-d') . ',' . $date->copy()->subDay()->endOfWeek()->format('Y-m-d'),\n '--site' => 'santiago-hq',\n ])->weeklyOn(1, '05:56'); // Every monday for the previous week\n $schedule->command(\\App\\Console\\Commands\\EmployeesTerminated::class, [\n now()->subMonth()->startOfMonth()->format('Y-m-d') . ',' . now()->subMonth()->endOfMonth()->format('Y-m-d'),\n '--site' => 'santiago-hq',\n ])->monthlyOn(1, '05:57'); // Monthly for the previous month\n\n /**\n * Ring Central Commands\n * ---------------------------------------------------------------------------------\n */\n $schedule->command(\\App\\Console\\Commands\\General\\SendGeneralDailyProductionReportCommand::class, ['--team' => 'ECC'])->dailyAt('05:25');\n $schedule->command(\\App\\Console\\Commands\\General\\SendGeneralDailyRawReportCommand::class, ['--team' => 'ECC'])->dailyAt('05:45');\n\n $schedule->command(\\App\\Console\\Commands\\RingCentralReports\\Commands\\Publishing\\SendPublishingProductionReportCommand::class)->everyThirtyMinutes();\n\n $schedule->command(\\App\\Console\\Commands\\RingCentralReports\\Commands\\Political\\SendPoliticalFlashReportCommand::class)->hourly();\n $schedule->command(\\App\\Console\\Commands\\RingCentralReports\\Commands\\Political\\SendPoliticalProductionReportCommand::class)->hourly();\n $schedule->command(\\App\\Console\\Commands\\RingCentralReports\\Commands\\Political\\SendPoliticalTextCampaignReportCommand::class)->dailyAt('07:20');\n\n $schedule->command(\\App\\Console\\Commands\\RingCentralReports\\Commands\\HotelPlanning\\SendHotelPlanningProductionReportCommand::class, ['--date' => now()->format('Y-m-d')])->hourly();\n\n $schedule->command(\\App\\Console\\Commands\\Inbound\\SendDailySummaryCommand::class)->dailyAt('06:20');\n $schedule->command(\\App\\Console\\Commands\\Inbound\\SendWTDSummaryCommand::class)->dailyAt('06:30');\n // check for dispositions\n $schedule->command(\\App\\Console\\Commands\\CheckForDispositionsPendingIdentification::class)->everyThreeHours();\n\n /**\n * Clean up commands\n * ----------------------------------------------------------------------\n */\n $schedule->command(\\Dainsys\\Commands\\ClearLogs\\ClearLogsCommand::class, [\n '--clear',\n '--keep=3',\n ])->dailyAt('02:00');\n\n $schedule->command(\\App\\Console\\Commands\\ClearTempraryFiles::class, [\n // 'remove_files_older_than_days' => 5\n 5,\n ])->dailyAt('20:45');\n\n $schedule->command(\\Spatie\\Backup\\Commands\\BackupCommand::class)->dailyAt('21:15');\n $schedule->command(\\Spatie\\Backup\\Commands\\CleanupCommand::class)->dailyAt('22:15');\n\n $schedule->command(\\App\\Console\\Commands\\UpdateBillableHoursAndRevenue::class, [now()->subDays(1)->format('Y-m-d') . ',' . now()->format('Y-m-d')])->dailyAt('01:15');\n $schedule->command(\\Illuminate\\Database\\Console\\PruneCommand::class, [\n '--model' => [\n \\App\\Models\\Performance::class,\n \\App\\Models\\UserLogin::class,\n \\App\\Models\\Notification::class,\n ],\n ])->dailyAt('02:15');\n\n $schedule->command(\\Laravel\\Telescope\\Console\\PruneCommand::class, ['--hours' => 72])->dailyAt('06:40');\n }", "protected function schedule(Schedule $schedule) {\n // $schedule->command('inspire')\n // ->hourly();\n }", "static function cron() {\n\t\tself::starter();\n\t\tself::ender();\n\t}", "public function registerScheduledCommands($app)\n {\n $app->make(Schedule::class)\n ->call($app->make(CheckQueues::class))\n ->everyMinute()\n ->name('check-queue-alert')\n ->onOneServer();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('email:daily')\n ->dailyAt('23:30');\n\n $schedule->command('command:Aging')\n ->dailyAt('23:30');\n\n $schedule->command('command:Tat')\n ->dailyAt('23:30');\n\n $schedule->command('command:automatedsales')\n ->dailyAt('23:30');\n\n $schedule->command('command:failedpickup')\n ->dailyAt('23:30');\n\n $schedule->command('command:faileddelivery')\n ->dailyAt('23:30');\n\n $schedule->command('command:failedreturn')\n ->dailyAt('23:30');\n\n $schedule->command('command:intransit')\n ->dailyAt('23:30');\n //Feedback\n $schedule->command('command:collectFeedback')\n ->dailyAt('23:45');\n\n $schedule->command('command:task_manage')\n ->everyMinute();\n \n// $schedule->command('fb-order:update')\n// ->everyMinute();\n }", "protected function schedule(Schedule $schedule)\n {\n \n //$schedule->command('add:winners')->everyMinute();\n \n //$schedule->command('add:winners')->cron('00 18 31 10 * *');\n \n /*$schedule->command('test:test')\n ->everyMinute()\n ->sendOutputTo(base_path() . '/public/output_files/test.txt');\n */\n \n //$schedule->command('add:winners')->cron('52 13 02 11 * *');\n \n $periods = Period::all();\n \n foreach($periods as $period) {\n \n $enddate_month = explode('-', $period->enddate)[1];\n $enddate_day = explode(' ', explode('-', $period->enddate)[2])[0];\n //echo(\"maand: \" . $enddate_month . \" en dag \" . $enddate_day . \"<br>\");\n $schedule->command('add:winners')->cron('40 22 ' . $enddate_day . ' ' . $enddate_month . ' * *');\n }\n \n \n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('youtube:check')\n ->daily()\n ->withoutOverlapping();\n\n $schedule->command('youtube:duration')\n ->everyMinute()\n ->withoutOverlapping();\n\n $schedule->command('vidme:check')\n ->daily()\n ->withoutOverlapping();\n\n $schedule->command('delete:synced')\n ->daily()\n ->withoutOverlapping();\n\n $schedule->command('clean:user_watched_table')\n ->weekly()\n ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate www')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate en')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate il')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate ar')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate ro')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n // $schedule->command('mapcontentjson:generate ru')\n // ->everyTenMinutes()\n // ->withoutOverlapping();\n\n $schedule->command('videocache:generate')\n ->everyTenMinutes()\n ->withoutOverlapping();\n\n // $schedule->command('download:livefeedxml')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson en')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson il')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson ar')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson ro')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson ru')\n // ->everyMinute()\n // ->withoutOverlapping();\n\n // $schedule->command('livefeed:createjson www')\n // ->everyMinute()\n // ->withoutOverlapping();\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n }", "protected function schedule(Schedule $schedule)\n {\n //$schedule->command('inspire')->hourly();\n\n\n\n $schedule->command('emails:evento')->everyFiveMinutes();\n\n $schedule->command('emails:oportunidad')->daily()->timezone('America/Mexico_City');\n\n $schedule->command('emails:tareas')->everyFiveMinutes();\n \n $schedule->command('clear')->daily()->timezone('America/Mexico_City');\n\n $schedule->command('repeat')->daily()->timezone('America/Mexico_City');\n\n $schedule->command('emails:send')->daily()->timezone('America/Mexico_City');\n\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t\t//$schedule->command('inspire')->hourly();\n $schedule->command('jamyl:allchecks')->everyFiveMinutes();\n $schedule->command('jamyl:firekillbot')->everyFiveMinutes();\n $schedule->command('jamyl:manage')->everyFiveMinutes();\n $schedule->command('jamyl:getchannels')->Hourly();\n $schedule->command('jamyl:punk')->dailyAt('10:05');\n $schedule->command('api:getalliances')->dailyAt('00:01');\n $schedule->command('api:getcontactlists')->twiceDaily();\n $schedule->command('api:getcorporations')->everyFiveMinutes();\n $schedule->command('jamyl:refreshgrouppermissions')->everyFiveMinutes();\n $schedule->command('ts3:checknickames')->everyFiveMinutes();\n $schedule->command('ts3:updateaccess')->everyFiveMinutes();\n $schedule->command('ts3:checknicknames')->everyFiveMinutes();\n //$schedule->command('ts3:getgroups')->twiceDaily();\n\t}", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "public function schedule(Schedule $schedule): void\n {\n // $schedule->command(static::class)->everyMinute();\n }", "protected function schedule(Schedule $schedule)\n {\n\n $schedule->command('inspire')\n ->everyMinute()->withoutOverlapping();\n $schedule->command('invite')\n ->everyMinute()->withoutOverlapping();\n $schedule->command('reminder')\n ->daily()->at('06:45')->withoutOverlapping();\n $schedule->command('notify_admin_pending_sign_up_payments')\n ->hourly()->withoutOverlapping();\n $schedule->command('notify_no_audit_after_payment')\n ->hourly()->withoutOverlapping();\n $schedule->command('subscription:renew')\n ->daily()->withoutOverlapping();\n $schedule->command('roster:job')\n ->daily()->at('00:02')->withoutOverlapping();\n $schedule->command('tempMjb:remove')\n ->weekly()->at('23:30')->withoutOverlapping(); //runs on weekly at 23:30\n $schedule->command('audit')\n ->everyMinute()->withoutOverlapping();\n $schedule->command('question_publisher')\n ->daily()->at('00:01')->withoutOverlapping();\n }", "protected function schedule(Schedule $schedule)\n {\n //Developed by Ahmed ullah\n // $schedule->command('email:document-reminder')->everyMinute();\n\n // ->twiceDaily(1, 13); //Run the task daily at 1:00 & 13:00\n // ->dailyAt('13:00');\tRun the task every day at 13:00\n // ->daily(); Run the task every day at midnight\n\n $schedule->command('email:document-reminder')\n ->daily();\n\n //to run this command write php artisan schedule:run on powershell\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('daily:updates')->dailyAt('00:30')->timezone('Africa/Cairo');\n $schedule->command('monthly:updates')->monthlyOn(1,'00:30')->timezone('Africa/Cairo');\n\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('del:plug')\n ->everyMinute();\n $schedule->command('draw:gold')\n ->everyMinute();\n $schedule->command('check:ad')\n ->dailyAt('10:00');\n $schedule->command('get:baidu')\n ->everyTenMinutes();\n }", "public function addcron() {\r\n $os = php_uname('s');\r\n\r\n $file = APP_PATH . '/index.php?c=cron&a=apply';\r\n\r\n\r\n switch ($os) {\r\n case substr($os, 0, 7) == 'Windows':\r\n exec(\"schtasks /create /sc minute /mo 5 /tn 'update_quota' /tr . $file . /ru 'System'\");\r\n break;\r\n\r\n case substr($os, 0, 5) == 'Linux':\r\n switch ($_SERVER['SERVER_PORT']) {\r\n case 80:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n case 443:\r\n $url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n default:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\r\n }\r\n\r\n $cmdline = '*/5 * * * * /usr/bin/curl' . $url;\r\n\r\n exec('crontab -e <' . $cmdline);\r\n break;\r\n }\r\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n $schedule->command('updateView')->everyMinute();\n $schedule->command('updateTrending')->everyTenMinutes();\n $schedule->command('updateToday')->everyThirtyMinutes();\n $schedule->command('sitemap')->hourly();\n// $schedule->command('update:Chapter')->name('change1.1')->everyTenMinutes()->withoutOverlapping();\n $schedule->command('update:mangareader')->name('mangareader1')->everyMinute()->withoutOverlapping();\n $schedule->command('update:old')->name('mangareader1.old')->everyThirtyMinutes()->withoutOverlapping();\n }", "public function schedule(Schedule $schedule)\n {\n // $schedule->command(static::class)->everyMinute();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('updateapplicationaccesstoken:cron');\n $schedule->command('updateclientaccesstoken:cron');\n $schedule->command('createapplicationuser:command');\n $schedule->command('signupunregisteredclient:command');\n $schedule->command('generatebillanddeactivateplan:cron');\n $schedule->command('deactivateclientpayablesubcategory:cron');\n $schedule->command('sendofflineduesms:cron');\n $schedule->command('deleteclientevents:command');\n $schedule->command('deletecollegeevents:command');\n $schedule->command('sendmentorschedulemessages:cron');\n }", "protected function schedule(Schedule $schedule)\n {\n //admim模块下的demo测试任务\n $schedule->command('task_admin_demo_taskone')->everyMinute()->withoutOverlapping();//admim模块下的demo测试任务1\n $schedule->command('task_admin_demo_tasktwo')->everyMinute()->withoutOverlapping();//admim模块下的demo测试任务2\n $schedule->command('task_admin_demo_taskthree')->everyFiveMinutes()->withoutOverlapping();//admim模块下的demo测试任务3\n\n //xx模块xx任务\n\n }", "public function schedule(Schedule $schedule): void\n\t{\n\t\t// $schedule->command(static::class)->everyMinute();\n\t}", "public function schedule(Schedule $schedule): void\n\t{\n\t\t// $schedule->command(static::class)->everyMinute();\n\t}", "protected function schedule(Schedule $schedule)\n {\n\n // aca donde vas a configurar las horas que se enviaran\n $schedule->command('trabajador:cumpleanios')->dailyAt('10:00');\n $schedule->command('trabajador:contrato')->dailyAt('11:52');\n\n }", "protected function schedule(Schedule $schedule)\n {\n // fix lumen timezone issue\n date_default_timezone_set(config('app.timezone'));\n\n $schedule->command('cruise:crawl')->weekly()->saturdays()->at('16:00');\n $schedule->command('cruise:dump')->weekly()->saturdays()->at('20:00');\n }", "public function testScheduleCommand()\n {\n $this->artisan('schedule:run')\n ->expectsOutput('No scheduled commands are ready to run.');\n }", "protected function schedule(Schedule $schedule)\n {\n // */1 * * * * /www/web/php70/bin/php /www/htdocs/shenghua.app/artisan schedule:run --env=production 1>> /dev/null 2>&1\n\n // 每天早上8:30执行,生日提醒\n // $schedule->command('sms:birthday')->cron('30 8 * * *');\n\n // 每天早上8:30执行,推送\n // $schedule->command('push:market')->cron('30 8 * * *');\n\n // 每30分钟执行,用友库存同步\n // $schedule->command('sync:yonyoustock')->cron('*/30 * * * *');\n\n // 每30分钟执行,清除文档数据\n // $schedule->command('clear:document')->cron('*/30 * * * *');\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('notify:endrbtcontent')->daily();\n $schedule->command('notify:endcontractrenew')->daily();\n $schedule->command('notify:roadmapstartdate')->daily();\n $schedule->command('contract:auto_renew')->daily();\n\n\n $schedule->command('notify:endcontract')->weeklyOn(1, '8:00'); //weekly each monday at 10:00\n $schedule->command('notify:attachments')->weeklyOn(1, '08:15'); //weekly each monday at 10:15\n\n // $schedule->command(\"queue:work --tries=3 --daemon\");\n\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('auth:clear-resets')->hourly();\n $schedule->command('bouncer:seed')->everyTenMinutes();\n $schedule->command('calendar:import')->hourly();\n $schedule->command('calendar:reindex')->monthly();\n// $schedule->command('events:import')->monthly();\n }", "public function run()\n {\n Schedule::create(['name'=>'7:00-9:00']);\n Schedule::create(['name'=>'9:00-11:00']);\n Schedule::create(['name'=>'11:00-13:00']);\n Schedule::create(['name'=>'13:00-15:00']);\n Schedule::create(['name'=>'15:00-17:00']);\n Schedule::create(['name'=>'17:00-19:00']);\n Schedule::create(['name'=>'19:00-21:00']);\n }", "protected function schedule(Schedule $schedule)\n {\n // Получаем товары из 1С\n $schedule->command('parser:catalog')\n ->everyFiveMinutes()\n ->withoutOverlapping();\n\n // Контрагенты из 1С\n $schedule->command('parser:users')\n ->everyFiveMinutes()\n ->withoutOverlapping();\n\n // Полный экспорт контрагентов\n $schedule->command('odin:users')\n ->dailyAt('00:00');\n\n // Проверка баланса sms\n $schedule->command('sms:balance-check')\n ->dailyAt('06:00');\n\n // Удаление брошенных корзин, которые были созданы более\n // значения часов указаного в настройке cart__time_clear\n $schedule->command('cart:clear')\n ->everyFiveMinutes();\n\n // Уведомления пользователей о брошенной корзине, которые были созданы более\n // значения часов указаного в настройке cart__time_notify\n $schedule->command('cart:notify')\n ->dailyAt('10:00');\n }", "protected function schedule ( Schedule $schedule )\n {\n\n /** BEGIN: FETCH APPWORKS API DATA ****************************************/\n\n $schedule->command( 'ot-appworks:fetch-events' )\n ->hourlyAt(0)\n ->withoutOverlapping();\n\n $schedule->command( 'ot-appworks:fetch-event-data' )\n ->hourlyAt(5)\n ->withoutOverlapping();\n\n $schedule->command( 'ot-scoreboard:fetch-new-points' )\n ->everyFiveMinutes()\n ->withoutOverlapping();\n\n $schedule->command( 'ot-socialcards:fetch-new-posts' )\n ->everyFiveMinutes()\n ->withoutOverlapping();\n\n /** END: FETCH APPWORKS API DATA ******************************************/\n\n /** BEGIN: FETCH TWITTER API DATA *****************************************/\n\n $schedule->command( 'ot-socialcards:fetch-new-tweets' )\n ->everyMinute()\n ->withoutOverlapping();\n\n /** END: FETCH TWITTER API DATA *******************************************/\n\n }", "public static function wpapp_schedule_events() {\n\t\t// setup temporary script deletion.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_file_watcher' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_file_watcher' );\n\n\t\t// setup deferred instance actions schedule.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_server' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_deferred_actions_for_server' );\n\n\t\t// setup repeated actions schedule.\n\t\twp_clear_scheduled_hook( 'wpcd_wordpress_deferred_actions_for_apps' );\n\t\twp_schedule_event( time(), 'every_minute', 'wpcd_wordpress_deferred_actions_for_apps' );\n\n\t\t// @TODO does not work because the cron schedule is not registered.\n\t\t// wp_schedule_event( time(), 'every-10-seconds', \"wpcd_wordpress_repeated_actions_for_apps\" );\n\t}", "function emp_cron_schedules($schedules){\n\t$schedules['em_minute'] = array(\n\t\t'interval' => 60,\n\t\t'display' => 'Every Minute'\n\t);\n\treturn $schedules;\n}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('reminder')\n ->hourly();\n \n $schedule->command('refresh:token')->dailyAt('00:30');\n }", "function dcs_dropship_cron_definer($schedules)\r\n{ \r\n\t$schedules['monthly'] = array( \r\n\t\t'interval'=> 2592000, \r\n\t\t'display'=> __('Once Every 30 Days') \r\n\t\t); \r\n\treturn $schedules;\r\n}", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n // $schedule->command('mail:reminder')->everyMinute();\n \n // Scheduled mail to users to remind them it's the day orders are going to be send.\n $schedule->command('mail:reminder')->weekly()->sundays()->at('9:00');\n $schedule->command('mail:reminder')->weekly()->wednesdays()->at('9:00');\n\n // Scheduled mail to cyclist to remind him/her they are next on the schedule to go and pick up the orders.\n $schedule->command('mail:cyclist')->weekly()->mondays()->at('18:00');\n $schedule->command('mail:cyclist')->weekly()->thursdays()->at('18:00');\n\n // $schedule->command('mail:cyclist')->everyMinute();\n\n }", "function addCronTask()\n{\n require_once __DIR__.\"/models/SchedulesModel.php\";\n require_once __DIR__.\"/models/LogModel.php\";\n\n // Emojione client\n $Emojione = new \\Emojione\\Client(new \\Emojione\\Ruleset());\n\n\n // Get auto repost schedules\n $Schedules = new SchedulesModel;\n $Schedules->where(\"is_active\", \"=\", 1)\n ->where(\"schedule_date\", \"<=\", date(\"Y-m-d H:i:s\"))\n ->where(\"end_date\", \">=\", date(\"Y-m-d H:i:s\"))\n ->orderBy(\"last_action_date\", \"ASC\")\n ->setPageSize(5) // required to prevent server overload\n ->setPage(1)\n ->fetchData();\n\n if ($Schedules->getTotalCount() < 1) {\n // There is not any active schedule\n return false;\n }\n\n // Settings\n $settings = namespace\\settings();\n\n // Random delays between actions\n $random_delay = 0;\n if ($settings->get(\"data.random_delay\")) {\n $random_delay = rand(0, 3600); // up to an hour\n }\n\n // Speeds (action count per day)\n $default_speeds = [\n \"very_slow\" => 1,\n \"slow\" => 2,\n \"medium\" => 3,\n \"fast\" => 4,\n \"very_fast\" => 5,\n ];\n $speeds = $settings->get(\"data.speeds\");\n if (empty($speeds)) {\n $speeds = [];\n } else {\n $speeds = json_decode(json_encode($speeds), true);\n }\n $speeds = array_merge($default_speeds, $speeds);\n\n\n $as = [__DIR__.\"/models/ScheduleModel.php\", __NAMESPACE__.\"\\ScheduleModel\"];\n foreach ($Schedules->getDataAs($as) as $sc) {\n $Log = new LogModel;\n $Account = \\Controller::model(\"Account\", $sc->get(\"account_id\"));\n $User = \\Controller::model(\"User\", $sc->get(\"user_id\"));\n\n // Set default values for the log (not save yet)...\n $Log->set(\"user_id\", $User->get(\"id\"))\n ->set(\"account_id\", $Account->get(\"id\"))\n ->set(\"status\", \"error\");\n\n // Check the account\n if (!$Account->isAvailable() || $Account->get(\"login_required\")) {\n // Account is either removed (unexected, external factors)\n // Or login reqiured for this account\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Re-login is required for the account.\")\n ->save();\n continue;\n }\n\n // Check the user\n if (!$User->isAvailable() || !$User->get(\"is_active\") || $User->isExpired()) {\n // User is not valid\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"User account is either disabled or expired.\")\n ->save();\n continue;\n }\n\n if ($User->get(\"id\") != $Account->get(\"user_id\")) {\n // Unexpected, data modified by external factors\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n // Check user access to the module\n $user_modules = $User->get(\"settings.modules\");\n if (!is_array($user_modules) || !in_array(IDNAME, $user_modules)) {\n // Module is not accessible to this user\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Module is not accessible to your account.\")\n ->save();\n continue;\n }\n\n // Calculate next schedule datetime...\n if (isset($speeds[$sc->get(\"speed\")]) && (int)$speeds[$sc->get(\"speed\")] > 0) {\n $speed = (int)$speeds[$sc->get(\"speed\")];\n $delta = round(86400/$speed) + $random_delay;\n } else {\n $delta = rand(1200, 21600); // 20 min - 6 hours\n }\n\n $next_schedule = date(\"Y-m-d H:i:s\", time() + $delta);\n if ($sc->get(\"daily_pause\")) {\n $pause_from = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_from\");\n $pause_to = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_to\");\n if ($pause_to <= $pause_from) {\n // next day\n $pause_to = date(\"Y-m-d\", time() + 86400).\" \".$sc->get(\"daily_pause_to\");\n }\n\n if ($next_schedule > $pause_to) {\n // Today's pause interval is over\n $pause_from = date(\"Y-m-d H:i:s\", strtotime($pause_from) + 86400);\n $pause_to = date(\"Y-m-d H:i:s\", strtotime($pause_to) + 86400);\n }\n\n if ($next_schedule >= $pause_from && $next_schedule <= $pause_to) {\n $next_schedule = $pause_to;\n }\n }\n $sc->set(\"schedule_date\", $next_schedule)\n ->set(\"last_action_date\", date(\"Y-m-d H:i:s\"))\n ->save();\n\n\n // Parse targets\n $targets = @json_decode($sc->get(\"target\"));\n if (is_null($targets)) {\n // Unexpected, data modified by external factors or empty targets\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n if (count($targets) < 1) {\n // Couldn't find any target for the feed\n // Log data\n $Log->set(\"data.error.msg\", \"Couldn't find any target to search for the feed.\")\n ->save();\n return false;\n }\n\n // Select random target from the defined target collection\n $i = rand(0, count($targets) - 1);\n $target = $targets[$i];\n\n if (empty($target->type) || empty($target->id) ||\n !in_array($target->type, [\"hashtag\", \"location\", \"people\"])) \n {\n // Unexpected invalid target, \n // data modified by external factors\n $sc->set(\"is_active\", 0)->save();\n continue; \n }\n\n $Log->set(\"data.trigger\", $target);\n\n\n // Login into the account\n try {\n $Instagram = \\InstagramController::login($Account);\n } catch (\\Exception $e) {\n // Couldn't login into the account\n $Account->refresh();\n\n // Log data\n if ($Account->get(\"login_required\")) {\n $sc->set(\"is_active\", 0)->save();\n $Log->set(\"data.error.msg\", \"Activity has been stopped\");\n } else {\n $Log->set(\"data.error.msg\", \"Action re-scheduled\");\n }\n $Log->set(\"data.error.details\", $e->getMessage())\n ->save();\n\n continue;\n }\n\n\n // Logged in successfully\n $permissions = $User->get(\"settings.post_types\");\n $video_processing = isVideoExtenstionsLoaded() ? true : false;\n\n $acceptable_media_types = [];\n if (!empty($permissions->timeline_photo)) {\n $acceptable_media_types[] = \"1\"; // Photo\n }\n\n if (!empty($permissions->timeline_video)) {\n $acceptable_media_types[] = \"2\"; // Video\n }\n\n if (!empty($permissions->album_photo) || !empty($permissions->album_video)) {\n $acceptable_media_types[] = \"8\"; // Album\n }\n\n\n // Generate a random rank token.\n $rank_token = \\InstagramAPI\\Signatures::generateUUID();\n\n if ($target->type == \"hashtag\") {\n $hashtag = str_replace(\"#\", \"\", trim($target->id));\n if (!$hashtag) {\n continue;\n }\n\n try {\n $feed = $Instagram->hashtag->getFeed(\n $hashtag,\n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the hashtag\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = array_merge($feed->getRankedItems(), $feed->getItems());\n } else if ($target->type == \"location\") {\n try {\n $feed = $Instagram->location->getFeed(\n $target->id, \n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the location id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n } else if ($target->type == \"people\") {\n try {\n $feed = $Instagram->timeline->getUserFeed($target->id);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the user id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n }\n\n\n // Found feed item to repost\n $feed_item = null;\n\n // Shuffe items\n shuffle($items);\n\n // Iterate through the items to find a proper item to repost\n foreach ($items as $item) {\n if (!$item->getId()) {\n // Item is not valid\n continue;\n }\n\n if (!in_array($item->getMediaType(), $acceptable_media_types)) {\n // User has not got a permission to post this kind of the item\n continue;\n }\n\n if ($item->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n continue;\n }\n\n if ($item->getMediaType() == 8) {\n $medias = $item->getCarouselMedia();\n $is_valid = true;\n foreach ($medias as $media) {\n if ($media->getMediaType() == 1 && empty($permissions->album_photo)) {\n // User has not got a permission for photo albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && empty($permissions->album_video)) {\n // User has not got a permission for video albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n $is_valid = false;\n break; \n }\n }\n\n if (!$is_valid) {\n // User can not re-post this album post because of the permission \n // (or absence of the ffmpeg video processing)\n continue;\n }\n }\n\n\n $_log = new LogModel([\n \"user_id\" => $User->get(\"id\"),\n \"account_id\" => $Account->get(\"id\"),\n \"original_media_code\" => $item->getCode(),\n \"status\" => \"success\"\n ]);\n\n if ($_log->isAvailable()) {\n // Already reposted this feed\n continue;\n }\n\n // Found the feed item to repost\n $feed_item = $item;\n break;\n }\n\n\n if (empty($feed_item)) {\n $Log->set(\"data.error.msg\", \"Couldn't find the new feed item to repost\")\n ->save();\n continue;\n }\n\n\n // Download the media\n $media = [];\n if ($feed_item->getMediaType() == 1 && $feed_item->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 2 && $feed_item->getVideoVersions()[0]->getUrl()) {\n $media[] = $feed_item->getVideoVersions()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 8) {\n foreach ($feed_item->getCarouselMedia() as $m) {\n if ($m->getMediaType() == 1 && $m->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $m->getImageVersions2()->getCandidates()[0]->getUrl();\n\n } else if ($m->getMediaType() == 2 && $m->getVideoVersions()[0]->getUrl()) {\n $media[] = $m->getVideoVersions()[0]->getUrl();\n }\n }\n }\n\n\n $downloaded_media = [];\n foreach ($media as $m) {\n $url_parts = parse_url($m);\n if (empty($url_parts['path'])) {\n continue;\n }\n\n $ext = strtolower(pathinfo($url_parts['path'], PATHINFO_EXTENSION));\n $filename = uniqid(readableRandomString(8).\"-\").\".\".$ext;\n $downres = file_put_contents(TEMP_PATH . \"/\". $filename, file_get_contents($m));\n if ($downres) {\n $downloaded_media[] = $filename;\n }\n }\n\n if (empty($downloaded_media)) {\n $Log->set(\"data.error.msg\", \"Couldn't download the media of the selected post\")\n ->save();\n continue;\n }\n\n $original_caption = \"\";\n if ($feed_item->getCaption()->getText()) {\n $original_caption = $feed_item->getCaption()->getText();\n }\n\n $caption = $sc->get(\"caption\");\n $variables = [\n \"{{caption}}\" => $original_caption,\n \"{{username}}\" => \"@\".$feed_item->getUser()->getUsername(),\n \"{{full_name}}\" => $feed_item->getUser()->getFullName() ?\n $feed_item->getUser()->getFullName() :\n \"@\".$feed_item->getUser()->getUsername()\n ];\n $caption = str_replace(\n array_keys($variables), \n array_values($variables), \n $caption);\n\n $caption = $Emojione->shortnameToUnicode($caption);\n if ($User->get(\"settings.spintax\")) {\n $caption = \\Spintax::process($caption);\n }\n\n $caption = mb_substr($caption, 0, 2200);\n\n\n\n // Try to repost\n try {\n if (count($downloaded_media) > 1) {\n $album_media = [];\n\n foreach ($downloaded_media as $m) {\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n\n $album_media[] = [\n \"type\" => in_array($ext, [\"mp4\"]) ? \"video\" : \"photo\",\n \"file\" => TEMP_PATH.\"/\".$m\n ];\n }\n\n $res = $Instagram->timeline->uploadAlbum($album_media, ['caption' => $caption]);\n } else {\n $m = $downloaded_media[0];\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n if (in_array($ext, [\"mp4\"])) {\n $res = $Instagram->timeline->uploadVideo(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n } else {\n $res = $Instagram->timeline->uploadPhoto(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n }\n }\n } catch (\\Exception $e) {\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n if (!$res->isOk()) {\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", __(\"Instagram didn't return the expected result.\"))\n ->save();\n continue;\n }\n\n\n // Reposted media succesfully\n // Save log\n $thumb = null;\n if (null !== $feed_item->getImageVersions2()) {\n $thumb = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if (null !== $feed_item->getCarouselMedia()) {\n $thumb = $feed_item->getCarouselMedia()[0]->getImageVersions2()->getCandidates()[0]->getUrl();\n }\n\n\n $Log->set(\"data.grabbed\", [\n \"media_id\" => $feed_item->getId(),\n \"media_code\" => $feed_item->getCode(),\n \"media_type\" => $feed_item->getMediaType(),\n \"media_thumb\" => $thumb,\n \"user\" => [\n \"pk\" => $feed_item->getUser()->getPk(),\n \"username\" => $feed_item->getUser()->getUsername(),\n \"full_name\" => $feed_item->getUser()->getFullName()\n ]\n ]);\n\n $Log->set(\"data.reposted\", [\n \"upload_id\" => $res->getUploadId(),\n \"media_pk\" => $res->getMedia()->getPk(),\n \"media_id\" => $res->getMedia()->getId(),\n \"media_code\" => $res->getMedia()->getCode()\n ]);\n \n $Log->set(\"status\", \"success\")\n ->set(\"original_media_code\", $feed_item->getCode());\n \n\n if ($sc->get(\"remove_delay\") > 0) {\n $Log->set(\"is_removable\", 1)\n ->set(\"remove_scheduled\", date(\"Y-m-d H:i:s\", time() + $sc->get(\"remove_delay\")));\n }\n\n $Log->save();\n\n // Remove downloaded media files\n foreach ($downloaded_media as $m) {\n @unlink(TEMP_PATH.\"/\".$m);\n }\n }\n}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('statics')->everyTenMinutes();\n\n $schedule->command('statement_profile')->everyTenMinutes();\n\n $schedule->command('statement_day')->dailyAt('00:00');\n $schedule->command('statement_month')->monthlyOn(1, '00:01');\n\n// $schedule->command('search_bill_day')->dailyAt('00:10');\n// $schedule->command('search_bill_month')->monthlyOn(1, '00:11');\n\n// $schedule->command('favor:restore')->monthlyOn(1, '00:20');\n// $schedule->command('favor:enable')->monthlyOn(1, '00:21');\n\n //过期检查\n// $schedule->command('user_product:check')->dailyAt('01:00');\n// $schedule->command('user_auth:check')->dailyAt('01:01');\n\n //清除temp文件\n $schedule->command('clean_temp')->hourly();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('tarea:clientecumpleanios')->dailyAt('9:01');\n $schedule->command('tarea:soatvencido')->dailyAt('9:01');\n $schedule->command('tarea:reviciontecnicavencida')->dailyAt('9:01');\n $schedule->command('tarea:licenciavencido')->dailyAt('9:01');\n $schedule->command('tarea:cambioaciete')->everyMinute();\n $schedule->command('tarea:cambioaceitex2')->cron('0 */72 * * *');\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('make:rss')->hourly();\n\n }", "protected function configure(): void\n {\n $this->setName('schedule:list')\n ->setDescription('Displays the list of scheduled tasks.')\n ->setDefinition(\n [\n new InputArgument(\n 'source',\n InputArgument::OPTIONAL,\n 'The source directory for collecting the tasks.',\n $this->configuration\n ->getSourcePath()\n ),\n ]\n )\n ->setHelp('This command displays the scheduled tasks in a tabular format.');\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('sitemap:generate')\n // ->everyMinute();\n }", "protected function schedule(Schedule $schedule)\n {\n $tasks = Task::all();\n foreach ($tasks as $task) {\n /**\n * Importantly, we enforce that the invoked command must begin with 'task'. All commands\n * we intend to use as scheduled tasks must begin this way in their signature. This is for\n * safety to prevent accidental or malicious invocation of other artisan commands.\n */\n $schedule->command(\"task:$task->command\")->cron($task->cron);\n }\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('revenue:update')\n ->everyTenMinutes();\n // $schedule->command('say:hello')\n // ->everyMinute();\n }", "private function registerAppCommands()\n {\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }", "function ds_add_email_cron_schedules( $param ) {\n\n $param['fifteen_minute'] = array(\n 'interval' => 900, // seconds* 900/60 = 15 mins\n 'display' => __( 'Every Fifteen Minutes' )\n );\n\n return $param;\n\n }", "public function cronAction()\n {\n $force = Mage::app()->getRequest()->getParam('force', false);\n $generator = Mage::getModel('smartassistant/generator');\n $generator->scheduleRun($force);\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command(\"benfin:guides\")->weekly()->mondays();\n $schedule->command(\"benfin:check_freeze\")->daily();\n $schedule->command(\"benfin:clear-intermediate\")->daily();\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')->hourly();\n //* Du lieu chay that\n $schedule->command('weekView:reset')->weekly();\n $schedule->command('monthView:reset')->monthly();\n $schedule->command('yearView:reset')->yearly();\n\n //* Du lieu chay thu\n // $schedule->command('dayView:reset')->everyMinute();\n // $schedule->command('monthView:reset')->everyTwoMinutes();\n // $schedule->command('yearView:reset')->everyThreeMinutes();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('morning_schedule')->dailyAt('7:00');\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('cluster:refresh')->dailyAt('04:00');\n $schedule->command('cluster:refresh')->dailyAt('07:00');\n $schedule->command('cluster:refresh')->dailyAt('12:00');\n $schedule->command('cluster:refresh')->dailyAt('19:00');\n $schedule->command('cluster:refresh')->dailyAt('23:00');\n // $schedule->command('inspire')\n // ->hourly();\n }", "public function consoleScheduleAction()\n {\n $response = new ConsoleResponse();\n $request = $this->getRequest();\n\n // TODO: handle looping and scheduling actions\n\n while (true) {\n //echo \"\\tScheduling tasks...\\n\";\n\n // Exit if we have received a stop signal\n if ($request->isStopping()) {\n $response->writeLine(\"Exiting job scheduler\");\n return $response;\n } else {\n sleep(3);\n }\n }\n\n return $response;\n }", "private function scheduleVehicleJobs(): void\n {\n $hours = config('schedule.ship_matrix.at', []);\n // Ensure first and second key exists\n $hours = array_merge([1, 13], $hours);\n\n $this->schedule\n ->command(DownloadShipMatrix::class, ['--import'])\n ->twiceDaily(\n $hours[0],\n $hours[1],\n );\n\n $this->schedule\n ->command(ImportMsrp::class)\n ->daily();\n\n $this->schedule\n ->command(ImportLoaner::class)\n ->daily();\n }", "public function schedule(Schedule $schedule): void\n {\n $schedule->command(static::class)->daily();\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t\t$schedule->command('inspire')\n\t\t\t\t ->hourly();\n\t}", "protected function schedule(Schedule $schedule)\n\t{\n\t\t$schedule->command('inspire')\n\t\t\t\t ->hourly();\n\t}", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n echo date(\"Y-m-d H:i:s\").\"\\n\";\n $schedule->command('flow:sync 0 ' . date('Y-m-d'))->hourly();\n $schedule->command('flow:sync 1 ' . date('Y-m-d'))->hourly();\n $schedule->command('flow:sync 0 ' . date('Y-m-d', time() - (60 * 60 * 24) ))->dailyAt('00:20');\n $schedule->command('flow:sync 1 ' . date('Y-m-d', time() - (60 * 60 * 24) ))->dailyAt('00:40');\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('sendMailVencidos')\n ->everyMinute()\n ->appendOutputTo(\"ticketsvencidos.txt\");\n\n $schedule->command('sendMailVence3')\n ->everyMinute()\n ->appendOutputTo(\"ticketsvence3.txt\");\n \n $schedule->command('sendMailVence24')\n ->everyMinute()\n ->appendOutputTo(\"ticketsvence24.txt\");\n\n $schedule->command('send:Alertas')\n ->everyMinute()\n ->appendOutputTo(\"alertas.txt\");\n\n $schedule->command('backup:clean')->daily();\n $schedule->command('backup:run')->daily();\n\n }", "protected function schedule(Schedule $schedule){\n\n\t\t$schedule->command('CheckChallengeDeadlines:expirations')->dailyAt('04:00')->timezone('America/New_York');\n\t\t$schedule->command('CheckChallengeDeadlines:summaries', [3])->weekly()->mondays()->at('04:30')->timezone('America/New_York');\n\t\t$schedule->command('CheckChallengeDeadlines:summaries', [4])->weekly()->thursdays()->at('04:30')->timezone('America/New_York');\n\n\t}", "private function scheduleStarmapJobs(): void\n {\n $this->schedule\n ->command(DownloadStarmap::class, ['--import'])\n ->monthly();\n }", "public function schedule(Schedule $schedule): void\n {\n $schedule->command(static::class)->everyMinute()->withoutOverlapping();\n }", "protected function schedule(Schedule $schedule)\n {\n // Automation\n $schedule->call(function () {\n Automation::run();\n })->name('automation:run')->everyFiveMinutes();\n\n // Bounce/feedback handler\n $schedule->command('handler:run')->everyFiveMinutes();\n\n // Queued import/export/campaign\n $schedule->command('queue:work --tries=3')->everyMinute();\n }", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('notify:rehabilitations')->twiceDaily(1, 22);\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n //每日校時\n $schedule->command('sms:ntpdate_localtime')->daily();\n //每日2點自動帳號同步\n $schedule->command('sms:sync_ad_account')\n ->withoutOverlapping()\n //->everyMinute()\n ->cron('0 2 * * *')\n ->after(function () {\n if(env('APP_OS') == \"ubuntu\"){\n Storage::append('/var/log/syslog', Carbon::now().' [E-Tool][Sync Account](Auto))'.\"\\n\");\n }else{\n Storage::append('/var/log/messages', Carbon::now().' [E-Tool][Sync Account](Auto))'.\"\\n\");\n }\n });\n }", "public function cron(){\n\n $out = shell_exec('/opt/php56/bin/php /home2/nitcfest/public_html/bullsnbears.tathva.org/artisan schedule:run >> /dev/null 2>&1');\n return $out;\n\n }", "public function schedule(Schedule $schedule): void\n {\n $schedule->command(static::class)->weekdays()->at('17:00');\n }" ]
[ "0.67529404", "0.66640395", "0.66137487", "0.65509903", "0.651756", "0.6487023", "0.64777046", "0.6475713", "0.6472033", "0.6437954", "0.6431944", "0.64265746", "0.642389", "0.6404224", "0.6365451", "0.6330308", "0.6320412", "0.63142854", "0.6311569", "0.6302855", "0.63020927", "0.62775886", "0.62765753", "0.62341726", "0.6226231", "0.62256795", "0.62239087", "0.6188098", "0.6178192", "0.6178192", "0.6178192", "0.61779237", "0.6170785", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.615892", "0.6156001", "0.6154648", "0.61507493", "0.6147589", "0.6092503", "0.6053361", "0.6039777", "0.6034754", "0.6028774", "0.6018939", "0.6018939", "0.5991768", "0.5988214", "0.598651", "0.5974835", "0.596667", "0.59574646", "0.59429747", "0.5941668", "0.59100163", "0.58972496", "0.5880426", "0.58789533", "0.58773905", "0.5868443", "0.5863277", "0.5849902", "0.58462876", "0.5820606", "0.58134955", "0.58042544", "0.58022416", "0.57890826", "0.5778977", "0.5775965", "0.5774683", "0.57742363", "0.5764936", "0.57628447", "0.5758261", "0.5756477", "0.5753398", "0.5744742", "0.57294965", "0.5727747", "0.5727747", "0.5726508", "0.57236123", "0.5723527", "0.5715951", "0.5708506", "0.569745", "0.5691536", "0.5685563", "0.5684242", "0.56841534" ]
0.0
-1
Register the commands for the application.
protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function registerCommands(): void\n {\n $commands = CommandsList::toLoad($this->app::VERSION);\n $customCommands = CommandsList::getCustomCommands();\n $commandsList = array_values($commands) + array_keys($customCommands);\n\n foreach (array_keys($commands) as $command) {\n call_user_func_array([$this, \"register{$command}Command\"], []);\n }\n\n foreach ($customCommands as $command => $callback) {\n $this->app->singleton($command, $callback);\n }\n\n $this->commands($commandsList);\n }", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n InstallCommand::class,\n MakeTileCommand::class,\n ]);\n }\n }", "protected function registerCommands(): void\n {\n $this->commands([\n\n ]);\n }", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n CreateService::class,\n CreateInterface::class,\n CreateProvider::class,\n ]);\n }\n }", "private function registerAppCommands()\n {\n }", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n KnetCommand::class,\n InstallCommand::class,\n PublishCommand::class,\n ]);\n }\n }", "public function registerCommands()\n\t{\n\t\t/*$this->app['command.assets'] = $this->app->share(function($app)\n\t\t{\n\t\t\treturn new Commands\\AssetsCommand;\n\t\t});\n\n\t\t$this->app['command.assets.compile'] = $this->app->share(function($app)\n\t\t{\n\t\t\treturn new Commands\\CompileCommand($app['assets'], $app['assets.compiler']);\n\t\t});\n\n\t\t$this->commands('command.assets', 'command.assets.cache');*/\n\t}", "private function registerCommands()\n {\n $this->add(new RunCommand());\n }", "protected function registerCommands()\n {\n $this->add(new Command\\BuildCommand());\n }", "public function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([GeneratePhaseRouter::class]);\n }\n }", "public function registerCommands()\n {\n $this->app->bindShared('command.oauth2-server.controller', function($app) {\n return new OAuthControllerCommand($app['files']);\n });\n\n $this->app->bindShared('command.oauth2-server.migrations', function($app) {\n return new MigrationsCommand($app['files']);\n });\n\n $this->commands('command.oauth2-server.controller', 'command.oauth2-server.migrations');\n }", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n InstallCommand::class,\n ]);\n }\n }", "private function registerCommands()\n\t{\n\t\tforeach ($this->commands as $command)\n\t\t{\n\t\t\t$name = ucfirst(last(explode('.', $command)));\n\n\t\t\t$this->app->singleton($command, function($app) use($name)\n\t\t\t{\n\t\t\t\treturn $app[\"Cerbero\\Workflow\\Console\\Commands\\\\{$name}WorkflowCommand\"];\n\t\t\t});\n\t\t}\n\t}", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\AddLaratrustUserTraitUseCommand::class,\n Console\\MakePermissionCommand::class,\n Console\\MakeRoleCommand::class,\n Console\\MakeSeederCommand::class,\n Console\\MakeTeamCommand::class,\n Console\\MigrationCommand::class,\n Console\\SetupCommand::class,\n Console\\SetupTeamsCommand::class,\n Console\\UpgradeCommand::class,\n ]);\n }\n }", "private function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EventListenCommand::class,\n ]);\n }\n }", "protected function registerCommands()\n {\n $this->commands([\n // \"jwt:generate\" command (generates keys).\n KeyGenerateCommand::class,\n ]);\n }", "protected function registerApplicationCommands()\n {\n if (!is_dir($dir = __DIR__.'/../Command')) {\n return;\n }\n\n $finder = new Finder();\n $finder->files()->name('*Command.php')->in($dir);\n\n $prefix = 'Phlexget\\\\Command';\n foreach ($finder as $file) {\n $ns = $prefix;\n if ($relativePath = $file->getRelativePath()) {\n $ns .= '\\\\'.strtr($relativePath, '/', '\\\\');\n }\n $r = new \\ReflectionClass($ns.'\\\\'.$file->getBasename('.php'));\n if ($r->isSubclassOf('Symfony\\\\Component\\\\Console\\\\Command\\\\Command') && !$r->isAbstract()) {\n $this->add($r->newInstance());\n }\n }\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "protected function registerCommands()\n\t{\n\t\t$this->app->bind('authentify.users-table', function()\n\t\t{\n\t\t\treturn new UsersTable;\n\t\t});\n\n\t\t$this->app->bind('authentify.social_profiles-table', function ()\n\t\t{\n\t\t\treturn new SocialProfilesTable;\n\t\t});\n\n\t\t$this->app->bind('authentify.tokens-table', function ()\n\t\t{\n\t\t\treturn new TokensTable;\n\t\t});\n\n\t\t$this->app->bind('authentify.repository', function ()\n\t\t{\n\t\t\treturn new RepositoryCommand;\n\t\t});\n\n\t\t$this->commands('authentify.users-table', 'authentify.tokens-table', 'authentify.social_profiles-table', 'authentify.repository');\n\t}", "protected function registerCommands()\n\t{\n\t\t$this->addCommand(new Command\\Generate\\Generate);\n\t\t$this->addCommand(new Command\\Init\\Init);\n\t\t$this->addCommand(new Command\\Convert\\Convert);\n\t}", "protected function registerCommands()\n {\n // create singletons of each command\n $commands = array('Register', 'Clear');\n\n foreach ($commands as $command) {\n $this->{'register'.$command.'Command'}();\n }\n\n // register commands\n $this->commands(\n 'command.presenter.register',\n 'command.presenter.clear'\n );\n }", "public function registerCommands()\n\t{\n\t\t$this->app->singleton('command.lock.clear', function ($app) {\n\t\t\treturn new ClearCommand($app['lock']);\n\t\t});\n\n\t\t$this->commands('command.lock.clear');\n\t}", "protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n call_user_func_array([$this, $method], []);\n }\n $this->commands(array_values($this->commands));\n }", "protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n call_user_func_array([$this, $method], []);\n }\n $this->commands(array_values($this->commands));\n }", "private function registerCommands()\n {\n $this->app->bindShared('command.lara-pay-ng.purge-database', function ($app) {\n return new PurgeDatabaseCommand();\n });\n }", "protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n\n call_user_func_array([$this, $method], []);\n }\n\n $this->commands(array_values($this->commands));\n }", "protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n\n call_user_func_array([$this, $method], []);\n }\n\n $this->commands(array_values($this->commands));\n }", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "protected function registerCommands()\n {\n $this->commands([\n ConvertCommand::class,\n ]);\n }", "protected function registerCommands()\n {\n $this->commands(CleanCommand::class);\n }", "private function registerConsoleCommands()\n {\n $this->commands(BadasoSitemapSetup::class);\n $this->commands(BadasoSitemapTestSetup::class);\n }", "private function registerConsoleCommands()\n {\n $this->commands(Commands\\InstallCommand::class);\n $this->commands(Commands\\AdminCommand::class);\n }", "public function registerCommands()\n\t{\n// Artisan::add(new InstallCommand);\n// Artisan::add(new UpdateCommand);\n \n\t\t$commands = array('SkinsInstall','SkinsUpdate');\n\n\t\tforeach ($commands as $command)\n\t\t{\n\t\t\t$this->{'register'.$command.'Command'}();\n\t\t}\n\n\t\t$this->commands(\n\t\t\t'command.skins.install','command.skins.update'\n\t\t);\n \n\t}", "protected function registerCommands()\r\n\t{\r\n\t\t$this->commands(\r\n\t\t\t'hipsupport.online', \r\n\t\t\t'hipsupport.offline'\r\n\t\t);\r\n\t}", "protected function loadCommands()\n {\n $this->application = new Application($this->getKernel());\n\n $this->application->add(new CreateClientCommand());\n $this->application->add(new CreateUserCommand());\n }", "public function register()\n {\n $this->commands(static::$commands);\n }", "private function registerConsoleCommands()\n {\n $this->commands(DB2Reader\\Commands\\SyncStructures::class);\n }", "public function registerAll()\n {\n $this->registerCommands();\n }", "private function setupCommands(): void\n {\n if ($this->app->runningInConsole()) {\n // $this->commands([\n // ]);\n }\n }", "protected function registerCommands()\n {\n $this->app->singleton('cms.commands.user-create', CreateUser::class);\n $this->app->singleton('cms.commands.user-delete', DeleteUser::class);\n\n $this->commands([\n 'cms.commands.user-create',\n 'cms.commands.user-delete',\n ]);\n\n return $this;\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function register()\n {\n //register the commands\n $this->commands($this->commands);\n }", "public function commands()\n {\n $this->load($this->app->path('Console/Commands'));\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n \n require base_path('routes/console.php');\n }", "public function register()\n {\n\n// foreach ($this->commands as $command)\n// {\n// $this->{\"register{$command}Command\"}();\n// }\n//\n// $this->commands(\n// \"command.route-controllers.generate\"\n// );\n\n }", "private function registerCommands(): void\n\t{\n\t\t// get all files in the Commands dir\n\t\t$commandFiles = new \\DirectoryIterator(__DIR__ . '/Command');\n\t\t// get the Command class name ... using psr4 ... this will be same as filename\n\t\t$namespace = $this->container->get('base-commands-namespace');\n\n\t\t// loop over all files in the commands folder\n\t\tforeach ($commandFiles as $commandFile) {\n\n\t\t\t// check if file is a dir\n\t\t\tif (!$commandFile->isFile()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\n\t\t\t// get the Command class name..using psr4 this will be same as filename\n\t\t\t$command = $namespace . pathinfo($commandFile, PATHINFO_FILENAME);\n\t\t\tif (str_contains($command, 'AbstractCommand')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// if it is a subclass of CommandInterface\n\t\t\tif (is_subclass_of($command, CommandInterface::class)) {\n\n\t\t\t\t// add to the container, using the name as the ID e.g. $container->add('database:migrations:migrate', MigrateDatabase::class)\n\t\t\t\t$commandName = (new \\ReflectionClass($command))->getProperty('name')->getDefaultValue();\n\t\t\t\t$this->container->add($commandName, $command);\n\t\t\t}\n\t\t}\n\n\t\t// === register all user-defined commands (@todo) ===\n\n\t}", "protected function addCommands()\n {\n $this->commands([\n MakeBlueprint::class,\n ]);\n }", "public function register()\n {\n $this->registerCommands($this->commands);\n $this->registerCommands($this->devCommands);\n }", "public function register()\n {\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerCommands();\n }", "private function loadCommands()\n {\n foreach($this->commands as $command => $class)\n {\n $this->app->bindShared($command, function($app) use ($class)\n {\n return $app->make($class);\n });\n\n $this->commands($command);\n }\n }", "public function register()\n {\n $this->registerCommands($this->commands);\n }" ]
[ "0.84608006", "0.8417399", "0.8402163", "0.8317755", "0.8316768", "0.8295053", "0.8282585", "0.82797676", "0.8279441", "0.8277464", "0.82571745", "0.82296735", "0.8222855", "0.81923383", "0.8182901", "0.8168073", "0.8112546", "0.8095785", "0.80795026", "0.8029935", "0.7962525", "0.7956269", "0.78929174", "0.78929174", "0.78762424", "0.7864433", "0.7864433", "0.78334904", "0.78334904", "0.7813936", "0.7807285", "0.7731446", "0.7714064", "0.764232", "0.76001686", "0.75150347", "0.7412085", "0.7412017", "0.73767394", "0.73696524", "0.7341464", "0.7327118", "0.72746176", "0.72726303", "0.7272588", "0.72717136", "0.7208565", "0.7194345", "0.7157433", "0.7154003", "0.7154003", "0.71525955", "0.71510226" ]
0.7213183
85
Guartdar un nuevo registro
public function create($data) { try { $record = $this->model->create($data); } catch (\Exception $e) { throw $e; } return $record; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registrar_registro()\n \n {\n /** \n * @brief : Metodos para ingresar registro en la base de datos.\n * @return :Vista donde nos mostrara todos lo registro.\n */\n \n $data =Request()->all();\n registro::create($data);\n\n }", "public function nuevo() {\n // Create a new post without validating.\n $new_post = Post::create(['author_id' => $this->current_user->id], false);\n redirect('/backend/posts/edit', [], ['id' => $new_post->id]);\n }", "public function crear()\n {\n\n try{\n $model = new \\App\\Models\\Pasientes();\n\n foreach ($_POST as $campo => $val){\n $model->$campo = $val;\n }\n\n $model::insert($model);\n $this->historico();\n\n }catch(\\Exception $e){\n\n $this->formularioCreacion(['_error' => $e]);\n\n }\n\n }", "public function nuevo() {\n }", "public function nuevoAction()\n {\n $entity = new EnvaseIngreso();\n $entity->setFecha(new \\DateTime('NOW'));\n \n $form = $this->createCreateForm($entity);\n \n return $this->render('NossisBundle:EnvaseIngreso:new.html.twig',\n array( 'form' => $form->createView(), 'entity' => $entity,\n )); \n \n }", "public function nuevo()\n\t {\n $this->Seguridad();\n\t\t$hoy = date(\"Y\").\"-\".date(\"m\").\"-\".date(\"d\").\" \".date(\"H:i:s\");\n\t\t\t\t\n\t\t$this->ValidaCampos();\n\t\tif($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t\t//Verificamos si existe el registro de ofrenda\n\t\t\t $VerifyExist = $this->model_ofrendas->ExisteOfrenda($this->input->post(\"id_registro\"));\n if($VerifyExist==0){\n \t $OfrendasInsertar = $this->input->post();//Recibimos todo los campos por array nos lo envia codeigther\n \t //$OfrendasInsertar[\"fecha_registro\"] = $hoy;//le agregamos la fecha de registro\n \t //guardamos los registros\n \t $this->model_ofrendas->SaveOfrenda($OfrendasInsertar);\n \t redirect(\"ofrendas?save=true\");\n }\n\t\t\t if($VerifyExist>0){\n $this->session->set_flashdata('msg', '<div class=\"alert alert-error text-center\">Registro Duplicado</div>');\n $this->load->view('header');\n\t\t\t\t\t$this->load->view('view_nueva_ofrenda');\n\t\t\t\t\t$this->load->view('footer');\n }\n\n\t\t}else{\n\t\t\t $this->load->view('header');\n\t\t\t $this->load->view('view_nueva_ofrenda');\n\t\t\t $this->load->view('footer');\n\t\t}\n }", "public function create()\n\n {\n \n $buscar=empresa::all();\n \n if (count($buscar)>0) {\n flash('<i class=\"icon-circle-check\"></i> ¡Ya existe un registro de empresa, para registrar uno debe eliminar el anterior!')->success()->important();\n return redirect()->back();\n } else {\n return view ('admin.empresa.create');\n }\n \n \n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $tipocodigo = new Tipocodigo();\n $tipocodigo->Descripciontipo = $this->request->getPost(\"descripcionTipo\");\n $tipocodigo->Estadoregistro = $this->request->getPost(\"estadoRegistro\");\n $tipocodigo->LongitudCodigo = $this->request->getPost(\"longitudCodigo\");\n \n\n if (!$tipocodigo->save()) {\n foreach ($tipocodigo->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"Tipo de Código se Registró Satisfactoriamente\");\n\n $this->dispatcher->forward([\n 'controller' => \"tipocodigo\",\n 'action' => 'index'\n ]);\n }", "public function nuevoAction()\n {\n $consultaCollection = \\ConsultaQuery::create()->find();\n $consultaArray = array();\n foreach ($consultaCollection as $consultaEntity){\n $consultaArray[$consultaEntity->getIdconsulta()] = $consultaEntity->getPaciente()->getPacienteNombre();\n }\n // Almacenamos en un array los registros de todos los servicios existentes en la base de datos\n $servicioCollection = \\ServicioQuery::create()->find();\n $servicioArray = array();\n foreach ($servicioCollection as $servicioEntity){\n $servicioArray[$servicioEntity->getIdservicio()] = $servicioEntity->getServicioNombre();\n }\n //Intanciamos nuestro formulario cargoadmision y le mandamos por parametro los medicos y consultorios existentes\n $cargoadmisionForm = new CargoadmisionForm($consultaArray, $servicioArray);\n $request = $this->getRequest();\n if ($request->isPost()) {\n //Instanciamos nuestro filtro\n $cargoadmisionFilter = new CargoadmisionFilter();\n //Le ponemos nuestro filtro a nuesto fromulario\n $cargoadmisionForm->setInputFilter($cargoadmisionFilter->getInputFilter());\n\n //Le ponemos los datos a nuestro formulario\n $cargoadmisionForm->setData($request->getPost());\n\n //Validamos nuestro formulario\n if($cargoadmisionForm->isValid()){\n\n //Instanciamos un nuevo objeto de nuestro objeto Paciente\n $cargoadmision = new \\Cargoadmision();\n\n //Recorremos nuestro formulario y seteamos los valores a nuestro objeto Consulta\n foreach ($cargoadmisionForm->getData() as $cargoadmisionKey => $cargoadmisionValue){\n $cargoadmision->setByName($cargoadmisionKey, $cargoadmisionValue, \\BasePeer::TYPE_FIELDNAME);\n }\n $cargoadmision->save();\n\n // Validar precio, caducidad y existencia de ordencompradetalle\n $existencia = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetalleExistencia();\n $caducidad = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetalleCaducidad();\n $precio = $cargoadmision->getLugarinventario()->getOrdencompradetalle()->getOrdencompradetallePrecio();\n $cantidad = $cargoadmision->getCantidad();\n\n if($existencia > 0){\n if($caducidad < date('Y-m-d')){\n $cargoadmision->setMonto($request->getPost()->cantidad*$precio);\n }\n }\n\n //Guardamos en nuestra base de datos\n $cargoadmision->save();\n\n //Redireccionamos a nuestro list\n //return $this->redirect()->toRoute('pacientes');\n } else {\n $messageArray = array();\n foreach ($cargoadmisionForm->getMessages() as $key => $value){\n foreach($value as $val){\n //Obtenemos el valor de la columna con error\n $message = $key.' '.$val;\n array_push($messageArray, $message);\n }\n }\n var_dump($messageArray);\n return new ViewModel(array(\n 'input_error' => $messageArray\n ));\n }\n }\n return array('cargoadmisionForm' => $cargoadmisionForm);\n }", "function insert(){\n //Declarar variables para recibir los datos del formuario nuevo\n $nombre=$_POST['nombre'];\n $apellido=$_POST['apellido'];\n $telefono=$_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n $this->index();\n }", "public function nuevo(){\r\n $data['OFICINAS'] = self::$OFICINAS;\r\n $data['ROLES'] = self::$ROLES;\r\n $data['PRIVILEGIOS'] = self::$PRIVILEGIOS;\r\n $data['PERMISOS'] = self::$PERMISOS;\r\n $this->load->library('layout');\r\n $data['header_title'] = self::$header_title;\r\n $data['header_icon'] = self::$header_icon;\r\n $data['tipo_vista'] = 'nuevo';\r\n $data['btn_guardar'] = true;\r\n $data['btn_cancelar'] = 'registros/modalidad';\r\n $this->layout->view('registros/modalidad_form', $data);\r\n $this->load->view('notificacion');\r\n }", "public function registrar(){\n $cedula = $_POST['cedula'];\n $nombre = $_POST['nombre'];\n $apellido = $_POST['apellido'];\n $edad = $_POST['edad'];\n \n //2. Crear un objeto Estudiante y enviar a actualizar\n $estudiante = new Estudiante($cedula,$nombre,$apellido,$edad); \n \n //3. llamar al modelo para registar un Estudiante\n $this->model->registrarEstudiante($estudiante);\n \n //4. redirección index. \n $mensaje= \"El estudiante fue registrado de manera correcta!\";\n Util::mostarAlerta($mensaje);\n }", "function inserir()\n{\n $produto = new Produto();\n\n // Colocando os valores recebidos do formulário nos atributos do objeto $produto\n $produto->descricao = Input::get('descricao');\n $produto->quantidade = Input::get('quantidade');\n $produto->valor = Input::get('valor');\n $produto->data_vencimento = Input::get('data_vencimento');\n\n // Salvando no banco de dados\n $produto->save();\n\n // Criado uma mensagem para o usuário\n $mensagem = \"Produto inserido com sucesso\";\n\n // Chamando a view produto.inserir e enviando a mensagem criada\n return view('produto.inserir')->with('mensagem', $mensagem);\n}", "public function Nuevo(){\n\t\tDB::table(\"materia\")->insertGetId(array(\n\t\t\t\"periodo_idperiodo\" => $_POST[\"periodo\"],\n\t\t\t\"carrera_idcarrera\" => $_POST[\"carrera\"],\n\t\t\t\"nombre\" =>$_POST[\"nombre\"]));\n\t\t\n\t\treturn Redirect::to(\"/inicio\");\n\t}", "public function createNew(Request $request)\n {\n $idComuna = DB::table('comuna')->insert([\n 'nombre_comuna'=>$request->inputComuna,\n 'descripcion_comuna'=>'sin descripcion',\n 'cod_comuna'=>9\n ]);\n return redirect()->back()->withErrors(['Inserción con éxito.']);\n }", "public function nuevo() {\n\n /* Si NO esta autenticado redirecciona a auth */\n if (!$this->ion_auth->logged_in()) {\n\n redirect('auth', 'refresh');\n }\n \n \n\n $this->load->library('form_validation');\n\n if ($this->form_validation->run('clientes')) {\n\n $data = $this->clientes->add();\n\n $index = array();\n\n $index['id'] = $data['id_cliente'];\n\n $index['type'] = \"clientes\";\n\n $this->session->set_flashdata('message', custom_lang('sima_client_created_message', 'Cliente creado correctamente'));\n\n redirect('clientes/index');\n } else {\n\n\n $data = array();\n\n $data['tipo_identificacion'] = $this->clientes->get_tipo_identificacion();\n\n $data['pais'] = $this->clientes->get_pais();\n $data['grupo'] = $this->grupo->getAll();\n $data_empresa = $this->miempresa->get_data_empresa();\n $data[\"tipo_negocio\"] = $data_empresa['data']['tipo_negocio']; \n $this->layout->template('member')->show('clientes/nuevo', array('data' => $data));\n }\n }", "public function registrar(){\n\n /*parametros del metodo input:\n *nomnbre del campo,\n *si es requerido o no (true,false)\n *tipo del campo -actualmente valida (string,int,date,email)*/\n\n $nombre=$this->input('nombre',true,'string');\n\n $descripcion=$this->input('descripcion',true,'string');\n\n\n\n //si la validacion falla lo redirecciona a la vista donde esta los mensaje de error\n if($this->validateFails()){\n //este metodo REDIRECCIONA osea cambia de pagina, se le pasa a que controlador y que accion\n\n $this->redirect('Example','index');\n }else{\n\n $example=new Example();//no hace falta incluir el modelo ya esta incluido\n $example->setExampleParameters1($nombre);\n $example->setExampleParameters2($descripcion);\n $example->save();\n $this->redirect('Example','index');\n }\n }", "public function nuevo() {\n\t\t$view = Flight::View();\n\n\t\t// Si ya tenemos datos los cargamos\n\t\tif ( $datos = Flight::flash('datos') ) {\n\t\t\t$datos = array_pop($datos);\n\t\t\t$view->set('datos',$datos);\n\t\t\tFlight::clearFlash('datos');\t\n\t\t}\n\n\t\t// Si esta logueado traemos los pedidos\n\t\t$auth = model_auth::getCurrent();\n\t\tif ( auth::isLoggedIn() ) {\n\t\t\t$pedidos = $auth->getUser()->getUltimosPedidos();\n\t\t\t$view->set('pedidos',$pedidos);\n\t\t}\n\n\t\t$view->set('token',$auth->getCSRFToken());\n\t\t$view->set('cantidades',$_GET['p']);\n\t\t$view->set('productos',model_producto::getAll());\n\t\tFlight::render('pedido_form',null,'layout');\n\t}", "public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }", "public function createAction() {\n $model = new Application_Model_Compromisso();\n //persisto os dados no banco\n $model->insert($this->_getAllParams());\n //redireciono para o index\n $this->_redirect('compromisso/index');\n }", "public function create()\n {\n // $data = array(\n // 'id_pemasok' => request()->get('idpemasok'),\n // 'nama_pemasok' => request()->get('namapemasok'),\n // 'email' => request()->get('emailpemasok'),\n // 'alamat' => request()->get('alamatpemasok'),\n\n // );\n // DB::table('pemasoks')->insert($data);\n // return redirect('/supplier');;\n }", "public function create()\n {\n $estados = new articulos();\n\t$this->query= $estados->obtener_articulos('%');\n if(Input::hasPost('articulos')){\n\t\t$articulos = new Articulos();\n\t\tif($articulos->create(Input::post('articulos'))){\n\t\t\tFlash::success('Articulo Registrado Correctamente');\n\t\t\tInput::delete();\n\t\t\treturn Router::toAction('create');\n\t\t}else{\n\t\t\t\tFlash::error('No se pudo guardar el articulo');\n\t\t}\n\t}\n\n }", "function create()\r\n\t{\r\n\r\n\t\t$this->form_validation->set_rules('nom', 'le nom', 'trim|required|min_length[2]|max_length[12]');\r\n\r\n\t\tif ($this->form_validation->run() == TRUE ) {\r\n\t\t\r\n\t\t$this->e->ajouter($this->input->post());\r\n\r\n\t\t$this->_notice=\"Ajout effectué avec succéss\";\r\n\r\n\t\t$this->index();\r\n\t\t} \r\n\t\telse {\r\n\t\t\t$this->index();\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "public function createAction()\n {\n $entity = new CarpetaEmprendimiento();\n $request = $this->getRequest();\n $form = $this->createForm(new CarpetaEmprendimientoType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('carpetaemprendimiento_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('IamSoftAndrethaBundle:CarpetaEmprendimiento:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create(){\n\t\t$this->autenticate();\n\t\t$user_id = $_POST['id'];\n\t\t$nombre = \"'\".$_POST['nombre'].\"'\";\n\t\t$cedula = \"'\".$_POST['cedula'].\"'\";\n\t\t$nacimiento = \"'2000/1/1'\"; //fecha de nacimiento default, despues el mismo usuario la puede editar\n\t\trequire_once(\"../app/models/administrativo.php\");//conexion entre los controladores\n\t\t$administrativo=new Administrativo();// crea el perfil administrativo vacio\n\t\t$administrativo->new($nombre,$cedula,$nacimiento); // inserta la informacion antes ingresada en la base de datos\n\t\t$administrativo_id = $administrativo->where(\"cedula\",$cedula); // se trae el perfil administrativo recien creado con la cedula\n\t\t$administrativo_id = $administrativo_id[0][\"id\"];\n\t\t$administrativo->attach_user($user_id,$administrativo_id); // amarra el usuario a su nuevo perfil docente\n\t\t$administrativo_id = strval($user_id);//convierte el user_id de entero a string\n\t\theader(\"Location: http://localhost:8000/usuarios/show/$user_id\");\n\t\texit;\n\t\t$this->view('administrativos/index', []);\n\t}", "public function addAction(){\n\t\t\t$emp = new Empresa();\n\t\t\t//cargamos el objeto mediantes los metodos setters\n\t\t\t$emp->id = '0';\n\t\t\t$emp->nombre_empresa = $this->getPostParam(\"nombre_empresa\");\n\t\t\t$emp->nit = $this->getPostParam(\"nit\");\n\t\t\t$emp->direccion = $this->getPostParam(\"direccion\");\n\t\t\t$emp->logo = $this->getPostParam(\"imagen\");\n\t\t\t$emp->regimen_id = $this->getPostParam(\"regimen_id\");\n\t\t\t\t\t\t\t\t\n\t\t\tif($emp->save()){\n\t\t\t\tFlash::success(\"Se insertó correctamente el registro\");\n\t\t\t\tprint(\"<script>document.location.replace(\".core::getInstancePath().\"'empresa/mostrar/$emp->id');</script>\");\n\t\t\t}else{\n\t\t\t\tFlash::error(\"Error: No se pudo insertar registro\");\t\n\t\t\t}\n\t\t\t\t\t\n\t }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $empresa = new Empresa();\n $empresa->nombre = $this->request->getPost(\"nombre\");\n $empresa->nit = $this->request->getPost(\"nit\");\n $empresa->idMunicipio = $this->request->getPost(\"idMunicipio\");\n $empresa->telefono = $this->request->getPost(\"telefono\");\n $empresa->cedulaRepresentante = $this->request->getPost(\"cedulaRepresentante\");\n $empresa->representanteLegal = $this->request->getPost(\"representanteLegal\");\n $empresa->nombreInterno = $this->request->getPost(\"nombreInterno\");\n $password = $this->security->hash($this->request->getPost(\"cedulaRepresentante\"));\n $sql = $this->db->query(\"INSERT INTO usuario (nombreUsuario, contrasena, correo, tipoUsuario, estado) VALUES ('\".$empresa->cedulaRepresentante.\"','\".$password.\"', '[email protected]', 2, 1)\");\n $lastId = $this->db->lastInsertId();\n $empresa->idUsuario = $lastId;\n\n\n if (!$empresa->save()) {\n foreach ($empresa->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"Empresa\",\n 'action' => 'new'\n ]);\n\n return;\n }\n\n $this->flash->success(\"Empresa registrada exitosamente\");\n\n return $this->response->redirect(\"empresa/index\");\n }", "public function actionCreate()\n {\n $model = new Concursante();\n $model->load(Yii::$app->request->post());\n if ($model->findOne(['cedula' => $model->cedula]))\n {\n Yii::$app->session['msj'] = ['alert alert-danger', 'Su número de cédula ya está en nuestra base de datos. Gracias nuevamente por haberse registrado.'];\n } else if ($model->save())\n {\n Yii::$app->session['msj'] = ['alert alert-success', '¡Gracias por registrarse!'];\n }\n\n return $this->redirect(['/']);\n }", "public function create()\n {\n echo 'Estoy en en create';\n }", "public function create()\r\n {\r\n if (Input::hasPost('clientes')){\r\n $clientes = new clientes(Input::post('clientes'));\r\n if (!$clientes->save()){\r\n Flash::error('No se pudo guardar el nuevo cliente.');\r\n }else{\r\n Flash::valid('El registro del cliente se creo corectamente');\r\n //Input::delete();\r\n return Router::redirect();\r\n }\r\n }\r\n \r\n $this->page_title = 'Nuevo Cliente.';\r\n }", "public function create(){\r\n if ($this->puedeGuardar==1) {\r\n $idModulo=Modulo::lists('nombre','id');\r\n return view('objeto.create',compact('idModulo',$idModulo)); \r\n }\r\n else{\r\n return redirect('/Objeto')->with('message-error','No tiene privilegios para guardar'); \r\n }\r\n \r\n }", "public function nuevo_cargo() {\n $this->_acl->acceso('gestionar_acl');\n $this->_view->assign('titulo', 'Nuevo Cargo');\n\n if ($this->getInt('guardar') == 1) {\n $this->_view->assign('datos', filter_input_array(INPUT_POST));\n\n $this->validarCargo();\n\n $this->_aclm->insertarCargo(\n $this->getTexto('cargo')\n );\n\n $this->redireccionar('acl');\n }\n\n $this->_view->renderizar('nuevo_cargo', 'acl');\n }", "public function insertEstudiante_post() {\n\t\t$nombre = $this->input->post(\"txtNombre\");\n\t\t$apellido = $this->input->post(\"txtApellido\");\n\t\t$carrera = $this->input->post(\"txtCarrera\");\n $carnet = $this->input->post(\"txtCarnet\");\n $pass = $this->input->post(\"txtPassword\");\n\n\t\t//mandar los input a arreglo y campos de la bd\n\t\t$data = array(\n\t\t\t'nombre' => $nombre ,\n\t\t\t'apellido' => $apellido ,\n\t\t\t'carrera'=>$carrera,\n 'carnet'=>$carnet,\n 'password'=>$pass,\n\t\t );\n\n if($this->EstudianteModel->insertEstudiante($data))\n $this->response(array('status' => 'exito'));\n else \n $this->response(array('status' => 'fallo'));\n }", "public function inserir() {\n $this->load->model('Usuario_model', 'usuario');\n\n //Recebe os dados da view de usuario\n $data['login'] = $this->input->post('login');\n $data['senha'] = md5($this->input->post('senha'));\n $data['codAluno'] = $this->input->post('codAluno');\n $data['nivel'] = 1;\n\n if ($this->usuario->inserirUsuario($data)) {\n redirect('Painel_controller/login');\n }\n }", "public function newAction()\n {\n sleep(2);\n \n $entity = new Reserva();\n $dia = new ReservaDia();\n// $hora = new ReservaHora();\n// \n// $dia->getHoras()->add($hora);\n \n $entity->getDias()->add($dia);\n\n $form = $this->createCreateForm($entity);\n \n return $this->render('CosacoGesenBundle:Horario:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function createi(){ // Chama a função responsável pelo cadastro dos presos ao banco de dados\n $this->SaidapresosAudiencia_model->cadastroMaster();\n redirect('Home/transitoInterno');\n\n }", "public function create() //添加\n {\n\t\t//\n }", "public function Nuevo(){\n\t\tdate_default_timezone_set('America/Mexico_City');\n\t\t$AlCfecha = date('Y-m-d');\n\t\t$AlCmatricula = $_POST[\"periodo\"].$_POST[\"carrera\"].$_POST[\"grupo\"];\n\n\t\t$AlCmat = DB::table(\"alumno\")->insertGetId(array(\n\t\t\t\"idperiodo\" => $_POST[\"periodo\"],\n\t\t\t\"carrera_idcarrera\" => $_POST[\"carrera\"],\n\t\t\t\"nivel_idnivel\" => $_POST[\"nivel\"],\n\t\t\t\"grupo_idgrupo\" => $_POST[\"grupo\"],\n\t\t\t\"curp\" => $_POST[\"curp\"],\n\t\t\t\"fecha\" => $AlCfecha,\n\t\t\t\"nombre\" =>$_POST[\"nombre\"]));\n\t\t$AlCmatricula = $AlCmatricula.$AlCmat;\n\n\t\tDB::table(\"alumno\")->where(\"idAlumno\",$AlCmat)->update(array(\"matriculaa\" => $AlCmatricula,\"contrasena\" => $AlCmatricula));\n\t\treturn Redirect::to(\"/inicio\");\n\t}", "public function actionCreate()\n {\n///\n$nombre=Yii::$app->user->identity->username;\n$connection = \\Yii::$app->db;\n$db = $connection->createCommand(\"INSERT INTO auditoria (id, user, modelo, accion, fechahora) VALUES (NULL, '$nombre', 'PropiedadDet', 'Crear', NOW());\")->execute();\n///\n\n $model = new PropiedadDet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n// return $this->redirect(['view', 'id' => $model->id_propiedad_det]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function crear(Request $request)\n { //return $request->all();\n\n /*$empresa = new App\\Empresa;\n\n $empresa->nombre = $request->nombre;\n $empresa->telefono = $request->telefono;\n $empresa->email = $request->email;\n $empresa->direccion_web = $request->direccion_web;\n $empresa->direccion = $request->direccion;\n\n $empresa->save(); \n \n Esto ultimo no funciono\n */\n\n $this->validate($request, [\n 'nombre' => 'required',\n 'telefono' => 'required',\n 'email' => 'required',\n 'direccion_web' => 'required',\n 'direccion' => 'required'\n ]);\n $empresa = new Empresa([\n 'nombre' => $request->get('nombre'),\n 'telefono' => $request->get('telefono'),\n 'email' => $request->get('email'),\n 'direccion_web' => $request->get('direccion_web'),\n 'direccion' => $request->get('direccion'),\n 'habilitar' => $request->get('habilitar') ? true : false\n ]);\n $empresa->save();\n\n\n\n\n return back()->with('mensaje','Empresa Guardada Correctamente.');\n }", "public function nuevo($producto){\r\n return $this->set($producto); \r\n }", "public function registro() {\n\t\t$this -> redirect('/registro');\n\t}", "public function actionCreate()\n {\n $this->autorizaUsuario();\n $model = new Palestrante();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->save()){\n $this->mensagens('success', 'Palestrante Cadastrado', 'Palestrante foi Cadastrado com Sucesso');\n }else{\n $this->mensagens('danger', 'Palestrante Não Cadastrado', 'Houve um erro ao adicionar o Palestrante');\n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function inserir()\n {\n $produto = new Produto();\n\n // Colocando os valores recebidos do formulário nos atributos do objeto $produto\n $produto->descricao = Input::get('descricao');\n $produto->quantidade = Input::get('quantidade');\n $produto->valor = Input::get('valor');\n $produto->data_vencimento = Input::get('data_vencimento');\n\n // Salvando no banco de dados\n $produto->save();\n\n // Criado uma mensagem para o usuário\n $mensagem = \"Produto inserido com sucesso\";\n\n // Chamando a view produto.inserir e enviando a mensagem criada\n return view('produto.inserir')->with('mensagem', $mensagem);\n }", "public function create()\n {\n $request = \\Config\\Services::request(); \n $nombre = $request->getPostGet('nombre'); \n $datos = array(\n 'NombreCa' => $nombre\n ); \n $model = new CategoriasModel();\n $model->insert($datos); \n return redirect()->to(base_url('/categorias'));//Se vuelve a cargar el controlador\n }", "public function createParqueaderos(Request $request){\n $obj = Parqueaderos::where('id','=',$request->id)->first();\n if(sizeof($obj) != 0 ){ //actualizar\n ParqueaderosController::ObjParqueaderos($obj,$request);\n $obj->save();\n }\n else { //crear\n $obj = new Parqueaderos();\n ParqueaderosController::ObjParqueaderos($obj,$request);\n $obj->save();\n }\n return redirect('registroUsuario/'.$obj->id);\n }", "function crear_reserva($reserva) {\n $this->db->insert('edicion', $reserva);\n }", "public function nueva_unidad(Request $request){\n $this->validar_unidad($request);\n try{\n \\DB::beginTransaction();\n $seccion = Seccione::create($request->input());\n \\DB::commit();\n return response()->json($seccion);\n }\n catch(Exception $e){\n \\DB::rollBack();\n return response()->json($e);\n }\n }", "public function crear(Request $request)\n\t{\n\t\t$empleado = $request->empleado;\n\t\t$concepto = $request->concepto;\n\n\t\tDB::table('casos_particulares')->insert(['dato_empleado_id' => $empleado, 'concepto_id' => $concepto]);\n\n\t\treturn redirect()->to('/casos_particulares_view')->with('alert', 'Caso particular registrado');\n\n\t}", "public function actionCreate()\n {\n $model = new Planilla_entrega();\n $model->scenario = 'create';\n if ($model->load(Yii::$app->request->post())) {\n \n if ($model->validate() ){ \n \n \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n //Se guarda encabezado de la PLanilla\n $model->PE_PROCESADO = 0;\n if ($model->save()){\n $this->guardar_renglones($model);\n \n }else{\n $mensaje = \"\"; \n foreach ($model->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n\n $this->verificar_pedido_completo($model->PE_NUMVALE);\n\n $transaction->commit();\n Yii::$app->getSession()->setFlash('exito_deposito_central', 'Planilla de entrega creada con éxito.');\n return $this->redirect(['view', 'id' => $model->PE_NROREM]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n \n Yii::$app->getSession()->setFlash('error_deposito_central', $e->getMessage());\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(CreateContratoRequest $request)\n {\n //return $request->all();\n $listacontratos = \\App\\Contrato::create( $request->all() );\n\n //$listacontratos->tipoDeContrato()->create([$listacontratos]);\n // $listacontratos-> tipoDeContrato()->save($listacontratos);\n \n \n //$listacontratos->tipoDeContrato()->associate($listacontratos);\n //$listacontratos->save();\n \n\n\n // DB::table('contrato') -> insert([\n\n // \"Jornada\" => $request->input('Jornada'),\n //\"PeriodoDePrueva\" => $request->input('PeriodoDePrueva'),\n // \"Salario\" => $request->input('Salario'),\n // \"FechaInicio\" => $request->input('FechaInicio'),\n // \"id_tipoDeContrato\" => $request->input('id_tipoDeContrato'),\n // \"id_cargo\" => $request->input('id_cargo'),\n // \"id_empleado\" => $request->input('id_empleado'),\n // \"id_empresa\" => $request->input('id_empresa'),\n // ]);\n\n\n //return redirect()->route('contratos.index');\n return redirect()->route('contratos.index', compact('listacontratos'))->with('infoContratoCreate','Contrato Creado');\n\n }", "public function actionCrear() {\n $model = new Factura();\n $atributos_viejos = $model->attributes;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n StaticMembers::RegistrarTraza($model, $atributos_viejos, 'crear', $model->numero);\n Yii::$app->session->setFlash('success', 'Elemento creado correctamente', false);\n return $this->redirect(['inicio', 'id' => $model->id, 'id_devolucion' => $model->id_devolucion]);\n } else {\n return $this->render('crear', ['model' => $model,]);\n }\n }", "public function store(PlancuentaRequestCrear $request)\n {\n //$id_registro = uniqid();\n\n $plancuentas=sfp_plancuenta::max('id_registro');\n $plancuentas=$plancuentas+1;\n $id_registro = $plancuentas;\n $plancuenta = new Sfp_plancuenta();\n $plancuenta->id_plancuenta = $request->id_plancuenta;\n $plancuenta->nombre_cuenta = $request->nombre_cuenta;\n $plancuenta->id_registro = $id_registro;\n\n $plancuenta->save();\n return redirect('/sfp-plancuentas/crear')->with('status', 'La cuenta ha sido ingresada exitosamente');\n }", "public function guardar()\n\t{\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\t\t// Comprobar si es un registro nuevo o uno ya existente\n\t\tif ($this->update) {\n\n\t\t\t// Preparar la sentencia para actualizar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"UPDATE \". static::$tablaConsulta . \" SET medio= ? WHERE id= ?\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t'si',\n\t\t\t\t\t$this->medio,\n\t\t\t\t\t$this->id\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t// Preparar la sentencia para isertar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"INSERT INTO \". static::$tablaConsulta . \" VALUES (null, ?)\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t's',\n\t\t\t\t\t$this->medio\n\t\t\t);\n\t\t}\n\n\n // Ejecutar la sentencia\n\t\tif ( $sentencia->execute() ) {\n\n\t\t\t// Devolver un uno si fue un exito\n\t\t\treturn 1;\n\t\t} else {\n\n\t\t\t// Devolver un 0 si ocurrio un error\n\t\t\treturn 0;\n\t\t}\n\t}", "public function create()\n {\n //KEMUDIAN DI DALAMNYA KITA MENJALANKAN FUNGSI UNTUK MENGOSONGKAN FIELD\n $this->resetFields();\n //DAN MEMBUKA MODAL\n $this->openModal();\n }", "public function postRegistrar(){\n\t\t$post = Input::all();\n\t\t$rule = ['nombre' => 'required', 'apellidos' => 'required', 'usuario' => 'required', 'contrasena' => 'required', 'tipo_usuario' => 'required'];\n\t\tif(Validator::make($post, $rule)->fails()){\n\t\t\tSession::flash('mensaje', '¡Completa todos los campos!');\n\t\t\treturn Redirect::back();\n\t\t}\n\n\t\tif(Usuario::where('usuario', '=', $post['usuario'])->count() != 0){\n\t\t\tSession::flash('mensaje', '¡El usuario ya está registrado!');\n\t\t\treturn Redirect::back();\n\t\t}\n\n\t\t$persona = new Persona();\n\t\t$persona->Nombres = $post['nombre'];\n\t\t$persona->Apellidos = $post['apellidos'];\n\t\t$persona->DNI = $post['dni'];\n\t\t$persona->Telefono = $post['telefono'];\n\t\t$persona->Celular = $post['celular'];\n\t\t$persona->email = $post['email'];\t\n\t\t$persona->Direccion = $post['direccion'];\t\t\n\t\t$persona->estado = 1;\t\n\t\t$persona->foto = '';\n\t\t$persona->iddistrito = $post['distrito'];\n\t\t$persona->save();\t\t\n\n\t\t$usuario = new Usuario();\n\t\t$usuario->Usuario = $post['usuario'];\n\t\t$usuario->Password = Hash::make($post['contrasena']);\n\t\t$usuario->idPersona = $persona->idPersona;\n\t\t$usuario->id_tipousuario = $post['tipo_usuario'];\n\t\t$usuario->save();\n\n\t\tif($post['tipo_usuario'] == 2){\n\t\t\tdate_default_timezone_set('America/Lima');\n\t\t\t$dist = new Distribuidores();\n\t\t\t$dist->FechaIngreso = date('Y-m-d');\n\t\t\t$dist->idPersona = $persona->idPersona;\n\t\t\t$dist->idDistribuidorReferido = 0;\n\t\t\t$dist->idRangoDistribuidor = $post['rango_distribuidor'];\n\t\t\t$dist->save();\n\t\t}\n\t\treturn 'Usuario registrado correctamente.';\n\t}", "public function registro() {\n \n if(Auth::is_valid()){\n return Router::redirect('/');\n }\n \n $this->title = 'Formulario de registro';\n\n if (Input::hasPost('usuario')) {\n $obj = Load::model('usuario'); \n if ($obj->save(Input::post('usuario'))) {\n Flash::success('En un momento recibira un correo de confirmación para activar su cuenta.');\n return Router::redirect(\"usuario/ver/$obj->nick/\");\n }else{\n Flash::error('Falló operación'); \n $this->usuario = $obj;\n $this->usuario->clave = '';\n return false;\n }\n } \n }", "public function postCreate()\n\t{\n\t\tif(Input::get('unidad')){\t\t\n\t\t\t$rules = array('nombre' => 'required');\n\t\t}else{\t\t\t\n\t\t\t$rules = array('unidad' => 'required');\n\t\t}\t\n\t\t// do the validation ----------------------------------\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// check if the validator failed -----------------------\n\t\tif ($validator->fails()) {\n\n\t\t\t\treturn Redirect::back()->withInput()->withErrors($validator);\n\t\t} else {\t\t\n\t\t\t\t\n\t\t\t$materias\t= new Materias;\t\t\n\t\t\t$materias->nombre \t\t\t= Input::get('nombre');\n\t\t\t$materias->unidad \t\t \t= Input::get('unidad');\n\t\t\t\n\t\t\tif($materias->save()){\n\t\t\t\n\t\t\treturn Redirect::to('dashboard/materias/index/')\n\t\t\t\t\t\t->with('msg', 'Materia Prima Agregada con éxito.')\n\t\t\t\t\t\t->with('class', 'success');\n\t\t\t \n\t\t\t}else {\n\t\t\t\t\t\n\t\t\t\treturn Redirect::back()->withInput()\n\t\t\t\t\t\t->with('msg', '¡Algo salió mal! Los datos no fueron guardados.')\n\t\t\t\t\t\t->with('class', 'error');\n\n\t\t\t}\n\t\t}\t\n\t}", "public function create()\n {//\n \n //\n return view('empresas.create');\n }", "public function Nuevo(){\n\t\t$UsCg = new HomeController();\n\t\t$UsCdatos = array();\n\t\tarray_push($UsCdatos, $_POST[\"usuario\"]);\n\t\tarray_push($UsCdatos, $_POST[\"contrasena\"]);\n\t\t$UsCvalidado = $UsCg->ValidarNoVacio($UsCdatos);\n\t\tif ($UsCvalidado) {\n\t\t\t\t$UsCexiste = DB::table(\"coordinador\")->where(\"matriculac\",$_POST[\"contrasena\"])->first();\n\t\t\t\tif (!isset($UsCexiste) || $UsCexiste==null) {\n\t\t\t\t\t$UsCusuariosesion = DB::table(\"coordinador\")->insertGetId(array(\"nombre\" => $_POST[\"usuario\"], \"contrasena\" => $_POST[\"contrasena\"], \"matriculac\" => $_POST[\"contrasena\"]));\n\t\t\t\t}\n\t\t\t}\n\t\treturn Redirect::to(\"/inicio\"); \n\t}", "public function mostrar_insertar() {\r\n\t\t\t$this -> pantalla_edicion('insertar'); \r\n\t\t }", "public function actionCreate()\n {\n $model = new Devolucion_salas_granel();\n $model->scenario = \"create_sobrante\";\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->validate() ){ \n $model->DE_SOBRAN = 1;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n //Se guarda encabezado Devolucion\n if ($model->save()){\n $this->guardar_renglones($model);\n }\n\n $this->generarPdf($model->DE_NRODEVOL);\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n \n }\n else{\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n \n } else {\n $model->DE_FECHA = date('Y-m-d');\n $model->DE_HORA = date('H:i:s');\n $model->DE_CODOPE = Yii::$app->user->identity->LE_NUMLEGA; //El usuario logueado\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function agregar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n \n // Sanitize POST array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'nombreEspecialidad' => trim($_POST['nombreEspecialidad'])\n ];\n\n // Validar Nombre Especialidad obligatorio\n if(empty($data['nombreEspecialidad'])){\n $data['nombreEspecialidad_error'] = 'Por favor ingrese un titulo para la especialidad';\n }\n\n // Validar Nombre Especialidad existente\n if($this->especialidadModel->checkEspecialidad($data['nombreEspecialidad'])){\n $data['nombreEspecialidad_error'] = 'La especialidad que intentó agregar ya existe';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['nombreEspecialidad_error'])){\n // Crear especialidad\n if($this->especialidadModel->agregarEspecialidad($data['nombreEspecialidad'])){\n flash('especialidad_success', 'Especialidad creada correctamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['nombreEspecialidad_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }", "public function nuevo(){\r\n if($_SESSION[\"inicio\"] == true){\r\n return Vista::crear(\"admin.usuario.crear\");\r\n }else{\r\n return redirecciona()->to(\"/\");\r\n }\r\n\r\n }", "public function actionCreate()\n {\n $model = new NuevoUsuario();\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $LoginFrom = new LoginForm;\n $LoginFrom->password = $model->Clave;\n $LoginFrom->username = $model->NombreUsuario;\n if ($LoginFrom->login()){\n // provisoriamente lo inscribe al torneo programate para hacegurar el registro\n //$this->redirect(array('/torneo/inscripcion','idTorneo'=>1));\n $this->redirect(array('/site'));\n \n }else{\n $this->redirect(array('/site/login'));\n }\n }\n return $this->render('nuevousuario', [\n \n 'model' => $model,\n ]);\n \n\n \n }", "public function store(Request $request)//crea un nuevo cliente\n {\n $this->validate($request,[\n 'nombre'=>'required',\n 'precioReal'=>'required',\n 'precioOferta'=>'required',\n 'ahorro'=>'required',\n 'cantVentas'=>'required',\n 'validez'=>'required',\n 'imagenusers'=>'required',\n 'url'=>'required',\n ]);\n $promocion = new Promocion($request->all());\n $promocion->save();\n\n return redirect()->route('promociones.index')->with('message','data has been updated!');\n }", "function insert(){\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono]);\n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n // $this->index();\n }", "public function nuevo()\n {\n log_message('DEBUG','#TRAZA | #TRAZ-PROD-TRAZASOFT | ETAPA | nuevo()');\n \n $this->load->model(TST.'Tareas');\n $this->Tareas->eliminarTareasSinOrigen(empresa());\n #Snapshot\n $user = userNick();\n $view = 'etapa/abm';\n $data['key'] = $view . $user;\n\n $data['fecha'] = date('Y-m-d');\n $data['id'] = $this->input->get('op');\n $data['etapa'] = $this->Etapas->nuevo($data['id'])->etapa;\n $data['idetapa'] = $data['etapa']->id;\n $data['accion'] = 'Nuevo';\n $data['op'] = $data['etapa']->titulo;\n\n $this->load->model(ALM . 'Articulos');\n #$data['materias'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Final', 'Materia Prima'));\n // $data['productos'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Producto'));\n\n #FORMULARIO GENERICO\n $data['form_id'] = $data['etapa']->form_id;\n\n #Obtener Proucto por Etapa\n $data['productos_etapa'] = $this->Etapas->obtenerArticulos($data['etapa']->id)['data'];\n $data['productos_entrada_etapa'] = $this->Etapas->getEntradaEtapa($data['etapa']->id)['data'];\n $data['formulas'] = $this->Formulas->getFormulas()->formulas->formula;\n $data['lang'] = lang_get('spanish', 5);\n $data['tareas'] = []; //$this->Tareas->listar()->tareas->tarea;\n $data['templates'] = []; //$this->Templates->listar()->templates->template;\n $data['establecimientos'] = $this->Establecimientos->listar($data['id'])->establecimientos->establecimiento; // listo\n $data['recursosmateriales'] = []; //;$this->Recursos_Materiales->listar()->recursos->recurso;\n $data['rec_trabajo'] = $this->Recursos->obtenerXTipo('TRABAJO')['data'];\n $this->load->view($view, $data);\n }", "public function nuevoLenguajes() {\n\t $this->Utilidades->validar($this->Session->get('admin'));\n\t $data['breadCrumb'] = $this->BreadCrumb->listarBreadCrumb($_REQUEST);\n\t $data['datos'] = $this->Lenguajes->buscarLenguajes($_REQUEST);\n\t $this->Vistas->show('editarLenguajes.html',$data);\n\t}", "public function create(){\n \n $razas = Raza::get();\n include 'views/mascota/form_new.php';\n }", "public function insertar($objeto){\r\n\t}", "public function create(){\n return view(\"personal.especialidades.create\");\n }", "public function create()\n {\n //return view(\"Estudiantes.register\",[\"carreras\"=>Carrera::all()]); \n }", "public function insert($producto);", "public function create()\n {\n //return view('pedidoFinalizado');\n }", "public function store(Request $request){\n Mantenimiento::create($request->all());\n return redirect()->route('mantenimiento.index')->with('success','Registro creado satisfactoriamente');\n //return Mantenimiento::create($request->all());\n }", "public function createAction()\n {\n $entity = new Titeur();\n $request = $this->getRequest();\n\t\t\t\t$user = $this->get('security.context')->getToken()->getUser();\n $form = $this->createForm(new TiteurType(), $entity, array('user' => $user));\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n\t\t\t\t\t\t$this->get('session')->set('titeur_id', $entity->getId());\n\t\t\t\t\t\t$this->get('session')->setFlash('notice', 'Titeur a été ajouté avec succès');\n\n return $this->redirect($this->generateUrl('enfant_new'));\n \n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "public function guardarRegistro2(){\r\n $this->database->execute(\"INSERT INTO empleados (nombreApellido, dni, email, pass) VALUES ('rodri', '12345678', '[email protected]', '123456'\");\r\n }", "public function create()\n {\n //return view('estados.create');\n }", "public function create()\n {\n $trabajoController = new TrabajoController();\n $arregloBuscarTrabajos = ['eliminado'=>0];\n $arregloBuscarTrabajos = new Request ($arregloBuscarTrabajos);\n $listaTrabajos=$trabajoController->buscar($arregloBuscarTrabajos);\n $listaTrabajos = json_decode($listaTrabajos);\n return view('pagorecibido.create',['listaTrabajos'=>$listaTrabajos]); //Vista para crear el elemento nuevo\n }", "public function actionCreate() {}", "public function actionCreate() {}", "public function create()\n {\n echo \"Đây là trang Create\";\n }", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function create()\n {\n return view('artigo.inserir');\n }", "public function store(createEmpresa $request) {\r\n\r\n $input = $request->all();\r\n $input['usu_alta_id'] = Auth::user()->id;\r\n $input['usu_mod_id'] = Auth::user()->id;\r\n\r\n //create data\r\n Empresa::create($input);\r\n\r\n return redirect()->route('empresas.index')->with('message', 'Registro Creado.');\r\n }", "public function create()\n {\n //este deriva a un formulario, el cual debe tomar todos\n //los parametros del bache (nombre, fecha_y_hora, ubicacion, object_state_id (recuperarlo y pasarlo), estado(mostrar opciones y tomar el elegido)) y luego de todo esto llama a store para ser almacenado en la base de datos\n\n }", "public function store(Request $request)\n {\n // formas de guardar datos\n //numero 1 por consultas\n \n //dd($request);\n DB::table('proyectos')->insert([\n \"user_id\"=>auth()->user()->id,\n \"nombre\"=>$request->input('nombre'),\n \"descripcion\"=>$request->input('descripcion'),\n \"created_at\" => Carbon::now(),\n \"updated_at\" => Carbon::now(), \n ]);\n \n //numero 2 elquent\n /*\n $proyecto = new Proyecto;\n $proyecto-> nombre = $request->input('nombre');\n $proyecto-> descripcion = $request->input('descripcion');\n $proyecto->save();\n // las fechas no se guardan por que en eloquent se guardan por defecto \n */\n //y asi susesivamente\n //forma numero 3\n /*\n $proyecto = Proyecto::create($request->all());\n if (auth()->check()) {\n auth()->user()->proyectos()->save($proyecto);\n }*/\n\n return redirect()->route('registro.index');\n }", "public function store(Request $request)\n {\n $naslov=$request->input('naslov');\n $opis=$request->input('opis');\n $idAutor=session()->get('korisnik')->id;\n \ntry{\n\n\n $clanci=Clanak::create([\n 'naslov'=>$naslov,\n 'tekst'=>$opis,\n 'autorId'=>$idAutor,\n 'datumObjavljivanja'=>now()\n ]);\n return redirect()->route('home');\n }\n catch(PDOException $ex){\n $ex->getMessage();\n }\n }", "public function criarAction() {\n if($this->usuario['tp_id']==5){\n $this->_redirect('index');\n }\n $this->modelColonia->insert($this->_getAllParams());\n\n $this->_redirect('colonia/index');\n }", "public function actionCreate()\n\t{\n //Chequear que tenga permisos de encargado\n //Chequear que la mesa pertenezca a la aplicacion del usuario logueado\n //Solo AJAX\n\t\t$pedido=new Pedidos;\n\t\tif(isset($_POST['Pedidos']))\n\t\t{\n if(isset($_POST['Pedidos']['cantidad']) && $_POST['Pedidos']['cantidad']>0)\n $cantidad = intval($_POST['Pedidos']['cantidad']);\n else{\n echo 'Debe crear al menos un tiket';\n die;\n }\n $mesa = Mesas::model()->findByPk(intval($_POST['Pedidos']['mesas_id']));\n for($i=0; $cantidad>$i; $i++)\n {\n $pedido=new Pedidos;\n $pedido->mesas_id = $mesa->id;\n $pedido->pedidos_estados_id = 1;\n $pedido->hash = md5($i.time());\n $pedido->aplicacion_id = intval($_POST['Pedidos']['mesas_id']);\n $pedido->qr_image = $this->createQR($pedido->hash, $mesa->aplicacion->subdominio);\n\t\t\t$pedido->save(); \n }\n //Crear tarjeta QR\n echo 'ok';\n die;\n\t\t}\n else\n throw new CHttpException(404,'Página no encontrada');\n\t}", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n \n $model = new Pago;\n $transaction=$model->dbConnection->beginTransaction();\n try\n {\n \n //Cargo datos en Pagos\n\n $recibo = $this->loadModelRecibo($_GET['id']);\n $importe = $recibo->importePendiente;\n \n if (isset($_GET['id'])) {\n $model->attributes = $_GET['id'];\n $model->idRecibo = $recibo->idRecibo;\n $model->fecha = date('Y-m-d H:i:s');\n $model->importe = $recibo->importePendiente;\n $model->idUsuario = Yii::app()->user->id;\n $model->idMedioPago = 1;\n \n \n if ($model->save()) {\n \n // Modifico Recibos actualizando datos\n\n $recibo->importePendiente = 0;\n $recibo->fechaCobroCompleto = $model->fecha;\n \n // Modifico la Cuenta con los saldos\n\n $recibo->idCuenta0->saldo = $recibo->idCuenta0->saldo - $importe;\n $recibo->save();\n \n $transaction->commit();\n \n Yii::app()->user->setFlash('success',\"El pago fue registrado.\");\n $this->redirect(array('view', 'id' => $model->idPago));\n }\n $transaction->rollback();\n }\n \n $this->render('update', array('model' => $model,));\n \n } \n catch(Exception $e)\n {\n $transaction->rollback();\n \n throw $e;\n }\n \n }", "public function registrar_objeto_controlador(){\n\t\t\t$Nombre=mainModelo::limpiar_cadena($_POST['objeto-txt']);\n\t\t\t$Marca=mainModelo::limpiar_cadena($_POST['marcaobjeto-txt']);\n\t\t\t$Modelo=mainModelo::limpiar_cadena($_POST['modeloobjeto-txt']);\n\t\t\t$Cantidad=mainModelo::limpiar_cadena($_POST['cantidadobjeto-txt']);\n\t\t\t$Tipo=mainModelo::limpiar_cadena($_POST['tipoobjeto-txt']);\n\t\t\t$Propietario=mainModelo::limpiar_cadena($_POST['docpropietario-txt']); \n\t\t\t$codigo= objetoModelo::codigo_auto();\n\t\t\t$codigo= ($codigo->rowCount()+1);\n\t\t\t\n\t\t\t$dataobjeto=[\n\t\t \"Codigo\"=>$codigo,\n\t\t\t\t\"Nombre\"=>$Nombre,\n\t\t\t\t\"Marca\"=>$Marca,\n\t\t\t\t\"Modelo\"=>$Modelo,\n\t\t\t\t\"Cantidad\"=>$Cantidad,\n\t\t\t\t\"Tipo\"=>$Tipo,\n\t\t\t\t\"Estado\"=>'A',\n\t\t\t\t\"Propietario\"=>$Propietario\n\t\t\t];\n\t\t\t\n\t\t\t$guardarObjeto=ObjetoModelo::registrar_objeto_modelo($dataobjeto);\n\n\t\t\tif ($guardarObjeto->rowCount()==1) {\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alerta\"=>\"limpiar\",\n\t\t\t\t\t\"Titulo\"=>\"Objeto registrado\",\n\t\t\t\t\t\"Texto\"=>\"Registro exitoso!\",\n\t\t\t\t\t\"Tipo\"=>\"success\"\n\t\t\t ];\n\t\t }else{\n\t\t\t\t\n\t\t\t\t$alerta=[\n\t\t\t\t\t\"Alerta\"=>\"simple\",\n\t\t\t\t\t\"Titulo\"=>\"Ocurrio un error inesperado\",\n\t\t\t\t\t\"Texto\"=>\"No se ha podido registrar el objeto!\",\n\t\t\t\t\t\"Tipo\"=>\"error\"\n\t\t\t\t];\n\t\t }\n\t\t\treturn mainModelo::sweet_alert($alerta);\n\t\t}", "public function create(): void\n {\n\n $description = null;\n $image = null;\n $velo_id = null;\n\n if (!empty($_POST['description']) && $_POST['description'] != \"\") {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!empty($_POST['image'])) {\n $image = htmlspecialchars($_POST['image']);\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n\n if (!$description || !$image || !$velo_id) {\n die(\"formulaire mal rempli\");\n }\n\n $this->model->insert($description, $image, $velo_id);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function create(Request $request)\n {\n $this->validate($request,[\n 'codigo'=> 'required|max:10',\n 'nombre'=> 'required|max:10',\n 'grado'=> 'required|max:10',\n ]);\n \n $result = DB::select('call pa_inserEstudiante(?,?,?)', array($request->codigo,$request->nombre,$request->grado));\n \n if($result == null){\n return redirect::back()->with('msj','Creado éxitosamente');\n }else{\n return redirect::back()->with('msjError','No se pudo crear');\n }\n }", "public function create()\n {\n //\n return view('empleado.create');\n }", "public function createAction(Request $request)\n {\n \n $entity = new Aula();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n if ($this::existeAula($entity)){\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n return $this->redirect($this->generateUrl('aulas_aula_show', array('id' => $entity->getId())));\n }\n return $this->render('CrestaAulasBundle:Aula:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }else{\n throw new Exception(\"Ya existe un Aula con ese nombre modifique e intente nuevamente\"); \n }\n\n \n }", "public function createAction()\n {\n $user = new User(); // New user object\n $em = $this->getDoctrine()->getManager(); // Gettting the doctrine manager to make the database persistance\n $em->persist($user); // Persistance called\n $em->flush(); // INSERT\n return new Response('Utilisateur créé : '.$user->getId());\n }", "public function store(Request $request)\n { Bitacoras::bitacora(\"Registro de remesa\");\n $remesa = new Remesas;\n $remesa->caja_id = $request->cajaTipo;\n $remesa->banco_id = $request->bancoTipo;\n $remesa->monto = $request->Monto;\n $remesa->transaccion = $request->transaccion;\n $remesa->save();\n return redirect('/remesas')->with('mensaje','Registro Guardado');\n\n }", "public function store(Request $request)\n {\n Proyecto::create([\n 'nb_proyecto'=> $request ['nb_proyecto'],\n ]);\n return redirect()->route('proyecto.index')->with('info','Proyecto actualizado correctamente'); \n }" ]
[ "0.7670244", "0.7481748", "0.7272138", "0.7246096", "0.72371775", "0.71551245", "0.7013024", "0.7010045", "0.69698375", "0.69646233", "0.69164234", "0.6911575", "0.6867675", "0.6864074", "0.6861235", "0.68108654", "0.6802688", "0.6790662", "0.676971", "0.676804", "0.6740098", "0.6738594", "0.6696954", "0.66861933", "0.668426", "0.66831625", "0.6680297", "0.6677499", "0.6669186", "0.6648058", "0.66467625", "0.6640826", "0.6637741", "0.6632163", "0.6631368", "0.6625177", "0.6619223", "0.6616612", "0.66143703", "0.66096056", "0.66095775", "0.6601374", "0.65963", "0.6595164", "0.6568733", "0.6564196", "0.65567553", "0.6543823", "0.6534957", "0.6534811", "0.65342677", "0.65295064", "0.6528335", "0.6526737", "0.652201", "0.65211874", "0.6516701", "0.65134555", "0.65124404", "0.6510812", "0.65078056", "0.65070146", "0.6505993", "0.649475", "0.64824384", "0.6471561", "0.64634687", "0.6463346", "0.64619565", "0.6460902", "0.64605606", "0.64560694", "0.6455125", "0.645396", "0.64536697", "0.6453666", "0.64528114", "0.645139", "0.6449493", "0.64466274", "0.64446867", "0.64446867", "0.6444281", "0.6442295", "0.64409786", "0.64400053", "0.643569", "0.64331234", "0.6432866", "0.6431587", "0.64304173", "0.6429877", "0.6427154", "0.642548", "0.6423328", "0.6421793", "0.64214265", "0.642002", "0.6408051", "0.640411", "0.640238" ]
0.0
-1
default data dalam range
function fivaa(Int $num) { $default = range(0, $num + 1); // penyimpanan data $storedBox = []; // hitung loop yang berjalan $countingLoop = 0; foreach($default as $key => $item) { // tandai loop yang berjalan $countingLoop = $countingLoop + 1; // label pertama $firstLabel = str_repeat( $default[($countingLoop-1)], 2 ); // label kedua $secondLabel = str_repeat( $default[($countingLoop+1)], $countingLoop ); // combine label $result = $firstLabel . $secondLabel; // storing result array_push($storedBox, $result); // hentikan loop if($countingLoop === $num) break; } // reorder data rsort($storedBox); return $storedBox; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getDefaultValues()\n {\n return [\n 'year-start' => 1997,\n 'year-end' => 2018,\n 'month-start' => 1,\n 'month-end' => 12,\n 'page-start' => 1,\n 'page-end' => 300,\n ];\n }", "public function getRange() {\n\n }", "public function setDefaultValues() {\n $this->effective_date = \"1970-1-1\";\n $this->end_date = \"9999-12-31\";\n $this->pu_percentage = 100;\n }", "public function setDataRange($limit, $offset = 0) {\n\t\t\t$this->limit = (int) $limit;\n\t\t\t$this->offset = (int) $offset;\n\t\t}", "protected function calculateRange($data)\n {\n $data_range = array_fill(0, count(current($data)), ['min' => null, 'max' => null]);\n foreach ($data as $observation) {\n $key = 0;\n foreach ($observation as $value) {\n if ($data_range[$key]['min'] === null || $data_range[$key]['min'] > $value) {\n $data_range[$key]['min'] = $value;\n }\n if ($data_range[$key]['max'] === null || $data_range[$key]['max'] < $value) {\n $data_range[$key]['max'] = $value;\n }\n $key++;\n }\n }\n\n return $data_range;\n }", "function dataDefatult($data, $defaultD) {\r\n if ($data)\r\n return $data;\r\n return $defaultD;\r\n}", "public function forceIntegerInRangeForcesIntegerIntoDefaultBoundariesDataProvider() {}", "private function daysDefault(){\n $data = array();\n\n for($i=1; $i<=31; $i++){\n $data['day_'.$i] = 0;\n }\n\n return $data;\n }", "public function dataProviderForRange(): array\n {\n return [\n [ [ 1, 1, 1 ], 0 ],\n [ [ 1, 1, 2 ], 1 ],\n [ [ 1, 2, 1 ], 1 ],\n [ [ 8, 4, 3 ], 5 ],\n [ [ 9, 7, 8 ], 2 ],\n [ [ 13, 18, 13, 14, 13, 16, 14, 21, 13 ], 8 ],\n [ [ 1, 2, 4, 7 ], 6 ],\n [ [ 8, 9, 10, 10, 10, 11, 11, 11, 12, 13 ], 5 ],\n [ [ 6, 7, 8, 10, 12, 14, 14, 15, 16, 20 ], 14 ],\n [ [ 9, 10, 11, 13, 15, 17, 17, 18, 19, 23 ], 14 ],\n [ [ 12, 14, 16, 20, 24, 28, 28, 30, 32, 40 ], 28 ],\n ];\n }", "public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function applyDefaultValues()\n\t{\n\t}", "public function __construct($alias='',$name='',$default=0,$min=NULL,$max=NULL){\n\t\tparent::__construct($alias,$name,$default);\n\t\t$this->min=$min;\n\t\t$this->max=$max;\n\t\t}", "public function defaultData();", "public function dataProviderForMidrange(): array\n {\n return [\n [ [ 1, 1, 1 ], 1 ],\n [ [ 1, 1, 2 ], 1.5 ],\n [ [ 1, 2, 1 ], 1.5 ],\n [ [ 8, 4, 3 ], 5.5 ],\n [ [ 9, 7, 8 ], 8 ],\n [ [ 13, 18, 13, 14, 13, 16, 14, 21, 13 ], 17 ],\n [ [ 1, 2, 4, 7 ], 4 ],\n [ [ 8, 9, 10, 10, 10, 11, 11, 11, 12, 13 ], 10.5 ],\n [ [ 6, 7, 8, 10, 12, 14, 14, 15, 16, 20 ], 13 ],\n [ [ 9, 10, 11, 13, 15, 17, 17, 18, 19, 23 ], 16 ],\n [ [ 12, 14, 16, 20, 24, 28, 28, 30, 32, 40 ], 26 ],\n ];\n }", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "private function getRange() {\n\t\t\ttry {\n\t\t\t\t$connection = new \\Phalcon\\Db\\Adapter\\Pdo\\Mysql(array(\n\t\t\t\t\t\t\"host\" => \"localhost\",\n\t\t\t\t\t\t\"username\" => \"addhawk\",\n\t\t\t\t\t\t\"password\" => \"addhawk4784\",\n\t\t\t\t\t\t\"dbname\" => \"addhawk\"\n\t\t\t\t));\n\t\t\t //Reconnect\n\t\t\t $connection->connect();\n\t\t\t $phql = \"SELECT * FROM admin\";\n\t\t\t $result = $connection->query($phql);\n\t\t\t $result->setFetchMode(Phalcon\\Db::FETCH_NUM);\n\t\t\t $this->data['admin'];\n\t\t\t\t$admin = $result->fetchArray();\n\t\t\t\t$this->data['x_range'] = $admin[1];\n\t\t\t\t$this->data['y_range'] = $admin[2];\n\t\t\t\t$this->data['title'] = \"Get Range\";\n\t\t\t\t$this->response->setJsonContent(array('success' => true, 'data' => $this->data));\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->data['error'] = $e->getMessage();\n\t\t\t\t$this->response->setJsonContent(array('success' => false, 'data' => $this->data));\n\t\t\t}\n \treturn $this->response; //Supply response\n }", "public function cpRange($tablename,$columnname,$startvalue,$endvalue=0,$param=0) {\n $sql= \"SELECT * FROM $tablename WHERE $columnname BETWEEN '$startvalue'\";\n if($endvalue!=0){\n \n $sql.= \" AND '$endvalue'\";}\n if($param!=0)\n {\n $d_id_key= key($param);\n $d_value= $param[$d_id_key];\n $sql.= \" AND $d_id_key>0\"; \n }\n elseif ($param=0) {\n $d_id_key= key($param);\n $d_value= $param[$d_id_key];\n $sql.= \" AND $d_id_key=0\"; \n \n }\n//print_r($sql);\n $sth = $this->dbh->prepare($sql);\n $sth->execute();\n $result = $sth->fetchAll(PDO::FETCH_ASSOC);\n \n return $result;\n}", "public function filter_range($data,$min,$max){\n return filter_var($data,FILTER_VALIDATE_INT,array(\n \"options\" => array(\n \"min_range\" =>$min,\n \"min_range\"=>$max)\n ));\n }", "protected function _construct() {\n parent::_construct();\n\n if (!$this->hasData('range')) {\n $this->setData('range', 5);\n }\n }", "public function getRange(): string;", "function tradeoff_value_range($definition)\n {\n return app(Models\\Problem\\Range\\ValueRange::class)->setData($definition);\n }", "private function init_set() {\n\t\t$this->_set = array();\n\t\tfor($i=0; $i < $this->_max-$this->_min + 1; $i++) {\n\t\t\t$this->_set[$i] = $this->_min + $i;\n\t\t}\n\t}", "public function range($start = NULL, $length = NULL);", "static function getRange()\n {\n return static::$range;\n }", "function data_preprocessing(&$default_values){\n }", "public function setDataRange($startVal, $endVal) {\n\t\t$this->setMaxValue($endVal);\n\t\t$this->setMinValue($startVal);\n\t\t$this->setProperty('chds', $startVal.','.$endVal);\n\t}", "public function ProcessData($data=null) {\n if($data !== null) $this->data = $data;\n\n $curMax = null;\n $curMin = null;\n\n if(empty($this->data)) {\n return;\n }\n\n foreach($this->data as $datum) {\n if($curMax === null || $curMax < $datum) {\n $curMax = $datum;\n }\n if($curMin === null || $curMin > $datum) {\n $curMin = $datum;\n }\n }\n\n $this->dataMin = $curMin;\n $this->dataMax = $curMax;\n }", "public function getDefaultSearchData()\n {\n return array(\n self::DATE_FACTOR => 0,\n self::DATE_GROUP => null,\n self::DATE_TYPE => 'W');\n }", "public function applyDefaultValues()\n {\n $this->montacargas_baja = 0;\n }", "function setDefaultValues() {}", "public function applyDefaultValues()\n {\n $this->setregis = 0;\n }", "public static function range(array $data): float\n\t{\n\t\treturn max($data) - min($data);\n\t}", "protected static function setRange(array $range = [])\n {\n static::$range = ! empty($range) ? $range : range(0, 9);\n }", "public function getSearchRange() {}", "public function getSearchRange() {}", "public function url($data,$min,$max);", "public function buscaPorData($dataOrigem, $dataLimite){\n $query = 'select *from headset where data BETWEEN \"'.$dataOrigem.'\" AND \"'.$dataLimite.'\" order by id desc';\n $stm = $this->conexao->prepare($query);\n //$stm->bindValue(':dataOrigem', $dataOrigem.'%');\n //$stm->bindValue(':dataLimite', $dataLimite.'%');\n $stm->execute();\n return $stm->fetchAll(PDO::FETCH_OBJ);\n }", "function setDisplayRange(&$range_limits,$total_pages,$page_index){\n\t\tdefine('PAGES_DISPLAYED',7);\n\t\tdefine('MAX_OFFSET',3);\n\t\t\n\t\tif ($total_pages <= constant('PAGES_DISPLAYED')){\n\t\t\t//range 1 to $total_pages\n\t\t\t$range_limits['min'] = 1;\n\t\t\t$range_limits['max'] = $total_pages;\n\t\t} else {//range $PAGE_NO_MAX buttons required\n\t\t\t//button moves, range is stationary\n\t\t\tif (($page_index <= constant('MAX_OFFSET')) || (($total_pages - $page_index) < constant('MAX_OFFSET'))) {\n\t\t\t\tif ($page_index <= constant('MAX_OFFSET')) {\n\t\t\t\t\t$range_limits['min'] = 1;\n\t\t\t\t\t$range_limits['max'] = constant('PAGES_DISPLAYED');\n\t\t\t\t} else {\n\t\t\t\t\t$range_limits['min'] = $total_pages - (constant('PAGES_DISPLAYED') - 1);\n\t\t\t\t\t$range_limits['max'] = $total_pages;\n\t\t\t\t}\n\t\t\t} else {//($page_index > $max_offset) && (($total_pages - $page_index) > $max_offset)\n\t\t\t\t//button stationary, range moves[$page_index +/- $max_offset] \n\t\t\t\t$range_limits['min'] = $page_index - constant('MAX_OFFSET');\n\t\t\t\t$range_limits['max'] = $page_index + constant('MAX_OFFSET');\n\t\t\t}\t\n\t\t}\n\t\treturn;\t\t\t\n\t}", "function tradeoff_date_range($definition)\n {\n return app(Models\\Problem\\Range\\DateRange::class)->setData($definition);\n }", "public function __construct($name, $value, $start = false, $end = false, phpMyWave_Range $range = false) {\n\n }", "function fillArr($year,$range,$save,$depo,$beg){\n\t\t\t\t$fill=[];\n\t\t\t\tfor($i=0;$i<$year;$i++){\n\t\t\t\t\t$fill[$i]=[];\n\t\t\t\t\tfor($j=0;$j<$range+2;$j++){\t//\t+2 for year column & to include the $endRate\n\t\t\t\t\t\tif($j===0){\n\t\t\t\t\t\t\t$fill[$i][0]=$i+1;\t//\tFill the first column with year values.\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$save+=$save*($beg/100);\n\t\t\t\t\t\t\t$fill[$i][$j]=$save;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$beg++;\n\t\t\t\t\t$save=$depo;\n\t\t\t\t}\n\t\t\t\treturn $fill;\n\t\t\t}", "public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }", "public function fillupDefault()\n {\n\n foreach (static::$cols as $key => $col) {\n if ('' != $col[self::COL_DEFAULT]) {\n $this->data[$key] = $col[self::COL_DEFAULT];\n }\n }\n\n }", "public function range($start, $end, $step = null): static;", "function ods_level1_ranges() {\n $level0ranges = array();\n \n foreach ($this->schema['named-range'] as $range_name => $range){\n if ($range['level'] == 1){\n $level0ranges[] = $range_name;\n }\n }\n \n return $level0ranges;\n }", "public function setDefaultData(array $defaultData);", "function _erpal_contract_helper_cancelation_precalculate_range() {\n return variable_get('cancelation_precalculate_range', 500);\n}", "function getDefaults($app) {\r\n // Get stats object\r\n $stats = $app->getDoc()->stats();\r\n \r\n // Return some defaults\r\n return array(\r\n 'mileage' => (isset($stats['last']['mileage']) && isset($stats['all']['tripdistance'])) ? getMiles($stats['last']['mileage'] + $stats['all']['tripdistance']) : '',\r\n 'location' => (isset($stats['all']['location']) ? $stats['all']['location'] : ''),\r\n 'pricepergallon' => (isset($stats['last']['pricepergallon'])) ? getGasMoney($stats['last']['pricepergallon']) : '',\r\n 'grade' => (isset($stats['all']['grade'])) ? $stats['all']['grade'] : '0'\r\n );\r\n}", "protected function defaultValues() : array\n {\n return [\n 'limit' => 20,\n 'offset' => 0,\n 'order_by_dir' => 'DESC',\n ];\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\n\t}", "protected function _getRanges() {}", "function normalisasiData(){\n\n\t\tglobal $uanData;\n\t\tglobal $testData;\n\t\tglobal $minR;\n\t\tglobal $maxR;\n\t\tglobal $minT;\n\t\tglobal $maxT;\n\n\t\tif ($uanData < $minR) $minR = $uanData;\n\t\tif ($uanData > $maxR) $maxR = $uanData;\n\t\tif ($testData < $minT) $minT = $testData;\n\t\tif ($testData > $maxT) $maxT = $testData;\n\t\t\n\n\t\t$newDataUan = ($uanData-$minR)/($maxR-$minR);\n\t\t$newDataTest = ($testData-$minT)/($maxT-$minT);\n\n\t}", "public function getDefaultAllLevel()\n {\n return 100; # dung chon loc thong tin\n }", "function tradeoff_categorical_range($definition)\n {\n return app(Models\\Problem\\Range\\CategoricalRange::class)->setData($definition);\n }", "function setArticleCountsRange($min, $max)\n\t{\n\t\t$this->validate['articles_count']['range']['rule'][1] = $min-1;\n\t\t$this->validate['articles_count']['range']['rule'][2] = $max+1;\n\t}", "public function applyDefaultValues()\n {\n $this->is_not = false;\n $this->rank = 0;\n }", "public function getRange()\n {\n return $this->range;\n }", "public function getRange()\n {\n return $this->range;\n }", "private function range() {\n\n $data = array();\n\n for($i = 1; $i<= 2; $i++) {\n\n array_push($data, $this->id($i));\n\n }\n\n return $data;\n\n }", "function getDateRangePicker(){\n\treturn array('last60days'=>'Last 60 Days','today'=>'Today','thisweek'=>'This Week (Mon to Sun)','lastweek'=>'Last Week (Mon to Sun)','thismonth'=>'This Month','lastmonth'=>'Last Month','last6months'=>'Last 6 Months','thisyear'=>'This Year','custom'=>'Custom');\n}", "function loaddata($dataarray) {\r\n for ($i = 0; $i < count($dataarray); $i++) {\r\n $data = array(\r\n 'id_lab_item' \t=> $dataarray[$i]['id_lab_item'],\r\n 'low_limit' \t=> $dataarray[$i]['low_limit'],\r\n 'high_limit' \t=> $dataarray[$i]['high_limit'],\r\n 'min_limit' \t=> $dataarray[$i]['min_limit'],\r\n 'max_limit' \t=> $dataarray[$i]['max_limit'],\r\n 'age_range_1' \t=> $dataarray[$i]['age_range_1'],\r\n 'age_range_2' \t=> $dataarray[$i]['age_range_2'],\r\n 'pat_gender' \t=> $dataarray[$i]['pat_gender']\r\n );\r\n //ini untuk menambahkan apakah dalam tabel sudah ada data yang sama\r\n //apabila data sudah ada maka data di-skip\r\n // saya contohkan kalau ada data nama yang sama maka data tidak dimasukkan\r\n $this->db->where('id_lab_item', $this->input->post('id_lab_item')); \r\n if ($cek) {\r\n $this->db->insert('mst_lab_item_range', $data);\r\n }\r\n }\r\n\t}", "function GetNormalisasi($data, $maxmin, $status){\n if(strtolower($status) == 'benefit'){\n return round( $data / $maxmin, 2);\n }else{\n return round($maxmin / $data, 2);\n }\n}", "public function ranges(): array\n {\n return [\n 30 => '30 Days',\n 60 => '60 Days',\n 90 => '90 Days',\n 180 => '180 Days',\n 365 => '365 Days',\n ];\n }", "public function applyDefaultValues()\n {\n $this->create_date = '2021-06-07 11:49:57';\n $this->last_update = '2021-06-07 11:49:57';\n $this->last_sync = '1901-01-01 00:00:00';\n $this->jml_jamban_l_g = '0';\n $this->jml_jamban_l_tg = '0';\n $this->jml_jamban_p_g = '0';\n $this->jml_jamban_p_tg = '0';\n $this->jml_jamban_lp_g = '0';\n $this->jml_jamban_lp_tg = '0';\n $this->tipe_jamban = '9';\n $this->a_sedia_pembalut = '0';\n $this->a_tempat_sampah_kelas = '0';\n $this->a_tempat_sampah_tutup_p = '0';\n $this->a_cermin_jamban_p = '0';\n $this->a_memiliki_tps = '0';\n $this->a_tps_angkut_rutin = '0';\n $this->a_anggaran_sanitasi = '0';\n $this->a_melibatkan_sanitasi_siswa = '0';\n }", "protected function normalizeDefaultValue($data) {\n return $data;\n }", "public function applyDefaultValues()\n {\n $this->last_sync = '1901-01-01 00:00:00';\n }", "function range($args) {\r\n\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\techo \"<div style='line-height:24px;'><input style=' float:left;\" . $this->width($args['width']) . \"' type='range' data-tooltip='\" . $args['tooltip'] . \"' min='\" . $args['min'] . \"' max='\" . $args['max'] . \"' class='range' size='57' \" . $this->placeholder($args['placeholder'] ) . \" name='\" . $args['formname'] . \"' value='\" . $args['value'] . \"'/>\";\t\t\t\t\r\n\t\t\r\n\t\techo \"<span style=' float:left; margin-left:10px;' class='rangeval'>\" . $args['value']. \"</span><span>\" . $args['unit']. \"</span</div>\";\r\n\t\r\n\t\t$this->description($args['description']);\r\n\t\t}", "function test_range() {\n\t\t// Check range\n\t\tlist( $start, $end ) = $this->revenue->get_month_range( 2018, 1 );\n\t\t$this->assertEquals( '2018-01-01 00:00:00', $start );\n\t\t$this->assertEquals( '2018-01-31 23:59:59', $end );\n\t\t// Check leap year\n\t\tlist( $start, $end ) = $this->revenue->get_month_range( 2004, 2 );\n\t\t$this->assertEquals( '2004-02-01 00:00:00', $start );\n\t\t$this->assertEquals( '2004-02-29 23:59:59', $end );\n\t\t// Check exceptional leap year.\n\t\tlist( $start, $end ) = $this->revenue->get_month_range( 1900, 2 );\n\t\t$this->assertEquals( '1900-02-01 00:00:00', $start );\n\t\t$this->assertEquals( '1900-02-28 23:59:59', $end );\n\t}", "function giorno($min,$max)\n{\n$giorno='';\nif(!$min) $min='1';\nif(!$max) $max='31';\n$giorni=array();\nfor($x=$min;$x<=$max;$x++) $giorni[]=$x;\n#$giorni= array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31');\nforeach($giorni as $gi)\n\t$giorno .= \"<option value=$gi>$gi</option>\";\n$giorno .= \"</select>\";\necho \"$giorno\";\n}", "public function addRange($min, $max)\n {\n $this->range = \"$min to $max\";\n array_push($this->options, array(\"options\" => array(\"min_range\" => $min, \"max_range\" => $max)));\n }", "public function getRange() \n {\n \n return $this->_range;\n \n }", "public static function dataProvider()\n\t{\n\t\treturn array(\n\t\t\tarray(1600, 'MONTHLY', 1600),\n\t\t\tarray(2800, 'FOUR_WEEKLY', 2800),\n\t\t\tarray(280, 'TWICE_MONTHLY', 140),\n\t\t\tarray(1400, 'BI_WEEKLY', 700),\n\t\t\tarray(500, 'WEEKLY', 125),\n\t\t\tarray(505, 'WEEKLY', 126),\n\t\t\tarray(503, 'WEEKLY', 125),\n\t\t\tarray(1600, 'WHATEVER', 0),\n\t\t);\t\t\n\t}", "public function getRangeUnit(): string;", "function summary_argument($data) {\r\n $format = $this->date_handler->views_formats($this->options['granularity'], 'sql');\r\n $value = $data->{$this->name_alias};\r\n $range = $this->date_handler->arg_range($value);\r\n return date_format_date($range[0], 'custom', $format);\r\n }", "function getMinMaxForRange($date_start, $date_end) {\n $query = \"SELECT MIN(price) AS minPrice,\n MAX(price) AS maxPrice\n FROM np_data\n WHERE (\n (date BETWEEN '$date_start' AND '$date_end' AND hour != '23')\n OR (date = ($date_start - INTERVAL 1 DAY) AND hour = '23')\n )\";\n if ($result = $this->link->query($query)) {\n /* free result set */\n $row = mysqli_fetch_array($result);\n $result->close();\n $resultArray = array (\n 'min' => $row['minPrice'],\n 'max' => $row['maxPrice']\n );\n return $resultArray;\n }\n }", "protected function initDefaultNumberOfDays() {}", "public function ranges()\n {\n return [\n 6 => '6 Months',\n 12 => '12 Months',\n ];\n }", "public function setDomain(int $low, int $high) : void\n\t{\n\t\t$this->isRangeX = true;\n\t\t$this->rangeXHigh = $high;\n\t\t$this->rangeXLow = $low;\n\n\t}", "function fann_scale_output_train_data($train_data, $new_min, $new_max)\n{\n}", "function culturefeed_search_ui_get_age_range_facet_options() {\n return array(\n 0 => array(\n 'name' => '0-2 ' . t('year'),\n 'query' => '(agefrom:[0 TO 2] OR keywords:\"ook voor kinderen\")',\n 'range' => '[0 TO 2]',\n ),\n 3 => array(\n 'name' => '3-5 ' . t('year'),\n 'query' => '(agefrom:[3 TO 5] OR keywords:\"ook voor kinderen\")',\n 'range' => '[3 TO 5]',\n ),\n 6 => array(\n 'name' => '6-8 ' . t('year'),\n 'query' => '(agefrom:[6 TO 8] OR keywords:\"ook voor kinderen\")',\n 'range' => '[6 TO 8]',\n ),\n 9 => array(\n 'name' => '9-11 ' . t('year'),\n 'query' => '(agefrom:[9 TO 11] OR keywords:\"ook voor kinderen\")',\n 'range' => '[9 TO 11]',\n ),\n );\n\n}", "public function ranges()\n {\n return [];\n }", "function getSpendingData($group) {\r\n\t\t// so call it with our min and max multiplied by 100, then divide the\r\n\t\t// result by 100.\r\n $people = mt_rand(-2000, 2000) / 100;\r\n $supplies = mt_rand(-900, 900) / 100;\r\n $tools = mt_rand(-100, 100) / 100;\r\n $utilities = mt_rand(-250, 250) / 100;\r\n $maintenance = mt_rand(-700, 700) / 100;\r\n $other = mt_rand(-300, 300) / 100;\r\n $yesterday = $people + $supplies + $tools + $utilities + $maintenance + $other;\r\n\t\t\t\r\n return ['yesterday' => $yesterday,\r\n 'people' => $people,\r\n 'supplies' => $supplies,\r\n 'tools' => $tools,\r\n 'utilities' => $utilities,\r\n 'maintenance' => $maintenance,\r\n 'other' => $other];\r\n\t}", "public function dataBodyRange(): DataBodyRangeRequestBuilder {\n return new DataBodyRangeRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "function assignDataValues($timeHour, $timeMin, $row, $maxValue, $maxValuePoint, $maxValueText, $time, $watts, $watthours, $nowLogging, $startTime) {\n $timeText = $timeHour.\":\".$timeMin;\n $time[] = $timeText;\n $watts[] = $row[6];\n if($row[6] > $maxValue) {\n $maxValue = $row[6];\n $maxValuePoint = $timeText; // used for label on graph\n $maxValueText = number_format($row[6]). \" at $timeText\"; // used for label on graph\n }\n $watthours[] = $row[9];\n if(!$nowLogging) {\n $startTime = ($timeHour * 60) + $timeMin;\n $nowLogging = true;\n }\n return array($maxValue, $maxValuePoint, $maxValueText, $time, $watts, $watthours, $nowLogging, $startTime);\n}", "function getDefault() {\n return $this->records[2];\n }", "protected function getDefaultDataSource() {\r\n return new \\Yourface\\NiftyGrid\\ArrayDataSource($this->data);\r\n }", "function rangePOUpdate($start,$data) {\n $this->db->where('START_RANGE',$start);\n return $this->db->update($this->table, $data);\n }", "public function __construct($data=null,$default_data=null)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t\t$this->default_data = $default_data;\r\n\t}", "private function setLimitAndOffset()\n {\n $this->offset = ($this->page - 1) * $this->config->limit;\n if ($this->config->limit == 0) {\n $this->config->limit = count(self::$needles);\n }\n }", "function get_limit_data($limit, $start = 0, $q = NULL) {\n $this->db->order_by($this->id, $this->order);\n $this->db->like('id_jadwal', $q);\n\t$this->db->or_like('id_semester', $q);\n\t$this->db->or_like('id_makul', $q);\n\t$this->db->or_like('id_kelas', $q);\n\t$this->db->or_like('id_dosen', $q);\n\t$this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }", "public function compare_default_date(){\n\t\t$getdates = $this->Timerecordsummary_model->get_default_date()->row();\n\t\tif(!(empty($getdates))){\n\t\t\t$data = array(\"success\" => 1, \"date_ranges\" => $getdates);\n\t\t}else{\n\t\t\t$data = array(\"success\" => 0, \"date_ranges\" => \"Please input valid date range from Time Record Summary Range in settings\");\n\t\t}\n\t\techo json_encode($data);\n\n\t}", "public function ranges(): array\n {\n return [\n 3 => '3 Weeks',\n 6 => '6 Weeks',\n 9 => '9 Weeks',\n 12 => '12 Weeks',\n ];\n }", "public function getSliceSettingsDefaultData()\n {\n $settings = array(\n 'slice_1' => array(\n 'label' => '10% OFF',\n 'discount_type' => 'percent',\n 'value' => 10,\n 'gravity' => '20',\n ),\n 'slice_2' => array(\n 'label' => 'Not Lucky Today',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '5',\n ),\n 'slice_3' => array(\n 'label' => '35% OFF',\n 'discount_type' => 'percent',\n 'value' => 35,\n 'gravity' => '0',\n ),\n 'slice_4' => array(\n 'label' => 'Opps! Sorry',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '5',\n ),\n 'slice_5' => array(\n 'label' => '15% OFF',\n 'discount_type' => 'percent',\n 'value' => 15,\n 'gravity' => '10',\n ),\n 'slice_6' => array(\n 'label' => 'Better Luck Next Time',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_7' => array(\n 'label' => '50% OFF',\n 'discount_type' => 'percent',\n 'value' => 50,\n 'gravity' => '0',\n ),\n 'slice_8' => array(\n 'label' => 'Try Next Time',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_9' => array(\n 'label' => 'Free Shipping',\n 'discount_type' => 'freeship',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_10' => array(\n 'label' => 'Come Again',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n ),\n 'slice_11' => array(\n 'label' => '5% OFF',\n 'discount_type' => 'percent',\n 'value' => 5,\n 'gravity' => '10',\n ),\n 'slice_12' => array(\n 'label' => 'Try Again',\n 'discount_type' => 'fixed',\n 'value' => 0,\n 'gravity' => '10',\n )\n );\n return $settings;\n }", "function age_criteria($age_min, $age_max){\n\n $min = intval($age_min);\n $max = intval($age_max);\n\n $temp = [];\n\n $list = \"\";\n\n if (0>=$min and 0<=$max){\n $temp[] = 'Quaternary';\n $temp[] = 'Holocene';\n $temp[] = 'Pleistone';\n }\n\n if (1>=$min and 1<=$max){\n $temp[] = 'Pleicene';\n $temp[] = 'Miocene';\n }\n\n if (2>=$min and 2<=$max){\n $temp[] = 'Oligocene';\n $temp[] = 'Eocene';\n $temp[] = 'Paleocene';\n }\n\n if (3>=$min and 3<=$max){\n $temp[] = 'Cretaceous';\n $temp[] = 'Cretaceous, Upper';\n $temp[] = 'Cretaceous, Lower';\n }\n\n if (4>=$min and 4<=$max){\n $temp[] = 'Jurassic';\n $temp[] = 'Jurassic, Upper';\n $temp[] = 'Jurassic, Middle';\n $temp[] = 'Jurassic, Lower (Lias)';\n }\n\n if (5>=$min and 5<=$max){\n $temp[] = 'Triassic';\n $temp[] = 'Triassic, Upper';\n $temp[] = 'Triassic, Middle';\n $temp[] = 'Triassic, lower';\n }\n\n if (6>=$min and 6<=$max){\n $temp[] = 'Permian';\n }\n\n if (7>=$min and 7<=$max){\n $temp[] = 'Carboniferous';\n $temp[] = 'Carboniferous Upper (Coal Measeures)';\n $temp[] = 'Carboniferous Lower (Limestone)';\n }\n\n if (8>=$min and 8<=$max){\n $temp[] = 'Devonian';\n $temp[] = 'Devonian, Upper';\n $temp[] = 'Devonian, Middle';\n $temp[] = 'Devonian, Lower';\n }\n\n if (9>=$min and 9<=$max){\n $temp[] = 'Silurian';\n $temp[] = 'Silurian, Pridoli';\n $temp[] = 'Silurian, Ludlow';\n $temp[] = 'Silurian, Wenlock';\n $temp[] = 'Silurian, Llandovery';\n }\n\n if (10>=$min and 10<=$max){\n $temp[] = 'Ordovician';\n $temp[] = 'Ordovician, Upper';\n $temp[] = 'Ordovician, Middle';\n $temp[] = 'Ordovician, Lower';\n }\n\n if (11>=$min and 11<=$max){\n $temp[] = 'Cambrian';\n }\n\n if (12>=$min and 12<=$max){\n $temp[] = 'Precambrian';\n }\n\n if ($min==0 and $max==12)\n {\n $temp[] = 'Illegible';\n $temp[] = 'Missing';\n $temp[] = '';\n }\n\n for ($i = 0; $i < count($temp)-1; ++$i){\n $list .= \"'\".$temp[$i].\"', \";\n }\n $list .= \"'\".$temp[count($temp)-1].\"'\";\n\n return \"age IN (\".$list.\")\";\n }", "function page_range($pps,$tot_page,$sel_page){\r\n\t$min=null;\r\n\t$max=null;\r\n\r\n\tif($tot_page<=($pps*2)+1){\r\n\t\t$min=1;\r\n\t\t$max=$tot_page;\r\n\t}\r\n\telseif(($pps+$sel_page)>$tot_page){\r\n\t\t$max=$tot_page;\r\n\t\t$min=$sel_page-((($pps+$sel_page)-$tot_page)+$pps);\r\n\t}\r\n\telseif($sel_page-$pps<1){\r\n\t\t$min=1;\r\n\t\t$max=($pps-($sel_page-1))+$sel_page+$pps;\r\n\t}\r\n\telse{\r\n\t\t$min=$sel_page-$pps;\r\n\t\t$max=$sel_page+$pps;\r\n\t}\r\n\r\n\treturn array($min,$max);\r\n}", "public function ranges()\n {\n return [\n 30 => '30 Min',\n 60 => '60 Min',\n 180 => '3 Hrs',\n 720 => '12 Hrs',\n 1440 => '24 Hrs',\n ];\n }", "public function length($data,$min,$max);", "public function getDefaultValue();", "public function getDefaultValue();" ]
[ "0.5874796", "0.58617795", "0.58200365", "0.5813991", "0.5740875", "0.57173955", "0.56320065", "0.56128466", "0.5574428", "0.5561104", "0.55601156", "0.55601156", "0.55601156", "0.5543906", "0.55415666", "0.5530549", "0.5466999", "0.5465033", "0.54648393", "0.54479474", "0.5392983", "0.53822225", "0.5381547", "0.5374241", "0.5355604", "0.5347662", "0.53333825", "0.5326771", "0.53197247", "0.53191036", "0.5288369", "0.5287711", "0.5264819", "0.52627623", "0.5260006", "0.52537364", "0.5249729", "0.5233712", "0.52141225", "0.51969135", "0.5192225", "0.51625454", "0.51553875", "0.5151066", "0.5139964", "0.5128291", "0.512761", "0.5119825", "0.50998425", "0.50752777", "0.50659996", "0.50639224", "0.50606924", "0.5059062", "0.50437343", "0.50413966", "0.50199336", "0.5018741", "0.50090843", "0.50090843", "0.5008231", "0.50001734", "0.4997492", "0.49926788", "0.4976029", "0.49757463", "0.49672765", "0.49624762", "0.49590635", "0.4956483", "0.49551153", "0.49487016", "0.494727", "0.49388158", "0.49230206", "0.4922271", "0.49186364", "0.49034065", "0.48914474", "0.48896676", "0.48812726", "0.48810974", "0.48801425", "0.4875763", "0.48737034", "0.48662356", "0.48645642", "0.4863569", "0.48624116", "0.48593834", "0.48333177", "0.48329836", "0.48313498", "0.4829319", "0.48288518", "0.48185885", "0.48175475", "0.48174942", "0.48171186", "0.48152828", "0.48152828" ]
0.0
-1
get foto berdasarkan id
public function delete($id) { $foto = $this->m_akomodasi->getAkomodasi_byId($id); // cek jika file gambar default.jpg if ($foto['foto'] != 'default.jpg') { // hapus foto akomodasi unlink('upload/akomodasi/' . $foto['foto']); } $this->m_akomodasi->delete($id); session()->setFlashdata('pesan', 'Deleted'); return redirect()->to('/Akomodasi/' . $foto['nama_tipe']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getImageId();", "public function getId() {\n\t\treturn (string) $this->photo['id'];\n\t}", "public function getPhoto($id);", "public function getImageId()\n {\n return $this->imageid;\n }", "public function getImageid()\n {\n return $this->imageid;\n }", "public function getId()\n {\n return $this->_imageId;\n }", "public function getPhotoId()\n {\n return $this->photoId;\n }", "protected function getImageWithId($id){\n $conn = static::connect();\n $stmt = $conn->prepare(\"SELECT * FROM images where id=:id\");\n $stmt->bindValue('id', $id, PDO::PARAM_INT);\n $stmt->execute();\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }", "public function apartmentMainPhoto($id){\n\n $mainPhoto = DB::table('apartament_photos')\n ->select('id')\n ->where('apartament_id', $id)\n ->where('main_photo', 1)\n ->first();\n\n return $mainPhoto->id;\n }", "public static function find_photo($id){\n global $db;\n $message = null;\n $sql = \"SELECT * FROM photos WHERE photo_id = '\".$id.\"' LIMIT 1\";\n try {\n $result = $db->query($sql);\n $row = $result->fetch();\n return $row;\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function getImageId()\n {\n return $this->_imageId;\n }", "public function get_foto_file($id)\n\t{\n\t\tif (!$this->is_allowed('m_ads_update', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Image not loaded, you do not have permission to access'\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$m_ads = $this->model_m_ads->find($id);\n\n\t\techo $this->get_file([\n 'uuid' => $id, \n 'delete_by' => 'id', \n 'field_name' => 'foto', \n 'table_name' => 'm_ads',\n 'primary_key' => 'id',\n 'upload_path' => 'uploads/m_ads/',\n 'delete_endpoint' => 'administrator/m_ads/delete_foto_file'\n ]);\n\t}", "function getNomPhotoEtId($id) {\n\t\t$selectPrepa = self::$bdd -> prepare(\"SELECT nom, photoProfil, id FROM utilisateur WHERE id = '$id'\");\n\t\t$selectPrepa -> execute();\n\t\t$result = $selectPrepa -> fetch();\n\t\treturn $result;\n\t}", "protected function traerFoto(){\n $foto = Fotoperfil::where('id_user', \\Auth::user()->id )->get();\n return $foto[0]->foto;\n }", "public function getPhoto($id){\n $sql=\"SELECT from_url FROM people WHERE id_people=?\";\n $rs=$this->con->prepare($sql);\n $rs->execute(array($id));\n return $rs->fetch(PDO::FETCH_OBJ);\n }", "public function getId()\n {\n return $this->file->get('id');\n }", "function findPhoto($photo_id){\n\t\n}", "public function consultarId(){\r\n\r\n\t\t\t$conexion=new conexion();\r\n\r\n\t\t\t$query =\"SELECT * FROM imgEncabezado\r\n\t\t\t\t\t\tWHERE idimg=\".$this->getIdImg().\";\";\r\n\t\t\t$resultado =pg_query($conexion->getStrcnx(),$query);\r\n\t\t\tpg_close($conexion->getStrcnx()); //cerramos la conexion a la db\r\n\t\t\t\r\n\t\t\treturn $resultado;\r\n\t\t}", "public function selectImage($id) {\n $sql = \"SELECT * FROM `images` WHERE `id` = :id\"; \n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue('id', $id); \n $stmt->execute(); \n return $stmt->fetch(PDO::FETCH_ASSOC); \n }", "public function getImagesId()\n {\n $url = str_replace(\"[:action]\", \"images/ids\", self::ImgUrAPI_MINE_URL);\n $url = str_replace(\"[:user_id]\", $this->user_id, $url);\n $result = self::excuteHTTPSRequest($url, $this->accessToken);\n\n return isset($result['data']) && !empty($result['data']) ? $result['data'] : null;\n }", "function files_id_get($resource=\".files_meta\", $uuid) { // read one\n return resource_id_get($resource, $uuid);\n}", "public function getPictureId()\n {\n return $this->pictureId;\n }", "public function get_image_id() {\r\n return $this->image_id;\r\n }", "function getFileId() {\n\t\treturn $this->getData('fileId');\n\t}", "public function getPictureById($id)\n\t{\n\t\t$sql = \"SELECT id,file FROM photo WHERE id=:id LIMIT 1\";\n\t\t$query = $this->db->prepare($sql);\n\t\t$query->execute(array(\":id\"=>$id));\n\t\treturn $query->fetchAll();\n\t}", "public function getPhoto($id)\n {\n $res = $this->db->select(\"SELECT * FROM `{$this->domainPhoto}` WHERE itemName()='{$id}'\", array('ConsistentRead' => 'true'));\n $this->logErrors($res);\n if(isset($res->body->SelectResult->Item))\n return self::normalizePhoto($res->body->SelectResult->Item);\n else\n return false;\n }", "function getFirstImage($id) {\n global $DB;\n $stmt = $DB->prepare(\"SELECT image FROM hotel_image WHERE hotel_id = ?\");\n $stmt->bindParam(1, $id);\n $stmt->execute();\n if ($row = $stmt->fetch()) {\n return \"./uploads/\".$row[\"image\"];\n }\n return \"./images/default-image.png\";\n}", "public function getFoto($foto)\n {\n// throw new \\InvalidArgumentException('Parâmetros inválidos');\n// $fotoMural = $this->getEm()->find('Application\\Entity\\Mural', (int) $id);\n// if (!$user)\n// throw new NoResultException('Mural não existe');\n// $base = null;\n if ($foto != null) {\n $stream = stream_get_contents($foto);\n $foto = base64_decode($stream);\n }\n \n return $foto;\n }", "function getImageByImageId() {\n if($this->image_id == '') return;\n\n $sql = \"SELECT * FROM \".$this->tableImages().\" WHERE image_id = \".$this->image_id;\n return $this->db->query($sql)->row_array();\n\t}", "public function getFileId(): string\n {\n return $this->file_id;\n }", "public function getFoto()\r\n {\r\n return $this->Foto;\r\n }", "function ac_get_image_id($image_url) {\n \n global $wpdb;\n \n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url )); \n \n return $attachment[0]; \n}", "function wpbm_get_image_id( $image_url ){\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb -> posts} WHERE guid='$image_url'\";\n $id = $wpdb -> get_var( $query );\n return $id;\n }", "public function getFoto()\n {\n return $this->foto;\n }", "public function getFoto()\n {\n return $this->foto;\n }", "function getPhotoInfo($photoId);", "function imageID( )\r\n {\r\n return $this->ImageID;\r\n }", "function getSpecificPhoto($id) {\r\n App::import('Vendor', 'phpFlickr/phpFlickr');\r\n $flickr =& new phpFlickr(Configure::read('Flickr.settings.key'));\r\n return $flickr->photos_getSizes($id);\r\n }", "public function getFileId()\n\t{\n\t\treturn $this->fileId; \n\n\t}", "public function getMediaId();", "function obtenerimg($id){\n $sql = \"SELECT img_perfil from GestionHongos.dbo.Usuarios where id_usuario = '{$id}'\";\n $qry = sqlsrv_query($this->conn, $sql);\n if ($qry === false) {\n echo \"Error (sqlsrv_query): \" . print_r(sqlsrv_errors(), true);\n }\n $data = '';\n while ($row = sqlsrv_fetch_array($qry, SQLSRV_FETCH_ASSOC)) {\n $data .= $row['img_perfil'];\n }\n return $data;\n }", "public function getImageByID ($id_image = 0) {\n $this->connection->where('id_image', $id_image);\n $result = $this->connection->select('base64', 'images');\n\n if ($result && $result->num_rows > 0) {\n while($row = $result->fetch_assoc()) {\n $image = array(\n 'base64' => $row['base64'],\n );\n\n // if (file_exists('./images/' . $row['filename'])) {\n // $image['base64'] = base64_encode(file_get_contents('./images/' . $row['filename']));\n // }\n break;\n }\n\n return $image;\n }\n\n return null;\n }", "public function get_photo_name($i_id)\r\n\t{\r\n\t\ttry\r\n {\r\n\t\t\t$this->db->select('s_photo');\r\n\t\t\t$this->db->where(array('i_id'=>$i_id));\r\n\t\t\t$mix_res = $this->db->get_where($this->tbl);\r\n\t\t\t$mix_name_array = $mix_res->result_array();\r\n\t\t\treturn $mix_name_array[0]['s_photo'];\r\n\t\t}\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n\t}", "public function get_file_foto_2()\n {\n $hasil = $this->db->get_where('file_foto', array('keterangan' => 'gambar_detail'))->result_array();\n\n $value = array();\n \n foreach ($hasil as $h) {\n $nama_file \t\t= base64_decode($h['file_foto']);\n \t\t$id_file_foto \t= $h['id_file_foto'];\n\n \t\t$value[] = ['file_foto' \t=> $nama_file,\n\t \t\t\t\t'id_file_foto'\t=> $id_file_foto\n\t \t\t\t\t];\n }\n\n return $value;\n \n }", "function get_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t$query = \"SELECT * FROM $images_db_table WHERE id='$image_id';\";\n\n\t\tif ($result = receive_query($query, $db_hostname, $db_user,\n\t\t$db_password,$idea_db))\n\t\t{\n\t\t\t// extract record from query\n\t\t\t$row = $result->fetch_array();\n\t\t\treturn $row['filename'];\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}", "function shoestrap_get_attachment_id_from_src( $image_src ) {\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n $id = $wpdb->get_var( $query );\n return $id;\n}", "function kt_get_image_id($image_url) {\n global $wpdb;\n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url )); \n return $attachment[0]; \n}", "public function gezippercolorimg($id){\n\n\n\n $productid = Zippercolor::find($id);\n \n\n $filePath = base_path().\"/storage/app/zipper/\".$productid->productImage; \n header('Content-type: image/jpeg');\n $img = Image::make($filePath);\n return $img->response('jpg');\n\n \n }", "public function gezippercolorimg($id){\n\n\n\n $productid = Zippercolor::find($id);\n \n\n $filePath = base_path().\"/storage/app/zipper/\".$productid->productImage; \n header('Content-type: image/jpeg');\n $img = Image::make($filePath);\n return $img->response('jpg');\n\n \n }", "public function photoShow($id)\n {\n //\n }", "function pz_get_image_id($image_url)\n{\n global $wpdb;\n $attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM $wpdb->posts WHERE guid='%s';\", $image_url));\n return $attachment[0];\n}", "function ImageFile()\n\t{\treturn $this->imagedir . (int)$this->id . \".jpg\";\n\t}", "public function getPhoto()\n {\n return $this->execute('GET', '/' . self::PHOTO);\n }", "public function get_file_file($id)\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_bendungan_update', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Image not loaded, you do not have permission to access'\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$dokumentasi_bendungan = $this->model_dokumentasi_bendungan->find($id);\n\n\t\techo $this->get_file([\n 'uuid' => $id, \n 'delete_by' => 'id', \n 'field_name' => 'file', \n 'table_name' => 'dokumentasi_bendungan',\n 'primary_key' => 'kode_dbd',\n 'upload_path' => 'uploads/dokumentasi_bendungan/',\n 'delete_endpoint' => 'administrator/dokumentasi_bendungan/delete_file_file'\n ]);\n\t}", "public function getFileID()\n {\n return $this->get('FileID');\n }", "public function getImage($id){\n $id = strip_tags($id);\n\n $sql = \"SELECT * FROM image WHERE id = :id LIMIT 1\";\n $query = $this->db->prepare($sql);\n $parameters = array(':id' => $id);\n\n $query->execute($parameters);\n\n return $query->fetchAll();\n }", "public function Photo(){\n\t\t$photoId = \"491634914183411\";\n\t\t$imgInfo \t\t\t= 'https://graph.facebook.com/'.$photoId.'?access_token='.$this->session->userdata('oauth_token');\n\t\techo $imgInfo;\n\t}", "public function cargarImagen() {\n\n $id = $_REQUEST[\"id\"];\n\n echo $this->usuario->getCampo($id,'imagen');\n\n }", "public function item_primary_image()\n\t{\n\t\t$product_id = ee()->TMPL->fetch_param('product_id');\n\n\t\t$query = ee()->db\n\t\t\t->select('field_id_32')\n\t\t\t->where('channel_id', 1)\n\t\t\t->where('entry_id', $product_id)\n\t\t\t->get('channel_data');\n\n\t\treturn $query->row('field_id_32');\t\n\t}", "public function header_image($id)\n {\n $h = $this->db->select('*')->from('user')->where('id',$id)->get(); \n return $h->result(); \n }", "public function get_avatar($id = \"\") {\n $this->db->select('id,avatar');\n $this->db->from($this->admin_table);\n $this->db->where('id', $id);\n $result = $this->db->get();\n return $result->row_array();\n }", "public function product_get_images_id($id)\n {\n \n $query = \"SELECT * FROM \" . $this->db_table_prefix. \"images where product_id = '\" . $id . \"' order by id DESC\";\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }", "public function getimagebykatid($id){\n $query = $this->db->table($this->table)\n ->where('kategori_id',$id)\n ->where('status_cd','normal')\n ->get();\n return $query;\n }", "public function getUserPhoto($iduser){\n //convert the $id to integer\n $iduser = intval($iduser);\n\n $userinfo = DB::connection('mongodb')->collection('userinformations')\n ->project(['_id' => 0])\n ->select('profilephoto')\n ->where('iduser', '=', $iduser)\n ->get();\n if($userinfo) {\n foreach($userinfo as $new){\n return $new;\n }\n \n } else {\n return 'no photo';\n }\n \n }", "public function hapusFoto($id)\n\t{\n\t\t$guru_id = array(\n\t\t\t'guru_id' => $id,\n\t\t);\n\t\t$x = $this->primary_model->getDataBy('tb_guru',$guru_id);\n\t\tforeach($x as $m)\n\t\t{\n\t\t\t$foto=$m->foto;\n\t\t}\n\t\t$dir =\"data/guru/photo/\".$foto;\n\t\tunlink($dir);\n\t\t$data=array('foto' => '');\n\t\t$this->primary_model->updateData('guru_id',$id,'tb_guru',$data);\n\t\t$this->session->set_flashdata('msgFoto','Foto berhasil di hapus');\n\t\tredirect('guru/data_guru/'.$id);\n\t\t\n\t}", "public function getFileId()\n {\n return $this->fileId;\n }", "public function getFileById(int $id)\n {\n $sql = \"SELECT files.*, users.name as user_name, users.avatar as user_avatar FROM files LEFT JOIN users on files.user_id = users.id WHERE files.id=:id_bind\";\n $stmt = $this->db->prepare($sql);\n $stmt->bindValue(':id_bind', $id, \\PDO::PARAM_STR);\n $stmt->execute();\n $result = $stmt->fetchAll(\\PDO::FETCH_CLASS, 'Filehosting\\Entity\\File');\n return !empty($result) ? $result[0] : null;\n }", "public function get_photo(){\n $id = $this->input->post('id');\n if(is_numeric($id)){\n $data = $this->base_model->get_data('deal_pic' , '*' , 'row' , array('id'=>$id));\n echo json_encode($data);\n }else{\n show_404();\n }\n }", "public function get_file_foto()\n {\n \t/*$this->db->order_by('add_time', 'desc');\n \treturn $this->db->get('file_foto');*/\n\n \t$this->db->select('*');\n \t$this->db->from('file_foto');\n \t$this->db->order_by('add_time', 'desc');\n\n \t$hasil = $this->db->get();\n\n \t$value = array();\n\n \tforeach ($hasil->result_array() as $h) {\n \t\tif (base64_decode($h['file_foto']) == \"no_image.jpg\") {\n \t\t\tunset($hasil);\n \t\t} else {\n \t\t\t$nama_file \t\t= base64_decode($h['file_foto']);\n \t\t\t$id_file_foto \t= $h['id_file_foto'];\n\n \t\t\t$value[] = ['file_foto' \t=> $nama_file,\n\t \t\t\t\t\t'id_file_foto'\t=> $id_file_foto\n\t \t\t\t\t ];\n \t\t}\n\n \t}\n\n \treturn $value;\n }", "public function getFileById($conn, $id){\n\t\t//preparo lo statement che mi ricava tutti i dati di una determinata informazione \t\t\t\n\t\t$sth = $conn->prepare(\"select * from Filmato_Presentazione where id = :id\");\n\t\t$sth->bindParam(':id', $id, PDO::PARAM_INT);\n\t\t$sth->execute();\n\t\t//voglio solo 1 record\n\t\t$result = $sth->fetch(PDO::FETCH_ASSOC);\n\t\treturn $result;\n\t}", "function get_photo_date_by_id($id)\n{\n\t$result=$GLOBALS['db']->Execute(\"SELECT date FROM \".PREFIX.\"photos WHERE id='\".linpha_addslashes($id).\"'\");\n\t$row=$result->FetchRow();\n\treturn $row[0];\n}", "function ts_get_attachment_id_from_src ($image_src) {\r\n\r\n\tglobal $wpdb;\r\n\t$query = $wpdb -> prepare(\"SELECT ID FROM {$wpdb->posts} WHERE guid= %s \",$image_src);\r\n\t$id = $wpdb->get_var($query);\r\n\treturn $id;\r\n}", "public function getFile_id() {\n return (int) $this->_file_id;\n }", "public function getIdFil()\n {\n return $this->idFil;\n }", "static function GetPhoto($md5, $type = APP_FEATURE)\n\t{\n\t\t# ¿La foto predeterminada? ¡Claro!\n\t\tif ( $md5 == 'default' )\n\t\t\treturn file_get_contents(RESOURCES_GLOBAL . '/images/id/web.default.png');\n\n\t\t# Obtenemos la carpeta donde guardar esta foto.\n\t\t$folder = self::GetFolder($type);\n\t\t# Esta sería la ubicación de la foto.\n\t\t$file \t= MEDIA . $folder . DS . $md5;\n\n\t\t# ¡La foto no existe! Algo malo sucedio aquí...\n\t\tif ( !file_exists($file) )\n\t\t\treturn NO_EXIST;\n\n\t\t# Regresar bits.\n\t\treturn file_get_contents($file);\n\t}", "public function get_file_file($id)\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_tol_update', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => 'Image not loaded, you do not have permission to access'\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$dokumentasi_tol = $this->model_dokumentasi_tol->find($id);\n\n\t\techo $this->get_file([\n 'uuid' => $id, \n 'delete_by' => 'id', \n 'field_name' => 'file', \n 'table_name' => 'dokumentasi_tol',\n 'primary_key' => 'kode_dtl',\n 'upload_path' => 'uploads/dokumentasi_tol/',\n 'delete_endpoint' => 'administrator/dokumentasi_tol/delete_file_file'\n ]);\n\t}", "function getImage($id,$privacy,$photo) {\n\t\t\n\t\t// Privacy check\n\t\tif(substr($photo, 0, 7) == \"default\") return $photo ;\n\t\t\n\t\t// Else confirm privacy check and return image\n\t\treturn ($privacy == 1) ? 'private.png' : $photo;\n\t\t\n\t}", "function retrieveOneImageId($folderId, $apiKey){\n $fileArray = retrieveOneFileArray($folderId, $apiKey);\n $filteredFileArray = filterByMimeType($fileArray, \"image/\");\n return getfileIds($filteredFileArray);\n}", "protected function GetImageFromPageTable()\n {\n $imageID = null;\n $activePage = $this->getActivePageService()->getActivePage();\n if (array_key_exists('images', $activePage->sqlData)) {\n $oPageImages = $activePage->GetImages('images');\n if ($oPageImages->Length() > 0) {\n /** @var $oImage TCMSImage */\n if ($this->bPickRandomImage) {\n $oImage = $oPageImages->Random();\n } else {\n $oImage = $oPageImages->Current();\n }\n $imageID = $oImage->id;\n }\n }\n\n return $imageID;\n }", "function get_attachment_id_from_src ($image_src) {\n\n\tglobal $wpdb;\n\t$query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n\t$id = $wpdb->get_var($query);\n\treturn $id;\n\n}", "function requestFotosProduto($produto_id)\n {\n\n $conn = new db_conect();\n $query = 'SELECT caminho_foto FROM img_produto WHERE produto_fk = ' . $produto_id . ';';\n $result = $conn->selectCustom($query);\n return $result;\n }", "function get_project_id_gallery($project_id){\n $id=base64_decode($project_id)/98765;\n $get_all_gallery_img=\"SELECT * FROM rmd_gallery_img WHERE project_id='$id'\";\n $get_all=$this->db->query($get_all_gallery_img);\n return $get_all->result();\n }", "public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }", "public function loadproductimagebyid($id){\n\t\t$this->db->where('Product_Id', $id);\n\t\t$query=$this->db->get('tbl_product_images');\n\t\treturn $query->result();\n\t}", "public function getPhoto() {\n return DATADIR . 'alumni/' . $this->shortName . '.jpg';\n }", "protected function getFile($id) {\n\t\t/* load from database */\n\t\t$data = $this->db->querySingle('SELECT * FROM image WHERE id = \"'.SQLite3::escapeString($id).'\"', true);\n\t\t$path = self::getPath($id);\n\t\tif (!$data || !is_file($path)) {\n\t\t\t/* delete leftovers */\n\t\t\t$this->delete($id);\n\t\t\tthrow new QuicksandException(\"The file you are looking for does not exist (anymore).\");\n\t\t}\n\t\treturn $data + array('path' => $path);\n\t}", "public function getPathFile($id){\n $sql = \"SELECT pathFile FROM fanart WHERE id=\".intval($id).\";\";\n $res = mysqli_query($this->link, $sql);\n $path = mysqli_fetch_all($res)[0][0];\n return $path;\n }", "public function getImageFile() \n {\n return isset($this->imagen) ? Yii::$app->basePath . '/web/img/producto/'. $this->imagen : null;\n }", "public function photoURL($ID) {\n\t\t\t\t$image = File::get_by_id($ID);\n\t\t\t\t$url = $image->getAbsoluteURL();\n\t\t\t\treturn $url;\n\t\t}", "function get_attachment_id_from_src ($image_src) {\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'\";\n $id = $wpdb->get_var($query);\n return $id;\n}", "function get_file($hash_id = null)\r\n\t{\r\n\t\t\r\n\t}", "public function sel_next_image_id()\n\t{\n\t\t$image_id = null;\n\t\ttry{\n\t\t\t$m_image = new Model_M_Image($this->db, $this->client_id);\n\t\t\t$image_id = $m_image->sel_next_id();\n\t\t} catch(Exception $e){\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e))->write();\n\t\t\t$image_id = null;\n\t\t}\n\t\treturn $image_id;\n\t}", "function cpo_image_url( $id, $size = 'full' ) {\n\t$url = '';\n\tif ( is_numeric( $id ) ) {\n\t\t$url = wp_get_attachment_image_src( $id, $size );\n\t\t$url = $url[0];\n\t} else {\n\t\t$url = $id;\n\t}\n\n\treturn $url;\n}", "function get_first_object_image($obj_type, $obj_id, $image_sizes = array())\n{\n $query = 'SELECT * FROM object_images WHERE obj_type = \"' . strtok($obj_type, \" \") .\n '\" AND obj_id = ' . (int)$obj_id;\n $row = db()->query( $query);\n if (!$row)\n return;\n \n $image = get_images($row[0]['img_id'], $image_sizes);\n $image['id'] = $row[0]['id'];\n\n return $image;\n}", "function fotoPagina($pid){\n\t\t\t\t$sql = $this->db->query(\"SELECT foto FROM pagina WHERE pid='\".$pid.\"';\");\n\t\t\t\t$resultado = stmt ($sql);\n\t\t\t\treturn ($resultado->count() > 0) ? $resultado[0]->foto : false;\n\t\t}", "function getPhoto()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$response = $this->mapi->getPhoto($id);\n\n\t\techo json_encode($response);\n\t}", "public function photo($id)\n {\n $post = Post::where('id', $id)->first();\n\n return response()->file(storage_path() .'/app/'. $post->image_path);\n }", "private function getImageForCarId($id)\n {\n $this->db->setQuery(\"SELECT * FROM #__djcf_images WHERE item_id='\" . (int)$id . \"' ORDER BY ordering ASC LIMIT 1\");\n $row = $this->db->loadObject();\n\n // replace incorrect double //\n return JUri::base() . substr($row->path, 1, strlen($row->path) - 1) . $row->name . '.' . $row->ext;\n }", "private function getPicture($id)\n\t{\n\t\t$url = 'https://graph.facebook.com/' . $id . '/picture?type=normal';\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$a = curl_exec($ch);\n\t\t$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n\t\tcurl_close($ch);\n\t\treturn $url;\n\t}", "public function getLogoBlobId()\n {\n return $this->logo_blob_id;\n }", "protected function get_foto_file($model){\n $file = sprintf('%1$s/%2$s/%3$s',$this->get_foto_folder() , $model->id_user, $model->foto);\n\t\treturn $this->get_and_check_file($file);\n }" ]
[ "0.78125066", "0.71092147", "0.70982677", "0.7007602", "0.7002171", "0.69385976", "0.68940014", "0.6882539", "0.6831955", "0.6827038", "0.68204266", "0.67692417", "0.67642224", "0.6729315", "0.67240256", "0.6697832", "0.6629205", "0.66184086", "0.6590405", "0.6577907", "0.65649056", "0.6538693", "0.6513496", "0.6509412", "0.65078235", "0.64728063", "0.6471065", "0.6459409", "0.6456857", "0.6418148", "0.6411112", "0.6410964", "0.6410058", "0.64093816", "0.6357774", "0.635745", "0.6350553", "0.6349689", "0.6342408", "0.6339487", "0.63350755", "0.63264364", "0.63220555", "0.6318726", "0.63174444", "0.62980926", "0.6288234", "0.627246", "0.627246", "0.62588394", "0.625453", "0.6249854", "0.62355894", "0.62350476", "0.6232646", "0.6227725", "0.6197616", "0.6191613", "0.6191263", "0.6191039", "0.6186854", "0.6180277", "0.61648077", "0.6163424", "0.61629415", "0.6161615", "0.616106", "0.6149095", "0.6145143", "0.61360437", "0.61169", "0.61096764", "0.6105036", "0.60975444", "0.6095619", "0.60788584", "0.60759795", "0.60742354", "0.60708934", "0.6066078", "0.6062766", "0.6060352", "0.6056031", "0.60438704", "0.6043629", "0.6041892", "0.6038993", "0.603873", "0.60287666", "0.6017202", "0.60108566", "0.6009515", "0.60093445", "0.60089624", "0.60082763", "0.6006852", "0.59988433", "0.5994511", "0.59725684", "0.5972216", "0.5960225" ]
0.0
-1
Display a listing of the resource.
public function index() { // return "multipics"; $images=Multipics::latest()->paginate(3); return view('admin.multipic.index',compact('images')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $files = $request->file('images'); foreach ($files as $image) { // if ($image) { $imageName = rand(11111, 99999) . '.' . $image-> getClientOriginalExtension(); $image->move(public_path('multipic'), $imageName); // return $imageName; Multipics::insert([ 'image'=>$imageName, // 'created_at'=>Carbon::now(), ]); } return back()->with('success','Images created successfully!'); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7286258", "0.71454436", "0.7132821", "0.6640289", "0.6621105", "0.6566493", "0.65255576", "0.65087926", "0.6448317", "0.63752604", "0.63736314", "0.6365631", "0.6365631", "0.6365631", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229" ]
0.0
-1
Display the specified resource.
public function show(Multipics $multipics) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Multipics $multipics) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Multipics $multipics) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Multipics $multipics) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
==== Property Declarations ============================================= ======================================================================== ==== End of Property Declarations ====================================== ======================================================================== ==== Method Declarations =============================================== ======================================================================== ==== getForm() ========================================================= Recieve all rows using name & email parameters Parameters: $name string of a name $email string of a email Return: TRUE database results found FALSE no database results found ========================================================================
protected function getForm(string $name, string $email) { $sql = "SELECT * FROM " . $this->formsTableName . " WHERE name = ? AND email = ?"; $stmt = $this->connect()->prepare($sql); $stmt->bindParam(1, $name, \PDO::PARAM_STR); $stmt->bindParam(2, $email, \PDO::PARAM_STR); $stmt->execute(); $res = $stmt->fetchAll(); if($res){ return $res; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getForm();", "public static function getForm();", "abstract function getForm();", "function getForms()\n {\n $func_status = 'pass';\n $func_error = '';\n $forms = '';\n\n try {\n $tableName = \"permissions_forms\";\n\n $getForms = new Mysql;\n $getForms->dbConnect();\n $resultSet = $getForms->selectAll($tableName);\n $getForms->dbDisconnect();\n\n if($resultSet) {\n if(mysqli_num_rows($resultSet) > 0){\n $forms = '[';\n while($row = mysqli_fetch_array($resultSet)){\n $newFormTitle = preg_replace(\"/\\\"/\",\" \",$row['FORMTITLE']);\n $forms .= '['.$row['FORMID'].',\"'.$newFormTitle.'\"],';\n }\n $forms = substr($forms, 0, -1);\n $forms .= ']';\n } else {\n $func_status = 'fail';\n $func_error = 'getForms: Query returned no results..';\n }\n } else {\n $func_status = 'fail';\n $func_error = 'getForms: Error performing query..';\n }\n\n } catch (Exception $e) {\n $func_status = 'fail';\n $func_error = 'getForms: Caught exception: '.$e->getMessage();\n mail(\"[email protected]\", \"PermissionsTable Demo Error: Users getForms\", $e->getMessage());\n }\n\n return '{\"STATUS\":\"'.$func_status.'\",\"ERROR\":\"'.$func_error.'\",\"RESULT\":'.$forms.'}';\n\n }", "abstract protected function getForm();", "function getMainForm()\r\n\t{\r\n\t\t// mendapatkan form-form nya row per row.\r\n\t\t// dan kemudian memasukkan value dari query database kedalam input form masing2 yang sesuai\r\n\t\t$i = 0;\r\n\t\t$arrData = array();\r\n\t\t$out = '<tbody>';\r\n\t\t$this->arrInput = get_object_vars($this->input);\r\n\t\twhile ($arrResult = $this->nav->fetch())\r\n\t\t{\r\n\t\t\t$this->arrResult = $arrResult;\r\n\t\t\t$tableId = $this->arrResult[$this->tableId];\r\n\t\t\t$out .= '<tr data-id=\"'.$tableId.'\">';\r\n\t\t\tforeach($this->arrInput AS $input)\r\n\t\t\t{\r\n\t\t\t\tif (!$input->isInsideMultiInput && !$input->isHeader)\r\n\t\t\t\t{\r\n\t\t\t\t\t// digunakan pada sqllinks\r\n\t\t\t\t\tif (preg_match ('~ as ~is',$this->tableId))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (preg_match('~(.*) (as) (.*)~is', $this->tableId, $match))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->tableId=$match[3];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($this->isMultiLanguage && !isset($this->load_lang[$i]) && !empty($this->strField2Lang))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$q = \"SELECT `lang_id`, `\".implode('`, `', $this->strField2Lang).\"` FROM `$this->LanguageTable` WHERE `$this->LanguageTableId`={$tableId}\".$this->LanguageTableWhere;\r\n\t\t\t\t\t\t$this->load_lang[$i] = 1;\r\n\t\t\t\t\t\t$r = $this->db->getAll($q);\r\n\t\t\t\t\t\tforeach($r AS $d)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach($this->strField2Lang AS $f)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$arrResult[$f][$d['lang_id']] = $d[$f];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$arrResult[$input->objectName] = $this->getDefaultValue($input, $arrResult, $i);\r\n\t\t\t\t\t// dapatkan array data report\r\n\t\t\t\t\tif ($this->isReportOn && $input->isIncludedInReport)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$irow = $input->getReportOutput($arrResult[$input->objectName]);\r\n\t\t\t\t\t\tif ($input->reportFunction && is_callable($input->displayFunction))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$irow = call_user_func_array($input->displayFunction, array($irow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_callable($input->exportFunction))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$irow = call_user_func_array($input->exportFunction, array($irow));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$arrData[$i][]\t= $irow;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($input->isInsideRow)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$out\t.= '<td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$str_value = in_array($input->objectName, ['system_delete_tool']) ? $arrResult[$this->tableId] : $arrResult[$input->objectName];\r\n\t\t\t\t\t$tmp = $input->getOutput($str_value, $input->name.'['.$i.']', $this->setDefaultExtra($input));\r\n\t\t\t\t\tif (!empty($this->disableInput[$input->objectName]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$is_disable = false;\r\n\t\t\t\t\t\tforeach ((array)$this->disableInput[$input->objectName] as $exec)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$comparator = is_array($arrResult[$exec[2]]) ? current($arrResult[$exec[2]]) : $arrResult[$exec[2]];\r\n\t\t\t\t\t\t\teval('if($exec[1] '.$exec[0].' $comparator){$is_disable=true;}');\r\n\t\t\t\t\t\t\tif ($is_disable)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ($is_disable)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$tmp = preg_replace(array('~(<input\\s?)~is', '~(<select\\s?)~is', '~(<textarea\\s?)~is'), '$1 disabled ', $tmp);\r\n\t\t\t\t\t\t\tif ($input->objectName != 'system_delete_tool')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$tmp.= $this->setDisableInputRecovery($arrResult[$input->objectName], $input->name.'['.$i.']', $tmp);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($input->isInsideRow)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$out\t.= $tmp.'</td>';\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif (!empty($tmp) && preg_match('~hidden~is', $tmp))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$out .= $tmp;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$out .= '<div class=\"hidden\">'.$tmp.'</div>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} // end foreach\r\n\t\t\t$out .= '</tr>';\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$out .= '</tbody>';\r\n\t\tif ($this->isReportOn)\r\n\t\t{\r\n\t\t\t$this->reportData['data'] = $arrData;\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "public function retrieveData ()\r\n {\r\n // deciding on the way we retrieve data\r\n $method = &$_POST;\r\n if ($this->_meta['method'] == 'get')\r\n $method = &$_GET;\r\n if (!isset ($method[$this->_meta['id'].'_submitted']))\r\n return false;\r\n // getting the information for each field\r\n foreach ($this->_fields as $key => $val)\r\n // if a field is missing, make form invalid\r\n if (!isset ($method[$key]) || !$method[$key])\r\n {\r\n if (!isset ($val['value']))\r\n {\r\n $this->_errors[$key] = 'required';\r\n $this->_valid = false;\r\n }\r\n else\r\n $this->_values[$key] = $val['value'];\r\n }\r\n else\r\n $this->_values[$key] = $method[$key];\r\n return true;\r\n }", "private function findForm(){\n\n\t\t$results = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`form`.`id` \t\t\tas 'id',\n\t\t\t\t`form`.`label` \t\t\tas 'label',\n\t\t\t\t`form`.`confirm_submit` as 'confirm_submit',\n\t\t\t\t`form`.`date_available` as 'date_available',\n\t\t\t\t`form`.`date_expire` \tas 'date_expire'\n\t\t\tFROM `mark_reg_forms` as `form`\n\t\t\tWHERE\n\t\t\t\t`form`.`id` = %d\n\t\t\t\tAND `form`.`enabled` = 1\n\t\t\", $this->form_id));\n\n\t\tif(count($results)):\n\t\t\t$this->form_confirm_submit\t= $results[0]->confirm_submit;\n\t\t\t$this->form_label \t\t\t= $results[0]->label;\n\t\t\t$this->form_date_available\t= $results[0]->date_available;\n\t\t\t$this->form_date_expire\t\t= $results[0]->date_expire;\n\t\t\t$this->form_name\t\t\t= 'mark_reg_form_'.$this->form_id;\n\t\telse:\n\t\t\t$this->log(\"FORM NOT FOUND FOR ID: $this->form_id\");\n\t\tendif;\n\t}", "private function getForm() {\n if ($this->get_request_method() != \"POST\") {\n $error = array('status_code' => \"0\", 'message' => \"wrong method\", 'response_code' => \"406\");\n $this->response($this->json($error), 406);\n }\n if (!isset($_SESSION)) {\n session_start();\n }\n $FormID = $_POST['FormID'];\n $sql = mysql_query(\"SELECT * FROM SCP_FormBuilder WHERE FormID='$FormID'\", $this->db);\n $row = mysql_fetch_array($sql, MYSQL_ASSOC);\n if($row) {\n $status = \"success\";\n } else {\n $status = \"fail\";\n }\n $error = array('status_code' => \"1\", 'status' => $status, 'message' => \"Form Get Successfully\", 'response_code' => \"200\", 'response_data' => $row[\"FormDataJson\"]);\n $this->response($this->json($error), 200);\n }", "public function indexAction()\n {\n \t$form_id = $this->params()->fromQuery(\"fid\", \"\");\n\n \t//select contact profile form to use\n \tif ($form_id == \"\")\n \t{\n \t\t//check if form id is set in user session\n \t\t$objUserStorage = FrontUserSession::getUserLocalStorageObject();\n \t\tif (isset($objUserStorage->readUserNativePreferences()->cpp_layout_id) && is_numeric($objUserStorage->readUserNativePreferences()->cpp_layout_id))\n \t\t{\n \t\t\t//load the specified form's fields\n \t\t\t$form_id = $objUserStorage->readUserNativePreferences()->cpp_layout_id;\n \t\t\t$objForm = $this->getFormAdminModel()->getForm($form_id);\n \t\t} else {\n \t\t\t$form_id = \"none\";\n \t\t}//end if\n \t} else {\n \t\tif ($form_id != \"none\" && is_numeric($form_id))\n \t\t{\n \t\t\t$objForm = $this->getFormAdminModel()->getForm($form_id);\n \t\t}//end if\n \t}//end if\n\n \t//extract search params from query\n \t$arr_params = $this->params()->fromQuery();\n\n \t$request = $this->getRequest();\n \tif ($request->isPost())\n \t{\n \t\t$arr_params = array_merge($arr_params, (array) $request->getPost());\n \t}//end foreach\n\n \t//load contacts\n\t\t$objContacts = $this->getContactsModel()->fetchContacts($arr_params);\n\n\t\tif (!isset($objForm))\n\t\t{\n\t\t\t$objForm = FALSE;\n\t\t}//end if\n\n\t\treturn array(\n\t\t\t\t\t\"objForm\" => $objForm,\n\t\t\t\t\t\"objContacts\" => $objContacts,\n\t\t\t\t\t\"arr_params\" => $arr_params,\n\t\t\t\t);\n }", "abstract public function getForm() : void;", "public function getReadEnquiries()\r\n\t\t{\r\n\t\t\tContact::SetQuery($name, $email, $subject, $message);\r\n\t\t}", "public function transactionGetForm ();", "public function getForm($data = array(), $loadData = true)\n {\n // Get the form.\n $form = $this->loadForm('com_labgeneagrogene.requestform', 'requestform', array(\n 'control' => 'jform',\n 'load_data' => false\n ));\n\n\t$examsCheckboxes = $this->getRelatedAdminModel('Exams')->getXmlFieldCheckboxes();\n if($examsCheckboxes) {\n $form->setField($examsCheckboxes);\n }\n\n if($loadData){\n @$form->bind($this->loadFormData());\n }\n\n if (empty($form)) {\n return false;\n }\n\n return $form;\n }", "public static function getForm($nameForm, $data = array())\n {\n $result = \"\";\n require_once(getenv(\"DOCUMENT_ROOT\").SP.\"lib\".SP.\"components\".SP.\"Form.php\");\n $file = getenv(\"DOCUMENT_ROOT\").SP.'view'.SP.'form'.SP.$nameForm.'.php';\n if(file_exists($file))\n {\n extract($data);\n ob_start();\n require($file);\n $result = ob_get_contents();\n ob_end_clean();\n }\n return $result;\n }", "public function getForm($data = array(), $loadData = true)\r\n {\r\n // Get the form.\r\n return $this->loadForm('com_data.email', 'email', array('control' => 'jform', 'load_data' => $loadData));\r\n }", "public function gui2()\n {\n require_code('form_templates');\n\n $submit_name = do_lang_tempcode('PROCEED');\n $post_url = build_url(array('page' => '_SELF', 'type' => 'actual'), '_SELF');\n\n $fields = new Tempcode();\n $hidden = new Tempcode();\n $already = array();\n $email_counter = 0;\n foreach ($_POST as $key => $input_value) {\n if (get_magic_quotes_gpc()) {\n $input_value = stripslashes($input_value);\n }\n\n if (substr($key, 0, 14) == 'email_address_') {\n $already[] = $input_value; //email address\n $email_counter++;\n $hidden->attach(form_input_hidden($key, $input_value));\n } else {\n // Add hidden field to the form\n if ($key != 'upload') {\n $hidden->attach(form_input_hidden($key, $input_value));\n }\n }\n }\n\n $hidden->attach(form_input_hidden('select_contacts_page', '1'));\n\n $text = do_lang_tempcode('RECOMMEND_SITE_TEXT_CHOOSE_CONTACTS', escape_html(get_site_name()));\n\n $page_title = get_param_string('page_title', null, true);\n if (is_null(get_param_string('from', null, true))) {\n $hidden->attach(form_input_hidden('wrap_message', '1'));\n }\n\n $success_read = false;\n\n // Start processing CSV file\n if ((get_option('enable_csv_recommend') == '1') && (!is_guest())) {\n if (array_key_exists('upload', $_FILES)) { // NB: We disabled plupload for this form so don't need to consider it\n if (is_uploaded_file($_FILES['upload']['tmp_name']) && preg_match('#\\.csv#', $_FILES['upload']['name']) != 0) {\n $possible_email_fields = array('E-mail', 'Email', 'E-mail address', 'Email address', 'Primary Email');\n $possible_name_fields = array('Name', 'Forename', 'First Name', 'Display Name', 'First');\n\n $fixed_contents = unixify_line_format(file_get_contents($_FILES['upload']['tmp_name']));\n require_code('files');\n cms_file_put_contents_safe($_FILES['upload']['tmp_name'], $fixed_contents, FILE_WRITE_FAILURE_SILENT);\n\n safe_ini_set('auto_detect_line_endings', '1');\n $myfile = fopen($_FILES['upload']['tmp_name'], 'rt');\n\n $del = ',';\n\n $csv_header_line_fields = fgetcsv($myfile, 10240, $del);\n if ((count($csv_header_line_fields) == 1) && (strpos($csv_header_line_fields[0], ';') !== false)) {\n $del = ';';\n rewind($myfile);\n $csv_header_line_fields = fgetcsv($myfile, 10240, $del);\n }\n\n $skip_next_process = false;\n\n if (function_exists('mb_convert_encoding')) {\n if ((function_exists('mb_detect_encoding')) && (strlen(mb_detect_encoding($csv_header_line_fields[0], \"ASCII,UTF-8,UTF-16,UTF16\")) == 0)) { // Apple mail weirdness\n // Test string just for Apple mail detection\n $test_unicode = utf8_decode(mb_convert_encoding($csv_header_line_fields[0], \"UTF-8\", \"UTF-16\"));\n if (preg_match('#\\?\\?ame#u', $test_unicode) != 0) {\n foreach ($csv_header_line_fields as $key => $value) {\n $csv_header_line_fields[$key] = utf8_decode(mb_convert_encoding($csv_header_line_fields[$key], \"UTF-8\", \"UTF-16\"));\n\n $found_email_address = '';\n $found_name = '';\n\n $first_row_exploded = explode(';', $csv_header_line_fields[0]);\n\n $email_index = 1; // by default\n $name_index = 0; // by default\n\n foreach ($csv_header_line_fields as $key2 => $value2) {\n if (preg_match('#\\?\\?ame#', $value2) != 0) {\n $name_index = $key2; // Windows mail\n }\n if (preg_match('#E\\-mail#', $value2) != 0) {\n $email_index = $key2; // both\n }\n }\n\n while (($csv_line = fgetcsv($myfile, 10240, $del)) !== false) { // Reading a CSV record\n foreach ($csv_line as $key2 => $value2) {\n $csv_line[$key2] = utf8_decode(mb_convert_encoding($value2, \"UTF-8\", \"UTF-16\"));\n }\n\n $found_email_address = (array_key_exists($email_index, $csv_line) && strlen($csv_line[$email_index]) > 0) ? $csv_line[$email_index] : '';\n $found_email_address = (preg_match('#.*\\@.*\\..*#', $found_email_address) != 0) ? preg_replace(\"#\\\"#\", '', $found_email_address) : '';\n $found_name = $found_email_address;\n\n if (strlen($found_email_address) > 0) {\n $skip_next_process = true;\n // Add to the list what we've found\n $fields->attach(form_input_tick($found_name, $found_email_address, 'use_details_' . strval($email_counter), true));\n $hidden->attach(form_input_hidden('details_email_' . strval($email_counter), $found_email_address));\n $hidden->attach(form_input_hidden('details_name_' . strval($email_counter), $found_name));\n $email_counter++;\n $success_read = true;\n }\n }\n }\n }\n }\n }\n\n if (!$skip_next_process) {\n // There is a strange symbol that appears at start of the Windows Mail file, so we need to convert the first file line to catch these\n if ((function_exists('mb_check_encoding')) && (mb_check_encoding($csv_header_line_fields[0], 'UTF-8'))) {\n $csv_header_line_fields[0] = utf8_decode($csv_header_line_fields[0]);\n }\n\n // This means that we need to import from Windows mail (also for Outlook Express) export file, which is different from others csv export formats\n if (array_key_exists(0, $csv_header_line_fields) && (preg_match('#\\?Name#', $csv_header_line_fields[0]) != 0 || preg_match('#Name\\;E\\-mail\\sAddress#', $csv_header_line_fields[0]) != 0)) {\n $found_email_address = '';\n $found_name = '';\n\n $first_row_exploded = explode(';', $csv_header_line_fields[0]);\n\n $email_index = 1; // by default\n $name_index = 0; // by default\n\n foreach ($first_row_exploded as $key => $value) {\n if (preg_match('#\\?Name#', $value) != 0) {\n $name_index = $key; // Windows mail\n }\n if (preg_match('#^Name$#', $value) != 0) {\n $name_index = $key; // Outlook Express\n }\n if (preg_match('#E\\-mail\\sAddress#', $value) != 0) {\n $email_index = $key; // both\n }\n }\n\n while (($csv_line = fgetcsv($myfile, 10240, $del)) !== false) { // Reading a CSV record\n $row_exploded = (array_key_exists(0, $csv_line) && strlen($csv_line['0']) > 0) ? explode(';', $csv_line[0]) : array('', '');\n\n $found_email_address = (strlen($row_exploded[$email_index]) > 0) ? $row_exploded[$email_index] : '';\n $found_name = (strlen($row_exploded[$name_index]) > 0) ? $row_exploded[$name_index] : '';\n\n if (strlen($found_email_address) > 0) {\n // Add to the list what we've found\n $fields->attach(form_input_tick($found_name, do_lang_tempcode('RECOMMENDING_TO_LINE', escape_html($found_name), escape_html($found_email_address)), 'use_details_' . strval($email_counter), true));\n $hidden->attach(form_input_hidden('details_email_' . strval($email_counter), $found_email_address));\n $hidden->attach(form_input_hidden('details_name_' . strval($email_counter), $found_name));\n $email_counter++;\n $success_read = true;\n }\n }\n } else {\n require_code('type_sanitisation');\n\n // Find e-mail\n $email_field_index = mixed();\n foreach ($possible_email_fields as $field) {\n foreach ($csv_header_line_fields as $i => $header_field) {\n if (strtolower($header_field) == strtolower($field)) {\n $email_field_index = $i;\n $success_read = true;\n break 2;\n }\n\n // No header\n if (is_email_address($header_field)) {\n $email_field_index = $i;\n $success_read = true;\n rewind($myfile);\n break 2;\n }\n }\n }\n\n if ($success_read) {\n // Find name\n $name_field_index = mixed();\n foreach ($possible_name_fields as $field) {\n foreach ($csv_header_line_fields as $i => $header_field) {\n if ((strtolower($header_field) == strtolower($field)) && ($i != $email_field_index)) {\n $name_field_index = $i;\n break 2;\n }\n }\n }\n // Hmm, first one that is not the email then\n if (is_null($name_field_index)) {\n foreach ($csv_header_line_fields as $i => $header_field) {\n if ($i != $email_field_index) {\n $name_field_index = $i;\n break;\n }\n }\n }\n\n // Go through all records\n while (($csv_line = fgetcsv($myfile, 10240, $del)) !== false) { // Reading a CSV record\n if (empty($csv_line[$email_field_index])) {\n continue;\n }\n if (empty($csv_line[$name_field_index])) {\n continue;\n }\n\n $found_email_address = $csv_line[$email_field_index];\n $found_name = ucwords($csv_line[$name_field_index]);\n\n if (is_email_address($found_email_address)) {\n // Add to the list what we've found\n $fields->attach(form_input_tick($found_name, do_lang_tempcode('RECOMMENDING_TO_LINE', escape_html($found_name), escape_html($found_email_address)), 'use_details_' . strval($email_counter), true));\n $hidden->attach(form_input_hidden('details_email_' . strval($email_counter), $found_email_address));\n $hidden->attach(form_input_hidden('details_name_' . strval($email_counter), $found_name));\n $email_counter++;\n }\n }\n }\n }\n }\n\n fclose($myfile);\n }\n }\n }\n\n if (!$success_read) {\n warn_exit(do_lang_tempcode('ERROR_NO_CONTACTS_SELECTED'));\n }\n\n return do_template('FORM_SCREEN', array('_GUID' => 'e3831cf87d76295c48cbce627bdd07e3', 'PREVIEW' => true, 'SKIP_WEBSTANDARDS' => true, 'TITLE' => $this->title, 'HIDDEN' => $hidden, 'FIELDS' => $fields, 'URL' => $post_url, 'SUBMIT_ICON' => 'menu__site_meta__recommend', 'SUBMIT_NAME' => $submit_name, 'TEXT' => $text));\n }", "public function MetadataEntryForm()\n {\n // NIWA are worried about parameter case and would like it case insensitive so convert all get vars to lower\n // I think this is because they are not 100% what case the parameters from oracle will be in.\n $params = array_change_key_case($this->getRequest()->getVars(), CASE_LOWER);\n\n // Check in the parameters sent to this page if there are certian fields needed to power the\n // functionality which emails project coordinators and if so get them as we will need to add\n // them to the bottom of the form as hidden fields, this way we can access them in the form\n // processing and send the email.\n $hiddenFields = array();\n\n // These 2 fields can be populated either by Project_Coordinator or Project_Administrator as Oracle actually\n // sends Project_Administrator. NIWA want to keep the field here called coordinator.\n if (!empty($params['project_coordinator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_coordinator'];\n } else if (!empty($params['project_administrator'])) {\n $hiddenFields['_Project_Coordinator'] = $params['project_administrator'];\n }\n\n if (!empty($params['project_coordinator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_coordinator_email'];\n } else if (!empty($params['project_administrator_email'])) {\n $hiddenFields['_Project_Coordinator_email'] = $params['project_administrator_email'];\n }\n\n if (!empty($params['project_manager'])) {\n $hiddenFields['_Project_Manager'] = $params['project_manager'];\n }\n\n if (!empty($params['project_code'])) {\n $hiddenFields['_Project_Code'] = $params['project_code'];\n }\n\n // Get the fields defined for this page, exclude the placeholder fields as they are not displayed to the user.\n $metadataFields = $this->Fields()->where(\"FieldType != 'PLACEHOLDER'\")->Sort('SortOrder', 'asc');\n\n // Create fieldfield for the form fields.\n $formFields = FieldList::create();\n $actions = FieldList::create();\n $requiredFields = array();\n\n // Push the required fields message as a literal field at the top.\n $formFields->push(\n LiteralField::create('required', '<p>* Required fields</p>')\n );\n\n if ($metadataFields->count()) {\n foreach($metadataFields as $field) {\n // Create a version of the label with spaces replaced with underscores as that is how\n // any paraemters in the URL will come (plus we can use it for the field name)\n $fieldName = str_replace(' ', '_', $field->Label);\n $fieldLabel = $field->Label;\n\n // If the field is required then add it to the required fields and also add an\n // asterix to the end of the field label.\n if ($field->Required) {\n $requiredFields[] = $fieldName;\n $fieldLabel .= ' *';\n }\n\n // Check if there is a parameter in the GET vars with the corresponding name.\n $fieldValue = null;\n\n if (isset($params[strtolower($fieldName)])) {\n $fieldValue = $params[strtolower($fieldName)];\n }\n\n // Define a var for the new field, means no matter the type created\n // later on in the code we can apply common things like the value.\n $newField = null;\n\n // Single line text field creation.\n if ($field->FieldType == 'TEXTBOX') {\n $formFields->push($newField = TextField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'TEXTAREA') {\n $formFields->push($newField = TextareaField::create($fieldName, $fieldLabel));\n } else if ($field->FieldType == 'KEYWORDS') {\n // If keywords then output 2 fields the textbox for the keywords and then also a\n // literal read only list of those already specified by the admin below.\n $formFields->push($newField = TextAreaField::create($fieldName, $fieldLabel));\n $formFields->push(LiteralField::create(\n $fieldName . '_adminKeywords',\n \"<div class='control-group' style='margin-top: -12px'>Already specified : \" . $field->KeywordsValue . \"</div>\"\n ));\n } else if ($field->FieldType == 'DROPDOWN') {\n // Some dropdowns have an 'other' option so must add the 'other' to the entries\n // and also have a conditionally displayed text field for when other is chosen.\n $entries = $field->DropdownEntries()->sort('SortOrder', 'Asc')->map('Key', 'Label');\n\n if ($field->DropdownOtherOption == true) {\n $entries->push('other', 'Other');\n }\n\n $formFields->push(\n $newField = DropdownField::create(\n $fieldName,\n $fieldLabel,\n $entries\n )->setEmptyString('Select')\n );\n\n if ($field->DropdownOtherOption == true) {\n $formFields->push(\n TextField::create(\n \"${fieldName}_other\",\n \"Please specify the 'other'\"\n )->hideUnless($fieldName)->isEqualTo(\"other\")->end()\n );\n\n //++ @TODO\n // Ideally if the dropdown is required then if other is selected the other field\n // should also be required. Unfortunatley the conditional validation logic of ZEN\n // does not work in the front end - so need to figure out how to do this.\n }\n }\n\n // If a new field was created then set some things on it which are common no matter the type.\n if ($newField) {\n // Set help text for the field if defined.\n if (!empty($field->HelpText)) {\n $newField->setRightTitle($field->HelpText);\n }\n\n // Field must only be made readonly if the admin specified that they should be\n // provided that a value was specified in the URL for it.\n if ($field->Readonly && $fieldValue) {\n $newField->setReadonly(true);\n }\n\n // Set the value of the field one was plucked from the URL params.\n if ($fieldValue) {\n $newField->setValue($fieldValue);\n }\n }\n }\n\n // Add fields to the bottom of the form for the user to include a message in the email sent to curators\n // this is entirely optional and will not be used in most cases so is hidden until a checkbox is ticked.\n $formFields->push(\n CheckboxField::create('AdditionalMessage', 'Include a message from me to the curators')\n );\n\n // For the email address, because its project managers filling out the form, check if the Project_Manager_email\n // has been specified in the URL params and if so pre-populate the field with that value.\n $formFields->push(\n $emailField = EmailField::create('AdditionalMessageEmail', 'My email address')\n ->setRightTitle('Please enter your email address so the curator knows who the message below is from.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n if (isset($params['project_manager_email'])) {\n $emailField->setValue($params['project_manager_email']);\n }\n\n $formFields->push(\n TextareaField::create('AdditionalMessageText', 'My message')\n ->setRightTitle('You can enter a message here which is appended to the email sent the curator after the record has successfully been pushed to the catalogue.')\n ->hideUnless('AdditionalMessage')->isChecked()->end()\n );\n\n // If there are any hidden fields then loop though and add them as hidden fields to the bottom of the form.\n if ($hiddenFields) {\n foreach($hiddenFields as $key => $val) {\n $formFields->push(\n HiddenField::create($key, '', $val)\n );\n }\n }\n\n // We have at least one field so set the action for the form to submit the entry to the catalogue.\n $actions = FieldList::create(FormAction::create('sendMetadataForm', 'Send'));\n } else {\n $formFields->push(\n ErrorMessage::create('No metadata entry fields have been specified for this page.')\n );\n }\n\n // Set up the required fields validation.\n $validator = ZenValidator::create();\n $validator->addRequiredFields($requiredFields);\n\n // Create form.\n $form = Form::create($this, 'MetadataEntryForm', $formFields, $actions, $validator);\n\n // Check if the data for the form has been saved in the session, if so then populate\n // the form with this data, if not then just return the default form.\n $data = Session::get(\"FormData.{$form->getName()}.data\");\n\n return $data ? $form->loadDataFrom($data) : $form;\n }", "public function searchForm( $return = false )\r\n\t{\r\n\t\tif( $this->searchMethod == 'general' ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif( $this->searchMethod == 'range' ) {\r\n\t\t\treturn $this->rangeSearch( $this->searchRangeValues );\r\n\t\t}\r\n\r\n\t\t$db =& SPFactory::db();\r\n\t\t$fdata = array();\r\n try {\r\n \t$db->dselect( array( 'baseData' ), 'spdb_field_data', array( 'fid' => $this->fid, 'copy' => '0', 'enabled' => 1 ), 'field( lang, \\''.Sobi::Lang().'\\'), baseData', 0, 0, 'baseData' );\r\n \t$data = $db->loadResultArray();\r\n } catch ( SPException $x ) {\r\n \tSobi::Error( $this->name(), SPLang::e( 'CANNOT_GET_FIELDS_DATA_DB_ERR', $x->getMessage() ), SPC::WARNING, 0, __LINE__, __FILE__ );\r\n }\r\n\r\n $data = ( ( array ) $data );\r\n if( count( $data ) ) {\r\n \t$fdata[ '' ] = Sobi::Txt( 'FD.INBOX_SEARCH_SELECT', array( 'name' => $this->name ) );\r\n \tforeach ( $data as $i => $d ) {\r\n \t\t$fdata[ strip_tags( $d ) ] = strip_tags( $d );\r\n \t}\r\n }\r\n return SPHtml_Input::select( $this->nid, $fdata, $this->_selected, false, array( 'class' => $this->cssClass.' '.Sobi::Cfg( 'search.form_list_def_css', 'SPSearchSelect' ), 'size' => '1' ) );\r\n\t}", "public function getForm($data = array(), $loadData = true)\n\t{\n\t\t// Get the form.\n\t\t$options = array('control' => 'jform', 'load_data' => $loadData);\n $form = $this->loadForm('tkdclub', 'email', $options);\n\n\t\tif (empty($form))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $form;\n\t}", "public function getForm($data = array(), $loadData = true) \n {\n\t\t\techo '<br/> **************************************************************';\n\t\t echo '<br/> model VISTA -> funcion getForm\t\t\t\t ';\n\t\t echo '<br/> ************************************************************** <br/>';\n // Get the form.\n $form = $this->loadForm('com_codigorecibo.vista', 'vista',array('control' => 'jform', 'load_data' => $loadData));\n if (empty($form)) \n {\n return false;\n }\n \n \n return $form;\n }", "public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }", "public function listForms();", "public function getForm($data = array(), $loadData = true)\n\t{\n\t}", "protected function getRecByNameEmail(string $name, string $email) {\n $sql = \"SELECT COUNT(*) FROM \" . $this->formsTableName . \" WHERE name = ? AND email = ?\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->bindParam(1, $name, \\PDO::PARAM_STR);\n $stmt->bindParam(2, $email, \\PDO::PARAM_STR);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return $res[0]['COUNT(*)'];\n }", "abstract protected function getFormTypeQuery();", "public function RunSearch()\n {\n BizSystem::log(LOG_DEBUG,\"FORMOBJ\",$this->m_Name.\"::RunSearch()\");\n global $g_BizSystem;\n $this->m_SearchRule = \"\";\n foreach ($this->m_RecordRow as $fldCtrl) {\n $value = $g_BizSystem->GetClientProxy()->GetFormInputs($fldCtrl->m_Name);\n if ($value) {\n $searchStr = $this->InputValToRule($fldCtrl->m_BizFieldName, $value);\n if ($this->m_SearchRule == \"\")\n $this->m_SearchRule .= $searchStr;\n else\n $this->m_SearchRule .= \" AND \" . $searchStr;\n }\n }\n\n $this->SetDisplayMode (MODE_R);\n $this->GotoPage(1);\n $this->m_RecordId = null; // clean the current record id\n $this->m_ClearSearchRule = true;\n return $this->ReRender();\n }", "public function getForm($data = array(), $loadData = true)\n\t{\n\t\t// Get the form.\n\t\t$form = $this->loadForm(\n\t\t\t'com_tjucm.itemform', 'itemform',\n\t\t\tarray('control' => 'jform',\n\t\t\t\t'load_data' => $loadData,\n\t\t\t)\n\t\t);\n\n\t\tif (empty($form))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $form;\n\t}", "public function getEmails(){\r\n \r\n $dbConfig = array(\r\n \"DB_DNS\" => 'mysql:host=localhost;port=3306;dbname=PHPadvClassSpring2015',\r\n \"DB_USER\" => 'root', \r\n \"DB_PASSWORD\" => '');\r\n $pdo = new DB($dbConfig);\r\n $db = $pdo->getDB();\r\n $stmt = $db->prepare(\"SELECT * FROM emailtype where active = 1\");\r\n if ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n echo '<h3>Types of E-mails</h3>';\r\n foreach ($results as $value) {\r\n echo '<p>- <strong>', $value['emailtype'], '</strong></p>';\r\n }\r\n } else {\r\n echo '<p>No data found!</p>';\r\n } \r\n \r\n }", "public function showSearchForm(){\r\n global $nitobigridthemes,$isadmin,$havewriteperm;\r\n\r\n $rowsperpage = \"10\";\r\n\r\n if($isadmin==1){\r\n $grIdColumn=7; //define primary key column index, it will set as readonly afterwards (count from 0)\r\n $deleteddefaultvalue_js=\"myGrid.getCellObject(rowNo,6).setValue(0);\"; //if admin login got deleted column, during admin insert new record shall set it default =0 (not deleted)\r\n }\r\n else{\r\n $grIdColumn=5;//define primary key column index for normal user\r\n $deleteddefaultvalue_js=\"\";\r\n }\r\n\r\n $savectrl=\"\";\r\n $permctrl=\" rowinsertenabled=\\\"false\\\" rowdeleteenabled=\\\"false\\\" onbeforesaveevent=\\\"return false\\\" \";\r\n $alloweditgrid= \"false\";\r\n\r\necho <<< EOF\r\n\r\n<script language=\"javascript\" type=\"text/javascript\">\r\n\r\n jQuery(document).ready((function (){nitobi.loadComponent('DataboundGridApprovalList');}));\r\n\r\n function init(){}\r\n\r\n function search(){\r\n\r\n var grid = nitobi.getGrid(\"DataboundGridApprovalList\");\r\n var searchemployee_no=document.getElementById(\"searchemployee_no\").value;\r\n var searchemployee_name=document.getElementById(\"searchemployee_name\").value;\r\n var searchleave_fromdate=document.getElementById(\"searchleave_fromdate\").value;\r\n var searchleave_todate=document.getElementById(\"searchleave_todate\").value;\r\n //var searchleave_no=document.getElementById(\"searchleave_no\").value;\r\n var searchiscomplete=document.getElementById(\"searchiscomplete\").checked;\r\n var searchishistory=document.getElementById(\"searchishistory\").checked;\r\n\r\n var searchTxt = \"\";\r\n if(searchiscomplete == true)\r\n searchiscompletetxt = \"Yes\";\r\n else\r\n searchiscompletetxt = \"No\";\r\n\r\n if(searchishistory == true)\r\n searchishistorytxt = \"Yes\";\r\n else\r\n searchishistorytxt = \"No\";\r\n\r\n if(searchemployee_no != \"\")\r\n searchTxt += \"Employee No : \"+searchemployee_no+\"<br/>\";\r\n if(searchemployee_name != \"\")\r\n searchTxt += \"Employee Name : \"+searchemployee_name+\"<br/>\";\r\n if(searchleave_fromdate != \"\")\r\n searchTxt += \"Date From : \"+searchleave_fromdate+\"<br/>\";\r\n if(searchleave_todate != \"\")\r\n searchTxt += \"Date To : \"+searchleave_todate+\"<br/>\";\r\n //if(searchleave_no != \"\")\r\n //searchTxt += \"Doc No : \"+searchleave_no+\"<br/>\";\r\n\r\n searchTxt += \"Complete : \"+searchiscompletetxt+\"<br/>\";\r\n //searchTxt += \"Approval History : \"+searchishistorytxt+\"<br/>\";\r\n\r\n /*\r\n *only user isadmin will have element searchisdeleted (apply in every windows and records)\r\n *check element is exist before submit variable to avoid javascript failure\r\n */\r\n //if(document.getElementById(\"searchisdeleted\"))\r\n //var searchisdeleted=document.getElementById(\"searchisdeleted\").checked;\r\n\r\n //Submit javascript to grid with _GET method\r\n\tgrid.getDataSource().setGetHandlerParameter('searchemployee_no',searchemployee_no);\r\n\tgrid.getDataSource().setGetHandlerParameter('searchemployee_name',searchemployee_name);\r\n\tgrid.getDataSource().setGetHandlerParameter('searchleave_fromdate',searchleave_fromdate);\r\n grid.getDataSource().setGetHandlerParameter('searchleave_todate',searchleave_todate);\r\n //grid.getDataSource().setGetHandlerParameter('searchleave_no',searchleave_no);\r\n grid.getDataSource().setGetHandlerParameter('searchiscomplete',searchiscomplete);\r\n grid.getDataSource().setGetHandlerParameter('searchishistory',searchishistory);\r\n\r\n document.getElementById('rightBox').innerHTML = searchTxt;\r\n //reload grid data\r\n\tgrid.dataBind();\r\n //Pager.First('DataboundGridApprovalList');\r\n }\r\n\r\n //optional function to generate primary key value, ignore this function because we use autogen method\r\n function GetNewRecordID()\r\n {\r\n//\t\tvar myAjaxRequest = new nitobi.ajax.HttpRequest();\r\n//\r\n//\t\t// Define the url for your generatekey script\r\n//\t\t//myAjaxRequest.handler = 'approvallist.php?rnd=' + Math.random();\r\n// myAjaxRequest.handler = 'approvallist.php?action=searchgrid&';\r\n//\t\tmyAjaxRequest.async = false;\r\n//\t\tmyAjaxRequest.get();\r\n//\r\n//\t\t// return the result to the grid\r\n//\t\treturn myAjaxRequest.httpObj.responseText;\r\n }\r\n\r\n //after grid html render properly, set focus on it. It is important when use choose particular cell but\r\n // immediately press search again. From screen we won't detect cell is selected infact from javascript\r\n // detect selected\r\n function dataready(){\r\n\r\n var g = nitobi.getGrid('DataboundGridApprovalList');\r\n g.move(0,0);//need to trigger relative position 0,0 in for next code able to highlight at screen\r\n var selRow = g.getSelectedRow();\r\n\r\n }\r\n\r\n //Call event after save complete\r\n function savedone(eventArgs){\r\n var grid= nitobi.getGrid('DataboundGridApprovalList');\r\n var dataSource =grid.getDataSource();\r\n var errorMessage = dataSource.getHandlerError();\r\n\r\n if (!errorMessage) {//save successfully\r\n \t jQuery('#msgbox').fadeTo('slow', 1, function() {\r\n \t document.getElementById('msgbox').innerHTML=\"Record save successfully\";\r\n //document.getElementById('popupmessage').innerHTML=\"Please Wait.....\";\r\n search();\r\n popup('popUpDiv');\r\n\t\t});\r\n return true;\r\n }\r\n else{ //save failed\r\n \tsearch();\r\n\r\n popup('popUpDiv');\r\n\r\n \treturn false;\r\n \t}\r\n }\r\n\r\n //if save_data have error, trigger this function\r\n function showError(){\r\n\r\n var grid= nitobi.getGrid('DataboundGridApprovalList');\r\n var dataSource =grid.getDataSource();\r\n var errorMessage = dataSource.getHandlerError();\r\n\r\n\r\n\r\n if (errorMessage) {\r\n document.getElementById('msgbox').innerHTML=\"<b style=\\\"color:red\\\">\"+errorMessage+\"</b><br/>\";\r\n //grid.dataBind();\r\n }\r\n else\r\n document.getElementById('msgbox').innerHTML=\"\";\r\n jQuery('#msgbox').fadeTo('slow', 1, function() {});\r\n }\r\n\r\n\r\n //if user click particular column, auto fall into edit mode\r\n function clickrecord(eventArgs){\r\n row=eventArgs.getCell().getRow();\r\n col=eventArgs.getCell().getColumn();\r\n \r\n var myGrid = nitobi.getGrid('DataboundGridApprovalList');\r\n var myCell = myGrid.getCellObject(row, col);\r\n var objectVal = myGrid.getCellObject(row, 11);\r\n var objectVal2 = myGrid.getCellObject(row, 10);\r\n var objectVal3 = myGrid.getCellObject(row, 9);\r\n var objectVal4 = myGrid.getCellObject(row, 12);\r\n var objectVal5 = myGrid.getCellObject(row, 8);\r\n var objectVal6 = myGrid.getCellObject(row, 13);\r\n\r\n var primarykey_value = objectVal.getValue();\r\n var primarykey_name = objectVal2.getValue();\r\n var tablename = objectVal3.getValue();\r\n var window_workflow = objectVal4.getValue();\r\n var workflowtransaction_id = objectVal5.getValue();\r\n var hyperlink = objectVal6.getValue();\r\n\t\r\n if(col == 6){\r\n// if(primarykey_name == \"leave_id\"){\r\n// window.open(\"leave.php?action=edit&leave_id=\"+primarykey_value,\"Leave\"+primarykey_value);\r\n// }\r\n\r\n //if(primarykey_name == \"leave_id\"){\r\n //window.open(\"leave.php?action=edit&leave_id=\"+primarykey_value,\"Leave\"+primarykey_value);\r\n window.open(hyperlink+\"?action=edit&\"+primarykey_name+\"=\"+primarykey_value,window_workflow+\"-\"+primarykey_value);\r\n //}\r\n search();\r\n }\r\n\r\n if(col == 7){\r\n// alert(workflowtransaction_id);\r\n //if(primarykey_name == \"leave_id\"){\r\n var data=\"action=approvalwindows&primarykey_value=\"+primarykey_value+\"&primarykey_name=\"+primarykey_name+\"&tablename=\"+tablename+\"&window_workflow=\"+window_workflow+\"&workflowtransaction_id=\"+workflowtransaction_id;\r\n\r\n $.ajax({\r\n url: \"approvallist.php\",type: \"GET\",data: data,cache: false,\r\n success: function (xml) { \r\n\r\n document.getElementById('idApprovalWindows').innerHTML = xml;\r\n document.getElementById('idApprovalWindows').style.display = \"\";\r\n search();\r\n }\r\n\r\n });\r\n\r\n //}\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n //add line button will call this\r\n function addline(){\r\n var g= nitobi.getGrid('DataboundGridApprovalList');\r\n g.insertAfterCurrentRow();\r\n }\r\n\r\n //trigger save activity from javascript\r\n function save()\r\n {\r\n \tif(document.getElementById(\"afterconfirm\").value==1){ //Ask for confirmation from delete activity already, process data immediately\r\n\t var g= nitobi.getGrid('DataboundGridApprovalList');\r\n\t document.getElementById(\"afterconfirm\").value=0;\r\n\t g.save();\r\n }\r\n\telse{ // not yet request confirmation\r\n \t if(confirm(\"Confirm the changes? Data will save into database immediately\")){\r\n //popup('popUpDiv');\r\n \t var g= nitobi.getGrid('DataboundGridApprovalList');\r\n\t document.getElementById(\"afterconfirm\").value=0;\r\n\t g.save();\r\n\t search();\r\n \t }\r\n \t // else //cancel request\r\n\t //search();\r\n\t}\r\n }\r\n\r\n function beforesave(){\r\n document.getElementById('popupmessage').innerHTML=\"Please Wait.....\";\r\n popup('popUpDiv');\r\n }\r\n\r\n function onclickdeletebutton(){ //when press delete button will triger this function and ask for confirmation\r\n \tvar g= nitobi.getGrid('DataboundGridApprovalList');\r\n var selRow = g.getSelectedRow();\r\n if(selRow==-1){// no select any row\r\n alert(\"Please choose a row before deleting.\");\r\n return false;\r\n }\r\n else\r\n g.deleteCurrentRow();\r\n }\r\n\r\n function checkAllowEdit(eventArgs){\r\n\tvar g= nitobi.getGrid('DataboundGridApprovalList');\r\n col=eventArgs.getCell().getColumn();\r\n if($alloweditgrid) //if user have permission to edit the cell, control primary key column read only at here too\r\n return true;\r\n else\r\n return false;\r\n }\r\n\r\n\r\n//after insert a new line will automatically fill in some value here\r\n function setDefaultValue(eventArgs)\r\n {\r\n var myGrid = eventArgs.getSource();\r\n var r = eventArgs.getRow();\r\n var rowNo = r.Row;\r\n myGrid.getCellObject(rowNo,3).setValue(10);\r\n $deleteddefaultvalue_js\r\n myGrid.selectCellByCoords(rowNo, 0);\r\n}\r\n\r\n\tfunction beforeDelete(){\r\n\t\tif(confirm('Delete this record? Data will save into database immediately.')){\r\n\t\t\tdocument.getElementById(\"afterconfirm\").value=1;\r\n //popup('popUpDiv');\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\telse{\r\n\t\t\tdocument.getElementById(\"afterconfirm\").value=0;\r\n\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n function closeWorkflowWindow(){\r\n document.getElementById('idApprovalWindows').style.display = \"none\";\r\n }\r\n\r\n</script>\r\n <div id=\"idApprovalWindows\" style=\"display:none\"></div>\r\n <table style=\"width:950px;\"><tr><td>$this->addnewctrl</td><td align=\"right\">$this->searchctrl</td></tr></table>\r\n\r\n <div >\r\n <table style=\"width:950px;\" align=\"center\">\r\n\r\n <tr><td align=\"center\" class=\"searchformheader\">Search Form</td></tr>\r\n\r\n <tr>\r\n <td>\r\nEOF;\r\n $this->headerSearchForm();\r\necho <<< EOF\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <td>\r\n <div align=\"center\" id=\"statusDiv\"></div>\r\n <div align=\"center\">\r\n <input type=\"hidden\" id=\"totalRowGrid\" value=\"$rowsperpage\">\r\n <table style=\"width:950px;\"><tr><td class=\"head tdPager\">\r\n $savectrl\r\n\r\n <div id=\"pager_control\" class=\"inline\">\r\n <div id=\"pager_first\" class=\"inline FirstPage\" onclick=\"Pager.First('DataboundGridApprovalList');\" onmouseover=\"this.className+=' FirstPageHover';\" onmouseout=\"this.className='inline FirstPage';\" style=\"margin:0;border-right:1px solid #B1BAC2;\"></div>\r\n <div id=\"pager_prev\" class=\"inline PreviousPage\" onclick=\"Pager.Previous('DataboundGridApprovalList');\" onmouseover=\"this.className+=' PreviousPageHover';\" onmouseout=\"this.className='inline PreviousPage';\" style=\"margin:0;\"></div>\r\n <div class=\"inline\" style=\"height:22px;top:3px;\">\r\n <span class=\"inline\">Page</span>\r\n <span class=\"inline\" id=\"pager_current\">0</span>\r\n <span class=\"inline\">of</span>\r\n <span class=\"inline\" id=\"pager_total\">0</span>\r\n </div>\r\n <div id=\"pager_next\" class=\"inline NextPage\" onclick=\"Pager.Next('DataboundGridApprovalList');\" onmouseover=\"this.className+=' NextPageHover';\" onmouseout=\"this.className='inline NextPage';\" style=\"margin:0;border-right:1px solid #B1BAC2;\"></div>\r\n <div id=\"pager_last\" class=\"inline LastPage\" onclick=\"Pager.Last('DataboundGridApprovalList');\" onmouseover=\"this.className+=' LastPageHover';\" onmouseout=\"this.className='inline LastPage';\" style=\"margin:0;\"></div>\r\n </div>\r\n </td></tr></table>\r\n </td>\r\n </tr>\r\n\r\n <!-- savehandler=\"approvallist.php?action=save\" -->\r\n <tr>\r\n <td align=\"center\">\r\n\r\n <ntb:grid id=\"DataboundGridApprovalList\"\r\n mode=\"standard\"\r\n toolbarenabled='false'\r\n $permctrl\r\n ondatareadyevent=\"HandleReady(eventArgs);\"\r\n onhandlererrorevent=\"showError()\"\r\n oncellclickevent=\"clickrecord(eventArgs)\"\r\n keygenerator=\"GetNewRecordID();\"\r\n\r\n gethandler=\"approvallist.php?action=searchgrid\"\r\n\r\n onbeforecelleditevent=\"checkAllowEdit(eventArgs)\"\r\n onafterrowinsertevent=\"setDefaultValue(eventArgs)\"\r\n rowhighlightenabled=\"true\"\r\n width=\"943\"\r\n height=\"380\"\r\n rowheight=\"70\"\r\n onaftersaveevent=\"savedone(eventArgs)\"\r\n onbeforerowdeleteevent=\"beforeDelete()\"\r\n onafterrowdeleteevent=\"save()\"\r\n autosaveenabled=\"false\"\r\n theme=\"$nitobigridthemes\"\r\n rowsperpage=\"$rowsperpage\"\r\n >\r\n\r\n <ntb:columns>\r\n <ntb:textcolumn width=\"30\" label=\"No.\" xdatafld=\"seq_no\" classname=\"{\\$rh}\"></ntb:textcolumn>\r\n <ntb:textcolumn width=\"150\" label=\"Description\" xdatafld=\"workflow_name\" classname=\"{\\$rh}\"></ntb:textcolumn>\r\n <ntb:textcolumn width=\"130\" label=\"Employee\" xdatafld=\"employee_name\" classname=\"{\\$rh}\"></ntb:textcolumn>\r\n <ntb:textcolumn width=\"115\" label=\"Date\" xdatafld=\"apply_date\" classname=\"{\\$rh}\"></ntb:textcolumn>\r\n <ntb:textcolumn width=\"350\" label=\"Detail\" xdatafld=\"workflowtransaction_description\" classname=\"{\\$rh}\"></ntb:textcolumn>\r\n <ntb:textcolumn width=\"65\" label=\"Status\" xdatafld=\"workflowstatus_name\" classname=\"{\\$rh}\"></ntb:textcolumn>\r\n <ntb:textcolumn label=\"Edit\" xdatafld=\"operation\" sortenabled=\"false\" width=\"35\" initial=\"images/del.gif\" classname=\"{\\$rh}\" align=\"center\" cssstyle=\"cursor:pointer;\">\r\n <ntb:imageeditor></ntb:imageeditor>\r\n </ntb:textcolumn>\r\n <ntb:textcolumn label=\"Action\" xdatafld=\"approval\" sortenabled=\"false\" width=\"45\" initial=\"images/approval.gif\" classname=\"{\\$rh}\" align=\"center\" cssstyle=\"cursor:pointer;\">\r\n <ntb:imageeditor></ntb:imageeditor>\r\n </ntb:textcolumn>\r\n\r\n <ntb:textcolumn label=\"\" visible=\"false\" width=\"0\" xdatafld=\"workflowtransaction_id\" sortenabled=\"false\"></ntb:textcolumn>\r\n <ntb:textcolumn label=\"\" visible=\"false\" width=\"0\" xdatafld=\"tablename\" sortenabled=\"false\"></ntb:textcolumn>\r\n <ntb:textcolumn label=\"\" visible=\"false\" width=\"0\" xdatafld=\"primarykey_name\" sortenabled=\"false\"></ntb:textcolumn>\r\n <ntb:textcolumn label=\"\" visible=\"false\" width=\"0\" xdatafld=\"primarykey_value\" sortenabled=\"false\"></ntb:textcolumn>\r\n <ntb:textcolumn label=\"\" visible=\"false\" width=\"0\" xdatafld=\"window_workflow\" sortenabled=\"false\"></ntb:textcolumn>\r\n <ntb:textcolumn label=\"\" visible=\"false\" width=\"0\" xdatafld=\"hyperlink\" sortenabled=\"false\"></ntb:textcolumn>\r\n\r\n</ntb:columns>\r\n </ntb:grid>\r\n\r\n </td>\r\n </tr>\r\n\r\n <tr>\r\n <td><div id=\"msgbox\" style='display:none'></div></td>\r\n </tr>\r\n\r\n </table>\r\n </div>\r\nEOF;\r\n }", "function getForm()\r\n\t{\r\n\t\t$this->action();\r\n\t\t$mainForm\t= $this->getMainForm();\r\n\t\tif($this->isFormRequire)\r\n\t\t{\r\n\t\t\t$cls = ' class=\"formIsRequire\"';\r\n\t\t\tlink_js(_PEA_URL.'includes/formIsRequire.js', false);\r\n\t\t}else{\r\n\t\t\t$cls = '';\r\n\t\t}\r\n\r\n\t\t$i = 0;\r\n\t\t$out = '';\r\n\r\n\t\t$out .= '<form method=\"'.$this->methodForm.'\" action=\"'.$this->actionUrl.'\" name=\"'. $this->formName .'\"'.$cls.' enctype=\"multipart/form-data\" role=\"form\">';\r\n\t\t$out .= $this->getSaveSuccessPage();\r\n\t\t$out .= $this->getDeleteSuccessPage();\r\n\r\n\t\t$hover= $this->isChangeBc ? ' table-hover' : '';\r\n\t\t$out .= '<table class=\"table table-striped table-bordered'.$hover.'\">';\r\n\t\t$out .= '<thead><tr>';\r\n\r\n\t\t// ngambil tr title\r\n\t\t$numColumns = 0;\r\n\r\n\t\tforeach($this->arrInput as $input)\r\n\t\t{\r\n\t\t\tif ($input->isInsideRow && !$input->isInsideMultiInput && !$input->isHeader)\r\n\t\t\t{\r\n\t\t\t\t// buat array data untuk report\r\n\t\t\t\tif ($this->isReportOn && $input->isIncludedInReport)\r\n\t\t\t\t{\r\n\t\t\t\t\t$arrHeader[]\t= $input->title;\r\n\t\t\t\t}\r\n\t\t\t\t// dapatkan text bantuan\r\n\t\t\t\tif (!empty($input->textHelp))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->help->value[$input->name] = $input->textHelp;\r\n\t\t\t\t}\r\n\t\t\t\tif (!empty($input->textTip))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->tip->value[$input->name] = $input->textTip;\r\n\t\t\t\t}\r\n\t\t\t\t$label = '';\r\n\t\t\t\tif (@$input->isCheckAll)\r\n\t\t\t\t{\r\n\t\t\t\t\t$label = $this->getCheckAll($input);\r\n\t\t\t\t}\r\n\t\t\t\t$href = $this->getOrderUrl($input, $input->title);\r\n\t\t\t\tif (!empty($this->tip->value[$input->name]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$input->title = tip($input->title, $this->tip->value[$input->name]);\r\n\t\t\t\t}\r\n\t\t\t\t$label .= $href['start'].$input->title.$href['end'];\r\n\t\t\t\t$out .= ' <th>'.$label;\r\n\t\t\t\tif (!empty($this->help->value[$input->name]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$out .= ' <span style=\"font-weight: normal;\">'.help($this->help->value[$input->name],'bottom').'</span>';\r\n\t\t\t\t}\r\n\t\t\t\t$out\t\t.= \"</th>\\n\";\r\n\t\t\t\t$numColumns++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$out .= '</tr></thead>';\r\n\t\t$this->reportData['header']\t= isset($arrHeader) ? $arrHeader : array();\r\n\t\t// ambil mainFormnya\r\n\t\t$out .= $mainForm;\r\n\r\n\t\t/* Return, Save, Reset, Navigation, Delete */\r\n\t\t$button = '';\r\n\t\tif (!empty($_GET['return']) && empty($_GET['is_ajax']))\r\n\t\t{\r\n\t\t\t$button .= $GLOBALS['sys']->button($_GET['return']);\r\n\t\t}\r\n\t\tif ($this->saveTool)\r\n\t\t{\r\n\t\t\t$button .= '<button type=\"submit\" name=\"'. $this->saveButton->name .'\" value=\"'. $this->saveButton->value\r\n\t\t\t\t\t\t.\t'\" class=\"btn btn-primary btn-sm\"><span class=\"glyphicon glyphicon-'.$this->saveButton->icon.'\"></span>'\r\n\t\t\t\t\t\t. $this->saveButton->label .'</button>';\r\n\t\t}\r\n\t\tif ($this->resetTool)\r\n\t\t{\r\n\t\t\t$button .= '<button type=\"reset\" class=\"btn btn-warning btn-sm\"><span class=\"glyphicon glyphicon-'.$this->resetButton->icon.'\"></span>'.$this->resetButton->label.'</button> ';\r\n\t\t}\r\n\t\t$nav = $this->nav->getNav();\r\n\t\tif (!empty($nav))\r\n\t\t{\r\n\t\t\tif (!empty($button))\r\n\t\t\t{\r\n\t\t\t\t$button = '<table style=\"width: 100%;\"><tr><td style=\"width: 10px;white-space: nowrap;\">'.$button.'</td><td style=\"text-align: center;\">'.$nav.'</td></tr></table>';\r\n\t\t\t}else{\r\n\t\t\t\t$button .= $nav;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$footerTD = array();\r\n\t\t$colspan = $numColumns;\r\n\t\tif ($this->deleteTool)\r\n\t\t{\r\n\t\t\t$colspan -= 1;\r\n\t\t}\r\n\t\t$attr = $colspan > 1 ? ' colspan=\"'.$colspan.'\"' : '';\r\n\t\t$footerTD[] = '<td'.$attr.'>'.$button.'</td>';\r\n\t\tif ($this->deleteTool)\r\n\t\t{\r\n\t\t\t$footerTD[] = '<td>'\r\n\t\t\t\t. '<button type=\"submit\" name=\"'.$this->deleteButton->name.'\" value=\"'. $this->deleteButton->value.'\" class=\"btn btn-danger btn-sm\" '\r\n\t\t\t\t. 'onclick=\"if (confirm(\\'Are you sure want to delete selected row(s) ?\\')) { return true; }else{ return false; }\">'\r\n\t\t\t\t. '<span class=\"glyphicon glyphicon-'.$this->deleteButton->icon.'\"></span>'.$this->deleteButton->label .'</button>'\r\n\t\t\t\t. '</td>';\r\n\t\t}\r\n\t\tif (!empty($footerTD))\r\n\t\t{\r\n\t\t\t$out .= '<tfoot><tr>'.implode('', $footerTD).'</tr></tfoot>';\r\n\t\t}\r\n\t\t$out .= '</table>';\r\n\t\t$out .= '</form>';\r\n\r\n\t\t/* Export Tool, Page Status, Form Navigate */\r\n\t\t$nav = $this->nav->getViewAllLink();\r\n\t\tif (!empty($nav))\r\n\t\t{\r\n\t\t\t$nav = '<span class=\"input-group-addon\">'.$nav.'</span>';\r\n\t\t}\r\n\t\t$nav .= $this->nav->getGoToForm(false);\r\n\t\t$out .= '<form method=\"get\" action=\"\" role=\"form\" style=\"margin-top:-20px;margin-bottom: 20px;\">'\r\n\t\t\t\t.\t'<div class=\"input-group\">'\r\n\t\t\t\t. $this->getReport($this->nav->int_cur_page)\r\n\t\t\t\t. '<span class=\"input-group-addon\">'\r\n\t\t\t\t. $this->nav->getStatus().'</span>'.$nav.'</div></form>';\r\n\r\n\t\t/* Form Panel */\r\n\t\t$formHeader = $this->getHeaderType();\r\n\t\tif (!empty($formHeader))\r\n\t\t{\r\n\t\t\t$out = '\r\n\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-heading\">\r\n\t\t\t\t\t\t<h3 class=\"panel-title\">'.$formHeader.'</h3>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div class=\"panel-body\">\r\n\t\t\t\t\t\t'.$out.'\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>';\r\n\t\t}\r\n\t\t$out = $this->getHideFormToolStart().$out.$this->getHideFormToolEnd();\r\n\t\treturn $out;\r\n\t}", "public function get_form($metodo,$usuario,$form,$data=0,$ciclo=1,$codSubM=null,$cMet=\"\"){\n #traemos el formulario\n $this->rows = \"\";\n $this->query = \"\";\n $this->query = \" SELECT fbArmaFormulario($form,$usuario,$data,$ciclo,$codSubM,$this->_modulo,'\".$cMet.\"') as formulario; \";\n $this->get_results_from_query();\n if(count($this->rows) >= 1){\n foreach ($this->rows as $pro=>$va) {\t\t\t\t\n $this->_formulario[] = $va;\n if($this->_formulario[0]['formulario'] == ''){\t\t\t\t\n $mensjFrm = getMenssage('danger','Ocurrio un error','No tiene permisos para acceder a esta opcion. ');\n $this->_formulario[0] = array('formulario'=>$mensjFrm);\n }\n }\n }\t\n #traemos el formulario modal\n $this->rows = \"\";\n $this->query = \"\";\n $this->query = \" SELECT fbArmaFormularioModal($form,$usuario) as modal; \";\n $this->get_results_from_query();\n if(count($this->rows) >= 1){\n foreach ($this->rows as $pro=>$va) { \n $this->_formulario_modal[] = $va;\n if($this->_formulario_modal[0]['modal'] == ''){ \n $mensjFrm = '';\n $this->_formulario_modal[0] = array('modal'=>$mensjFrm);\n }\n }\n } \n #traemos la ayuda del form\n $this->rows = \"\";\n $this->query = \"\";\n $this->query = \" SELECT fbArmaAyudaFormulario($form,$usuario,1) as formulario_ayuda\";\n $this->get_results_from_query();\n if (count($this->rows) >= 1) {\n foreach ($this->rows as $pro => $va) {\n $this->_formulario_ayuda[] = $va;\n if ($this->_formulario_ayuda[0]['formulario_ayuda'] == '') {\n $mensjFrm = getMenssage('info', 'Ocurrio un error', 'No hay ayuda registrada para este proceso,consulte al administrador del sistema. ');\n $this->_formulario_ayuda[0] = array('formulario_ayuda' => $mensjFrm);\n }\n }\n }\n #Traemos los botones por formulario y usuario\n ModeloFacturacion::get_boton($metodo,$usuario,$form,$cMet);\n }", "public function getAllEnquiries()\r\n\t\t{\r\n\t\t\tContact::SetQuery($name, $email, $subject, $message);\r\n\t\t}", "public function getFormInObject()\n {\n $sExKey = null;\n\n if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) {\n\n $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity);\n $oModel = new $sModelName;\n\n $oEntity = new $this->_sSynchronizeEntity;\n $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);\n $sMethodName = 'findOneBy'.$sPrimaryKey;\n $oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity));\n\n if (is_object($oCompleteEntity)) {\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n\t\t\t\t\tif ($sValue instanceof \\Venus\\lib\\Form\\Input && $sValue->getType() == 'submit') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio) {\n\n $sExKey = $sKey;\n $sKey = substr($sKey, 0, -6);\n }\n\n if ($sValue instanceof Form) {\n\n ;\n } else {\n\n $sMethodNameInEntity = 'get_'.$sKey;\n\t\t\t\t\t\tif (method_exists($oCompleteEntity, $sMethodNameInEntity)) {\n\t\t\t\t\t\t\t$mValue = $oCompleteEntity->$sMethodNameInEntity();\n\t\t\t\t\t\t}\n\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) {\n\n $this->_aElement[$sExKey]->setValueChecked($mValue);\n } else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) {\n\n $this->_aElement[$sKey]->setValue($mValue);\n }\n }\n }\n }\n }\n\n $oForm = new \\StdClass();\n $oForm->start = '<form name=\"form'.$this->_iFormNumber.'\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\"1\" name=\"validform'.$this->_iFormNumber.'\">';\n $oForm->form = array();\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n if ($sValue instanceof Container) {\n\n $oForm->form[$sKey] = $sValue;\n } else {\n\n $oForm->form[$sKey] = $sValue->fetch();\n }\n }\n\n $oForm->end = '</form>';\n\n return $oForm;\n }", "public function populateForm() {}", "abstract public function forms();", "public function getForm($args = '')\n {\n if (strlen($args) > 0) $args = ' ' . $args;\n if (!strlen($form = $this->_layout))\n $form = $this->_defaultLayout;\n\n // if this is a post back where the fields have been completed and need to be validated/populated\n if (!strcmp($this->getPostValue('webFormPostBack'), '1'))\n {\n // the fields have received input\n $this->validateFields();\n }\n\n for ($x=0; $x<count($this->_fields); $x++)\n {\n if (isset($this->_fields[$x]))\n {\n $field = $this->_fields[$x];\n if (strpos($form, $field['id']) !== false)\n {\n $form = str_replace(\n '[' . $field['id'] . ']',\n sprintf(\n \"<td valign=\\\"top\\\" align=\\\"right\\\" style=\\\"padding-right: 5px; font-size: 10pt; font-weight: normal;\\\">%s</td>\\n\"\n . \"<td valign=\\\"top\\\" align=\\\"left\\\" style=\\\"padding-right: 5px; height: 25px;\\\">%s\\n\"\n . \"<div id=\\\"%sCaption\\\" class=\\\"webFormCaption\\\"></div></td>\\n\",\n $this->getFieldCaption($field),\n ($this->_verifyForm ? $this->getFieldVerify($field) : $this->getFieldInput($field)),\n $field['id']\n ),\n $form\n );\n }\n }\n }\n $form = str_replace('[NL]', \"</tr>\\n<tr>\\n\", $form);\n $form = sprintf(\"<table%s>\\n\", $args) . $form . \"</table>\\n\";\n\n if (!$this->_printedPostBack)\n {\n $form = \"<input type=\\\"hidden\\\" name=\\\"webFormPostBack\\\" value=\\\"1\\\" />\\n\" . $form;\n $this->_printedPostBack = 1;\n }\n\n if (!$this->_printedHelpBox)\n {\n $form .= '<div class=\"webFormHelpBox\" id=\"webFormHelpBox\"> </div>';\n $form .= '<div class=\"webFormErrorBox\" id=\"webFormErrorBox\"> </div>';\n $this->_printedHelpBox = 1;\n }\n\n return $form;\n }", "public function getEventForm()\n\t{\n\t\t$url = 'professional-development/';\n\t\t$controller\t= new ProfessionalDevelopmentPage_Controller();\n\t\t$form = $controller->EventForm()->setFormAction(Controller::join_links($url, 'SearchForm'));\n\t\treturn isset($form) ? $form : false;\n\t}", "function FindStudents() {\n global $debug; global $COMMON; global $s_id;\n\n $sql = \"SELECT * FROM `students_basic_info` WHERE upper(`umbc_ID`) = '$s_id'\"; // uppercase so seach is case insensitive\n $rs = $COMMON->executeQuery($sql, $_SERVER[\"SCRIPT_NAME\"]);\n\n echo(\"<table class='table' border='1px'>\");\n echo(\"<tr><th>UMBC ID</th><th>First Name</th><th>Last Name</th><th>Preferred Name</th><th>Email</th><th>Major(s)</th><th>Appointment</th>\");\n while ( $row = mysql_fetch_assoc($rs) ) {\n echo(\"<tr>\\n\");\n echo(\"<td>\".$row['umbc_ID'].\"</td>\\n\");\n echo(\"<td>\".$row['fname'].\"</td>\\n\");\n echo(\"<td>\".$row['lname'].\"</td>\\n\");\n echo(\"<td>\".$row['pname'].\"</td>\\n\");\n echo (\"<td>\".$row['email'].\"</td>\\n\");\n echo \"<td>\\n\";\n if ($row['bio_ba'] == 1) { echo \"Biological Sciences BA<br/>\\n\"; }\n if ($row['bio_bs'] == 1) { echo \"Biological Sciences BS<br/>\\n\"; }\n if ($row['biochem_bs'] == 1) { echo \"Biochemistry & Molecular Biology BS<br/>\\n\"; }\n if ($row['bioinfo_bs'] == 1) { echo \"Bioinformatics & Computational Biology BS<br/>\\n\"; }\n if ($row['bioedu_ba'] == 1) { echo \"Biology Education BA<br/>\\n\"; }\n if ($row['chem_ba'] == 1) { echo \"Chemistry BA<br/>\\n\"; }\n if ($row['chem_bs'] == 1) { echo \"Chemistry BS<br/>\\n\"; }\n if ($row['chemedu_ba'] == 1) { echo \"Chemistry Education BA\"; }\n echo \"</td>\\n\";\n echo \"<td>\\n\";\n if ($row['appt_id'] != NULL) {\n echo \"<form class='form-fill' action='editMadeAppt.php' method='post' name='formEditMadeAppt'>\\n\";\n echo \"<input type='hidden' name='m_id' value='\".$row['appt_id'].\"'>\\n\";\n echo \"<input type='hidden' name='from_view' value='manageView'>\\n\";\n echo \"<input class='edit-button' type='submit' value='View'>\\n\";\n echo \"</form>\\n\";\n } else { // Not signed up\n echo \"<i>No Appointment</i>\";\n }\n echo \"</td>\\n\";\n echo(\"</tr>\\n\");\n }\n echo \"</table>\\n\";\n return $row;\n}", "function generate_form_from_table($tb,$item_id=0)\t{\n\n\tglobal $Form,$dbSwitch,$outPut,${$tb},$customInserts,$customPrints;\n\t\n\t\n//\tprint_r($_POST);\n\t\n\t\n\t\n//\t\tse quel tipo di form ha bisogno di una variabile per creare una nuova voce\n//\t\tin caso di assenza di questa variabile restituisco messaggio e back.\n\t\n\t\n\tif\t(\t(\tpreg_match(\t\"/\".$tb.\"\\[/\",\tREQUEST_MANDATORY_VALUES)\t)\t&&\t(\t!$_REQUEST[item_id]\t)\t)\t:\n\t\n\t\t$value\t=\tpreg_replace(\t\"/.*\".$tb.\"\\[([A-Za-z0-9_]*)\\].*/\",\"$1\",\tREQUEST_MANDATORY_VALUES\t);\n\t\t\n\t\tif\t(\t!$_REQUEST[$value]\t)\t:\t\t\n\t\t\t\n\t\t\t$form\t.=\t$Form->open(\"clarify\",FORM_ACTION,'POST',true,'Associazione');\n\t\t\t\n\t\t\t\n\t\t\t\n\t//\t\t$sql\t=\t\"SELECT \".$value.\" FROM \".find_primary_key_parent($value);\t###CONTROLLARE###\n\t\t\t\n\t//\t\t$data_list\t=\t$dbSwitch->select($sql);\n\t\t\t\n\t\t\t$form\t.=\t$Form->dynamic_select(codice_cliente,CLIENTI,ragione_sociale,cliente);\n\t\t\t\n\t\t\t$form\t.=\t$Form->submit(\"avanti\");\n\t\t\t\n\t\t\t$form\t.=\t$Form->close(true);\n\t\t\t\n\t\t\treturn\t$form;\t\t\t\n\t\t\n\t\tendif;\n\t\n\tendif;\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\n\t\n\tif\t(\t!$item_id\t)\t:\t$item_id\t=\t$_GET[item_id];\tendif;\n\n\n\t//definisco i tipi di campi\n\t$fields\t=\tfield_types($tb);\n\t\n\t\n\n\n\n\n\n\n\n\n\n\n//------- SE E' STATO POSTATO IL FORM IN QUESTIONE AGGIORNO -------//\n\n\tif\t(\t$_POST[$tb.'_is_sent']\t)\t:\n\t\n\t\t\n\t\tif\t(\tform_is_correct(\t$tb,\t$fields\t)\t)\t:\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t//definisco il tipo di query\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif\t(\t$item_id\t)\t:\n\t\t\t\t\t\n\t\t\t\t\t\t$action\t=\t\"UPDATE \"; $where\t=\t\" WHERE \".primary_key($tb).\"='\".$item_id.\"'\";\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$action\t=\t\"INSERT INTO \";\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t//preparo i pezzi di query\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tfor\t(\t$i=0;\t$i\t<\tcount($fields);\t$i++\t)\t:\n\t\t\t\t\t\n\t\t\t\t\t\n#************\t\t\t//COMBO INSERT da rivedere!!!!!!!!!!!!!!!!!!!!!! (3 variabili)\n\t\t\t\t\t\n\t\t\t\t\t\tif\t(\tpreg_match(\t\"/\".$fields[$i][Field].\"/\",\tCOMBO_INSERTS\t)\t)\t:\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\tATTENZIONE LA LISTA DELLE ATTREZZATURE ASSOCIATE VANNO PRESE DALLA TABELLA PRODOTTI SPECIFICI!\t*/\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$ins_funct\t=\tpreg_replace(\"/.*\".$fields[$i][Field].\"\\[([^\\[\\]$]*)\\].*/\",\"$1\",COMBO_INSERTS\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$sets\t.=\t$ins_funct($fields[$i][Field],$tb,$item_id);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//SPECIAL INSERT (1 variabile)\n\t\t\t\t\t\telseif\t(\tpreg_match(\t\"/\".$fields[$i][Field].\"/\",\tSPECIAL_INSERTS\t)\t):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$ins_funct\t=\tpreg_replace(\"/.*\".$fields[$i][Field].\"\\[([^\\[\\]$]*)\\].*/\",\"$1\",SPECIAL_INSERTS\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$toPost\t=\t$ins_funct($_POST[$fields[$i][Field]]);\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$sets.=\" \".$fields[$i][Field].\"='\".$toPost.\"', \";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//NORMAL INSERT\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif\t(\t$_POST[$fields[$i][Field]]\t!=\t$_POST['PRE_'.$fields[$i][Field]]\t)\t:\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$sets.=\" \".$fields[$i][Field].\"='\".trim($_POST[$fields[$i][Field]]).\"', \";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tendfor;\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t//se è stato immesso/modificato almeno un campo metto insieme la query\n\t\t\n\t\t\t\t\n\t\t\t\tif\t(\t$sets\t)\t:\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t//preparo gli aggiornamenti di data e ora\n\t\t\t\t\t\n\t\t\t\t\t$time=time();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif\t(\thas_date_to_be_updated($fields)\t)\t:\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tif\t(\t!$_POST[mod]\t)\t:\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$update_entry_date=\", entry_date=\".$time;\t//data inserimento\n\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$update_mod_date=\", mod_date=\".$time;\t\t\t\t//data modifica\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif\t(\tisClosing()\t)\t:\n\t\t\t\t\t\n\t\t\t\t\t\t$update_close_date=\", close_date=\".$time;\t\t//data chiusura\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t$sql=$action.$tb.\" SET \".substr($sets,-strlen($sets),strlen($sets)-2).$update_entry_date.$update_mod_date.$update_close_date.$where;\n\t\t\t\t\t\n\t\t\t\t\t\n#\t\t\t\t\tprint $sql;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$form\t.=\t$dbSwitch->insert($sql);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tunset($sets,$sql);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tendif;\n\n\n\n\n\n\t\t\t\t\t//------se è stato fatto salva e chiudi ed il form è corretto \n\t\t\t\t\t//porto di nuovo all'elenco della categoria in questione-------//\n\t\t\t\t\t\n\t\t\t\t\tif\t(\t$_POST['salva-e-chiudi']\t)\t:\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\theader(\"Location: \".ROOT.\"?cat=\".$_REQUEST[cat]);\n\t\t\t\t\t\n\t\t\t\t\tendif;\t\t\n\n\t\n\t\t\t\n\t\t\n\t\tendif;//fine se il form è corretto\n\t\n\t\n\tendif;//fine se c'è post\n\n//------- FINE AGGIORNAMENTO DATI IN PRESENZA DI POST -------//\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//apro il form\n\t$form\t.=\t$Form->open($tb);\n\n\n\n\n\n//Se è stato specificato l'item ID vado ad aprire la voce\n\t\n\tif\t(\t$item_id\t)\t:\n\t\n\t\t$dati\t=\t$dbSwitch->select(\t\"SELECT * FROM \".$tb.\" WHERE \".primary_key($tb).\"='\".$item_id.\"'\"\t);\n\t\t\n\t\tif\t(\t!is_array($dati)\t)\t:\t\t$_SESSION[err_mess]\t.= $dati;\tendif;\n\t\t\n\t\tif\t(\t!count($dati)\t\t)\t:\t\t$_SESSION[err_mess]\t.= \"non sono state trovate le informazioni.<br/>\";\tendif;\n\t\t\n\t\t$form\t.=\t$Form->hidden(\t\"mod\"\t,\t$item_id\t);\n\t\t\n\t\t\t\n\t\t\n\tendif;\n\t\n\n\n\n\n//per ogni campo creo l'apposito campo form\n\n\n\tfor\t(\t$i=0;\t$i\t<\tcount($fields);\t$i++\t)\t:\n\t\n\t\n\t\t//se il value va convertito lo converto ora\t\t\n\t\t$dati[0][$fields[$i][Field]]\t=\tdisplay_converted_form_value($fields[$i][Field],$dati[0][$fields[$i][Field]]);\n\t\t\n\t\t\t\n\t\n\t//definisco il fieldset al quale aqppartiene questo specifico campo\n\n\t\n\t\n\tforeach (${$tb}[fieldsets] as $k => $v) {\n\t\t\n\t\tif\t(\tpreg_match(\t\"/\".$fields[$i][Field].\"/\", $v)\t)\t:\t$fieldset=$k; endif;\n\t\t\n\t}\n\t\n\tif\t(\t!$fieldset\t)\t:\t$fieldset=\"altro\";\tendif;\n\t\n\t\n\t$FORM[$fieldset]\t.=\t\"\\n<div class='\".$fields[$i][Field].\"'>\\n\";\n\t\n\t\n\t\n\t\t//-- stampo eventuali messaggi e stili di errore --//\n\t\t\n\t\tif\t(\t$_POST[$tb.'_is_sent']\t&&\t!is_valid(\t$tb,$fields[$i][Field],true\t)\t)\t:\t\n\t\t\n\t\t\t$class=\" class='error'\";\n\t\t\n\t\tendif;\n\t\t\n\t\t//-- fine eventuali messaggi e stili di errore--//\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t\t//se il campo è da trattare in modo speciale\n\t\tif\t(\tis_special_field($fields[$i][Field])\t)\t:\n\t\t\n\t\t\t//richiamo l'apposita funzione dalla classe form\n\t\t\t$FORM[$fieldset]\t.=\t$Form->$fields[$i][Field]($dati[0][$fields[$i][Field]],$err_mess);\n\t\t\n\t\t\n\t\t//se viene specificato un fieldtype diverso\n\t\telseif\t(\tis_custom_field_type(\t$fields[$i][Field]\t)\t)\t:\n\t\t\n\t\t\t//richiamo l'apposita funzione dalla classe form\n\t\t\t\n\t\t\t//print get_custom_field_type(\t$fields[$i][Field]\t);\n\t\t\t\n\t\t\t$function=get_custom_field_type(\t$fields[$i][Field]\t);\n\t\t\t\n\t\t\t//se il campo personalizzato ha bisogno di variabili immetto fino alle prima 6 variabili presenti dopo la prima voce, separate da virgole nel file formconfig.php\n\t\t\t\n\t\t\t$FORM[$fieldset]\t.=\t$Form->$function[0]($fields[$i][Field],$function[1],$function[2],$function[3],$function[4],$function[5],$function[6]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\telse:\t//altrimenti se è un campo normale\n\t\t\n\t\t\t\t\n\t\t\t//se è varchar o smallint\n\t\t\tif\t(\tpreg_match('/varchar/',\t$fields[$i][Type]\t)\t||\n\t\t\t\t\tpreg_match('/smallint/',\t$fields[$i][Type]\t)\t||\n\t\t\t\t\tpreg_match('/int/',\t$fields[$i][Type]\t)\n\t\t\t\t)\t:\n\t\t\t\n\t\t\t\t$maxlength\t=\tpreg_replace('/[a-z]+\\(([0-9]+)\\)/','$1',$fields[$i][Type]);\n\t\t\t\t\n\t\t\t\t$FORM[$fieldset]\t.=\t$Form->input($fields[$i][Field],$dati[0][$fields[$i][Field]],$maxlength,$class,$err_mess);\n\t\t\t\n\t\t\t\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t\t//----------\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//se SET o ENUM\n\t\t\tif\t(\tpreg_match('/set/',\t$fields[$i][Type]\t)\t||\tpreg_match('/enum/',\t$fields[$i][Type]\t)\t)\t:\n\t\t\t\n\t\t\t\n\t\t\t$labels\t=\tpreg_replace('/\\'/','',$fields[$i][Type]);\n\t\t\t$labels\t=\tpreg_replace('/set\\((.*)\\)/','$1',$labels);\n\t\t\t$labels\t=\tpreg_replace('/enum\\((.*)\\)/','$1',$labels);\n\t\t\t$labels\t=\texplode(\",\", $labels); //metto tutti i valori in un array\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$FORM[$fieldset]\t.=\t$Form->select($fields[$i][Field],$labels,$dati[0][$fields[$i][Field]]);\n\t\t\t\n\t\t\t\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t\t//----------\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//se TEXT\n\t\t\tif\t(\t$fields[$i][Type] === \"text\"\t)\t:\n\t\t\t\n\t\t\t$FORM[$fieldset]\t.=\t$Form->textarea($fields[$i][Field],$dati[0][$fields[$i][Field]]);\n\t\t\t\n\t\t\tendif;\n\t\t\t\n\t\t\t\n\t\t\t//----------\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\tendif;\t//fine se il campo non speciale\n\t\t\n\t\t\t\t\n\t\t\n\t\n\t\n\t\t\n\t\t\n\t\t//$FORM[$fieldset]\t.= is_valid($tb,$dati[0][$fields[$i][Field]]);\n\t\t\n\t\t\n\t\t\n\t\t$FORM[$fieldset]\t.=\t$_SESSION[err_mess][$fields[$i][Field]];\n\t\t\n\t\tunset($_SESSION[err_mess]);\n\t\t\n\t\t$FORM[$fieldset]\t.=\t\"</div>\\n\\n\";\n\t\n\t\n\t\n\t\n\t\n\t//se c'è un'inserto da mettere dopo questo fieldset lo metto\n//\tprint \"preg_match(\\\"/\".$fieldset.\"/\".${$tb}[custom_inserts].\")\";\n\t\t\t\n\tif(\t(\tpreg_match(\"/\".$fieldset.\"/\",${$tb}[custom_inserts])\t)\t&&\t(\t!$FORM[custom_field]\t)\t):\n\t\n\t$custom_field\t=\tpreg_replace(\"/.*\".$fieldset.\"\\[([^\\[\\]$]*)\\].*/\",\"$1\",${$tb}[custom_inserts]\t)\t;\n\t\n\t$FORM[$custom_field]\t=\t$customInserts->$custom_field();\n\t\n\tendif;\n\t\n\t\n\t\n\t\n\t\n\tunset($fieldset,$class, $err_mess);\n//\t\tprint $fields[$i][Field].$i.$tb;\n\tendfor;\n\t\n\t\n\t\n\nprint_r($FORM);exit;\n\n\nforeach ($FORM as $key => $value) {\n \n\t$FIELDSET[$key]\t.=\t\"\\n\\n<fieldset id='\".$key.\"'>\\n\";\t\n\t$FIELDSET[$key]\t.=\t\"\\n<legend>\";\n\t$FIELDSET[$key]\t.=\t$outPut->label($key);\n\t$FIELDSET[$key]\t.=\t\"</legend>\\n\";\n\t$FIELDSET[$key]\t.=\t$value;\n\t$FIELDSET[$key]\t.=\t\"\\n</fieldset>\\n\\n\";\n\t\n}\n\n\n//se non è stato stabilito l'ordine dei fieldset seguo l'ordine di apparizione da DB\n\nif\t(\t!trim(${$tb}[fieldset_order])\t\t)\t:\n\n\tforeach ($FIELDSET as $key => $value) :\n\t\t\n\t\t$form\t.=\t$FIELDSET[$key];\n\t\t\n\tendforeach;\n\t\n\t\nelse:\n\n\tforeach (explode(\" \",${$tb}[fieldset_order]) as $value) :\n\t\t\n\t\t$form\t.=\t$FIELDSET[$value];\n\t\t\n\tendforeach;\n\t\n\nendif;\n\n\n\n\n\n\n\n$form\t.=$Form->tripleSubmit();\n\n\n$form\t.=$Form->close();\n\n\n\n\n\n\n\n\n\n\n\n\n//aggiungo eventuale lista correlata\nif\t(\tpreg_match(\t\"/\".$tb.\"\\[[^\\[\\]]*\\]/\",FORM_RELATED_LISTS\t)\t)\t:\n\t\t\t\t\n\t$related_list\t=\tpreg_replace(\t\"/.*\".$tb.\"\\[([^\\[\\]]*)\\].*/\",\"$1\",FORM_RELATED_LISTS\t);\n\t\n\t$form\t.=\tlist_($related_list,\" WHERE \".primary_key($tb).\"='\".$_GET[item_id].\"'\",1,1,'scroll');\t\n\t\nendif;\n\n//print_r($_POST);\n\nreturn $form;\n\n\n}", "public function get_forms( array $where = array() )\n {\n if( 'form' != $this->_object->get_type() ) return FALSE;\n\n return $this->_object->find( NULL, $where );\n }", "public function getForm($data = array(), $loadData = true)\n\t{\n\t\t// Get the form.\n\t\t$form = $this->loadForm('com_einsatzkomponente.einsatzbericht', 'einsatzbericht', array('control' => 'jform', 'load_data' => $loadData));\n\t\tif (empty($form)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $form;\n\t}", "public function searchAction() {\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$this->view->cols = $model->info('cols');\n\t\t$this->view->model = $this->_getParam('model');\n\t\t$this->view->config = Marcel_Backoffice_Config::getInstance()->getConfig();\n\t\t\n\t\tif ($this->_request->isPost()) {\n\t\t\t$fields = array();\n\t\t\t$func \t= array();\n\t\t\t$query \t= array();\n\t\t\tforeach ($_POST['query'] as $key => $q) {\n\t\t\t\tif (isset($_POST['fields'][$key]) && !empty($_POST['fields'][$key])) {\n\t\t\t\t\t$fields[$key] = $_POST['fields'][$key];\n\t\t\t\t\t$func[$key] \t= $_POST['func'][$key];\n\t\t\t\t\t$query[$key] \t= $_POST['query'][$key];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data = array('fields' => $fields, 'func' => $func, 'query' => $query);\n\t\t\t$data = serialize($data);\n\t\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName, 'data' => $data));\n\t\t}\n\t}", "function get_all(){\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_attitude\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\n\t}", "function consultaFacultades() {\r\n include_once($this->configuracion[\"raiz_documento\"].$this->configuracion[\"clases\"].\"/html.class.php\");\r\n $this->html = new html();\r\n $facultades=$this->consultarFacultades();\r\n \r\n foreach ($facultades as $key=>$facultad) {\r\n $registro[$key][0]=$facultad['COD_FACULTAD'];\r\n $registro[$key][1]=$facultad['NOMBRE_FACULTAD'];\r\n }?>\r\n\t\t<form enctype='multipart/form-data' method='POST' action='index.php' name='<? echo $this->formulario?>'>\r\n <table width=\"100%\" align=\"center\" border=\"1\" cellpadding=\"10\" cellspacing=\"0\" >\r\n <tr>\r\n <td>Seleccione la Facultad: \r\n <?$mi_cuadro=$this->html->cuadro_lista($registro,'facultad',$this->configuracion,-1,\"\",FALSE,\"\",\"facultad\");\r\n echo $mi_cuadro;?>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">\r\n <input type=\"hidden\" name=\"opcion\" value=\"consultaProyectos\">\r\n <input type=\"hidden\" name=\"action\" value=\"<? echo $this->bloque ?>\">\r\n <input class=\"boton\" type=\"button\" value=\"Continuar\" onclick=\"document.forms['<? echo $this->formulario?>'].submit()\">\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t</form>\t\r\n <?\r\n \r\n \r\n }", "function get_info($email)\n\t{\n\t\tif(! $email)\n\t\t\treturn FALSE;\n\t\t\t\n\t\t$get = $this->db->select('company_id, name AS company_name, registrant_name, registrant_email')\n\t\t\t\t\t\t->where('registrant_email', $email)\n\t\t\t\t\t\t->get('company');\n\t\t\n\t\tif($get && $get->num_rows()>0)\n\t\t{\n\t\t\treturn $get->row_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function getForm($data = array(), $loadData = true) \n\t{\n $form = $this->loadForm(\n 'com_perso_norlande.detailsperso',\n 'detailsperso',\n array('control' => 'jform', 'load_data' => $loadData)\n );\n return $form;\n\t}", "public function retrieveForms()\n {\n return $this->start()->uri(\"/api/form\")\n ->get()\n ->go();\n }", "function nf_getFormResult($templateTaskid,$projectid) {\n global $_TABLES;\n\n $retval = array();\n /* Retrieve the form for that this review task is defined for */\n // Potentially more then 1 form could be valid to verify - explode into an array\n // Get the latest result record in case there are more then 1 for the same form.\n $aforms = explode(',',DB_getItem($_TABLES['nftemplatedata'], 'optionalParm', \"id={$templateTaskid}\"));\n if (is_array($aforms)) {\n foreach ($aforms as $formid) {\n $sql = \"SELECT id,results_id FROM {$_TABLES['nfproject_forms']} \";\n $sql .= \"WHERE project_id='$projectid' \";\n $sql .= \"AND form_id='{$formid}' \";\n $sql .= \"ORDER BY id DESC LIMIT 1\";\n $query = DB_query($sql);\n if (DB_numRows($query) == 1) {\n list ($prjformid,$resultid) = DB_fetchArray($query);\n $retval['formid'] = $formid;\n $retval['prjformid'] = $prjformid;\n $retval['resultid'] = $resultid;\n break;\n }\n }\n }\n return $retval;\n}", "function getFormWithdataByFormDataIDAndUserID($post,$deviceType,$appVersion,$OSVersion,$browserVersion)\n{\n $CustomerID = is_require($post, 'CustomerID');\n $UserID = is_require($post, 'UserID');\n $FormDataID = is_require($post, 'FormDataID');\n //$OrgID = $post['OrgID'];\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\n /******************** userData start *******************/\n $sql = \"SELECT S.OrgID, UA.UserTypeID FROM \n SCP_Staff AS S \n INNER JOIN SCP_UserAccess AS UA ON UA.UserID='$UserID'\n WHERE S.UserID='$UserID'\";\n $resultset = mysql_query($sql);\n $accessRow = mysql_fetch_assoc($resultset); \n $OrgID = $accessRow['OrgID'];\n $UserTypeID = $accessRow['UserTypeID'];\n /******************** userData end *******************/ \n /******************** userformData start *******************/\n $sql1 = \"SELECT * FROM SCP_OrgFormBuilderDataAction WHERE CustomerID='$CustomerID' AND FormDataID='$FormDataID'\";\n $resultset1 = mysql_query($sql1);\n $rowData = mysql_fetch_assoc($resultset1); \n /******************** userformData end *******************/ \n //print_r($arrFormValueData); die();\n $result = mysql_query(\"call getFormWithdataByFormDataIDAndUserID('\".$OrgID.\"','\".$UserTypeID.\"','\".$FormDataID.\"');\");\n //CHECK FOR ERROR \n if (!$result) die('Invalid query: ' . mysql_error());\n $row = mysql_fetch_assoc($result);\n mysql_close($con); //close the connection\n\n if(!empty($rowData)) {\n $arrFormValueData = unserialize($rowData['FormValueData']);\n $jsonData = json_decode($row['FormDataJson']);\n $filterAllForms = array();\n foreach ($jsonData as $key => $value) {\n $array['component'] = $value->component;\n $array['editable'] = $value->editable;\n $array['index'] = $value->index;\n $array['label'] = $value->label;\n $array['value'] = $arrFormValueData->$key;\n $array['description'] = $value->description;\n $array['placeholder'] = $value->placeholder;\n $array['options'] = $value->options;\n $array['required'] = $value->required;\n $filterAllForms[] = $array;\n }\n $row['FormDataJson'] = json_encode($filterAllForms);\n }\n $filterFormWithData = $row;\n //print_r($filterFormWithData); die(); \n if($filterFormWithData) {\n $data['ResponseData'] = $filterFormWithData;\n $data['Message'] = \"Get form data successfully.\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Success\";\n $data['StatusCode'] = \"1\";\n } else {\n $data['ResponseData'] = \"\";\n $data['Message'] = \"Error\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Failed\";\n $data['StatusCode'] = \"0\";\n }\n print json_encode($data);\n}", "protected function createComponentForm($name) {\n\t\t$form = new AppForm($this, $name);\n\t\t$form = BaseForm::tuneRenderer($form);\n\t\tif ($this->compact) {\n\t\t\t$form->getElementPrototype()->setId(\"search\");\n\t\t}\n\t\tif ($this->compact) {\n\t\t\t$form->addText(\"query\")\n\t\t\t\t->addRule(Form::FILLED, \"The search field has to be filled.\");\n\t\t\t$form[\"query\"]->getControlPrototype()->title(System::translate(\"Enter query >> Select content >> Submit\"));\n\t\t\t// Key has to be same as name of action in search presenter\n\t\t\t$in = array(\n\t\t\t \"default\" => System::translate(\"Books\"),\n\t\t\t \"author\" => System::translate(\"Authors\"),\n\t\t\t \"discussion\" => System::translate(\"Discussions\"),\n\t\t\t \"user\" => System::translate(\"Users\"),\n\t\t\t \"help\" => System::translate(\"Help\")\n\t\t\t);\n\t\t\t$form->addRadioList(\"search\", \"In\", $in)\n\t\t\t\t->getControlPrototype()->setId(\"selectIn\");\n\t\t\t// Remove br after pair\n\t\t\t$form[\"search\"]->getSeparatorPrototype()->setName(\"\");\n\t\t\t$form->addSubmit(\"search_submit\", \"Search\");\n\t\t} else {\n\t\t\t$form->addText(\"query\", \"Text to search\")\n\t\t\t\t->addRule(Form::FILLED, \"The search field has to be filled.\");\n\t\t\t$form->addSubmit(\"search_submit\", \"Search\");\n\t\t}\n\t\t$form->setTranslator(System::translator());\n\t\t$form->onSubmit[] = array($this, \"formSubmitted\");\n\t\t$form->addProtection(\"Form timeout, please send form again.\");\n\t\treturn $form;\n\t}", "public function getForm($data = array(), $loadData = true){\n\t\t\n\t\t$app = JFactory::getApplication();\n\t\t$form = $this->loadForm('com_egoi.egoi', 'egoi', array('control' => 'jform', 'load_data' => $loadData));\n \n\t\tif (empty($form)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $form;\n\t}", "public function getForm($data = array(), $loadData = true)\n\t\t{\n\t\t\t\t// Get the form.\n\t\t\t\t$form = $this->loadForm('com_helloworld.' . $this->context, $this->context, array('control' => 'jform', 'load_data' => $loadData));\n\t\t\t\tif (empty($form))\n\t\t\t\t{\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn $form;\n\t\t}", "function fetchAllForms () {\n global $wpdb;\n $table_name = $wpdb->prefix . \"dx_forms_meta_data\";\n $dbResults = $wpdb->get_results( \"SELECT * FROM $table_name\" );\n\n echo \"<h1>All forms</h1>\";\n\n // loop through all forms\n foreach ($dbResults as $row) {\n ?>\n <div>Last updated on: <?= date(\"F j, Y. g:i A\",strtotime($row->timestamp)) ?></div>\n <div><?= $row->form_name ?></div>\n <h3>Form submissions</h3>\n <?php\n // get field mappings (ID to name) from DB row\n $field_mappings = json_decode($row->field_mappings, true);\n \n $this->fetchFormSubmissions($row->form_id, $field_mappings);\n }\n\n echo \"<hr>\";\n }", "function get_data_form(){\n\n $IdTrabajo= $_REQUEST['IdTrabajo']; //Variable para el id del trabajo\n $NombreTrabajo = $_REQUEST['NombreTrabajo']; //Variable para el nombre del trabajo\n $FechaIniTrabajo = $_REQUEST['FechaIniTrabajo']; //Variable para la fecha de inicio del trabajo\n $FechaFinTrabajo = $_REQUEST['FechaFinTrabajo']; //Variable para la fecha de finalizacion del trabajo\n $PorcentajeNota = $_REQUEST['PorcentajeNota']; //Variable para el porcentaje de la nota\n $action = $_REQUEST['action']; //Variable action para la accion a realizar\n\n //crea un trabajo\n $TRABAJO = new TRABAJO_Model(\n $IdTrabajo,\n $NombreTrabajo,\n $FechaIniTrabajo,\n $FechaFinTrabajo,\n $PorcentajeNota);\n\n return $TRABAJO;\n }", "function builder_contact()\n{\n\t$bname2=mysql_query(\"select * from manage_property_builder\");\n\t$brow2=mysql_fetch_object($bname2);\n\treturn $brow2;\n}", "function get_form_fields($name='',$subject='',$text='',$send_time=0,$newsletter=0)\n\t{\n\t\t$fields=new ocp_tempcode();\n\t\t$fields->attach(form_input_line(do_lang_tempcode('NAME'),do_lang_tempcode('DESCRIPTION_NAME_REFERENCE'),'name',$name,true));\n\t\t$fields->attach(form_input_line(do_lang_tempcode('SUBJECT'),do_lang_tempcode('DESCRIPTION_WELCOME_EMAIL_SUBJECT'),'subject',$subject,true));\n\t\t$fields->attach(form_input_huge_comcode(do_lang_tempcode('TEXT'),do_lang_tempcode('DESCRIPTION_WELCOME_EMAIL_TEXT'),'text',$text,true));\n\t\t$fields->attach(form_input_integer(do_lang_tempcode('SEND_TIME'),do_lang_tempcode('DESCRIPTION_SEND_TIME'),'send_time',$send_time,true));\n\t\tif (addon_installed('newsletter'))\n\t\t{\n\t\t\trequire_lang('newsletter');\n\t\t\tif (get_value('welcome_nw_choice')==='1')\n\t\t\t{\n\t\t\t\t$newsletters=new ocp_tempcode();\n\t\t\t\t$rows=$GLOBALS['SITE_DB']->query_select('newsletters',array('id','title'));\n\t\t\t\tif (get_forum_type()=='ocf')\n\t\t\t\t{\n\t\t\t\t\t$newsletters->attach(form_input_list_entry('',is_null($newsletter),do_lang_tempcode('NEWSLETTER_OCF')));\n\t\t\t\t}\n\t\t\t\tforeach ($rows as $_newsletter)\n\t\t\t\t\t$newsletters->attach(form_input_list_entry(strval($_newsletter['id']),$_newsletter['id']===$newsletter,get_translated_text($_newsletter['title'])));\n\t\t\t\tif (!$newsletters->is_empty())\n\t\t\t\t\t$fields->attach(form_input_list(do_lang_tempcode('NEWSLETTER'),'','newsletter',$newsletters,NULL,false,false));\n\t\t\t} else\n\t\t\t{\n\t\t\t\tif (get_forum_type()=='ocf') // If you are not using OCF, it is IMPLIED you will have to be sending to newsletter people, hence no choice\n\t\t\t\t{\n\t\t\t\t\trequire_lang('newsletter');\n\t\t\t\t\t$fields->attach(form_input_tick(do_lang_tempcode('NEWSLETTER'),do_lang_tempcode('DESCRIPTION_NEWSLETTER_INSTEAD'),'newsletter',$newsletter==1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $fields;\n\t}", "public static function get_form_info($search = '', $per_page = 5, $page_number = 1)\n\t{\n\t\tglobal $wpdb;\n\t\t$apf_form_tbl = $wpdb->prefix . 'applicant_submissions';\n\n\t\tif (!empty($search)) {\n\t\t\t$sql = \"SELECT * FROM \" . $apf_form_tbl . \" WHERE f_name LIKE '%\" . $search . \"%' OR l_name LIKE '%\" . $search . \"%' OR ap_address LIKE '%\" . $search . \"%' OR ap_email LIKE '%\" . $search . \"%' OR ap_mobile LIKE '%\" . $search . \"%' OR ap_postname LIKE '%\" . $search . \"%' \";\n\t\t} else {\n\t\t\t$sql = \"SELECT * FROM \" . $apf_form_tbl;\n\t\t}\n\n\t\tif (!empty($_REQUEST['orderby'])) {\n\t\t\t$sql .= \" ORDER BY \" . $_REQUEST['orderby'] . \" \" . $_REQUEST['order'];\n\t\t} else {\n\t\t\t$sql .= \" ORDER BY apid DESC\";\n\t\t}\n\n\t\t$sql .= \" LIMIT $per_page\";\n\t\t$sql .= \" OFFSET \" . ($page_number - 1) * $per_page;\n\n\t\t$result = $wpdb->get_results($sql, 'ARRAY_A');\n\n\t\treturn stripslashes_deep($result);\n\t}", "function search_by_email($tableName,$email) // searching employee by email\r\n {\r\n $conn = self::build_connection();\r\n $sql = \"select * from \".$tableName .\" WHERE email='{$email}'\";\r\n $result = $conn->query($sql);\r\n self::close_connection($conn);\r\n if($result->num_rows > 0){ //if value >0 true\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public function getForm($data = array(), $loadData = true){\n \n // Get the form.\n $form = $this->loadForm($this->option.'.profile', 'profile', array('control' => 'jform', 'load_data' => $loadData));\n if(empty($form)){\n return false;\n }\n \n return $form;\n }", "function formUsers() {\n\t\t$output = $formField = \"\"; $status = 1;\n\t\t$getPopupValue[] = $fieldValue[] = \"\";\n\t\tif($this->popupFormID){\n\t\t\t$getPopupValue = $this->getValueDB([\"table\"=>$this->Params['table'],\"id\"=>$this->popupFormID]);\n\t\t\t$status = $getPopupValue['status'];\n\t\t}\n\t\t$varLists = ['username','password','staff_id','role','supervisor','unit'];\n\t\tforeach($varLists as $var){\n\t\t\t$fieldValue[$var] = (isset($getPopupValue[$var]) && $this->popupFormID) ? $getPopupValue[$var] : \"\";\n\t\t}\n\n\t\t$username = $this->inputGroup(['label'=>'Username','type'=>'text','id'=>'username','name'=>'username','placeholder'=>'Username','value'=>$fieldValue['username']]);//$this->Params['first_name']\n\t\t$password = $this->inputGroup(['label'=>'Password','type'=>'password','id'=>'password','name'=>'password','placeholder'=>'&bull;&bull;&bull;&bull;&bull;&bull;','value'=>'']);//$this->Params['middle_name']\n\t\t$staff_id = $this->inputGroup(['label'=>'Employee','type'=>'select','id'=>'staff_id','name'=>'staff_id','meta_key'=>'staffs','meta'=>'staffs','placeholder'=>'Select to link User to Employee','value'=>$fieldValue['staff_id']]);\n\t\t$role = $this->inputGroup(['label'=>'Access Role','type'=>'select','id'=>'role','name'=>'role','meta_key'=>'role','meta'=>'codebook','placeholder'=>'Select Access Role','value'=>$fieldValue['role']]);\n\n\t\t$supervisor = $this->inputGroup(['label'=>'Supervisor','type'=>'select','id'=>'supervisor','name'=>'supervisor','meta_key'=>'users','meta'=>'users','placeholder'=>'Select User\\'s Supervisor','value'=>$fieldValue['supervisor']]);\n\t\t$unit = $this->inputGroup(['label'=>'Deparment','type'=>'select','id'=>'unit','name'=>'unit','meta_key'=>'unit','meta'=>'codebook','placeholder'=>'Select User\\'s Department/Unit','value'=>$fieldValue['unit']]);\n\n\t\t$popUpTitle = str_replace(\"_\",\" \",$this->Params['table']);\n\t\t$formField .= \"<div class='x_panel no-padding'><div class='box_title'><h2 class='left capitalize'>{$popUpTitle} Information Details</h2></div><div class='x_content no-padding'>\";\n\t\t$formField .= \"\n\t\t\t<div class='one-fourth'>\n\t\t\t\t<div class='form-group no-padding item alignRight'>\n\t\t\t\t\t<div class='col-md-12 col-sm-12 col-xs-12 no-padding'>{$username}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='form-group no-padding item alignRight'>\n\t\t\t\t\t<div class='col-md-12 col-sm-12 col-xs-12 no-padding'>{$password}</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='three-fourth'>\n\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$staff_id}</div>\n\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$supervisor}</div>\n\t\t\t</div>\n\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$role}</div>\n\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$unit}</div>\n\t\t\t</div>\n\t\t</div>\n\t\t</div>\n\t\t</div>\n\t\t\";\n\t\t$output .= \"\n <form id='createRecords' data-toggle='validator' name='{$this->Params['meta']}' class='form-label-left input_mask' novalidate>\n\t\t\t\t<input type='hidden' name='action' id='action' value='createRecords' />\n\t\t\t\t<input type='hidden' name='table' id='table' value='{$this->Params['table']}' />\n\t\t\t\t<input type='hidden' name='theID' id='theID' value='{$this->Params['value']}' />\n\t\t\t\t{$formField}\n\t\t\t</form>\n \";\n\t\t$output .= \"<script>\n\t\t\t$(document).ready(function() {\n\t\t\t\twebshims.setOptions('forms-ext', {replaceUI: 'auto', types: 'number'});webshims.polyfill('forms forms-ext');\n\t\t\t\t$('.select2_single').each(function() {\n\t\t\t\t\t$(this).select2({\n\t\t\t\t\t\tplaceholder: $(this).attr('placeholder'),\n\t\t\t\t\t\tallowClear: false\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t$(':input').inputmask();\n\t\t\t});\n\n\t\t</script>\";\n\t\treturn $output;\n\t}", "function get_data_form(){\n\n\n\t$IdGrupo = '';\n\t$IdFuncionalidad = '';\n\t$IdAccion = '';\n\t$NombreGrupo = '';\n\t$NombreFuncionalidad = '';\n\t$NombreAccion = '';\n\t$action = '';\n\n\tif(isset($_REQUEST['IdGrupo'])){\n\t$IdGrupo = $_REQUEST['IdGrupo'];\n\t}\n\tif(isset($_REQUEST['IdFuncionalidad'])){\n\t$IdFuncionalidad = $_REQUEST['IdFuncionalidad'];\n\t}\n\tif(isset($_REQUEST['IdAccion'])){\n\t$IdAccion = $_REQUEST['IdAccion'];\n\t}\n\tif(isset($_REQUEST['action'])){\n\t$action = $_REQUEST['action'];\n\t}\n\tif(isset($_REQUEST['NombreGrupo'])){\n\t$NombreGrupo = $_REQUEST['NombreGrupo'];\n\t}\n\tif(isset($_REQUEST['NombreFuncionalidad'])){\n\t$NombreFuncionalidad = $_REQUEST['NombreFuncionalidad'];\n\t}\n\tif(isset($_REQUEST['NombreAccion'])){\n\t$NombreAccion = $_REQUEST['NombreAccion'];\n\t}\n\n\t$PERMISOS = new PERMISO_Model(\n\t\t$IdGrupo, \n\t\t$IdFuncionalidad, \n\t\t$IdAccion,\n\t\t$NombreGrupo,\n\t\t$NombreFuncionalidad,\n\t\t$NombreAccion);\n\n\treturn $PERMISOS;\n}", "public function getAppFormElements($campaignName) {\n $row = $this->getAdapter()->query(\"SELECT * FROM tmw_wire_app_form_elements WHERE campaignName = '\".$campaignName.\"' ORDER BY elementOrder;\")->fetchAll();\n if(!$row) {\n throw new Exception('Could not load application form elements from database');\n } else {\n return $row;\n }\t\n }", "function handle_get($indata) {\n// showDebug('form_class GET:');\n// showArray($indata);\n if(array_key_exists('new', $indata)) {\n $this->is_new = 1;\n $this->title = 'New data';\n } \n if(array_key_exists('find', $indata)){\n $this->is_find_form = 1;\n $this->title = 'Find in ' . $this->table_title;\n }\n if(array_key_exists('id', $indata)){\n $this->id = $indata['id'];\n $this->form_data = $this->fetchRecordInfo($this->id);\n }\n }", "public function getForm()\n {\n RETURN $this->strategy->getForm();\n }", "public function ReadAll() {\r\n\t\t$sql = \"\r\n\t\tSELECT\r\n\t\tt1.id,\r\n\t\tt1.,\r\n\t\tt1.cpf,\r\n\t\tt1.email,\r\n\t\tt1.status\r\n\t\tFROM\r\n\t\tredefinicao_senha AS t1\r\n\t\t\r\n\r\n\t\t\";\r\n\t\t\r\n\t\t\r\n\t\t$DB = new DB();\r\n\t\t$DB->open();\r\n\t\t$Data = $DB->fetchData($sql);\r\n\t\t$realData;\r\n\t\tif($Data ==NULL){\r\n\t\t\t$realData = $Data;\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\r\n\t\t\tforeach($Data as $itemData){\r\n\t\t\t\tif(is_bool($itemData)) continue;\r\n\t\t\t\telse{\r\n\t\t\t\t\t$realData[] = $itemData;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$DB->close();\r\n\t\treturn $realData; \r\n\t}", "public static function Form() : iterable\n {\n return [\n 'role_id' => '',\n 'staff_id' => '',\n 'full_name' => '',\n 'date_of_appointment' => '',\n 'status' => '',\n 'category' => '',\n 'phone_number' => '',\n 'highest_qualification' => '',\n 'branch_id' => '',\n 'email' => '',\n 'address' => '',\n 'gender' => '',\n 'referee_1' => '',\n 'referee_2' => '',\n 'referee_1_phone_no' => '',\n 'referee_2_phone_no' => '',\n 'date_of_birth' => '',\n 'nationality' => '',\n 'next_of_kin_name' => '',\n 'next_of_kin_phone_no' => '',\n 'guarantor_name' => '',\n 'guarantor_phone_no' => '',\n 'guarantor_address' => '',\n 'guarantor_relationship' => '',\n 'guarantor_name_2' => '',\n 'guarantor_phone_no_2' => '',\n 'guarantor_address_2' => '',\n 'guarantor_relationship_2' => '',\n 'cv' => '',\n ];\n }", "function my_browse_data( $table_name , $datas ){\r\n\t\r\n\tglobal $connection;\r\n\t\r\n\t$primary_field = my_get_field_list($table_name);\r\n\tforeach($datas as $field => $value){\r\n\t\t$fieldname = $field ;\r\n\t\t$fieldvalue = $value;\r\n\t}\r\n\t\r\n\t$query = \" SELECT `\".$primary_field. \"` FROM `\".$table_name.\"` WHERE `\".$fieldname.\"` = \". $fieldvalue ;\r\n\t \r\n\t$result = my_query( $query );\r\n\tif( my_num_rows($result) > 0 ){\r\n\t\t\r\n\t\t$data = array();\r\n\t\t\r\n\t\twhile(\t$row = my_fetch_array($result) ){\r\n\t\t\t$data[] = $row[$primary_field];\r\n\t\t}\r\n\t\t\r\n\t\treturn $data;\r\n\t\r\n\t}\r\n\t\r\n\treturn false;\r\n\t\r\n}", "function smarty_function_forms_search($params, &$smarty)\n{\n\t$title = \"Search\";\n\t$ajax = true;\n\t$class = \"\";\n\t$sdivid = \"search\" . rand();\n\tforeach ($params as $_key=>$_value) {\n\t\tswitch ($_key) {\n\t\tcase 'form':\n\t\tcase 'class':\n\t\tcase 'table':\n\t\tcase 'title':\n\t\tcase 'ajax':\n\t\t\t$$_key = $_value;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t$output = \"\";\n\n\t$display = \"none\";\n\n\n\t$cur_table = &$form->tables->$table;\n\n\tif ($class == \"\")\n\t\t$class = \"forms\";\n\n\tif ($cur_table->search[\"type\"] == \"all\" || $cur_table->search[\"type\"] == \"individual\")\n\t{\n\t\tif (strlen($cur_table->search['value']) != 0)\n\t\t\t$display = \"block\";\n\t\t$output .= \"<input type=\\\"text\\\" value=\\\"$cur_table->search['value']\\\" name=\\\"search\\\">\";\n\t}\n\n\tif ($cur_table->search[\"type\"] != \"all\")\n\t{\n\n\t\tif ($cur_table->search[\"type\"] == \"individual\")\n\t\t{\n\t\t\t$output .=\"<br><SELECT name=\\\"searchfield\\\">\";\n\t\t}\n\n\t\tif ($cur_table->search[\"type\"] == \"advanced\")\n\t\t{\n \t\t\t$output .= \"<table class='$class'>\\r\";\n\t\t\tif (!$ajax)\n\t\t\t\t$output .= \"<tr><th colspan='2'>$title</th></tr>\\r\";\n\t\t}\n\n\t\tforeach ($cur_table->order as $fieldname)\n\t\t{\n\t\t\t$field = &$cur_table->fields[$fieldname];\n\t\t\tif (is_array($field->search[\"value\"]))\n\t\t\t{\n\t\t\t\tif (count($field->search[\"value\"]) != 0)\n\t\t\t\t\t$display = \"block\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (strlen($field->search['value']) != 0 && $field->search['value'] != \"any\")\n\t\t\t\t\t$display = \"block\";\n\t\t\t}\n\n\t\t\tif (isset($field->search[\"searchable\"]) && $field->search[\"searchable\"])\n\t\t\t{\n\t\t\t\tif ($cur_table->search[\"type\"] == \"individual\")\n\t\t\t\t{\n\t\t\t\t\t$cur_table->search[\"field\"] == $field->name ? $selected = \" selected \" : $selected = \"\";\n\t\t\t\t\t$output .= \"<OPTION value=\\\"$field->name\\\" $selected title=\\\"\\\">$field->name</OPTION>\";\n\t\t\t\t}\n\t\t\t\telse // CREATE ADVANCED SEARCH -- A BOX FOR EACH SEARCHABLE FIELD\n\t\t\t\t{\n\t\t\t\t\tif ($field->search[\"type\"] != \"range\")\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch ($field->search[\"type\"])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase \"exact\":\n\t\t\t\t\t\t\tcase \"contains\":\n\t\t\t\t\t\t\t\t$input = \"<input type=\\\"text\\\" value=\\\"{$field->search['value']}\\\" name=\\\"$field->name\\\" id=\\\"$field->name\\\">\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"index\":\n\t\t\t\t\t\t\t\t$input = \"<select name=\\\"$field->name\\\">\";\n\t\t\t\t\t\t\t\t$opput = \"\";\n\t\t\t\t\t\t\t\t$sel = false;\n\t\t\t\t\t\t\t\tforeach ($field->index as $val => $index)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif ($field->search[\"value\"] == $val && $field->search[\"value\"] != \"any\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$selected = \" selected \";\n\t\t\t\t\t\t\t\t\t\t$sel = true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$selected = \"\";\n\t\t\t\t\t\t\t\t\t$opput .= \"<option value=\\\"$val\\\" $selected>$index</option>\\r\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$sel === true ? $selected = \"\" : $selected = \" selected \";\n\t\t\t\t\t\t\t\t\t$opput = \"<option value=\\\"any\\\" $selected>Any</option>\\r\" . $opput;\n\t\t\t\t\t\t\t\t\t$input .= $opput;\n\t\t\t\t\t\t\t\t$input .= \"</select>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"multiple\":\n\t\t\t\t\t\t\t\t$input = \"<select name=\\\"{$field->name}[]\\\" multiple>\";\n\t\t\t\t\t\t\t\t$opput = \"\";\n\t\t\t\t\t\t\t\tforeach ($field->index as $val => $index)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$selected = \"\";\n\t\t\t\t\t\t\t\t\tif (isset($field->search[\"value\"]) && is_array($field->search[\"value\"]))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tforeach ($field->search[\"value\"] as $passedInValue)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif ($passedInValue == $val)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$selected = \" selected \";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$opput .= \"<option value=\\\"$val\\\" $selected>$index</option>\\r\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$input .= $opput;\n\t\t\t\t\t\t\t\t$input .= \"</select>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$output .= \"<tr><td>$field->label:</td><td>$input</td></tr>\\r\";\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$output .= \"<tr><td>$field->label min:</td><td><input type=\\\"text\\\" value=\\\"$field->search['value_min']\\\" name=\\\"$field->name\" . \"_min\\\" id=\\\"$field->name\" . \"_min\\\"></td></tr>\\r\";\n\t\t\t\t\t\t$output .= \"<tr><td>$field->label max:</td><td><input type=\\\"text\\\" value=\\\"$field->search['value_max']\\\" name=\\\"$field->name\" . \"_max\\\" id=\\\"$field->name\" . \"_max\\\"></td></tr>\\r\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($cur_table->search[\"type\"] == \"individual\")\n\t\t\t$output .= \"</SELECT>\";\n\n\t\tif ($cur_table->search[\"type\"] == \"advanced\")\n\t\t\t$output .= \"</table>\\r\";\n\n\t}\n\n\t$output .= \"<br><br><input type=\\\"submit\\\" name=\\\"Submit\\\" id=\\\"submit\\\" value=\\\"Search\\\"><br><br>\"; //onClick='document.main_form.submit();\n\tif ($ajax)\n\t{\n\t\t$output = \"<a style=\\\"cursor:pointer;\\\" onClick=\\\"new Effect.toggle('$sdivid', 'slide');\\\">Search</a><div id=\\\"$sdivid\\\" style=\\\"display:$display;\\\">\" . $output;\n\t\t$output .= \"</div>\";\n\t}\nreturn $output;\n}", "public function getForms() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('forms' => array(\"formSubject\" => 'searchCode')));\n return (is_array($result)) ? reset($result) : $result;\n }", "public static function formrow(){\n\n\n $forms = \"<tr class='row100 body'>\\n\";\n $forms .= \"<td class='cell100 column1'>\";\n return $forms;\n }", "public function getForm($data = array(), $loadData = true) {\n\t\t// Get the form.\n\n\t\t$form = $this->loadForm('com_smarticons.import', 'import', array('control' => 'jform'));\n\t\tif (empty($form))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn $form;\n\t}", "function form() \r\n {\r\n \t //El formateo va a ser realizado sobre una tabla en la que cada fila es un campo del formulario\r\n $table = &html_table($this->_width,0,2,2);\r\n $table->add_row($this->_showElement(\"Asunto\", '6', \"asunto_de_usuario\", 'Asunto', \"Asunto\", \"left\" )); \r\n $table->add_row($this->_showElement(\"Comentario\", '7', \"comentario\", 'Texto', \"Comentario\", \"left\" )); \r\n \r\n $this->set_form_tabindex(\"Aceptar\", '10'); \r\n $label = html_label( \"submit\" );\r\n $label->add($this->element_form(\"Aceptar\"));\r\n $table->add_row(html_td(\"\", \"left\", $label));\r\n \r\n return $table; \r\n }", "function loadAllOrgniserForms($post,$deviceType,$appVersion,$OSVersion,$browserVersion)\n{\n $UserID = is_require($post, 'UserID');\n $CustomerID = is_require($post, 'CustomerID');\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\n $sql = \"SELECT S.OrgID, UA.UserTypeID FROM \n SCP_Staff AS S \n INNER JOIN SCP_UserAccess AS UA ON UA.UserID='$UserID'\n WHERE S.UserID='$UserID'\";\n\n $resultset = mysql_query($sql);\n $accessRow = mysql_fetch_assoc($resultset); \n //print_r($accessRow); \n\n $OrgID = $accessRow['OrgID'];\n $UserTypeID = $accessRow['UserTypeID'];\n $result = mysql_query(\"call loadAllOrgniserForms('\".$OrgID.\"','\".$UserTypeID.\"');\");\n //CHECK FOR ERROR \n if (!$result) die('Invalid query: ' . mysql_error());\n $orgForms = array();\n while($row = mysql_fetch_assoc($result)) {\n $nrow[] = $row;\n }\n mysql_close($con); //close the connection\n //print_r($nrow); die();\n //while($row = mysql_fetch_assoc($result)) {\n foreach($nrow as $row) {\n $array1['FormID'] = $row['FormID'];\n $array1['FormDataID'] = $row['FormDataID'];\n $array1['FormName'] = $row['FormName'];\n /******************** userformData start *******************/\n $FormDataID = $row['FormDataID'];\n $rowData = callFormValue($CustomerID,$FormDataID);\n $filterFormWithData = $row['FormDataJson'];\n $FormStatus = '0';\n if(!empty($rowData)) {\n $arrFormValueData = unserialize($rowData['FormValueData']);\n $jsonData = json_decode($row['FormDataJson']);\n $filterAllForms = array();\n foreach ($jsonData as $key => $value) {\n $array['component'] = $value->component;\n $array['editable'] = $value->editable;\n $array['index'] = $value->index;\n $array['label'] = $value->label;\n if($value->component == 'signature' || $value->component == 'file') {\n $baseUrlUpload = base_url.\"uploads\";\n $array['value'] = $baseUrlUpload.'/'.$arrFormValueData->$key;\n } else {\n $array['value'] = $arrFormValueData->$key;\n }\n $array['description'] = $value->description;\n $array['placeholder'] = $value->placeholder;\n $array['options'] = $value->options;\n $array['required'] = $value->required;\n $filterAllForms[] = $array;\n }\n $filterFormWithData = json_encode($filterAllForms);\n $FormStatus = '1';\n }\n $array1['FormDataJson'] = $filterFormWithData;\n $array1['FormStatus'] = $FormStatus;\n $array1['FormCompletedDate'] = '';\n /******************** userformData end *******************/ \n $array1['UserID'] = $row['UserID'];\n $array1['StatusID'] = $row['StatusID'];\n $array1['FormType'] = $row['FromType'];\n $array1['UserTypeID'] = $row['UserTypeID'];\n $orgForms[] = $array1;\n }\n //$allForms = loadAllForms($UserTypeID);\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\n $result = mysql_query(\"call loadAllForms('\".$UserTypeID.\"');\");\n if (!$result) die('Invalid query: ' . mysql_error());\n $rows = array();\n while($row = mysql_fetch_assoc($result)) {\n $allForms[] = $row;\n }\n mysql_close($con); //close the connection\n //print_r($allForms); \n $filterAllForms = array();\n foreach ($allForms as $key => $value) {\n if(!in_array_r($value['FormDataID'], $orgForms)) {\n $array['FormID'] = $value['FormID'];\n $array['FormDataID'] = $value['FormDataID'];\n $array['FormName'] = $value['FormName'];/******************** userformData start *******************/\n $FormDataID = $value['FormDataID'];\n $rowData = callFormValue($CustomerID,$FormDataID);\n $filterFormWithData = $value['FormDataJson'];\n $FormStatus = '0';\n if(!empty($rowData)) {\n $arrFormValueData = unserialize($rowData['FormValueData']);\n $jsonData = json_decode($value['FormDataJson']);\n $filterAllForms = array();\n foreach ($jsonData as $key => $value2) {\n $array2['component'] = $value2->component;\n $array2['editable'] = $value2->editable;\n $array2['index'] = $value2->index;\n $array2['label'] = $value2->label;\n if($value2->component == 'signature' || $value2->component == 'file') {\n $baseUrlUpload = base_url.\"uploads\";\n $array2['value'] = $baseUrlUpload.'/'.$arrFormValueData->$key;\n } else {\n $array2['value'] = $arrFormValueData->$key;\n }\n $array2['description'] = $value2->description;\n $array2['placeholder'] = $value2->placeholder;\n $array2['options'] = $value2->options;\n $array2['required'] = $value2->required;\n $filterAllForms[] = $array2;\n }\n $filterFormWithData = json_encode($filterAllForms);\n $FormStatus = '1';\n }\n $array['FormDataJson'] = $filterFormWithData;\n $array['FormStatus'] = $FormStatus;\n $array['FormCompletedDate'] = '';\n /******************** userformData end *******************/ \n $array['UserID'] = $value['UserID'];\n $array['StatusID'] = $value['StatusID'];\n $array['FormType'] = 2;\n $array['UserTypeID'] = $value['UserTypeID'];\n $filterAllForms[] = $array;\n }\n }\n //print_r($orgForms); die();\n $rows = array_merge($orgForms,$filterAllForms);\n if($rows) {\n $data['ResponseData'] = $rows;\n $data['Message'] = \"Get all forms successfully.\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Success\";\n $data['StatusCode'] = \"1\";\n } else {\n $data['ResponseData'] = \"\";\n $data['Message'] = \"Request error\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Failed\";\n $data['StatusCode'] = \"0\";\n }\n print json_encode($data);\n}", "function form_mostrar($conp,$nreg,$pg,$bo,$filtro,$arc,$pefedi,$pefeli){\n\t\t$mempresa = new mempresa();\n\t\t$pa = new mpaginacion();\n\t\t$txt = '';\n\t\t//Creamos el cuadro de buscar (filtros-Busquedas)\n\t\t$txt .= \"<table>\";\n\t\t\t//Una Fila\n\t\t\t$txt .= \"<tr>\";\n\t\t\t\t//1ra Columna - Formulario buscar\n\t\t\t\t$txt .= '<td>';\n\t\t\t\t$txt .= '<form id=\"formfil\" name=\"frmfil\" method=\"GET\" action=\"'.$arc.'\" class=\"txtbold\">';\n\t\t\t\t$txt .= '<input name=\"pg\" type=\"hidden\" value=\"'.$pg.'\" />';\n\t\t\t$txt .= '<input class=\"search-box\" type=\"text\" name=\"filtro\" value=\"'.$filtro.'\" placeholder=\"Nombre De Empresa\"\n\t\t\t\t\tonChange=\"this.form.submit();\">';\n\t\t\t\t\t$txt .= '<label for=\"search-box\"><span class=\"glyphicon fas fa-search search-icon\"></span></label>';\n\t\t\t\t$txt .= '</form>';\n\t\t\t$txt .= '</td>';\n\t\t\t\t//2da Columna control de paginacion\n\t\t\t\t$txt .= \"<td align='right' style='padding-left: 10px;'>\";\n\t\t\t\t\t$bo = \"<input type='hidden' name='filtro' value='\".$filtro.\"' />\";\n\t\t\t\t\t//Llamamos el metodo de contar la cantida de paginas\n\t\t\t\t\t$txt .= $pa->spag($conp,$nreg,$pg,$bo,$arc);\n\t\t\t\t\t//Llamar los datos para completar la paginacion\n\t\t\t\t\t$result = $mempresa->sel_empresa($filtro,$pa->rvalini(),$pa->rvalfin());\n\t\t\t\t$txt .= \"</td>\";\n\t\t\t//Cierre Fila\n\t\t\t$txt .= \"</tr>\";\n\t\t$txt .= \"</table>\";\n\t\t\n\t\tif($result){\n\t\t$txt .= '<div class=\"cuad1\" style=\"width: 90%; \">';\n\t\t\t$txt .= '<table1 width=\"100%\" cellspacing=\"0px\" align=\"center\">';\n\t\t\t\t\t\t\t$txt .= \"<table class='table table-hover'>\";\n\t\t\t\t//Inicio de la (Cabecera_Tb)\t\t\n\t\t\t\t$txt .= '<tr>';\n\t\t\t\t\t$txt .= '<th>';\n\t\t\t\t\t\t$txt .= 'Foto';\n\t\t\t\t\t$txt .= '</th>';\n\t\t\t\t\t$txt .= '<th>';\n\t\t\t\t\t\t$txt .= 'Empresa';\n\t\t\t\t\t$txt .= '</th>';\n\t\t\t\t\t$txt .= '<th></th>';\n\t\t\t\t$txt .= '</tr>';\n\t\t\t\t//Cierre de la (Cabecera_Tb)\n\t\t\t\tforeach ($result as $f) {\n\t\t\t\t//Inicio ROW - Datos de la tabla\n\t\t\t\t$txt .= '<tr>';\n\t\t\t\t\t$txt .= '<td align=\"center\">';\n\t\t\t\t\t$txt .= '<img src=\"'.$f['logemp'].'\" width=\"25px\" />';\n\t\t\t\t\t$txt .= '</td>';\n\t\t\t\t\t$txt .= \"<td class='active lefi'>\";\n\t\t\t\t\t$txt .= \"<span style='font-size: 20px;'><strong>\".$f['nitemp'].\" - \".$f['razsocialemp'].\"</strong></span>\";\n\t\t\t\t\t$txt .= \"<br><strong>Sede: </strong>\".$f['sedecentemp'];\n\t\t\t\t\t$txt .= \"<br><strong>Email: </strong>\".$f['emailemp'];\n\t\t\t\t\t$txt .= \"<br><strong>Telefono: </strong>\".$f['telemp'];\n\t\t\t\t\t$txt .= \"</td>\";\n\t\t\t\t\t\t//ICONOS-MOdificar (Boton)\n\t\t\t\t\t\t$txt .= \"<td class='warning' align='center'>\";\n\t\t\t\t\t\t$txt .= \"<a href='home.php?pg=002&idemp=\".$f['idemp'].\"'><ul class='social-icons icon-circle icon-zoom list-unstyled list-inline'><li><i class='fas fa-pen' title='Actualizar'></i></li></ul></a>\";\n\t\t\t\t\t\t//ICONOS-Eliminar (Boton)\n\t\t\t\t\t\t$txt .= \"<a href='home.php?pg=002&del=\".$f['idemp'].\"'><ul class='social-icons icon-circle icon-zoom list-unstyled list-inline'><li><i class='fas fa-times' title='Eliminar'></i></li></ul></td></a>\";\t\n\t\t\t\t\t\t$txt .= \"</td>\";\n\n\t\t\t\t//Cierre ROW - Datos de la tabla\n\t\t\t\t$txt .= '</tr>';\n\t\t\t\t}\n\t\t\t$txt .= '</table>';\n\t\t\t$txt .= '<BR>';\n\t\t\t\t\t$txt .= '<BR>';\n\t\t\t\t\t$txt .= '<BR>';\n\t\t$txt .= '</div>';\n\t\t}else{\n\t\t$txt .= '<div class=\"cuad\" style=\"width: 90%;\">';\n\t\t$txt .= '<h3>No existen datos registrado en la base de datos...</h3>';\n\t\t$txt .= '</div>';\t\t\n\t}\n\t\techo $txt;\n\t}", "protected function loadFormData()\r\n {\r\n // Check the session for previously entered form data.\r\n $app = JFactory::getApplication();\r\n $data = $app->getUserState('com_data.edit.email.data', array());\r\n\r\n if (empty($data))\r\n {\r\n $data = $this->getItem();\r\n\r\n // Pre-select some filters (Status, Category, Language, Access) in edit form if those have been selected in Article Manager: Articles\r\n if ($this->getState('email.id') == 0)\r\n {\r\n $filters = (array) $app->getUserState('com_data.emails.filter');\r\n $data->set(\r\n 'state',\r\n $app->input->getInt(\r\n 'state',\r\n ((isset($filters['published']) && $filters['published'] !== '') ? $filters['published'] : null)\r\n )\r\n );\r\n\r\n $data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));\r\n $data->set('access',\r\n $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access')))\r\n );\r\n }\r\n }\r\n\r\n // If there are params fieldsets in the form it will fail with a registry object\r\n if (isset($data->params) && $data->params instanceof Registry)\r\n {\r\n $data->params = $data->params->toArray();\r\n }\r\n\r\n $this->preprocessData('com_data.email', $data);\r\n\r\n return $data;\r\n }", "function readForm() {\n\t\t$this->FiscaalGroepID = $this->formHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->formHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->formHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->formHelper(\"GewijzigdOp\", \"\");\n\t}", "public function get($args) {\n if (!SessionManager::instance()->authenticate_session($args))\n return array(\"result\" => \"failed\",\n \"reason\" => \"authentication failed\");\n\n $email = $args[\"email\"];\n $extra_conditions = \"\";\n if (isset($args[\"owner_email\"])) {\n $owner_email = $args[\"owner_email\"];\n $extra_conditions .= \" AND i.email = '$owner_email'\";\n }\n\n if (isset($args[\"keyword\"])) {\n $keyword = $args[\"keyword\"];\n $extra_conditions .= \" AND (i.iname LIKE '%$keyword%' OR i.idesc LIKE '%$keyword%')\";\n }\n\n if (isset($args[\"cname\"])) {\n $cname = $args[\"cname\"];\n $extra_conditions .= \" AND i.cname = '$cname'\";\n }\n\n\n try {\n $conn = Backend::instance()->get_db_conn();\n $r = Backend::instance()->sql_for_result(\n $conn,\n \"SELECT DISTINCT RAWTOHEX(i.item_id) as item_id, i.iname, i.idesc, i.price, i.cname, i.email, i.post_date \" .\n \"FROM tbl_item i, tbl_user_group ug2, tbl_user_group ug \" .\n \"WHERE ug.email = '$email' AND ug2.gname = ug.gname AND ug2.email = i.email\" .\n $extra_conditions .\n \" ORDER BY i.post_date DESC\");\n } catch (Exception $e) {\n $r = NULL;\n }\n\n $item_arr = [];\n if ($r) {\n while ($item = sql_extract_assoc($r)) {\n array_push($item_arr,\n array(\n \"item_id\" => $item[\"ITEM_ID\"],\n \"iname\" => $item[\"INAME\"],\n \"idesc\" => $item[\"IDESC\"],\n \"cname\" => $item[\"CNAME\"],\n \"email\" => $item[\"EMAIL\"],\n \"price\" => $item[\"PRICE\"],\n \"post_date\" => $item[\"POST_DATE\"]));\n }\n Backend::instance()->sql_close_result($r);\n }\n \n return array(\"result\" => \"success\",\n \"items\" => $item_arr);\n }", "abstract function performQueryAll(Form $arg0, $fields = '');", "public function getForm($data = array(), $loadData = true)\n\t{\n\t\t// Get the form.\n\t\t$form = $this->loadForm(\n\t\t\t'com_bookingmanager.customer',\n\t\t\t'customer',\n\t\t\tarray(\n\t\t\t\t'control' => 'jform',\n\t\t\t\t'load_data' => $loadData\n\t\t\t)\n\t\t);\n\n\t\tif (empty($form))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $form;\n\t}", "public function getSearchForm()\n {\n $data = $this->getFilterTableDataForSearchForm();\n\n $selector = $this->getSelector();\n $out = $selector->buildFilterTable($data);\n\n return $out;\n }", "public function sendMail_get() {\n extract($_GET);\n $data=$_GET; \n $response = $this->QuotationForEnquiry_model->contact_admin($data);\n return $this->response($response);\n }", "function clsRecordemails()\r\n {\r\n\r\n global $FileName;\r\n $this->Visible = true;\r\n $this->Errors = new clsErrors();\r\n $this->ds = new clsemailsDataSource();\r\n $this->ReadAllowed = false;\r\n $this->InsertAllowed = false;\r\n $this->UpdateAllowed = false;\r\n $this->DeleteAllowed = false;\r\n $this->Visible = (CCSecurityAccessCheck(\"1;2\") == \"success\");\r\n if($this->Visible)\r\n {\r\n $this->ReadAllowed = CCUserInGroups(CCGetGroupID(), \"1;2\");\r\n $this->InsertAllowed = CCUserInGroups(CCGetGroupID(), \"1;2\");\r\n $this->ComponentName = \"emails\";\r\n $this->HTMLFormAction = $FileName . \"?\" . CCAddParam(CCGetQueryString(\"QueryString\", \"\"), \"ccsForm\", $this->ComponentName);\r\n $CCSForm = CCGetFromGet(\"ccsForm\", \"\");\r\n $this->FormSubmitted = ($CCSForm == $this->ComponentName);\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n $this->message = new clsControl(ccsTextArea, \"message\", \"Message\", ccsMemo, \"\", CCGetRequestParam(\"message\", $Method));\r\n $this->Insert = new clsButton(\"Insert\");\r\n $this->item_id = new clsControl(ccsHidden, \"item_id\", \"Item Id\", ccsInteger, \"\", CCGetRequestParam(\"item_id\", $Method));\r\n $this->to_user_id = new clsControl(ccsHidden, \"to_user_id\", \"To User Id\", ccsInteger, \"\", CCGetRequestParam(\"to_user_id\", $Method));\r\n $this->from_user_id = new clsControl(ccsHidden, \"from_user_id\", \"From User Id\", ccsInteger, \"\", CCGetRequestParam(\"from_user_id\", $Method));\r\n $this->emaildate = new clsControl(ccsHidden, \"emaildate\", \"date\", ccsInteger, \"\", CCGetRequestParam(\"emaildate\", $Method));\r\n $this->subject = new clsControl(ccsHidden, \"subject\", \"Subject\", ccsText, \"\", CCGetRequestParam(\"subject\", $Method));\r\n if(!$this->FormSubmitted) {\r\n if(!strlen($this->from_user_id->GetValue()))\r\n $this->from_user_id->SetValue(CCGetUserID());\r\n if(!strlen($this->emaildate->GetValue()))\r\n $this->emaildate->SetValue(time());\r\n }\r\n }\r\n }", "public function getForm($data = array(), $loadData = true)\r\n\t{\r\n\t\t// Get the form.\r\n\t\t$form = $this->loadForm('com_fabrik.content-type', 'content-type', array('control' => 'jform', 'load_data' => $loadData));\r\n\r\n\t\tif (empty($form))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn $form;\r\n\t}", "function civicrm_api3_contact_getttpquick($params) {\n $result = array();\n $name = mysql_real_escape_string ($params['name']);\n $N= $params[\"option_limit\"];\n if (!is_numeric($N)) throw new Exception(\"invalid option.limit value\");\n if ($N>999) $N=999;\n $return_array = explode(\",\", mysql_real_escape_string($params[\"return\"]));\n if (!$return_array[0]) { // for some reasons, escape doesn't always work (lost mysql connection?)\n $return_array = array (\"sort_name\",\"email\");\n }\n $fields = civicrm_api(\"contact\",\"getfields\",array(\"version\"=>3));\n unset($fields[\"value\"][\"api_key\"]); // security blacklist\n unset($fields[\"value\"][\"id\"]); // security blacklist\n $fields = $fields['values'];\n $fields[\"email\"]=1;\n foreach ($return_array as $k => &$v) {\n if (!array_key_exists($v,$fields))\n unset($return_array[$k]);\n }\n require_once 'CRM/Contact/BAO/Contact/Permission.php';\n list($aclFrom, $aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause('civicrm_contact');\n\n if ($aclWhere) {\n $where = \" AND $aclWhere \";\n }\n\n\n $return = \"civicrm_contact.id, email, \". implode (\",\",$return_array);\n if (!$params['with_email_only'] && strlen ($name) < $params['fastSearchLimit']) { // start with a quick and dirty\n\n $sql = \"SELECT civicrm_contact.id, sort_name FROM civicrm_contact $aclFrom WHERE $aclWhere AND sort_name LIKE '$name%' ORDER BY sort_name LIMIT $N\";\n $dao = CRM_Core_DAO::executeQuery($sql);\n if($dao->N == $N) { \n while($dao->fetch()) {\n $result[$dao->id] = array (id=>$dao->id, \"sort_name\"=>$dao->sort_name);\n }\n return civicrm_api3_create_success($result, $params, 'Contact', 'getgoodquick');\n }\n }\n // search on name and first name\n if ($params['with_email_only']) \n $join = \"JOIN\";\n else \n $join = \"LEFT JOIN\";\n\n $sql = \"\n SELECT $return \n FROM civicrm_contact $aclFrom\n $join civicrm_email ON civicrm_email.contact_id = civicrm_contact.id \n WHERE (first_name LIKE '$name%' OR sort_name LIKE '$name%')\n AND $aclWhere \n ORDER BY sort_name LIMIT $N\";\n $dao = CRM_Core_DAO::executeQuery($sql);\n while($dao->fetch()) {\n $result[$dao->id] = array ('id'=>$dao->id, \"sort_name\"=>$dao->sort_name);\n foreach ($return_array as $r)\n if (!empty($dao->$r)) \n $result[$dao->id][$r] = $dao->$r;\n }\n\n // if matches found less than 15, try to find more \n if($dao->N < $N) { \n $limit = $N - $dao->N;\n if (strpos ($name,\" \") === false) {\n // find the match from email table \n $sql = \" \n SELECT $return \n FROM civicrm_email, civicrm_contact $aclFrom\n WHERE email LIKE '$name%' \n AND civicrm_email.contact_id = civicrm_contact.id\n AND $aclWhere \n ORDER BY sort_name \n LIMIT $limit\"; \n } else {\n $names= explode (\" \", $name);\n if (count($names)>2) {\n $where = \" WHERE display_name LIKE '%$name%'\";\n } else {\n $where = \" WHERE sort_name LIKE '{$names[0]}, {$names[1]}%' OR sort_name LIKE '{$names[1]}%, {$names[0]}' \";\n }\n $sql = \" \n SELECT $return \n FROM civicrm_contact $aclFrom\n $join civicrm_email ON civicrm_email.contact_id = civicrm_contact.id \n $where \n AND $aclWhere \n ORDER BY sort_name \n LIMIT $limit\"; \n }\n $dao = CRM_Core_DAO::executeQuery($sql); \n while($dao->fetch()) {\n $result[$dao->id] = array (id=>$dao->id, \"sort_name\"=>$dao->sort_name);\n foreach ($return_array as $r)\n if (!empty($dao->$r)) \n $result[$dao->id][$r] = $dao->$r;\n }\n }\n if (count ($result)<$N) { // scrapping the %bottom%\n $sql = \"\n SELECT $return \n FROM civicrm_contact $aclFrom\n LEFT JOIN civicrm_email ON civicrm_email.contact_id = civicrm_contact.id \n WHERE (sort_name LIKE '%$name%')\n AND $aclWhere \n ORDER BY sort_name LIMIT \". ($N - count ($result));\n $dao = CRM_Core_DAO::executeQuery($sql);\n while($dao->fetch()) {\n $result[$dao->id] = array (id=>$dao->id, \"sort_name\"=>$dao->sort_name);\n foreach ($return_array as $r)\n if (!empty($dao->$r)) \n $result[$dao->id][$r] = $dao->$r;\n }\n }\n \n if (count ($result)<$N && (strpos($name,\".\") !== false || strpos($name,\"@\"))) {\n // fetching on %email% if the string contains @ or . \n $sql = \"\n SELECT $return \n FROM civicrm_contact $aclFrom\n LEFT JOIN civicrm_email ON civicrm_email.contact_id = civicrm_contact.id \n WHERE (email LIKE '%$name%')\n AND $aclWhere \n ORDER BY sort_name LIMIT \". ($N - count ($result));\n $dao = CRM_Core_DAO::executeQuery($sql);\n while($dao->fetch()) {\n $result[$dao->id] = array (id=>$dao->id, \"sort_name\"=>$dao->sort_name);\n foreach ($return_array as $r)\n if (!empty($dao->$r)) \n $result[$dao->id][$r] = $dao->$r;\n }\n\n }\n\n return civicrm_api3_create_success($result, $params, 'Contact', 'getttpquick');\n}", "public function loadAllFieldsData()\n {\n // prepare request\n $sth = self::$connection->prepare('SELECT * FROM fields ORDER BY field_order ASC');\n // run it\n $sth->execute();\n\n // check if not empty or error\n if (self::$data = $sth->fetchAll(PDO::FETCH_ASSOC)) {\n // return answer\n return self::$data;\n }\n\n return false;\n }", "public function getForm($form_id, $item){\n \n $inPage = cmsPage::getInstance();\n\n\t$html = '';\n \n\tglobal $_LANG;\n \n\t//GET FORM DATA\n\t$sql = \"SELECT * FROM cms_forms\tWHERE id = $form_id\";\n\t$result = $this->inDB->query($sql);\n\t\n\tif (!$this->inDB->num_rows($result)) { return false; }\n\n $form = $this->inDB->fetch_assoc($result);\n \n //BUILD FORM\n if($form['description']) { $html .= '<div id=\"formdesc\">'.$form['description'].'</div>'; }\n\n //GET FIELDS DATA\n $sql = \"SELECT * FROM cms_form_fields WHERE form_id = $form_id ORDER BY ordering ASC\";\n $result = $this->inDB->query($sql);\n \n if ($this->inDB->num_rows($result)){\n //BUILD FORM FIELDS\n $html .= '<table class=\"coplaint_forma\">';\n while ($field = $this->inDB->fetch_assoc($result)) {\n $html .= '<tr><td class=\"fieldtitle\"><strong>'.$field['title'].'</strong>';\n \n if($field['mustbe']==1){\n $html .= '<span class=\"star\">*</span>';\n }\n \n if(is_array($item['fields'])){\n if (array_key_exists($field['id'], $item['fields'])){\n $default = $item['fields'][$field['id']];\n $default = str_replace('&quot;', '\"', $default);\n } else {\n $default = '';\n }\n }\n \n $html .= '</td></tr><tr><td class=\"fieldvalue\">'.$inPage->buildFormField(1, $field, $default);\n if(is_array($item['fields'])){\n if (array_key_exists($field['id'], $item['validation'])){\n $html .= '<br /><span class=\"required\">Это поле обязательно для заполнения</span>';\n }\n }\n $html .= '</td></tr>';\n }\n $html .= '</table>';\n } else { $html .= '<p>'.$_LANG['IN_FORM_NOT_FIELDS'].'</p>'; }\n\n\treturn $html;\n\n }", "public function getAllFields() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_field';\n\t\t\t$select_what\t= 'id, vc_field AS vc_name';\n\t\t\t$conditions\t\t= \"1 ORDER BY vc_field ASC\";\n\t\t\t$return\t\t\t= $db->getAllRows_Arr($table, $select_what, $conditions);\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "public function allrecord_get() { \n $result = $this->Api_model->selectData('info', 'id, name, email');\n if($result == null)\n $this->set_response(array('response_code'=>400,'response_message'=>'No Data Found','response_data'=>array()), REST_Controller::HTTP_OK);\n else\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK);\n }", "protected function getListQuery()\n {\n // Create a new query object. \n $db = JFactory::getDBO();\n $query = $db->getQuery(true);\n // Select some fields\n $query->select('id,name,email,published,ordering,bio,dob,gender,image');\n // From the hello table\n $query->from('#__helloworld_message');\n \n \n \n $name = $this->getState('filter.name');\n\t\t\t\t\tif (!empty($name)) {\n\t\t\t\t\t\t$name = $db->Quote($db->escape($name));\n\t\t\t\t\t\t$query->where('name = '. $name);\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\treturn $query;\n }", "public function getForm($data = array(), $loadData = true)\n {\n // Get the form.\n $form = $this->loadForm('com_ketshop.registration', 'registration', array('control' => 'jform', 'load_data' => $loadData));\n\n if(empty($form)) {\n return false;\n }\n\n return $form;\n }", "public function getForm($need = TRUE)\n\t{\n\t\treturn $this->getComponent('form', $need);\n\t}", "function readform() {\n\t\t$this->ftpmirror->name = $_POST['name'];\n\t\t$this->ftpmirror->url = $_POST['url'];\n\t\t$this->ftpmirror->location = $_POST['location'];\n\t\t$this->ftpmirror->email = $_POST['email'];\n\t\t$this->ftpmirror->description = $_POST['description'];\n\t\t$this->ftpmirror->comments = $_POST['comments'];\n\t\t\n\t\t// Validate details\n\t\t$errors = $this->ftpmirror->validate();\n\n\t\treturn $errors;\n\t}", "public function xforms() {\n\t\t\n\t\t/* Load Model */\n\t\t$forms = $this->getModel ( 'form' );\n\t\t\n\t\t/* Get all rows */\n\t\t$forms->getAll ();\n\t\t\n\t\tif (! count ( $forms->rows )) {\n\t\t\t$this->_redirect ( '_newForm' );\n\t\t\treturn;\n\t\t}\n\t\t/* set the view file (optional) */\n\t\t$this->setView ( 'forms' );\n\t\t\n\t\t/* set last view into session */\n\t\t$this->session->returnto ( $this->getView () );\n\t\n\t}", "public function get_form() : ?array\n {\n $form_filtro = array();\n \n $form_filtro['estado'] = $this->estado;\n $form_filtro['cidade'] = $this->cidade;\n $form_filtro['ordem_preco'] = $this->ordem_preco;\n $form_filtro['ordem_data'] = $this->ordem_data;\n $form_filtro['estado_uso'] = $this->estado_uso;\n $form_filtro['preferencia_entrega'] = $this->preferencia_entrega;\n $form_filtro['status_peca'] = $this->status_peca;\n \n return $form_filtro;\n }", "function getEmails() {\n\treturn db_query(\"SELECT email FROM Emails\");\n}", "function email_get_search_form($courseid){\n\n\tglobal $CFG;\n\n\n\t$inputhidden = '<input type=\"hidden\" name=\"courseid\" value=\"'.$courseid.'\" />';\n\n $form = '<form method=\"post\" name=\"searchform\" action=\"'.$CFG->wwwroot.'/blocks/email_list/email/search.php\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" value=\"'.get_string('searchtext', 'block_email_list').'\" name=\"words\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align=\"center\">' .\n\t\t\t\t\t\t\t\t\t\t$inputhidden.'\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"send\" value=\"'.get_string('search').'\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t\t\t<td align=\"center\">\n\t\t\t\t\t\t\t\t<a href=\"'.$CFG->wwwroot.'/blocks/email_list/email/search.php?courseid='.$courseid.'&amp;action=1\">'. get_string('advancedsearch','search') .'</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t</form>';\n\treturn $form;\n}", "function DBDataForm()\n {\n $this->ItemData();\n $this->ItemDataGroups();\n \n $this->InitActions();\n $this->SetPertains();\n\n return\n $this->ItemsForm_Run\n (\n array\n (\n \"FormTitle\" => $this->DBDataFormTitle(),\n \"ID\" => 2,\n \"Name\" => \"Datas\",\n \"Method\" => \"post\",\n \"Action\" => \n \"?Unit=\".$this->GetCGIVarValue(\"Unit\").\n \"&ModuleName=Events&Action=\".\n $this->CGI_Get(\"Action\").\n \"&Event=\".\n $this->GetGET(\"Event\")\n ,\n\n \"Anchor\" => \"TOP\",\n \"Uploads\" => FALSE,\n \"CGIGETVars\" => array(\"Group\",\"Datas\",\"Datas_Sort\",\"Datas_Reverse\"),\n\n\n \"Edit\" => 1,\n \"Update\" => 1,\n\n \"RowMethod\" => \"\",\n \"RowsMethod\" => \"Table_Rows\",\n \"RowMethod\" => \"\",\n \"RowsMethod\" => \"ItemsForm_ItemRows\",\n\n \"DefaultSorts\" => array(\"SortOrder\",\"ID\"),\n \"ReadWhere\" => array\n (\n \"Event\" => $this->Event(\"ID\"),\n \"Pertains\" => $this->ApplicationObj()->Pertains,\n ),\n\n \"IgnoreGETVars\" => array(\"CreateTable\"),\n \"UpdateCGIVar\" => \"Update\",\n \"UpdateCGIValue\" => 1,\n \"UpdateItems\" => array(),\n\n\n \"Group\" => $this->DBDataFormDataGroup(),\n\n \"Edit\" => 1,\n\n \"Items\" => array(),\n \"AddGroup\" => \"Basic\",\n \"AddItem\" => array\n (\n \"Unit\" => $this->Unit(\"ID\"),\n \"Event\" => $this->Event(\"ID\"),\n \"Pertains\" => $this->ApplicationObj()->Pertains,\n \"Friend\" => 3, //default access to friend is edit\n ),\n \"AddDatas\" => array(\"Pertains\",\"DataGroup\",\"SqlKey\",\"Type\",\"SortOrder\",\"Text\",\"Text_UK\"),\n \"UniqueDatas\" => array(\"SqlKey\"),\n \"NCols\" => 20,\n \n \"DetailsMethod\" => \"DBDataFormDetailsCell\",\n \"DetailsSGroups\" => \"GetDetailsSGroups\",\n )\n ).\n $this->DBDataQuest().\n \"\";\n }", "public function getMobileForm()\n {\n list($product_types) = $this->productTypesList();\n\n list($aac) = $this->annualAllowableCutLists();\n list($concession) = $this->concessionList();\n list($developmentunit) = $this->developmentunitList();\n list($managementunit) = $this->managementunitList();\n\n list($client, $transport, $concessionaire) = $this->companiesList();\n\n // mobile form\n\t\t//!!! daca nu are \"fl\" NU pui NotEmpty!!!!\n $formArr = [\n [\n \"f\" => \"ObserveAt\",\n \"fl\" => \"\",\n \"type\" => \"date\"\n ],\n [\n \"f\" => \"MobileId\",\n \"fl\" => \"\",\n \"type\" => \"str\"\n ],\n [\n \"f\" => \"GpsAccu\",\n \"fl\" => \"\",\n \"type\" => \"int\"\n ],\n [\n \"f\" => \"Lat\",\n \"fl\" => \"Lat\",\n \"type\" => \"float_NotEmpty\",\n \"group\" => \"Location\"\n ],\n [\n \"f\" => \"Lon\",\n \"fl\" => \"Lon\",\n \"type\" => \"float\",\n \"group\" => \"Location\"\n ],\n\n [\n \"f\" => \"ScanLat\",\n \"fl\" => \"\",\n \"type\" => \"float\"\n ],\n [\n \"f\" => \"ScanLon\",\n \"fl\" => \"\",\n \"type\" => \"float\"\n ],\n [\n \"f\" => \"ScanGpsAccu\",\n \"fl\" => \"\",\n \"type\" => \"int\"\n ],\n [\n \"f\" => \"Status\", //! 1- generat / 2 - in progress / 3 - finished\n \"fl\" => \"\", // nu trebuie sa faci nimic ... valorile vin hardcoded 1,2,3\n \"type\" => \"int\"\n ],\n\n [\n \"f\" => \"PermitNo\",\n \"fl\" => \"\",\n \"type\" => \"str\"\n ],\n [\n \"f\" => \"PermitNoMobile\", //! asta e OK ... il lasi asa - NU adauga NotEmpty!!!\n \"fl\" => \"\",\n \"type\" => \"str\"\n ],\n [\n \"f\" => \"AnnualAllowableCut\",\n \"fl\" => \"AnnualAllowableCut\",\n \"type\" => \"list_NotEmpty_NoLang\",\n \"values\" => $aac\n ],\n [\n \"f\" => \"ManagementUnit\",\n \"fl\" => \"ManagementUnit\",\n \"type\" => \"list_NotEmpty_NoLang\",\n \"values\" => $managementunit\n ],\n [\n \"f\" => \"DevelopmentUnit\",\n \"fl\" => \"DevelopmentUnit\",\n \"type\" => \"list_NotEmpty_NoLang\",\n \"values\" => $developmentunit\n ],\n [\n \"f\" => \"Concession\",\n \"fl\" => \"Concession\",\n \"type\" => \"list_NotEmpty_NoLang\",\n \"values\" => $concession\n ],\n [\n \"f\" => \"ConcessionaireCompany\",\n \"fl\" => \"ConcessionaireCompany\",\n \"type\" => \"list_NotEmpty_NoLang\",\n \"values\" => $concessionaire\n ],\n [\n \"f\" => \"ClientCompany\",\n \"fl\" => \"ClientCompany\",\n \"type\" => \"list_NotEmpty_NoLang\",\n \"values\" => $client\n ],\n [\n \"f\" => \"TransporterCompany\",\n \"fl\" => \"TransporterCompany\",\n \"type\" => \"list_NotEmpty_NoLang\",\n \"values\" => $transport\n ],\n [\n \"f\" => \"DriverName\",\n \"fl\" => \"DriverName\",\n \"type\" => \"str_NotEmpty\"\n ],\n [\n \"f\" => \"LicensePlate\",\n \"fl\" => \"LicensePlate\",\n \"type\" => \"str_NotEmpty\"\n ],\n [\n \"f\" => \"Province\",\n \"fl\" => \"Province\",\n \"type\" => \"str_NotEmpty\"\n ],\n [\n \"f\" => \"Destination\",\n \"fl\" => \"Destination\",\n \"type\" => \"str_NotEmpty\",\n // \"values\" => $destinations\n ],\n\n\t //! pentru moment e default resource = logs - facut default in DB\n /* [\n \"f\" => \"ProductType\",\n \"fl\" => \"ProductType\",\n \"type\" => \"list_NotEmpty\",\n \"values\" => $product_types //! vezi aici ce faci\n ],\n */\n\t/*\t\t!! not needed yet dar in viitoru apropiat ighen - ighen draga\n\t [\n\t\t\t\t\"f\":\"Photos\",\n\t\t\t\t\"fl\":\"Photos\",\n\t\t\t\t\"type\":\"photo\"\n\t\t\t],\n\t*/\n ];\n\n\n return $formArr;\n }", "public function getAcroForm() {}" ]
[ "0.6425265", "0.63722837", "0.6259364", "0.62215644", "0.6205603", "0.6174275", "0.59410477", "0.589464", "0.58898467", "0.5853461", "0.5797628", "0.574772", "0.57431763", "0.5741406", "0.570083", "0.5668568", "0.5650954", "0.5633477", "0.56190294", "0.56185323", "0.5615549", "0.5602869", "0.55633414", "0.5559666", "0.55517036", "0.5545464", "0.55391794", "0.5533673", "0.55064833", "0.55036485", "0.5490207", "0.54735404", "0.5472373", "0.5466199", "0.5465188", "0.54605895", "0.54605144", "0.54517674", "0.54500145", "0.54293925", "0.54271615", "0.5426703", "0.5425675", "0.541883", "0.5410422", "0.53998476", "0.53919584", "0.53902036", "0.5385232", "0.5374428", "0.53721476", "0.53604186", "0.5357171", "0.5356133", "0.5347927", "0.5336195", "0.5336099", "0.53275645", "0.53227264", "0.53194153", "0.5314787", "0.53106755", "0.53104913", "0.5310077", "0.5273188", "0.5262265", "0.52509934", "0.52411926", "0.52389634", "0.52365994", "0.5235369", "0.5235017", "0.5233309", "0.5230204", "0.5229039", "0.52285016", "0.52285004", "0.5226299", "0.5223863", "0.52194256", "0.5209456", "0.5208521", "0.5208228", "0.52068204", "0.52039313", "0.52025974", "0.52016014", "0.520129", "0.52010334", "0.5189863", "0.51843804", "0.5168052", "0.51662815", "0.5161905", "0.51604635", "0.5159991", "0.5158041", "0.5157342", "0.5155284", "0.51495665" ]
0.79565746
0
end of getForm() ==== setForm() ========================================================= Upload the contact form data into the database. Parameters: $arr associated array of contact form data Return: TRUE insertion of contact form successful FALSE unsccessful insertion of contact form ========================================================================
protected function setForm(array $arr) { $sql = "INSERT INTO " . $this->formsTableName . " (name, email, telNum, persFavFood, msg, rating, retCust, favCat, ts) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"; $stmt = $this->connect()->prepare($sql); $res = $stmt->execute([$arr['name'], $arr['email'], $arr['telNum'], $arr['persFavFood'], $arr['msg'], $arr['rating'], $arr['retCust'], $arr['favCat'], $arr['ts']]); if($res){ return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SaveForm($form_data) {\n $this->db->insert('adebiti', $form_data);\n if ($this->db->affected_rows() == '1') {\n return TRUE;\n }\n return FALSE;\n }", "public function processFormData($arrPost, $arrForm, $arrFiles)\n {\n\t\tif(!$arrForm['csvExport']){\n\t\t\treturn;\n\t\t}\n\n if(is_array($arrPost))\n {\n $objFormSubmission = new FormDbModel();\n $objFormSubmission->tstamp = time();\n $objFormSubmission->submitted_date = time();\n $objFormSubmission->form_data = json_encode($arrPost);\n $objFormSubmission->form_name = $arrForm['title'];\n\t\t\t$objFormSubmission->pid = $arrForm['id'];\n\t\t\t$objFormSubmission->save();\n }\n }", "function SaveForm($form_data)\n\t{\n\t\t$this->db->insert('gig_table', $form_data);\n\t\tif ($this->db->affected_rows() == '1')\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function SaveForm($form_data)\r\n {\r\n $this->db->insert($this->table, $form_data);\r\n\r\n if ($this->db->affected_rows() == '1')\r\n {\r\n return TRUE;\r\n }\r\n\r\n return FALSE;\r\n }", "function SaveForm($form_data)\n\t{\n\t\t$this->db->insert($this->table, $form_data);\n\t\t\n\t\tif ($this->db->affected_rows() == '1')\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "private function saveForm()\n {\n \tglobal $core;\n\n\t\t// Form ID check\n\t\tif (!empty($_POST['mj_form_id']) &&\n\t\t\tfilter_var($_POST['mj_form_id'], FILTER_VALIDATE_INT) === false) {\n\t\t\t$core->error->add(sprintf(__('Unknown form of ID “%s”.'), $_POST['mj_form_id']));\n\t\t}\n\n \t// Form name check\n \tif (empty($_POST['mj_form_name'])) {\n \t\t$core->error->add(__('Please enter a form name.'));\n \t} elseif (strlen($_POST['mj_form_name']) > 50) {\n \t\t$core->error->add(__('The form name is too long.'));\n \t}\n\n \t// Form data handler check, only if we are creating a new form\n\t\tif (empty($_POST['mj_form_id'])) {\n\t\t\tif (empty($_POST['mj_form_action'])) {\n\t\t\t\t$core->error->add(__('Please choose a handler for the form results.'));\n\t\t\t} else if (!in_array($_POST['mj_form_action'], majordome::getDataHandlerList())) {\n\t\t\t\t$core->error->add(__('The chosen data handler does not exists.'));\n\t\t\t}\n\t\t}\n\n \t// Form fields check\n \tif (empty($_POST['mj_form_content'])) {\n\t\t\t/* If we are editing an existing form, an empty content means that\n\t\t\t * it is unchanged\n\t\t\t */\n\t\t\tif (isset($_POST['mj_form_id']) && isset($this->form_data)) {\n\t\t\t\t$_POST['mj_form_content'] = $this->form_data->form_fields;\n\t\t\t} else {\n\t\t\t\t$core->error->add(__('The form has no field.'));\n\t\t\t}\n \t}\n\n \tif ($core->error->flag() === false) {\n \t\t// The form is valid, we store the result in the DB\n\n\t\t\tif (empty($_POST['mj_form_id'])) {\n\t\t\t\t// We create a new form\n\t\t\t\t$success = majordomeDBHandler::insert($_POST['mj_form_name'], $_POST['mj_form_desc'], $_POST['mj_form_action'], $_POST['mj_form_content']);\n\n\t\t\t\tif ($success) {\n\t\t\t\t\t// The form has been successfully created, so we hide this page from the view\n\t\t\t\t\tdcPage::addSuccessNotice(__('The form has been successfully created.'));\n\t\t\t\t\t$this->hidden = true;\n\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t$core->error->add(sprintf(__('An unknown error occurred. The form could not be created.'), html::escapeHTML($_POST['mj_form_name'])));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We update the existing form\n\t\t\t\ttry {\n\t\t\t\t\tmajordomeDBHandler::update($_POST['mj_form_id'], $_POST['mj_form_name'], $_POST['mj_form_desc'], $_POST['mj_form_content']);\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$core->error->add(sprintf(__('An unknown error occurred: %s.'), $e->getMessage()));\n\t\t\t\t}\n\n\t\t\t\t// The form has been successfully created, so we hide this page from the view\n\t\t\t\tdcPage::addSuccessNotice(__('The form has been successfully updated.'));\n\t\t\t\t$this->hidden = true;\n\t\t\t\treturn true;\n\t\t\t}\n \t}\n\n\t\treturn false;\n\t}", "function updateContact($sfConn, $dataArray){\n\t\techo(\"<P> updateContact \");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\t\t\techo(\"<P> Set records to Contact \");\n $sObject = new sObject();\n $sObject->type = 'Contact'; \n $sObject->fields = $fieldset;\n \t$sObject->Id = $fieldset[iaa_id];\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll \");\n $success = update_objects($sfConn, $sObjects);\n return $success; \n }", "protected function handleSave()\n {\n require_once('modules/Campaigns/utils.php');\n require_once(\"include/formbase.php\");\n $lead = false;\n if (!empty($_REQUEST['record']))\n {\n $lead = BeanFactory::getBean('Leads', $_REQUEST['record']);\n }\n\n global $beanList;\n $this->loadDefs();\n $beans = array();\n $selectedBeans = array();\n $selects = array();\n //Make sure the contact object is availible for relationships.\n $beans['Contacts'] = BeanFactory::newBean('Contacts');\n $beans['Contacts']->id = create_guid();\n $beans['Contacts']->new_with_id = true;\n\n // Bug 39287 - Check for Duplicates on selected modules before save\n if (!empty($_REQUEST['selectedContact']))\n {\n $beans['Contacts']->retrieve($_REQUEST['selectedContact']);\n if (!empty($beans['Contacts']->id))\n {\n $beans['Contacts']->new_with_id = false;\n unset($_REQUEST[\"convert_create_Contacts\"]);\n unset($_POST[\"convert_create_Contacts\"]);\n }\n }\n elseif (!empty($_REQUEST[\"convert_create_Contacts\"]) && $_REQUEST[\"convert_create_Contacts\"] != \"false\" && !isset($_POST['ContinueContact']))\n {\n $contactForm = new ContactFormBase();\n $duplicateContacts = $contactForm->checkForDuplicates('Contacts');\n\n if (isset($duplicateContacts))\n {\n echo $contactForm->buildTableForm($duplicateContacts, 'Contacts');\n return;\n }\n $this->new_contact = true;\n } elseif (isset($_POST['ContinueContact'])) {\n $this->new_contact = true;\n }\n // Accounts\n if (!empty($_REQUEST['selectedAccount']))\n {\n $_REQUEST['account_id'] = $_REQUEST['selectedAccount'];\n unset($_REQUEST[\"convert_create_Accounts\"]);\n unset($_POST[\"convert_create_Accounts\"]);\n }\n elseif (!empty($_REQUEST[\"convert_create_Accounts\"]) && $_REQUEST[\"convert_create_Accounts\"] != \"false\" && empty($_POST['ContinueAccount']))\n {\n $accountForm = new AccountFormBase();\n $duplicateAccounts = $accountForm->checkForDuplicates('Accounts');\n if (isset($duplicateAccounts))\n {\n echo $accountForm->buildTableForm($duplicateAccounts);\n return;\n }\n }\n\n foreach ($this->defs as $module => $vdef)\n {\n //Create a new record if \"create\" was selected\n \tif (!empty($_REQUEST[\"convert_create_$module\"]) && $_REQUEST[\"convert_create_$module\"] != \"false\")\n {\n //Save the new record\n\t if (empty($beans[$module]))\n\t \t$beans[$module] = BeanFactory::newBean($module);\n\n \t$this->populateNewBean($module, $beans[$module], $beans['Contacts'], $lead);\n\n // when creating a new contact, create the id for linking with other modules\n // and do not populate it with lead's old account_id\n if ($module == 'Contacts')\n {\n $beans[$module]->id = create_guid();\n $beans[$module]->new_with_id = true;\n $beans[$module]->account_id = '';\n }\n }\n //If an existing bean was selected, relate it to the contact\n else if (!empty($vdef['ConvertLead']['select']))\n {\n //Save the new record\n $select = $vdef['ConvertLead']['select'];\n $fieldDef = $beans['Contacts']->field_defs[$select];\n if (!empty($fieldDef['id_name']) && !empty($_REQUEST[$fieldDef['id_name']]))\n {\n $beans['Contacts']->{$fieldDef['id_name']} = $_REQUEST[$fieldDef['id_name']];\n $selects[$module] = $_REQUEST[$fieldDef['id_name']];\n if (!empty($_REQUEST[$select]))\n {\n $beans['Contacts']->$select = $_REQUEST[$select];\n }\n // Bug 39268 - Add the existing beans to a list of beans we'll potentially add the lead's activities to\n $selectedBeans[$module] = BeanFactory::getBean($module, $_REQUEST[$fieldDef['id_name']]);;\n // If we selected the Contact, just overwrite the $beans['Contacts']\n if ($module == 'Contacts')\n {\n $beans[$module] = $selectedBeans[$module];\n }\n }\n }\n }\n\n $this->handleActivities($lead, $beans);\n // Bug 39268 - Add the lead's activities to the selected beans\n $this->handleActivities($lead, $selectedBeans);\n\n //link selected account to lead if it exists\n if (!empty($selectedBeans['Accounts']))\n {\n $lead->account_id = $selectedBeans['Accounts']->id;\n }\n \n // link account to contact, if we picked an existing contact and created a new account\n if (!empty($beans['Accounts']->id) && !empty($beans['Contacts']->account_id) \n && $beans['Accounts']->id != $beans['Contacts']->account_id)\n {\n $beans['Contacts']->account_id = $beans['Accounts']->id;\n }\n \n // Saving beans with priorities.\n // Contacts and Accounts should be saved before lead activities to create correct relations\n $saveBeanPriority = array('Contacts', 'Accounts');\n $tempBeans = array();\n\n foreach ($saveBeanPriority as $name)\n {\n if (isset($beans[$name]))\n {\n $tempBeans[$name] = $beans[$name];\n }\n }\n\n $beans = array_merge($tempBeans, $beans);\n unset($tempBeans);\n\n $calcFieldBeans = array();\n //Handle non-contacts relationships\n foreach ($beans as $bean)\n {\n if (!empty($lead))\n {\n if(empty($bean->team_name))\n {\n $bean->team_id = $lead->team_id;\n $bean->team_set_id = $lead->team_set_id;\n }\n if (empty($bean->assigned_user_id))\n {\n $bean->assigned_user_id = $lead->assigned_user_id;\n }\n $leadsRel = $this->findRelationship($bean, $lead);\n if (!empty($leadsRel))\n {\n $bean->load_relationship($leadsRel);\n $relObject = $bean->$leadsRel->getRelationshipObject();\n if ($relObject->relationship_type == \"one-to-many\" && $bean->$leadsRel->_get_bean_position())\n {\n $id_field = $relObject->rhs_key;\n $lead->$id_field = $bean->id;\n }\n else\n {\n $bean->$leadsRel->add($lead->id);\n }\n }\n }\n //Special case code for opportunities->Accounts\n if ($bean->object_name == \"Opportunity\" && empty($bean->account_id))\n {\n if (isset($beans['Accounts']))\n {\n $bean->account_id = $beans['Accounts']->id;\n $bean->account_name = $beans['Accounts']->name;\n }\n else if (!empty($selects['Accounts']))\n {\n $bean->account_id = $selects['Accounts'];\n }\n }\n\n //create meetings-users relationship\n if ($bean->object_name == \"Meeting\")\n {\n $bean = $this->setMeetingsUsersRelationship($bean);\n }\n $this->copyAddressFields($bean, $beans['Contacts']);\n\n $bean->save();\n //if campaign id exists then there should be an entry in campaign_log table for the newly created contact: bug 44522\n if (isset($lead->campaign_id) && $lead->campaign_id != null && $bean->object_name == \"Contact\")\n {\n campaign_log_lead_or_contact_entry($lead->campaign_id, $lead, $beans['Contacts'], 'contact');\n }\n\n //iterate through each field in field map and check meta for calculated fields\n foreach ($bean->field_defs as $calcFieldDefs) {\n if (!empty($calcFieldDefs['calculated'])) {\n //bean has a calculated field, lets add it to the array for later processing\n $calcFieldBeans[] = $bean;\n break;\n }\n }\n\n }\n if (!empty($lead))\n {\t//Mark the original Lead converted\n $lead->status = \"Converted\";\n $lead->converted = '1';\n $lead->in_workflow = true;\n $lead->save();\n }\n\n //IF beans have calculated fields, re-save now that all beans and relationships have been updated\n foreach ($calcFieldBeans as $calcFieldBean) {\n //refetch bean and save to update Calculated Fields.\n $calcFieldBean->retrieve($calcFieldBean->id);\n $calcFieldBean->save();\n }\n\n $this->displaySaveResults($beans);\n }", "public static function insert()\n {\n if (isset($_POST['name'], \n $_POST['telephone'],\n $_POST['mobile'],\n $_POST['email'],\n $_POST['clientid'])) {\n ContactDAO::create($_POST['name'], \n $_POST['telephone'],\n $_POST['mobile'],\n $_POST['email'],\n $_POST['clientid']);\n }\n }", "protected function saveFormData($form_data, $contact_data, &$form_record=array())\n {\n // first check the contact data\n $contact_id = -1;\n\n if (!empty($contact_data) && isset($contact_data['communication_email'])) {\n // check the contact information and create a new or update an existing record\n\n if (false !== ($contact_id = $this->app['contact']->existsLogin($contact_data['communication_email']))) {\n // this contact already exists!\n $contact = $this->app['contact']->select($contact_id);\n $data = array();\n\n foreach ($contact['person'][0] as $key => $value) {\n if (isset($contact_data[$key]) && !empty($contact_data[$key]) &&\n ($contact_data[$key] != $value)) {\n $data['person'][0]['contact_id'] = $contact_id;\n $data['person'][0]['person_id'] = $contact['person'][0]['person_id'];\n $data['person'][0][$key] = $contact_data[$key];\n }\n }\n\n foreach ($contact['address'][0] as $key => $value) {\n if (isset($contact_data[$key]) && !empty($contact_data[$key]) &&\n ($contact_data[$key] != $value)) {\n $data['address'][0]['contact_id'] = $contact_id;\n $data['address'][0]['address_id'] = $contact['address'][0]['address_id'];\n $data['address'][0][$key] = $contact_data[$key];\n }\n }\n\n $phone_checked = false;\n foreach ($contact['communication'] as $communication) {\n // update existing communication entries\n if (($communication['communication_type'] == 'EMAIL') &&\n ($communication['communication_usage'] == 'PRIMARY') &&\n !empty($contact_data['communication_email']) &&\n ($communication['communication_value'] != $contact_data['communication_email'])) {\n $data['communication'][] = array(\n 'contact_id' => $contact_id,\n 'communication_id' => $communication['communication_id'],\n 'communication_value' => $contact_data['communication_email']\n );\n }\n elseif (($communication['communication_type'] == 'PHONE') &&\n ($communication['communication_usage'] == 'PRIMARY') &&\n !empty($contact_data['communication_phone']) &&\n ($communication['communication_value'] != $contact_data['communication_phone'])) {\n $data['communication'][] = array(\n 'contact_id' => $contact_id,\n 'communication_id' => $communication['communication_id'],\n 'communication_value' => $contact_data['communication_phone']\n );\n $phone_checked = true;\n }\n }\n\n\n if (!$phone_checked && !empty($contact_data['communication_phone'])) {\n // add a communication entry for the phone\n $data['communication'][] = array(\n 'contact_id' => $contact_id,\n 'communication_id' => -1,\n 'communication_type' => 'PHONE',\n 'communication_value' => $contact_data['communication_phone'],\n 'communication_usage' => 'PRIMARY'\n );\n }\n\n\n if (!empty($data)) {\n $data['contact']['contact_id'] = $contact_id;\n if (!$this->app['contact']->update($data, $contact_id)) {\n return false;\n }\n }\n }\n else {\n // create a new contact\n $data = array(\n 'contact' => array(\n 'contact_id' => -1,\n 'contact_name' => $contact_data['communication_email'],\n 'contact_login' => $contact_data['communication_email'],\n 'contact_type' => 'PERSON'\n ),\n 'person' => array(\n array(\n 'contact_id' => -1,\n 'person_id' => -1,\n 'person_gender' => isset($contact_data['person_gender']) ? $contact_data['person_gender'] : 'MALE',\n 'person_title' => isset($contact_data['person_title']) ? $contact_data['person_title'] : 'NO_TITLE',\n 'person_first_name' => isset($contact_data['person_first_name']) ? $contact_data['person_first_name'] : '',\n 'person_last_name' => isset($contact_data['person_last_name']) ? $contact_data['person_last_name'] : '',\n 'person_nick_name' => isset($contact_data['person_nick_name']) ? $contact_data['person_nick_name'] : '',\n 'person_birthday' => isset($contact_data['person_birthday']) ? $contact_data['person_birthday'] : '0000-00-00'\n )\n ),\n 'address' => array(\n array(\n 'contact_id' => -1,\n 'address_id' => -1,\n 'address_type' => 'PRIMARY', // PRIVATE is no longer in use,\n 'address_street' => isset($contact_data['address_street']) ? $contact_data['address_street'] : '',\n 'address_zip' => isset($contact_data['address_zip']) ? $contact_data['address_zip'] : '',\n 'address_city' => isset($contact_data['address_city']) ? $contact_data['address_city'] : ''\n )\n ),\n 'communication' => array(\n array(\n 'contact_id' => -1,\n 'communication_id' => -1,\n 'communication_type' => 'EMAIL',\n 'communication_value' => $contact_data['communication_email'],\n 'communication_usage' => 'PRIMARY'\n ),\n array(\n 'contact_id' => -1,\n 'communication_id' => -1,\n 'communication_type' => 'PHONE',\n 'communication_value' => isset($contact_data['communication_phone']) ? $contact_data['communication_phone'] : '',\n 'communication_usage' => 'PRIMARY'\n )\n )\n );\n if (!$this->app['contact']->insert($data, $contact_id)) {\n // problem inserting the new contact!\n return false;\n }\n }\n\n // check if the TAG `FORMS` exists and create it if needed\n if (!$this->app['contact']->existsTagName('FORMS')) {\n $this->app['contact']->createTagName('FORMS',\n $this->app['translator']->trans('This tag will be assigned to all user-defined `Contact` forms.'));\n }\n\n $tags = array();\n $tags[] = 'FORMS';\n\n if (isset($contact_data['tags']) && !empty($contact_data['tags'])) {\n // check user defined TAGS\n if (false !== strpos($contact_data['tags'], ',')) {\n $user_tags = explode(',', $contact_data['tags']);\n foreach ($user_tags as $user_tag) {\n $user_tag = strtoupper(trim($user_tag));\n if (!empty($user_tag)) {\n // check the TAG\n $tag_name = null;\n if (!$this->app['contact']->validateTagName($user_tag, $tag_name)) {\n // failed the tag name check!\n $this->app['monolog']->addDebug('The user defined TAG '.$user_tag.' failed the tag name check!');\n continue;\n }\n if (!$this->app['contact']->existsTagName($tag_name)) {\n // create the TAG\n $this->app['contact']->createTagName($tag_name,\n sprintf('This tag was automatically generated for the form %s', self::$form_name));\n }\n $tags[] = $tag_name;\n }\n }\n }\n else {\n $tags[] = strtoupper(trim($contact_data['tags']));\n }\n }\n\n if (isset(self::$form_config['tags']) && is_array(self::$form_config['tags'])) {\n foreach (self::$form_config['tags'] as $key => $tag) {\n if (!isset($tag['name'])) {\n $this->setAlert('Missing the field `name` in the `form.json` tag definition!',\n array(), self::ALERT_TYPE_DANGER);\n return false;\n }\n $tag_name = null;\n if (!$this->app['contact']->validateTagName($tag['name'], $tag_name)) {\n // failed the tag name check!\n return false;\n }\n if ($this->app['contact']->existsTagName($tag_name)) {\n // this tag already exists, add the tag to the array\n $tags[] = $tag_name;\n continue;\n }\n // add a description to the tag\n $tag_description = isset($tag['description']) ? $tag['description'] :\n sprintf('This tag was automatically generated for the form %s', self::$form_name);\n $this->app['contact']->createTagName($tag_name, $tag_description);\n $tags[] = $tag_name;\n }\n }\n\n // loop through the tags and check if they are assigned to the contact\n foreach ($tags as $tag) {\n if (!$this->app['contact']->issetContactTag($tag, $contact_id)) {\n $this->app['contact']->setContactTag($tag, $contact_id);\n }\n }\n }\n\n $form_record = array(\n 'contact_id' => $contact_id,\n 'contact_data' => json_encode($contact_data),\n 'form_name' => self::$form_name,\n 'form_config' => json_encode(self::$form_config),\n 'form_data' => json_encode($form_data),\n 'form_submitted_when' => date('Y-m-h H:i:s'),\n 'form_submitter_ip' => $_SERVER['REMOTE_ADDR']\n );\n\n $FormData = new FormData($this->app);\n $FormData->insert($form_record);\n return true;\n }", "function SaveForm($form_data)\n {\n $this->db->insert('prizebonddraw', $form_data);\n\n if ($this->db->affected_rows() == '1')\n {\n return TRUE;\n }\n\n return FALSE;\n }", "function handleFormSubmit($mode = self::CREATE){\r\n\t\t$ret = false;\r\n\t\ttry{\r\n\t\t\t$ret = $this->isSubmit();\r\n\t\t\tif($ret === NULL){\r\n\t\t\t\t$this->fillWithData(NULL, true);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif($ret === false){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}catch(EFormEnd $e){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif($ret === true){\r\n\t\t\t$fromDB = false;\r\n\t\t\tif($data = $this->validate()){\r\n\t\t\t\t$bSave = false;\r\n\r\n\t\t\t\t$this->fields->fillWithData($data);\r\n\r\n\t\t\t\t$data = $this->handleMEntity($this->getData());\r\n\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif($this->interCallBacks->isCallable(self::ON_BEFORE_SAVE)){\r\n\t\t\t\t\t\tif(!($call_ret = $this->interCallBacks->runCallBackParams(self::ON_BEFORE_SAVE, [\r\n\t\t\t\t\t\t\t$data,\r\n\t\t\t\t\t\t\t$this\r\n\t\t\t\t\t\t]))){\r\n\t\t\t\t\t\t\t$this->fillWithData($data);\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data = $call_ret;\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(ModelSaveException $e){\r\n\t\t\t\t\t$this->fillWithData($data);\r\n\t\t\t\t\t$this->addErr($e->getErrors());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tOBE_App::$db->startTransaction();\r\n\r\n\t\t\t\ttry{\r\n\t\t\t\t\t$fromDB = true;\r\n\t\t\t\t\tif($this->recordIdkeyName === NULL){\r\n\t\t\t\t\t\t$bSave = $this->model->Save($data, $this->scope->recordId, $this->recursionSave);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$keyName = $data[$this->model->name][$this->recordIdkeyName];\r\n\t\t\t\t\t\t$bInsert = false;\r\n\t\t\t\t\t\tif($this->scope->recordId === NULL){\r\n\t\t\t\t\t\t\t$bInsert = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->model->primaryKey = $this->recordIdkeyName;\r\n\t\t\t\t\t\t$bSave = $this->model->Save($data, $this->scope->recordId, $this->recursionSave, $bInsert);\r\n\t\t\t\t\t\t$data[$this->model->name][$this->recordIdkeyName] = $keyName;\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(ModelSaveException $e){\r\n\t\t\t\t\t$this->addErr($e->getErrors());\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif($bSave){\r\n\t\t\t\t\tif($this->recordIdkeyName !== NULL){\r\n\t\t\t\t\t\t$this->scope->recordId = $data[$this->model->name][$this->recordIdkeyName];\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$this->scope->recordId = $this->model->id;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$mid = $this->scope->recordId;\r\n\t\t\t\t\tif($this->scope->parent){\r\n\t\t\t\t\t\t$mid = $this->scope->getMasterId();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$masterScope = $this->scope->getMaster();\r\n\r\n\t\t\t\t\t$this->bSave = true;\r\n\t\t\t\t\tif($this->model->_saveWasInsert){\r\n\t\t\t\t\t\tif($this->interCallBacks->isCallable(self::ON_INSERT_NEW)){\r\n\t\t\t\t\t\t\t$data = $this->interCallBacks->runCallBackParams(self::ON_INSERT_NEW, [\r\n\t\t\t\t\t\t\t\t$data,\r\n\t\t\t\t\t\t\t\t$this\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$masterScope->info->activityLog('Vytvořeno', ($this->scope->parent) ? $this->scope->info->name : 'Vytvořen záznam', $mid);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$masterScope->info->activityLog('Upraveno', ($this->scope->parent) ? $this->scope->info->name : 'Upraven záznam', $mid);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$this->mode = self::EDIT;\r\n\t\t\t\t\tOBE_App::$db->finishTransaction(true);\r\n\t\t\t\t\tif($this->interCallBacks->isCallable(self::ON_AFTER_SAVE)){\r\n\t\t\t\t\t\t$this->interCallBacks->runCallBackParams(self::ON_AFTER_SAVE,\r\n\t\t\t\t\t\t\t[\r\n\t\t\t\t\t\t\t\t$data,\r\n\t\t\t\t\t\t\t\t$this,\r\n\t\t\t\t\t\t\t\t$this->model->_saveWasInsert\r\n\t\t\t\t\t\t\t]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->fillWithData();\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif($es = OBE_App::$db->errors->getErrors()){\r\n\t\t\t\t\t\t$this->addErr('Chyba při ukládání do databáze!');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->addErr($es);\r\n\t\t\t\t\tOBE_App::$db->finishTransaction(false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->fillWithData($data, false, $fromDB);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function insertFormSubmit()\r\n {\r\n $post = array(\r\n 'name' => ($_POST['name']),\r\n 'surname' => ($_POST['surname']),\r\n 'surname' => ($_POST['email']),\r\n 'telephone' => ($_POST['telephone'])\r\n );\r\n if (!empty($post)) {\r\n $formsubmit = new FormSubmit();\r\n $formsubmit->setDate();\r\n $this->entityManager->persist($formsubmit);\r\n $submitdata = new FormSubmitData();\r\n $submitdata->setName(($_POST['name']));\r\n $submitdata->setValue(base64_encode(serialize($post)));\r\n $this->entityManager->persist($submitdata);\r\n $this->entityManager->flush();\r\n echo 'ok';\r\n }\r\n }", "function insertDynamicFormData($post,$deviceType,$appVersion,$OSVersion,$browserVersion)\n{\n $FormValueData = serialize(json_decode($post['data']));\n //print_r(unserialize($imagesIndex)); die;\n $explode = explode(',', @$_POST['imagesIndex']);\n //print_r($explode); die();\n $UserID = is_require($post, 'UserID');\n $CustomerID = is_require($post, 'CustomerID');\n $FormDataID = is_require($post, 'FormDataID');\n $StatusID='1';\n $success = false;\n $CreatedDateTime = date('Y-m-d H:i:s');\n $ModifyDateTime = date('Y-m-d H:i:s');\n $con=connectToDB(); //connect to the DB\n $StatusID='1';\n $result = mysql_query(\"call insertDynamicFormData('\".$FormValueData.\"','\".$UserID.\"','\".$CustomerID.\"','\".$FormDataID.\"','\".$StatusID.\"','\".$CreatedDateTime.\"','\".$ModifyDateTime.\"')\")or die(mysql_error());\n $row = mysql_fetch_assoc($result);\n if(!empty($row)) {\n $row['FormValueData'] = unserialize($row['FormValueData']);\n $success = true;\n }\n if(!empty($_POST['imagesIndex'])) {\n foreach ($explode as $key => $value) {\n //echo $value; die();\n $fileName = $_FILES[$value]['name'];\n $targetDir = $_SERVER['DOCUMENT_ROOT'].\"/stealthcare/uploads/\";\n $targetFile = $targetDir . $fileName;\n if(move_uploaded_file($_FILES[$value]['tmp_name'], $targetFile)) {\n $success = true;\n } else {\n $success = false;\n }\n }\n }\n if($success) {\n $data['ResponseData'] = $row;\n $data['Message'] = \"Form data inserted successfully.\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Success\";\n $data['StatusCode'] = \"1\";\n } else {\n $data['ResponseData'] = \"\";\n $data['Message'] = \"Error\";\n $data['ResponseCode'] = \"200\";\n $data['Status'] = \"Failed\";\n $data['StatusCode'] = \"0\";\n }\n print json_encode($data);\n mysql_close($con); //close the connection\n}", "function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}", "function saveRecord($arrFields = array(), $tablename = '', $enablePrepData = false) {\n\t\t\tif(isset($enablePrepData) && $enablePrepData) {\n\t\t\t\t$arrFields = mysqlPrepValues($arrFields);\n\t\t\t}\n\t\t\t\n\t\t\t$total_fields = count($arrFields);\n\t\t\t$count = 0;\n\t\t\t$field_list = \"\"; $field_values = \"\";\n\t\t\tforeach($arrFields as $key => $item) {\n\t\t\t\t$field_list .= '`' . $key . '`';\n\t\t\t\t$field_values .= '\"' . $item . '\"';\n\t\t\t\t$count++;\n\t\t\t\tif ($count != $total_fields) {\n\t\t\t\t\t$field_list .= ', ';\n\t\t\t\t\t$field_values .= ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql = 'INSERT INTO ' . $tablename . '(' . $field_list . ') VALUES (' . $field_values . ')';\n\t\t\t//echo $sql;exit;\n\t\t\tif ($this->db->query($sql)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function insert_record()\n\t{\n\t $dbname=$this->dbname;\n\t $DB1=$this->__connect($dbname,$this->table_name);\n $fields_data=$this->__list_fields_data($dbname,$this->table_name);\n // echo_array($fields_data);\n $index=$this->_get_primary($fields_data);\n //echo $index;\n //echo_array($_POST);\n \n \n //since we are coming from a form there\n //are $_POST values\n foreach ($fields_data->name as $key=>$value)\n {\n $data[$value['name']]=$_POST[$value['name']];\n }\n\n //needs checking if a FOREIGN FIELD\n //insert into database \n $this->db->insert($this->table_name, $data);\n\n $keys=(array_keys($data));\n $values=(array_values($data));\n\n //prepare some data for the form controls\n //in this case the Tdataset control\n \n $i=0;\n $num_fields=count($keys);\n for ($i=0;$i<$num_fields;$i++){\n $this->table->add_row($keys[$i],$values[$i]);\n }\n $this->table->set_heading('field','Value');\n $this->table->set_caption('Insert');\n $this->table->set_template($this->tmpl);\n $s=$this->table->generate();\n $s.='<a href=\"http://localhost/CodeIgniter/admin/dbutil/browse/'.$dbname.'/'.$this->table_name.'\">Click to Edit More</a>';\n return $s;\n\t}", "function record_form($params, $action)\n{\n $data = $GLOBALS['PFR_LOCATIONS_fields'];\n $sub_arr = $GLOBALS['SUBCATEGORY_array'];\n $conn = $GLOBALS['connection_TBSM'];\n\t\n\t$actions_arr = array (\n\t\t\"cancel\" => array (\n\t\t\t\"text\" \t=> \"Вернуться\",\n\t\t\t\"image\" \t=> \"images/arrowdown.png\",\n\t\t\t\"title\" \t=> \"Вернуться назад\",\n \"onclick\" => \"return true;\", // return confirm('Сделанные изменения не будут сохранены! Вернуться?');\",\n \"access\" => \"\",\n\t\t),\n\t\t\"save\" => array (\n\t\t\t\"text\" \t=> \"Сохранить\",\n\t\t\t\"image\" \t=> \"images/ok.png\",\n\t\t\t\"title\" \t=> \"Сохранить текущую запись\",\n \"onclick\" => \"return confirm('Сохранить текущую запись?');\",\n \"access\" => \"\",\n\t\t),\n\t\t\"clone\" => array (\n\t\t\t\"text\" \t=> \"Клонировать\",\n\t\t\t\"image\" \t=> \"images/copy.png\",\n\t\t\t\"title\" \t=> \"Клонировать текущую запись\",\n \"onclick\" => \"return confirm('Если были сделаны изменения - они не будут сохранены! Клонировать текущую запись?');\",\n \"access\" => \"\",\n\t\t),\n\t\t\"delete\" => array (\n\t\t\t\"text\" \t=> \"Удалить\",\n\t\t\t\"image\" \t=> \"images/delete.png\",\n\t\t\t\"title\" \t=> \"Удалить текущую запись\",\n \"onclick\" => \"return confirm('Удалить текущую запись?');\",\n \"access\" => \"\",\n ),\n\t);\n\n // insert or update record to PFR_LOCATIONS\n if ($action == 'save') {\n // insert\n if (empty($data['ID']['VALUE'])) {\n $fields = \"\";\n $values = \"\";\n foreach ($data as $field => $prop) {\n if ($field != 'ID') {\n $fields .= \"{$field}, \";\n switch ($prop['COLTYPE']) {\n case 'INTEGER':\n $values .= (!empty($_POST[$field]) ? intval($_POST[$field]) : intval($prop['DEFAULT'])) . \", \";\n break;\n case 'TIMESTMP':\n $values .= \"'\" . date(\"Y-m-d H:i:s\") . \"', \";\n break;\n default:\n $values .= \"'\" . (empty($_POST[$field]) ? $prop['DEFAULT'] : $_POST[$field]) . \"', \";\n break;\n }\n }\n }\n $fields = rtrim($fields, \", \");\n $values = rtrim($values, \", \");\n\n $ins = \"insert into DB2INST1.PFR_LOCATIONS ({$fields}) values ({$values})\";\n $stmt = db2_prepare($conn, $ins);\n return db2_execute($stmt);\n }\n // update\n else {\n $fields_values = \"\";\n foreach ($data as $field => $prop) {\n if ($field != 'ID')\n switch ($prop['COLTYPE']) {\n case 'INTEGER':\n $fields_values .= $field . \" = \" . intval($_POST[$field]) . \", \"; break;\n case 'TIMESTMP':\n $fields_values .= $field . \" = '\" . date(\"Y-m-d H:i:s\") . \"', \"; break;\n default:\n $fields_values .= $field . \" = '\" . $_POST[$field] . \"', \"; break;\n }\n }\n $fields_values = rtrim($fields_values, \", \");\n\n $upd = \"update DB2INST1.PFR_LOCATIONS set \".$fields_values.\" where ID = {$data['ID']['VALUE']}\";\n $stmt = db2_prepare($conn, $upd);\n return db2_execute($stmt);\n }\n }\n\n // delete record from PFR_LOCATIONS\n if ($action == 'delete') {\n $del = \"delete from DB2INST1.PFR_LOCATIONS where ID = '\".$data['ID']['VALUE'].\"'\";\n $stmt = db2_prepare($conn, $del);\n return db2_execute($stmt);\n }\n\n // select existing record from PFR_LOCATIONS\n if ($action == 'edit') {\n $sel = \"select * from DB2INST1.PFR_LOCATIONS where ID = {$data['ID']['VALUE']}\";\n $stmt = db2_prepare($conn, $sel);\n if (!db2_execute($stmt))\n return false;\n if (empty($row = db2_fetch_assoc($stmt)))\n return false;\n foreach ($data as $field => &$prop)\n $prop['VALUE'] = $row[$field];\n unset($prop);\n }\n\n // web-form output\n echo \"<h3>Запись в таблице PFR_LOCATIONS</h3>\";\n\techo \"<form action='{$_SERVER[\"PHP_SELF\"]}?{$params}' method='post'>\";\n\techo \"<table border='0' cellspacing='0' cellpadding='5'>\";\n\t\tforeach ($data as $field => $prop) {\n\t\t\techo \"<tr>\";\n\t\t\t\techo \"<td>{$field}</td>\";\n\t\t\t\techo \"<td>\";\n\t\t\t\t if ($field == 'SUBCATEGORY') {\n echo \"<select class = 'select_in_form' size = '1' id = 'subcategory' name = '{$field}'>\";\n foreach ($sub_arr as $key => $val)\n echo \"<option value = '{$key}' \".($key == $prop['VALUE'] ? 'selected' : '').\">$key</option>\";\n echo \"</select>\";\n }\n else\n echo \"<input type='text' \n name='{$field}'\n value='\".($action == 'edit' ? $prop['VALUE'] : (empty($prop['VALUE']) ? $prop['DEFAULT'] : $prop['VALUE'])).\"'\n size='64'\n maxlength='{$prop['LENGTH']}'\".\n ($prop['COLTYPE'] == 'INTEGER' ? \"pattern=\\\"[-]?[0-9]+\\\"\" : '').\n (($action == 'view' or $prop['COLTYPE'] == 'TIMESTMP' or $field == 'ID') ? 'disabled' : '').\">\";\n\t\t\t\techo \"</td>\";\n\t\t\t\techo \"<td><font size='-2'>{$prop['COLTYPE']} ({$prop['LENGTH']})</font></td>\";\n\t\t\techo \"</tr>\";\n\t\t}\n\t\techo \"<tr><td align='center' colspan='0'><br>\";\n $actions_arr['delete']['access'] = empty($data['ID']['VALUE']) ? 'disabled' : '';\n\t\t\tforeach ($actions_arr as $key => $value)\n\t\t\t\techo \"<button type='submit' name='sendRequest' value='{$key}' title='{$value['title']}' onclick=\\\"{$value['onclick']}\\\" {$value['access']}><img src='{$value['image']}' width='16' height='16'>&nbsp;{$value['text']}</button>&emsp;\";\n\t\techo \"</td></tr>\";\n\techo \"</table>\";\n\t// hidden field for ID\n echo \"<input hidden type='text' name='ID_hidden' value='{$data['ID']['VALUE']}'>\";\n\techo \"</form>\";\n\treturn true;\n}", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "function setRecord($data_arr,$table,$id=0,$chkfield=\"\")\n\t{\n\t\tif($id)\n\t\t{\n\t\t\t// we already have this record in the db\n\t\t\t// so we are updating it\n\t\t\t$where=$this->WhereClause($chkfield,$id);\n\t\t\tif(strlen($where))\n\t\t\t{\n\t\t\t\t$sql=\"update \" . $table . \" set \";\n\t\t\t\t$sql.=$this->explodeUpdate($data_arr);\n\t\t\t\t$sql.=\" where $where\";\n\t\t\t}\n\t\t}else{\n\t\t\t// this record does not yet exist\n\t\t\t// so we are creating it\n\t\t\t$sql=\"insert into \" . $table . \" \";\n\t\t\t$sql.=$this->explodeData($data_arr);\n\t\t}\n // debug(\"in setRecord - query\",$sql);\n\t\tif(strlen($sql))\n\t\t{\n\t\t\t$this->query($sql);\n\t\t}\n\t\tif($this->_mysql_errno)\n\t\t{\n\t\t\treturn 0;\n\t\t}elseif($id)\n\t\t{\n\t\t\treturn $id;\n\t\t}else{\n\t\t\treturn $this->_insert_id;\n\t\t}\n\t}", "function validate_form_fields($array = NULL, $update = false) {\n $fields = $this->load_required_fields($array, $update);\n\n if ($array == NULL)\n $array = $_POST;\n\n if (is_array($_FILES))\n $array = array_merge($array, $_FILES);\n\n //Mergin Array\n $group_fields = array_merge($fields, $this->load_other_fields());\n\n validate_cb_form($group_fields, $array);\n }", "function form($action=null,$submit='Submit',$rows=null,$taction=null,$editmode=null) {\n\t //print_r($_POST);\n\t global $sFromErr;\n\t\t $taction = 'cpsubloadhtmlmail';//templates\n\t\t $iaction = 'cpsubloadimage';//add images (embed)\t\t \n\t\t $daction = 'cpsubattach';//add attachments\t\t \n\t\t \n\t\t $activebatch = $this->load_saved_batch();\n \n\t\t $sendto = GetParam('to')?GetParam('to'):$this->to;\n\t\t $sendcc = GetParam('cc')?GetParam('cc'):null;\t\t \n\t\t $sendbcc = GetParam('bcc')?GetParam('bcc'):null;\t\t\t \n\t\t \n\t\t $mailuser = $this->mailuser?$this->mailuser:$this->from;\t//echo '>',$mailname;\n\t $mymail = GetParam('from')?GetParam('from'):$mailuser;\t\t// echo '>',$mymail;\n\t\t\n\t\t \n\t\t if (!$submit)\n\t\t $submit = localize('_SUBMIT',getlocal());\n \n if (!$rows)\n\t\t $rows = 16;\n \n if ($action)\n\t\t $myaction = seturl(\"t=\".$action.\"&editmode=\".GetReq('editmode')); \n\t\t else \n $myaction = seturl(\"t=cmail\".\"&editmode=\".GetReq('editmode')); \n\t\t \n\t\t //in case of activebatch ..go directly to batch num\n\t\t if (($activebatch) && ($this->bypass_method==false))\n\t\t $myaction .= '&batchid=' . $activebatch; \n\t\t \t\t \n $out .= \"<FORM action=\". \"$myaction\" . \" method=post>\"; \t\n\t \t \n //error message\n $out .= setError($sFormErr);\t\t \n\t \n $from[] = \"<B>\" . localize('_FROM',getlocal()) . \":</B>\";\n $fromattr[] = \"right;20;\";\n\t\t $from[] = \"<input type=\\\"text\\\" name=\\\"from\\\" maxlenght=\\\"40\\\" readonly =\\\"readonly\\\" value=\\\"\".$mymail.\"\\\">&nbsp;\" . $this->mailname;\n\t $fromattr[] = \"left;80%;\";\t\t\n\n\t $fwin = new window('',$from,$fromattr);\n\t $winout .= $fwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($fwin);\t \n\t \n //TO..\n $to[] = \"<B>\" . localize('_TO',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $to[] = \"<input type=\\\"text\\\" name=\\\"to\\\" maxlenght=\\\"40\\\" value=\\\"$sendto\\\">&nbsp;\" . $this->toname;\t\n\t\t $toattr[] = \"left;80%;\";\n\t $twin = new window('',$to,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t \n\t\t \n //CC..\n if ((SMTP_PHPMAILER=='true') || (SENDMAIL_PHPMAILER=='true')) {\t\t\t \t\t\t \n $cc[] = \"<B>\" . localize('_CC',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $cc[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"cc\\\" maxlenght=\\\"80\\\" value=\\\"$sendcc\\\">\";\n\t\t $toattr[] = \"left;80%;\";\t\t \n\t $twin = new window('',$cc,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t\n\t\t \n $bcc[] = \"<B>\" . localize('_BCC',getlocal()) . \":</B>\";\n \t $toattr[] = \"right;20%;\";\t \n\t $bcc[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"bcc\\\" maxlenght=\\\"80\\\" value=\\\"$sendbcc\\\">\";\n\t\t $toattr[] = \"left;80%;\";\t\t \n\t $twin = new window('',$bcc,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t\t \n\t\t } \t\t\t \n \n\t //SUBJECT..\n\t\t $sbj = $subject?$subject:GetParam('subject');\n $subt[] = \"<B>\" . localize('_SUBJECT',getlocal()) . \":</B>\";\n \t $subattr[] = \"right;20%;\";\t \n $subt[] = \"<input style=\\\"width:100%\\\" type=\\\"text\\\" name=\\\"subject\\\" maxlenght=\\\"30\\\" value=\\\"\".$sbj.\"\\\">\"; \n \t $subattr[] = \"left;80%;\";\n\t $swin = new window('',$subt,$subattr);\n\t $winout .= $swin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($swin);\t \n\t\t \n\t\t //OPTIONS \n $opt[] = \"&nbsp;\";\n \t $toattr[] = \"right;20%;\";\t\n\t\t $check1 = $activebatch?'checked':null; \t\t \n\t $options = \"<B>\" . localize('_INCLSUBS',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"includesubs\\\" $check1>\";\t\t\n $options .= \"<B>\" . localize('_INCLALL',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"includeall\\\" ><br>\";\t\t\t\t \n if ((SMTP_PHPMAILER=='true') || (SENDMAIL_PHPMAILER=='true')) {\t\n\t\t $check2 = $this->ishtml?'checked':null;\n $options .= \"<B>\" . localize('_ISHTML',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"ishtml\\\" $check2><br>\";\t\t \n\t\t }\t\n\t\t else\n\t\t $options .= \"<B>\" . localize('_SMTPDEBUG',getlocal()) . \"&nbsp;<input type=\\\"checkbox\\\" name=\\\"smtpdebug\\\"><br>\";//debug smtp\n\t\t \t \n\t $opt[] = $options;\n \t $toattr[] = \"left;80%;\";\t\n\t $twin = new window('',$opt,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\t \n\t \t \n\t //MAIL BODY..\t\t \n $mb[] = \"&nbsp;\";//\"<B>\" . localize('_MESSAGE',getlocal()) . \":</B>\";\n \t $mbattr[] = \"right;1%;\";\t\n\t\t \n\t\t if (GetReq('t')=='cpsubloadhtmlmail') { //LOAS A NEW TEMPLATE\n\t\t $path = $this->urlpath.$this->infolder.$this->newsletter_path;//GetGlobal('controller')->calldpc_var('rctedit.htmlpath');\t\t \n\t\t //echo $path; print_r($_POST);\n\t\t if ($template = GetParam('template')) {\n\t\t $data = GetGlobal('controller')->calldpc_method('rctedit.loadfromfile use '.$template.'+'.$path);\n\t\t }\n\t\t else \n\t\t $data = null;\n\t\t\t \n\t\t $conditions = $this->spam_conditions_text($this->antispamlink,0,$this->ishtml);\n\t\t $this->mailbody = $data . $conditions; //str_replace('</html>',$conditions.'</html>',$data);\n\t\t \n\t\t //$this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t //$mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$data . $conditions);\n\t\t $mbody = $this->render_textarea($data . $conditions, $rows);\n\t\t \n\t\t $this->template = $this->url . $this->infolder . $this->newsletter_path . $template; \n\n\t\t $this->ishtml = true;\t\n\t\t SetSessionParam('template',$this->template);\n\t\t SetSessionParam('mailbody',$this->mailbody);\t\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t \n\t\t }\n\t\t elseif (GetReq('t')=='cpsubloadimage') {//..OR ADD EMBEDED IMAGE\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }*/\n\t\t $mbody = $this->render_textarea($mailbody,$rows);\t \n\t\t \t\n\t\t if ($img = GetParam('image'))\n\t $this->images[] = $img;\t\n\t\t //echo '>',GetParam('image');\t \n\t SetSessionParam('images',serialize($this->images));\t\t \t\t \n\t\t }\t\t\n\t\t elseif (GetReq('t')=='cpsubattach') {//..OR ATTACH A FILE\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }\t*/\t\n\t\t \n\t\t $mbody = $this->render_textarea($mailbody,$rows);\n\t\t \n\t\t if ($attachedfile = GetParam('attachment'))\t\t \n\t $this->attachments[] = $attachedfile;\t\n\t\t //echo '>',GetParam('attachment');\t \n\t SetSessionParam('attachments',serialize($this->attachments));\t\t \t\t \n\t\t }\t\t\n\t\t elseif (GetReq('t')=='cpsubsend') {//..OR SEND A MAIL\n\t\t if ($this->mailbody) \n\t\t $mailbody = $this->mailbody;\n\t\t else \n\t\t $mailbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t\t \n\t\t \n\t\t /*if ($this->ishtml == true) {\n\t\t $this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t $mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mailbody);\t\t \n\t\t }\t\t\t \n\t\t else {\n $mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\t \n $mbody .= $mailbody; \n $mbody .= \"</TEXTAREA></DIV>\";\n\t\t }\t*/\n\t\t \n\t\t $mbody = $this->render_textarea($mailbody,$rows);\t\t \n\t\t } \t \n\t\t elseif ($this->ishtml = true) {//..OR JUST SHOW NEW HTML MAIL ..\n\t\t //$this->htmleditor = new tinyMCE('textareas','ADVANCEDFULL',1,'images',$this->dirdepth);\n\t\t \n\t\t if ($this->mailbody) \n\t\t $mbody = $this->mailbody;\n\t\t else {\n\t\t $mbody = GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\n $mbody .= $this->spam_conditions_text($this->antispamlink,0,$this->ishtml);\t\t\t \n \t\t $this->mailbody = $mbody;\n\t\t\t SetSessionParam('mailbody',$mbody);\n\t\t }\t \n\t\t\t \t\t \n\t\t //$mbody = $this->htmleditor->render('mail_text','100%',$rows+10,$mbody);\n\t\t \n\t\t $mbody = $this->render_textarea($mbody,$rows);\n\t\t \n\t\t //reset arrays\n\t\t SetSessionParam('template',null);\t\n\t\t SetSessionParam('mailbody',null);\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t\t \t\t \t\t \n\t\t }\t \n\t\t else { //OR IN TEXT MODE\n\t\t \n\t\t $this->mailbody = null;\n\t\t \n //$mbody = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"mail_text\\\" ROWS=$rows cols=60 wrap=\\\"virtual\\\">\";\n\t\t if ($this->mailbody) \n\t\t $mbody .= $this->mailbody;\n\t\t else {\n\t\t $mbody .= GetParam('mail_text')?GetParam('mail_text'):$this->get_mail_body();\t\t \n $mbody .= $this->spam_conditions_text($this->antispamlink,0,0);\n\t\t }\t \n\t\t \n //$mbody .= \"</TEXTAREA></DIV>\";\n\t\t \n\t\t $mbody = $this->render_textarea($mbody,$rows);\n\t\t \n\t\t $this->ishtml = false;\t\n\t\t SetSessionParam('template',null);\t\n\t\t SetSessionParam('mailbody',null);\t\n\t\t //reset embeded images \n\t\t $this->images = array();\t\t \n\t SetSessionParam('images',null);\n\t\t //reset attachments \n\t\t $this->attachments = array();\t\t \n\t SetSessionParam('attachments',null);\t\t\t \t\t \t \n\t\t }\t \n\t\t \n\t $mb[] = $mbody;\n\t $mbattr[] = \"left;99%\";\n\t $mbwin = new window('',$mb,$mbattr);\n\t $winout .= $mbwin->render(\"center::100%::0::group_win_body::left::0::0::\");\t\n\t unset ($mbwin);\t \n\t \n\t \n\t\t //alternate text body\n\t\t if (!$editmode) {\n\t\t \n\t\t if (GetParam('alttext')) {\n\t\t $defaulttext = GetParam('alttext');\n\t\t }\n\t\t else {\n\t\t $defaulttext = localize('_NOTVIEW',0);\n\t\t $defaulttext .= localize('_NOTVIEW',1);\t\t \n\t\t $defaulttext .= $this->template ? $this->template :'Alternate Text message for non html viewers';\n\t\t $defaulttext .= $this->spam_conditions_text($this->antispamlink,0,0);\t\t \n\t\t } \n\t\t \n $alttext = \"<DIV class=\\\"monospace\\\"><TEXTAREA style=\\\"width:100%\\\" NAME=\\\"alttext\\\" ROWS=5 cols=60 wrap=\\\"virtual\\\">\";\n\t\t $alttext .= $defaulttext;\n\t\t $alttext .= \"</TEXTAREA></DIV>\";;\t\t \n\t $alt[] = $alttext;\n \t $toattr[] = \"left;80%;\";\t\n\t $twin = new window('',$alt,$toattr);\n\t $winout .= $twin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($twin);\t\n\t\t \n\t\t }//editmode\t\n\t\t \t \n\t //main window\n\t $mywin = new window('',$winout);\n\t $out .= $mywin->render();\t\n\t unset ($mywin);\t \n\t \n\t \n\t //batch num restored\n\t\t if ($activebatch) {\n\t\t $cmd = \"Previous campaign has stoped at batch num (reset or bypass)\";\n\t\t $cm = ($activebatch-1) * $this->batch; \n\t\t $cmd .= \"<br>Campaign stopped at \" . $cm . \" mails from \" . $this->subs_no . ' subscribers!<br>'; \n\t\t \n\t\t if ($this->bypass_method==true)\t\t\t \n\t\t $cmd .= \"<input style=\\\"width:30\\\" type=\\\"text\\\" name=\\\"batchrestore\\\" maxlenght=\\\"4\\\" value=\\\"\".($activebatch-1) .\"\\\">\"; \t \n\t\t //$cmd .= \"<br>\";\n\t\t }\n\t\t else\n\t\t $cmd = $this->subs_no . ' subscribers!<br>';\n\t \n\t //BUTTONS\n\t\t if ($action) {\n $cmd .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"SendCMail\\\">\"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"\" . $submit . \"\\\">&nbsp;\"; \n $cmd .= \"<INPUT type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"\" . $action . \"\\\">\";\t\t\t \n\t\t }\n\t\t else {\n $cmd .= \"<input type=\\\"hidden\\\" name=\\\"FormName\\\" value=\\\"SendCMail\\\">\"; \n $cmd .= \"<INPUT type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"\" . localize('_SENDCMAIL',getlocal()) . \"\\\">&nbsp;\"; \n $cmd .= \"<INPUT type=\\\"hidden\\\" name=\\\"FormAction\\\" value=\\\"\" . \"sendcmail\" . \"\\\">\";\t \n\t\t } \n\t\t \n\t $but[] = $cmd;\n\t $battr[] = \"left\";\n\t $bwin = new window('',$but,$battr);\n\t $out .= $bwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($bwin);\n\t \t \n $out .= \"</FORM>\"; \n\t\t \n\t if (defined('RCTEDIT_DPC')) {\n\t\t //html\n\t\t $out1_title = \"<B>\" . localize('_HTMLTEMPLATE',getlocal()) . \":</B>&nbsp;\" . $this->template;\n\t $out1 = GetGlobal('controller')->calldpc_method('rctedit.show_files use template+Load Newsletter+'.$taction.'+'.$this->newsletter_path.'+'.implode(',',$this->templatetypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out1 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploadtemplate+/'.$this->newsletter_path.'+++'.$this->maxsize); \n\t\t\t \n\t $awin = new window($out1_title,$out1);\n\t $out .= $awin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($awin);\t\n\t\t \t\t\t \n\t\t //embeded images\n\t\t if ((is_array($this->images)) && (!empty($this->images))) {\n\t\t //print_r($this->images);\n\t\t $myimages = implode(',',$this->images);\n\t\t }\t \n\t\t else\n\t\t $myimages = 'none';\t \n\t\t $out2_title = \"<B>\" . localize('_ADDIMAGES',getlocal()) . \":</B>&nbsp;\" . '<'.$myimages.'>';\n\t $out2 = GetGlobal('controller')->calldpc_method('rctedit.show_files use image+Embed Image+'.$iaction.'+'.$this->imgpath.'+'.implode(',',$this->imgtypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out2 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploadimage+/'.$this->imgpath.'+++'.$this->maxsize);\t\t \n\t\t\t \n\t $bwin = new window($out2_title,$out2);\n\t $out .= $bwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($bwin);\t\t\t \n\t\t\t \n\t\t //attachments\n\t\t if ((is_array($this->attachments)) && (!empty($this->attachments))) {\n\t\t //print_r($this->images);\n\t\t $mydocs = implode(',',$this->attachments);\n\t\t }\t \n\t\t else\n\t\t $mydocs = 'none';\t\t \n\t\t $out3_title = \"<B>\" . localize('_ATTACHMENTS',getlocal()) . \":</B>&nbsp;\" . '<'.$mydocs.'>';\n\t $out3 = GetGlobal('controller')->calldpc_method('rctedit.show_files use attachment+Attach File+'.$daction.'+'.$this->docpath.'+'.implode(',',$this->doctypes));\t\t \n\t\t if (defined('RCUPLOAD_DPC')) \n\t\t $out3 .= GetGlobal('controller')->calldpc_method('rcupload.uploadform use cpsubuploaddocument+/'.$this->docpath.'+++'.$this->maxsize);\t\n\t\t\t \n\t $cwin = new window($out3_title,$out3);\n\t $out .= $cwin->render(\"center::100%::0::group_article_selected::left::0::0::\");\t\n\t unset ($cwin);\t\t\t\t \n\t\t } \t\t \n\t\t \n\t $mywin = new window(localize('_SMTPSENDFORM',getlocal()) . ' ['.GetParam('id').']',$out);\n\t $wout = $mywin->render();\t\n\t unset ($mywin);\t\t \n\t\t \n\t\t return ($wout); \n }", "function store()\n\t{\t\n\t\t//$row =& $this->getTable();\n\t\t$db\t\t= JFactory::getDbo();\n\t\t\n\t\t$data = JRequest::get( 'post' );\n\t\t\n\t\tif($data[\"dsr_txt_prename\"] == '' ||\n\t\t\t$data[\"dsr_txt_name\"] == '' ||\n\t\t\t$data[\"dsr_txt_address\"] == '' ||\n\t\t\t$data[\"dsr_txt_plz\"] == '' ||\n\t\t\t$data[\"dsr_txt_city\"] == '' ||\n\t\t\t$data[\"dsr_txt_phone\"] == '' ||\n\t\t\t$data[\"dsr_txt_email\"] == '' ||\n\t\t\t$data[\"dsr_chk_AGB\"] == \"\" ||\n\t\t\t$data[\"dsr_title\"] == \"\" ||\n\t\t\t!filter_var($_POST[\"dsr_txt_email\"], FILTER_VALIDATE_EMAIL) ){\n\t\t\t\n\t\t\tJError::raiseWarning( 500, JText::_('COM_JEVENT_LBL_CORRECT_ERRORS') );\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/*if(!$this->check($data[\"dsr_txt_email\"] )){\n\t\t\tJError::raiseWarning( 500, JText::_('Email not valid!') );\n\t\t\treturn false;\n\t\t}*/\n\t\t\t\n\t\t$insData =new stdClass();\n\t\t//$insData->idt_drivin_event_apply = $_POST['id_upt'];\n\t\t$insData->idt_drivin_event = $_POST[\"applyEventId\"];\n\t\t\n\t\t$insData->s_name = $data[\"dsr_txt_name\"];\n\t\t$insData->s_prename = $data[\"dsr_txt_prename\"];\n\t\t$insData->s_address = $data[\"dsr_txt_address\"];\n\t\t$insData->s_plz = $data[\"dsr_txt_plz\"] ;\n\t\t$insData->s_city = $data[\"dsr_txt_city\"];\n\t\t$insData->s_phone = $data[\"dsr_txt_phone\"];\n\t\t$insData->s_email = $data[\"dsr_txt_email\"];\n\t\t$insData->dt_cancel = null;\n\t\t$insData->s_title = $data[\"dsr_title\"];\n\t\t\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->insertObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $db->stderr();\n\t\t\t//return false;\n\t\t\t$bSQLOk = false;\n\t\t}else{\n\t\t\t$bSQLOk = true;\n\t\t\t//test();\n\t\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\n\t\t$query->select($db->nameQuote('s_name'));\n\t\t$query->select($db->nameQuote('s_prename'));\n\t\t$query->select($db->nameQuote('s_address'));\n\t\t$query->select($db->nameQuote('s_plz'));\n\t\t$query->select($db->nameQuote('s_city'));\n\t\t$query->select($db->nameQuote('s_phone'));\n\t\t$query->select($db->nameQuote('s_email'));\n\t\t$query->select($db->nameQuote('idt_drivin_event_apply')); \n\t\t$query->select($db->nameQuote('s_title'));\n\t\t$query->from($db->nameQuote('#__jevent_events_apply'));\n\t\t$query->where($db->nameQuote('idt_drivin_event_apply') . '=' . $db->insertid());\n\t\tif(!$bCanceled)\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is null');\n\t\telse\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is not null');\n\n\t\t$db->setQuery($query);\n\t\t//if ($link = $db->loadRowList()) {\n\t\t$link = $db->loadRowList();\n\t\t\t$mailer = new jEventMailer();\n\t\t\t//$mailer->test();\n\t\t\tif(!$mailer->sendApplicationEmail2($db->insertid(), $link, $this->getEventById())){\n\t\t\t\t$this->setError($mailer->error);\n\t\t\t\techo \"Eroooor \" . $mailer->error;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t//if($bSQLOk)\n\t\t//\t$bMailOk = sendApplicationEmail($_POST[\"dsr_txt_email\"], $_POST[\"applyEventId\"]);\n\t\t//else\n\t\t//\t$bMailOk = false;\n\t\t//$mailer = new jEventMailer();\n\t\t//$mailer->test();\n\n\t\t// Bind the form fields to the hello table\n\t\t/*if (!$row->bind($data)) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Make sure the hello record is valid\n\t\tif (!$row->check()) {\n\t\t\t$this->setError($this->_db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Store the web link table to the database\n\t\tif (!$row->store()) {\n\t\t\t$this->setError( $row->getErrorMsg() );\n\t\t\treturn false;\n\t\t}*/\n\n\t\treturn true;\n\t}", "function createContact($sfConn, $dataArray){\n\t\techo(\"<P> createContact <P>\");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\techo(\"<P> Set records to Contact <P>\");\n $sObject = new sObject();\n $sObject->type = 'Contact'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n }\n\t\techo(\"<P> Ready to roll <P>\");\n $success = create_multiple($sfConn, $sObjects);\n return $success; \n }", "public abstract function validateFormInput($FORM_array);", "public function postData()\n\t{\n\t\t$this->setCustomerName($_POST['frmcname']);\n\t\t$this->setCustomerAddress1($_POST['frmcaddy1']);\n\t\t$this->setCustomerAddress2($_POST['frmcaddy2']);\n\t\t$this->setCustomerCity($_POST['frmccity']);\n\t\t$this->setCustomerZipcode($_POST['frmczipcode']);\n\t\t$this->setCustomerState($_POST['frmcstate']);\n\t\t$this->setCustomerPhone( $_POST['frmcpnumber']);\n\t\t$this->setCustomerExt($_POST['frmcext']);\n\t\t$this->setCustomerFax($_POST['frmcfnumber']);\n\t\t$this->setCustomerEmail($_POST['frmcemail']);\n\t\t$this->setCustomerRdp($_POST['frmcrdp']);\n\t\t$this->setCustomerNotes($_POST['frmcnotes']);\n\t\t$this->setFlag($_POST['frmflaggedq']);\n\t\t$this->setFlagReason($_POST['frmflagreason']);\n\t}", "public function initContactDataForm()\n\t{\n\t\tglobal $lng, $ilCtrl;\n\n\t\tinclude_once(\"Services/Form/classes/class.ilPropertyFormGUI.php\");\n\t\t$this->form = new ilPropertyFormGUI();\n\n\t\t// name\n\t\t$ti = new ilTextInputGUI($lng->txt(\"name\"), \"inst_name\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$ti->setRequired(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// description\n\t\t$ti = new ilTextInputGUI($lng->txt(\"client_info\"), \"inst_info\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$this->form->addItem($ti);\n\n\t\t// institution\n\t\t$ti = new ilTextInputGUI($lng->txt(\"client_institution\"), \"inst_institution\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$this->form->addItem($ti);\n\n\t\t// contact data\n\t\t$sh = new ilFormSectionHeaderGUI();\n\t\t$sh->setTitle($lng->txt(\"contact_data\"));\n\t\t$this->form->addItem($sh);\n\n\t\t// first name\n\t\t$ti = new ilTextInputGUI($lng->txt(\"firstname\"), \"admin_firstname\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$ti->setRequired(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// last name\n\t\t$ti = new ilTextInputGUI($lng->txt(\"lastname\"), \"admin_lastname\");\n\t\t$ti->setMaxLength(64);\n\t\t$ti->setSize(30);\n\t\t$ti->setRequired(true);\n\t\t$this->form->addItem($ti);\n\n\t\t$fs = array (\n\t\t\t\"title\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"position\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"institution\" => array(\"max\" => 200, \"size\" => 30),\n\t\t\t\"street\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"zipcode\" => array(\"max\" => 10, \"size\" => 5),\n\t\t\t\"city\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"country\" => array(\"max\" => 64, \"size\" => 30),\n\t\t\t\"phone\" => array(\"max\" => 64, \"size\" => 30)\n\t\t\t);\n\t\tforeach ($fs as $f => $op)\n\t\t{\n\t\t\t// field\n\t\t\t$ti = new ilTextInputGUI($lng->txt($f), \"admin_\".$f);\n\t\t\t$ti->setMaxLength($op[\"max\"]);\n\t\t\t$ti->setSize($op[\"size\"]);\n\t\t\t$ti->setInfo($lng->txt(\"\"));\n\t\t\t$this->form->addItem($ti);\n\t\t}\n\n\t\t// email\n\t\t$ti = new ilEmailInputGUI($lng->txt(\"email\"), \"admin_email\");\n\t\t$ti->setRequired(true);\n\t\t$ti->allowRFC822(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// feedback recipient\n\t\t$ti = new ilEmailInputGUI($lng->txt(\"feedback_recipient\"), \"feedback_recipient\");\n\t\t$ti->setInfo($lng->txt(\"feedback_recipient_info\"));\n\t\t$ti->setRequired(true);\n\t\t$ti->allowRFC822(true);\n\t\t$this->form->addItem($ti);\n\n\t\t// error recipient\n\t\t$ti = new ilEmailInputGUI($lng->txt(\"error_recipient\"), \"error_recipient\");\n\t\t$ti->allowRFC822(true);\n\t\t$this->form->addItem($ti);\n\n\t\t$this->form->addCommandButton(\"saveContact\", $lng->txt(\"save\"));\n\n\t\t$this->form->setTitle($lng->txt(\"client_data\"));\n\t\t$this->form->setFormAction(\"setup.php?cmd=gateway\");\n\t}", "abstract function performInsert(Form $arg0);", "function contactUs ($sendEmail=false, $serverSetting=null){\n\t\t\t$simpleFormBuilder = new simpleFormBuilder;\n\t\t\t\n\t\t\t$builder \t= array\t(\n\t\t\t\t\t\t\t\"prosesname\"=> \"Your Contact Has Been Saved \",\n\t\t\t\t\t\t\t\"action\"\t=> \"\",\n\t\t\t\t\t\t\t\"method\"\t=> \"insert\",\n\t\t\t\t\t\t\t\"datatable\"\t=> \"tbl_contact\",\n\t\t\t\t\t\t\t\"element\"\t=> array\t( \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Name\" => array( \"type\" => \"text\", \"dataname\" => \"contact_name\t\", \"required\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Email\" => array( \"type\" => \"text\", \"dataname\" => \"contact_email\", \"required\" => 1, \"emailvalid\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Phone\" => array( \"type\" => \"text\", \"dataname\" => \"contact_phone\", \"required\" => 1, \"phonevalid\" => 1),\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Address\" => array( \"type\" => \"text\", \"dataname\" => \"contact_address\", \"required\" => 1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Message\" => array( \"type\" => \"textarea\", \"dataname\" => \"contact_message\", \"required\" => 1, \"width\" => \"75\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"captcha\" => array( \"type\" => \"captcha\", \"ignore\" => 1, \"message\" => \"(spam protection)\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hidden\" => array( \"type\" => \"hidden\", \"dataname\" => \"contact_date\" , \"value\" => date(\"Y-m-d H:i:s\")),\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\n\t\t\t$form\t= $simpleFormBuilder->builder($builder, false, false, false);\n\t\t\t\n\t\t\tif($simpleFormBuilder->haveError != 1 AND isset($_POST['submit']) AND $sendEmail == true){\n\t\t\t\techo $simpleFormBuilder->haveError;\n\t\t\t\tif(is_null($serverSetting)){\n\t\t\t\t\t$objEmail \t= new send2email(MAIL_SERVER, SITE_EMAIL, SITE_EMAIL_PASS, MAIL_PORT, true);\n\t\t\t\t\t$receiver\t= MANAGEMENT_EMAIL;\n\t\t\t\t}else{\n\t\t\t\t\t$objEmail \t= new send2email(trim($serverSetting[0]), trim($serverSetting[1]), trim($serverSetting[2]), trim($serverSetting[3]), trim($serverSetting[4]) );\n\t\t\t\t\t$receiver\t= $serverSetting[5];\n\t\t\t\t}\n\n\t\t\t\t$send \t\t= $objEmail->send($_POST[\"contact_email\"], '[Blanco Indonesia] Contact Us from '.$_POST[\"contact_name\"] .' ('.$_POST[\"contact_phone\"]. ')', $_POST[\"contact_message\"], $receiver, 'Contact Us', $_POST[\"contact_name\"]);\n\t\t\t\t/*echo '<!-- <pre>'; print_r($send); echo ' </pre> -->';*/\n\t\t\t}\n\t\t\t\n\t\t\treturn $form;\n\t\t}", "public function insert(){\n $formClass = $this->type.'_Form';\n $form = new $formClass($this->values);\n $errors = $form->isValid();\n $object = $form->get('object');\n if (empty($errors)) {\n try {\n $object->insert($this->values);\n } catch (Exception $e) {\n $form = new $formClass($this->values, array());\n $html = '<div class=\"message messageError\">\n '.$e->getMessage().'\n </div>\n '.$form->createForm($form->createFormFields(), array('action'=>url($this->type.'/insert', true), 'submit'=>__('save'), 'class'=>'formAdmin formAdminInsert'));\n return array('success'=>'0', 'html'=>$html);\n }\n $multipleChoice = (count((array)$this->object->info->info->form->multipleActions) > 0) ? true : false;\n $html = $object->showUi('Admin', array('userType'=>$this->login->get('type'), 'multipleChoice'=>$multipleChoice));\n return array('success'=>'1', 'html'=>$html, 'id'=>$object->id());\n } else {\n $form = new $formClass($this->values, $errors);\n $html = $form->createForm($form->createFormFields(), array('action'=>url($this->type.'/insert', true), 'submit'=>__('save'), 'class'=>'formAdmin formAdminInsert'));\n return array('success'=>'0', 'html'=>$html);\n }\n }", "function savePersonStamm($daten,$datei) {\n $tmp=0;\n $pid=$daten[\"PID\"];\n $bildok=false;\n // Array zu jedem Formularfed: Tabelle (0=contact,1=cust/vend), require(0=nein,1=ja), Regel\n // cp_greeting ist raus hli\n $dbfld=array(\"cp_name\" => array(0,1,1,\"Name\",75), \"cp_givenname\" => array(0,1,1,\"Vorname\",75),\n \"cp_gender\" => array(0,0,1,\"Geschlecht\",1),\n \"cp_title\" => array(0,0,1,\"Titel\",75), \"cp_street\" => array(0,0,1,\"Strasse\",75),\n \"cp_zipcode\" => array(0,0,2,\"Plz\",10),\n \"cp_city\" => array(0,0,1,\"Ort\",75), \"cp_country\" => array(0,0,8,\"Land\",3),\n \"cp_phone1\" => array(0,0,3,\"Telefon 1\",30), \"cp_phone2\" => array(0,0,3,\"Telefon 2\",30),\n \"cp_mobile1\" => array(0,0,3,\"Mobiletelefon 1\",30), \"cp_mobile2\" => array(0,0,3,\"Mobiletelefon 2\",30),\n \"cp_homepage\" =>array(0,0,4,\"Homepage\",0), \"cp_fax\" => array(0,0,3,\"Fax\",30),\n \"cp_email\" => array(0,0,5,\"eMail\",0), \"cp_privatemail\" => array(0,0,5,\"Private eMail\",0),\n \"cp_notes\" => array(0,0,1,\"Bemerkungen\",0), \"cp_stichwort1\" => array(0,0,1,\"Stichworte\",50),\n \"cp_salutation\" => array(0,0,1,\"Briefanrede\",125), \"cp_privatphone\" => array(0,0,3,\"Privattelefon 1\",30),\n \"cp_birthday\" => array(0,0,7,\"Geb-Datum\",0), \"cp_beziehung\" => array(0,0,6,\"Beziehung\",0),\n \"cp_abteilung\" => array(0,0,1,\"Abteilung\",25), \"cp_position\" => array(0,0,1,\"Position\",25),\n \"cp_cv_id\" => array(0,0,6,\"FID\",0), \"name\" => array(1,0,1,\"Firma\",75),\n \"cp_owener\" => array(0,0,6,\"CRM-User\",0), \"cp_grafik\" => array(0,0,9,\"Grafik\",4),);\n if (!empty($datei[\"Datei\"][\"name\"][\"bild\"])) { // eine Datei wird mitgeliefert\n $pictyp=array(\"gif\",\"jpeg\",\"png\",\"jpg\");\n $ext=strtolower(substr($datei[\"Datei\"][\"name\"][\"bild\"],strrpos($datei[\"Datei\"][\"name\"][\"bild\"],\".\")+1));\n if (in_array($ext,$pictyp)) {\n $daten[\"cp_grafik\"]=$ext;\n $datei[\"Datei\"]['name'][\"bild\"]=\"kopf$pid.$ext\";\n $bildok=true;\n }\n } else {\n $daten[\"cp_grafik\"]=$daten[\"IMG_\"];\n }\n if ($daten[\"cp_salutation_\"]) $daten[\"cp_salutation\"]=$daten[\"cp_salutation_\"];\n $keys=array_keys($daten);\n $dbf=array_keys($dbfld);\n //$fid=$daten[\"fid\"];\n $anzahl=count($keys);\n $fehler=-1;\n $tels=array();\n $query0='';\n for ($i=0; $i<$anzahl; $i++) {\n if (in_array($keys[$i],$dbf)) {\n $tmpval=trim($daten[$keys[$i]]);\n if ($dbfld[$keys[$i]][0]==1) { // Daten nicht für contacts\n continue;\n } else {\n if (!chkFld($tmpval,$dbfld[$keys[$i]][1],$dbfld[$keys[$i]][2],$dbfld[$keys[$i]][4])) {\n $fehler=$dbfld[$keys[$i]][3]; $fehler.=\"::\".$keys[$i];\n $i=$anzahl+1;\n }\n if ($keys[$i]==\"cp_phone1\"||$keys[$i]==\"cp_phone2\"||$keys[$i]==\"cp_fax\") $tels[]=$tmpval;\n $query0.=$keys[$i].\"=\";\n if (in_array($dbfld[$keys[$i]][2],array(0,1,2,3,4,5,7,8,9))) { //Stringwert\n if (empty($tmpval)) {\n $query0.=\"null,\";\n } else {\n $query0.=\"'\".$tmpval.\"',\";\n }\n } else {\n if (empty($tmpval)) {\n $query0.=\"null,\";\n } else {\n $query0.=$tmpval.\",\"; //Zahlwert\n }\n }\n }\n }\n }\n if ($fehler==-1) { //Kein Fehler aufgetreten\n if (!$daten[\"PID\"] or $daten[\"PID\"]<1) $pid=mknewPerson($daten[\"employee\"]); //Neue Person\n if (!$pid) return \"keine PID\"; //Hat keine PID\n if ($daten[\"nummer\"]) { //Gehört zu einem Cust./Vend.\n $dir=$daten[\"Quelle\"].$daten[\"nummer\"].\"/\".$pid;\n } else {\n $dir=$pid;\n };\n $ok=chkdir($dir);\n if ($bildok) { //Ein Bild wird mitgeliefert\n require_once(\"documents.php\"); // db-Eintrag und upload\n $dbfile=new document();\n $dbfile->setDocData(\"descript\",\"Foto von \".$daten[\"cp_givenname\"].\" \".$daten[\"cp_name\"]);\n $bild[\"Datei\"][\"name\"]=$datei[\"Datei\"][\"name\"][\"bild\"];\n $bild[\"Datei\"][\"tmp_name\"]=$datei[\"Datei\"][\"tmp_name\"][\"bild\"];\n $bild[\"Datei\"][\"size\"]=$datei[\"Datei\"][\"size\"][\"bild\"];\n $bild[\"Datei\"][\"type\"]=$datei[\"Datei\"][\"type\"][\"bild\"];\n $bild[\"Datei\"][\"error\"]=$datei[\"Datei\"][\"error\"][\"bild\"];\n $dbfile->uploadDocument($bild,\"/$dir\");\n }\n if ($datei[\"Datei\"][\"name\"][\"visit\"]) {\n $bild[\"Datei\"][\"name\"]=\"vcard$pid.\".\n strtolower(substr($datei[\"Datei\"][\"name\"][\"visit\"],strrpos($datei[\"Datei\"][\"name\"][\"visit\"],\".\")+1));\n $bild[\"Datei\"][\"tmp_name\"]=$datei[\"Datei\"][\"tmp_name\"][\"visit\"];\n $bild[\"Datei\"][\"size\"]=$datei[\"Datei\"][\"size\"][\"visit\"];\n $bild[\"Datei\"][\"type\"]=$datei[\"Datei\"][\"type\"][\"visit\"];\n $bild[\"Datei\"][\"error\"]=$datei[\"Datei\"][\"error\"][\"visit\"];\n $dbfile=new document();\n $dbfile->setDocData(\"descript\",\"Visitenkarte von \".$daten[\"cp_givenname\"].\" \".$daten[\"cp_name\"]);\n $dbfile->uploadDocument($bild,\"/$dir\");\n }\n mkTelNummer($pid,\"P\",$tels);\n $sql0=\"update contacts set \".$query0.\"cp_employee=\".$_SESSION[\"loginCRM\"].\" where cp_id=$pid\";\n if($GLOBALS['dbh']->query($sql0)) { //Erfolgreich gesichert\n return $pid;\n } else {\n return \"unbekannt\";\n }\n } else { return $fehler; };\n}", "function store() {\n $row = & $this->getTable();\n\n $data = JRequest::get('post');\n // Bind the form fields to the hello table\n if (!$row->bind($data)) {\n $this->setError($this->_db->getErrorMsg());\n return false;\n }\n\n // Make sure the record is valid\n if (!$row->check()) {\n $this->setError($row->getError());\n return false;\n }\n\n // Store the table to the database\n if (!$row->store()) {\n $this->setError($row->getErrorMsg());\n return false;\n }\n\n return true;\n }", "function manage_form($form, $form_state) {\n module_load_include('inc','ccHosting','includes/lib');\n $form = array();\n global $user;\n\n\t$sitedata = array();\n\t$sitedata = getSiteData($form_state['site_id']);\n\n\tif(isset($sitedata)){\n\n\t\t$form['site_name'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Site Name'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_name'],\n\t\t);\n\t\t$form['site_description'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_description'],\n\t\t);\n\n\t\t$form['site_domain'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Domain'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_domain'],\n\t\t);\n\n\t\t$form['site_cms'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('CMS'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#default_value' => $sitedata['site_cms'],\n\t\t);\n\n\t\t/////// required for form\n\t\t$form['basic_id'] = array(\n\t\t\t'#type' => 'value',\n\t\t\t'#value' => $form_state['site_id'],\n\t\t);\n\t\t$form['bundle_type'] = array(\n\t\t\t'#type' => 'value',\n\t\t\t'#value' => 'ccdev_hosting_bundle',\n\t\t);\n\t\t$form['submit'] = array(\n\t\t\t'#type' => 'submit',\n\t\t\t'#value' => t('Save'),\n\t\t\t'#attributes' => array('class' => array('btn', 'btn-success'), 'style' => \"float:right; padding: 5px 10px;\"),\n\t\t\t'#theme' => \"submit\",\n\t\t\t'#prefix' => \"<div class=''>\",\n\t\t\t'#suffix' => \"</div>\",\n\t\t\t '#ajax' => array(\n\t\t\t 'callback' => 'manage_form_submit',),\n\t\t\t); \n\t}\n return $form;\n}", "public function store()\n {\n \n //POST\n $nombres = Security::verificateName( $_POST['nombres']);\n $apellidos = Security::verificateName( $_POST['apellidos']);\n $correo = Security::verificateEmail( $_POST['correo']);\n $clave1 = Security::verificatePassword($_POST['clave']);\n $numero_documento = Security::verificateDocument( $_POST['numero_documento']);\n $fk_rol = Security::verificateInt( $_POST['rol']);\n $fk_cargo = Security::verificateInt( $_POST['cargo']);\n $fk_tipo_documento = Security::verificateInt( $_POST['tipo_documento']);\n $fk_tipo_contrato = Security::verificateInt( $_POST['fk_tipo_contrato']);\n $salario = Security::verificateInt( $_POST['salario']);\n\n\n\n //Nomina\n $fecha_de = $_POST['fecha_de'];\n $fecha_hasta = $_POST['fecha_hasta'];\n $arrayDatos = json_decode($_POST['arrayDatos']);\n\n if($nombres && $apellidos && $correo && $clave1 && $numero_documento && $fk_rol && $fk_cargo && $fk_tipo_documento && $fk_tipo_contrato && $salario && $fecha_de && $fecha_hasta && $arrayDatos)\n {\n\n if(!Login::verificarSiExisteEmail($correo))\n {\n //? img si no se pone una img tomara el valor por defecto empty(si esta undefined da false)\n if(empty($_POST['user_img']))\n {\n //? Update Img\n $fecha = new DateTime();\n // funcion img\n $directorio = \"assets/uploud/profile/\";\n $archivo= $directorio.basename($fecha->getTimeStamp().$_FILES[\"user_img\"][\"name\"]);\n //info de ext(jpg,png,etc)\n $tipoArchivo =strtolower(pathinfo($archivo,PATHINFO_EXTENSION));\n //verifica que el archivo tenga dimensiones(w,h) \n $DimensionesImg =getimagesize($_FILES['user_img']['tmp_name']);\n \n if($DimensionesImg == true)\n {\n $tamañoImg = $_FILES['user_img'][\"size\"];\n if($tamañoImg > 2000000)\n {\n // echo \"El archivo tiene que ser menor a 2mb\";\n echo json_encode(['error'=>\"El archivo tiene que ser menor a 2mb\"]);\n return;\n }\n else{\n if($tipoArchivo == \"jpg\" || $tipoArchivo == \"png\" || $tipoArchivo == \"jpeg\" )\n {\n move_uploaded_file($_FILES[\"user_img\"][\"tmp_name\"],$archivo);\n $img_usuario=$archivo;\n }\n else{\n // echo \"la extension del archivo no es valida\";\n echo json_encode(['error'=>'a extension del archivo no es valida']);\n return;\n }\n }\n }else\n {\n // echo \"el documento no es una img\";\n echo json_encode(['error'=> 'el documento no es una img']);\n return;\n \n }\n }else{\n $img_usuario = 'assets/uploud/profile/default.svg';\n }\n\n\n $token = $this->seguridad->encryptToken(str_replace(' ','',$nombres.$numero_documento.$apellidos));\n $clave = password_hash($clave1,PASSWORD_DEFAULT);\n parent::storeUser($nombres,$apellidos,$correo,$salario,$clave,$img_usuario,$numero_documento,$fk_rol,$fk_cargo,$fk_tipo_documento,$fk_tipo_contrato,$token);\n \n \n\n //?NOMINA\n $fk_usuario = parent::consultarUltimoUsuario();\n $nomina = new Nomina();\n if($fecha_de && $fecha_hasta && $arrayDatos){\n\n $nomina->createNomina($fk_usuario->id, $fecha_de, $fecha_hasta,2);\n \n $lastNomina =$nomina->consultarUltimaNomina();\n \n $total = 0;\n for ($i=0; $i < count($arrayDatos); $i++) { \n $data = $arrayDatos[$i];\n $nomina->createConcept($data->descripcion,2, $data->fk_asiento_contable, $data->valor, $data->fk_tipo_concepto, $lastNomina->id_nomina);\n \n if($data->fk_asiento_contable == 2)\n {\n $total -=$data->valor;\n \n }else{\n $total +=$data->valor;\n }\n }\n \n \n $nomina->updateNominaValor($total,$lastNomina->id_nomina);\n echo json_encode(['ok'=> 'Creado']);\n return;\n }else{\n return;\n }\n\n //? END-NOMINA\n\n echo json_encode(['ok' => 'usuarioCreado']);\n\n\n }else{\n echo json_encode(['error' => 'correoExistente']);\n }\n }\n else{\n echo json_encode(['error' => 'errorAgregarUsuario']);\n return;\n }\n }", "function _submit_biz_data()\n {\n\t$data = $this->_get_data_from_post('business');\n\t//$this->debug($_FILES);\n\tif ($_FILES['photo']['name'] != NULL) {\n\t $data['logo'] = Modules::run('upload_manager/upload', 'photo', 'biz');\n\t}\n\n\t$id = $this->uri->segment(3) == 'edit' ? $this->session->user_id : '';\n\tif (is_numeric($id)) {\n\t $this->_update($id, $data, 'mdl_marketers_info');\n\t //Modules::run('auth/create_session', $this->session->user_id);\n\t redirect($this->uri->segment(3) == 'edit' ? 'users/profile' : 'users');\n\t} else {\n\t $this->_insert($data, 'mdl_marketers_info');\n\t //redirect('login');\n\t}\n }", "protected function _processForm (array $values, $form) {\n \n //---> blank codes <------\n $code99 = array(\n 'aborid','gender','popgrp','homelang',\n 'borncan','referby','marital','adults','numchild',\n 'actlim1', 'actlim2'\n );\n \n\t$code88 = array(\n\t\t'brsc5','brsc6'\n\t);\n \n $code77 = array(\n 'grade','ch1age','ch2age','ch3age','ch4age',\n 'ch5age','ch6age','ch7age','ch8age','hous1a',\n\t 'prlt1a','prlt2a','prlt3a','prlt4a','prlt5a','prlt6a','prlt7a',\n\t 'prlt1b','prlt2b','prlt3b','prlt4b','prlt5b','prlt6b','prlt7b',\n\t 'prst1a','prst2a','prst3a','prst4a',\n\t 'prst1b','prst2b','prst3b','prst4b'\n );\n \n $code777 = array(\n 'yrscan'\n );\n\n $code1 = array(\n 'cadu1', 'cadu2', 'cadu3', 'cadu4', 'cadu5', 'cadu6', 'cadu7', 'cadu8',\n 'cadu9', 'cadu10', 'cadu11', 'cadu12', 'cadu13', 'cadu14', 'cadu15', 'cadu16'\n );\n \n $codeDate = array(\n 'hous1until'\n );\n\n\t $codeNA = array(\n\t 'genderoth'\n\t );\n \n //---> alphanumeric questions <----\n $alphaNums = array(\n 'popgrp','homelang','country', 'referby'\n );\n \n //end code book option arrays\n \n $questions = array();\n //get all necessary elements\n $elementSQL = \"SELECT elementID,fsiiName,options \n FROM customFormElements\n WHERE fsiiName IS NOT NULL\n AND formID = $form\";\n $elementList = $this->elmntModel->getAdapter()\n ->fetchAll(\"$elementSQL\");\n \n foreach ($elementList as $element) {\n $eName = $element['elementID'];\n \n if (array_key_exists($eName, $values)) {\n $val = $values[$eName];\n } else {\n $val = '';\n }\n \n \n $qCode = $element['fsiiName'];\n //FCSS handles multiple-answer questions as series of\n //separate 'yes/no' dyads; we prefer checkboxes,\n //so must process. we've called these 'processCheck' for convenience\n \n if ($qCode == 'processCheck') {\n $submittedAnswers = explode(' , ' , strtolower($val));\n \n $set = json_decode($element['options'], TRUE);\n \n foreach ($set as $newQuestionCode => $newValue) {\n \n if (in_array(strtolower(trim($newValue)), $submittedAnswers)) {\n $answerCode = '2'; //YES\n } elseif (strlen($val) > 0) {\n $answerCode = '1'; //NO\n } else {\n $answerCode = '77' ; //NA\n }\n $processedCheckSet = array (\n 'QuestionCode' => $newQuestionCode,\n 'Answer' => $answerCode\n );\n array_push($questions,$processedCheckSet);\n }\n continue;\n }\n \n \n $answers = json_decode($element['options'], TRUE);\n \n //if there are coded options, $answers will be > 0,\n //but some coded options (in $alphaNums) no longer want their codes\n \n if ((!in_array($qCode,$alphaNums)) && (count ($answers) > 0)) {\n $codes = array_flip($answers);\n if (array_key_exists($val,$codes)) {\n $response = $codes[$val]; \n } else {\n $response = '';\n }\n } else {\n //keep free text\n $response = $val;\n }\n \n if (in_array($qCode, $code99)) {\n $blankCode = '99';\n } elseif (in_array ($qCode, $code88)){\n $blankCode = '88';\n } elseif (in_array ($qCode, $code77)){\n $blankCode = '77';\n } elseif (in_array($qCode, $code777)) {\n $blankCode = '777';\n } elseif (in_array($qCode, $code1)) {\n $blankCode = '1';\n } elseif (in_array($qCode, $codeDate)) {\n $blankCode = '7777-77-77'; \n } elseif (in_array($qCode, $codeNA)) {\n $blankCode = 'na'; \n } else {\n $blankCode = '';\n }\n \n if ($response == '') $response = $blankCode;\n \n $tempAnswerSet = array (\n 'QuestionCode' => $qCode,\n 'Answer' => $response\n );\n \n array_push($questions,$tempAnswerSet);\n \n }\n \n if ($form == '100') //Intake form requires age, will calculate\n {\n $ptcp = new Application_Model_DbTable_Participants;\n $ptcpID = $values['uid'];\n $ptcpRecord = $ptcp->getRecord($ptcpID);\n $age = $ptcpRecord['age'];\n $tempAnswerSet = array (\n 'QuestionCode' => 'age',\n 'Answer' => $age\n );\n array_push($questions,$tempAnswerSet); \n }\n \n if ($form == '103') //Discontinue form requires date twice\n {\n $tempAnswerSet = array (\n 'QuestionCode' => 'disc',\n 'Answer' => $values['responseDate']\n );\n \n array_push($questions,$tempAnswerSet);\n }\n \n /* LEGACY \n if ($form == '102' || $form == '113') { //In poverty forms, question-codes vary based on prepost\n \n if ($values['prepost'] == 'pre') {\n $suffix = 'a';\n $emptySuffix = 'b';\n } else {\n $suffix = 'b';\n $emptySuffix = 'a';\n }\n \n foreach ($questions as $key => $qArray) { \n $code = $qArray['QuestionCode'];\n \n $qArray['QuestionCode'] = $code . $suffix;\n $questions[$key] = $qArray;\n \n $emptyArray = array(\n 'QuestionCode' => $code . $emptySuffix,\n 'Answer' => '77'\n );\n array_push($questions, $emptyArray);\n }\n \n } */\n \n return $questions;\n }", "public function save() {\r\n $this->model->reverseInstantiate($_REQUEST);\r\n $message = array();\r\n\r\n if ($this->model->firstname == '') {\r\n $message['firstname'] = \"Firstname cannot be empty\";\r\n }\r\n\r\n if ($this->model->lastname == '') {\r\n $message['lastname'] = \"Lastname cannot be empty\";\r\n }\r\n\r\n if (count($message) == 0) {\r\n if (!($this->model->save())) {\r\n $message['message'] = ' No changes are made to the form';\r\n } else {\r\n $message['url'] = $this->api->getApplicationUrl() . 'contact/view?id=' . $this->model->id;\r\n $message['message'] = 'Saved Successfully';\r\n }\r\n } else {\r\n $message['message'] = 'Please Correct The Below Form Details and Try Saving';\r\n }\r\n echo json_encode($message);\r\n return true;\r\n }", "private function processForm()\n {\n //Validate the form passed The Curator's safety procedures.\n if(!$this->Form->validate())\n {\n array_push($this->Form->formMessagesError, FORM\\MESSAGE\\ERROR_GENERAL);\n\n return FALSE;\n }\n\n //Verify the form is not being flooded\n if($this->Form->checkFormFlood(CONFIG\\ACCOUNT\\FLOOD_DELAY))\n {\n array_push($this->Form->formMessagesError, FORM\\MESSAGE\\FLOOD);\n\n return FALSE;\n }\n\n //Initialize the Rules class for field validation.\n $this->Policy = new Policy($this->Form);\n\n //Check the user field data against Curator rules.\n if($this->Policy->checkRules())\n {\n array_push($this->Form->formMessagesError, FORM\\MESSAGE\\ERROR_FIELD);\n\n return FALSE;\n }\n\n array_push($this->Form->formMessagesSuccess, 'Account Created.');\n\n $this->success = TRUE;\n\n //Since the account was created set up the form flood protection.\n //$this->Form->setFormFlood();\n\n return TRUE;\n \n //Validate each field one at a time.\n //If its a required field it must have data\n //Ensure the data in the field matches the field.\n //Ensure the rules for each field are met.\n\n //Verify if account already exists.\n\n //Create account\n\n //Start authorization process\n }", "private function createForm($formOptions, $studentData, $recordData, $group){\n if(!$studentData) {\n \n $formStatus = 'new';\n $formTitle = 'New '; \n $formTitle .= $group;\n $groupSelect = $group.' List';\n \n $firstName = '';\n $lastName = '';\n $email = '';\n $ID = '';\n \n if($recordData){\n $formStatus = 'update';\n $formTitle = 'Update ';\n $formTitle .= $group;\n $firstName = $recordData['first_name'];\n $lastName = $recordData['last_name'];\n $email = $recordData['email'];\n switch($group) {\n case 'MedOpp Advisor':\n $ID = $recordData['advisorid'];\n break;\n case 'Letter Writer':\n $ID = $recordData['writerid'];\n break;\n case 'Committee Member':\n $ID = $recordData['interviewerid'];\n break;\n }\n }\n \n $this->formContent .= '\n <h2 class=\"center\">'.$formTitle.'</h2>\n <hr>\n <form action=\"index.php\" method=\"post\">\n <input type=\"hidden\" name=\"action\" value=\"submitForm\"><input type=\"hidden\" name=\"status\" value=\"' .$formStatus. '\">\n <input type=\"hidden\" name=\"groupSelect\" value=\"'.$groupSelect.'\">\n\n\n\n <table class=\"table table-striped tableBorder\">\n <tbody>\n <tr>\n <td>First / Last Name:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" id=\"first_name\" name=\"First_Name\" value=\"'.$firstName.'\" required>\n </div>\n\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" name=\"Last_Name\" value=\"'.$lastName.'\" required>\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>ID:</td>\n <td><input type=\"text\" pattern=\"[0-9]+\" class=\"form-control\" name=\"ID\" value=\"'.$ID.'\" readonly></td>\n\n </tr>\n <tr>\n <td>Email:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"Email\" value=\"'.$email.'\"></td>\n </tbody>\n </table>\n <input type=\"submit\" class=\"btn btn-primary\" value=\"Submit\">\n </form>'; \n } else {\n $editStatus = '';\n $formStatus = 'new';\n $formTitle = 'New Student';\n \n $firstName = '';\n $middleName = '';\n $lastName = '';\n $studentID = '';\n $email = '';\n $phone = '';\n $dob = '';\n $sex = '';\n $ethnicGroup = '';\n $disadvantagedYes = '';\n $disadvantagedNo = '';\n $firstGenerationYes = '';\n $firstGenerationNo = '';\n $militaryYes = '';\n $militaryNo = '';\n $address = ' ';\n $city = '';\n $state = '';\n $county = '';\n $postal = '';\n $country = '';\n $languages = '\n <tr><td> \n <input type=\"text\" class=\"form-control\" name=\"Language[]\" value=\" \">\n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder languageAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td><tr>';\n \n $applicationYear = '';\n $packetYes = '';\n $packetNo = '';\n $datePaid = '';\n $firstTerm = '';\n $applicationStatus = '';\n $hsGPA = '';\n $GPA = '';\n $credits = '';\n $eligibleYes = '';\n $eligibleNo = '';\n $participatingYes = '';\n $participatingNo = '';\n $honorCredits = '';\n $courses = '';\n $degrees = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Academic_Program[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Degree[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder academicAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $extras = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Extra_Org[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Extra_Start[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Extra_End[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder extraAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $groups = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Group_Org[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Group_Start[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Group_End[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder groupAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n \n $leadership = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Leader_Org[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Leader_Pos[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Leader_Start[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Leader_End[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder leaderAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $work = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Work_Employer[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Work_Pos[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]+|[\\s])\" title=\"Numbers only please.\" class=\"form-control\" name=\"Work_Hours[]\" value=\" \"> \n </td>\n <td>\n <select id=\"choice\" class=\"form-control\" name=\"Work_Healthcare[]\">\n <option value=\" \"></option>\n <option value=\"Yes\">Yes</option>\n <option value=\"No\">No</option>\n </select> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Work_Start[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Work_End[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder workAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $studyAbroad = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Abroad_School[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Abroad_City[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Abroad_Country[]\" value=\" \"> \n </td>\n \n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Abroad_Start[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Abroad_End[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder abroadAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $volunteer = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Volunteer_Org[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]+|[\\s])\" title=\"Numbers only please.\" class=\"form-control\" name=\"Volunteer_Hours[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]+|[\\s])\" title=\"Numbers only please.\" class=\"form-control\" name=\"Volunteer_Avg[]\" value=\" \"> \n </td>\n <td>\n <select id=\"choice\" class=\"form-control\" name=\"Volunteer_Healthcare[]\">\n <option value=\" \"></option>\n <option value=\"Yes\">Yes</option>\n <option value=\"No\">No</option>\n </select> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Volunteer_Start[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Volunteer_End[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder volunteerAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $research = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Research_Lab[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Research_Pos[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Research_Last_Name[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Research_First_Name[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]+|[\\s])\" title=\"Numbers only please.\" class=\"form-control\" name=\"Research_Hours[]\" value=\" \"> \n </td>\n <td>\n <select id=\"choice\" class=\"form-control\" name=\"Research_Volunteer[]\">\n <option value=\" \"></option>\n <option value=\"Yes\">Yes</option>\n <option value=\"No\">No</option>\n </select> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Research_Start[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Research_End[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder researchAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $shadow = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Shadow_Last_Name[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Shadow_First_Name[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Shadow_Specialty[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]+|[\\s])\" title=\"Numbers only please.\" class=\"form-control\" name=\"Shadow_Hours[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder shadowAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $tests = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Test_Name[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" class=\"form-control\" name=\"Test_Date[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" pattern=\"([0-9]+|[\\s])\" title=\"Numbers only please.\" class=\"form-control\" name=\"Test_Score[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder testsAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $schools = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"School_Name[]\" value=\" \"> \n </td>\n <td>\n <select id=\"accepted\" class=\"form-control\" name=\"School_Accepted[]\">\n <option value=\" \"></option>\n <option value=\"Waitlisted\" >Waitlisted</option>\n <option value=\"Yes\" >Yes</option>\n <option value=\"No\" >No</option>\n </select> \n </td>\n <td>\n <select id=\"choice\" class=\"form-control\" name=\"School_Choice[]\">\n <option value=\" \"></option>\n <option value=\"Yes\" >Yes</option>\n <option value=\"No\">No</option>\n </select> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder schoolAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr>';\n $events = '\n <tr>\n <td>\n <input type=\"text\" class=\"form-control\" name=\"Event_Name[]\" value=\" \"> \n </td>\n <td>\n <input type=\"text\" class=\"form-control\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" name=\"Event_Completed[]\" value=\" \"> \n </td>\n <td class=\"text-right\">\n <a href=\"#\"><img class=\"iconBorder eventAddRow\" src=\"Images/open-iconic/png/plus-2x.png\" alt=\"Edit Icon\"></a>\n </td>\n </tr> ';\n \n $contactedYes = '';\n $contactedNo = '';\n $interviewDate = '';\n $transmitDate = '';\n $committeeNote = '';\n \n \n \n if($recordData){\n $editStatus = \"readonly\";\n $formStatus = 'update';\n $formTitle = 'Update Student';\n if($recordData['first_name']) $firstName = $recordData['first_name'];\n if($recordData['middle_name']) $middleName = $recordData['middle_name'];\n if($recordData['last_name']) $lastName = $recordData['last_name'];\n if($recordData['studentid']) $studentID = $recordData['studentid'];\n if($recordData['email']) $email = $recordData['email'];\n if($recordData['phone']) $phone = $recordData['phone'];\n if($recordData['date_of_birth']) $dob = $recordData['date_of_birth'];\n if($recordData['sex']) $sex = $recordData['sex'];\n if($recordData['ethnic_group']) $ethnicGroup = $recordData['ethnic_group'];\n if($recordData['disadvantaged']) $disadvantaged = $recordData['disadvantaged'];\n if($recordData['first_generation']) $firstGeneration = $recordData['first_generation'];\n if($recordData['military_service']) $military = $recordData['military_service'];\n if($recordData['address']) $address = $recordData['address'];\n if($recordData['city']) $city = $recordData['city'];\n if($recordData['state']) $state = $recordData['state'];\n if($recordData['county']) $county = $recordData['county'];\n if($recordData['postal']) $postal = $recordData['postal'];\n if($recordData['country']) $country = $recordData['country'];\n if($studentData['languageData']) $languages = $studentData['languageData'];\n \n if($recordData['application_year']) $applicationYear = $recordData['application_year'];\n if($recordData['packet_received']) $packet = $recordData['packet_received'];\n if($recordData['date_paid']) $datePaid = $recordData['date_paid'];\n if($recordData['first_term']) $firstTerm = $recordData['first_term'];\n if($recordData['application_status']) $applicationStatus = $recordData['application_status'];\n if($recordData['hs_core_gpa']) $hsGPA = $recordData['hs_core_gpa'];\n if($recordData['cum_gpa']) $GPA = $recordData['cum_gpa'];\n if($recordData['total_credit']) $credits = $recordData['total_credit'];\n if($recordData['honors_eligible']) $eligible = $recordData['honors_eligible'];\n if($studentData['participating']) $participating = $studentData['participating'];\n if($studentData['credit_hours']) $honorCredits = $studentData['credit_hours'];\n if($studentData['course_count']) $courses = $studentData['course_count'];\n if($studentData['degreeData']) $degrees = $studentData['degreeData'];\n \n if($studentData['extraData']) $extras = $studentData['extraData'];\n if($studentData['stugroupsData']) $groups = $studentData['stugroupsData'];\n if($studentData['leadershipData']) $leadership = $studentData['leadershipData'];\n if($studentData['workData']) $work = $studentData['workData'];\n if($studentData['abroadData']) $studyAbroad = $studentData['abroadData'];\n if($studentData['volunteerData']) $volunteer = $studentData['volunteerData'];\n if($studentData['shadowData']) $shadow = $studentData['shadowData'];\n if($studentData['researchData']) $research = $studentData['researchData'];\n \n if($studentData['hptestData']) $tests = $studentData['hptestData'];\n if($studentData['hpschoolData']) $schools = $studentData['hpschoolData'];\n \n if($studentData['eventData']) $events = $studentData['eventData'];\n \n if($studentData['contacted_student']) $contacted = $studentData['contacted_student'];\n if($studentData['interview_date']) $interviewDate = $studentData['interview_date'];\n if($studentData['transmit_date']) $transmitDate = $studentData['transmit_date'];\n if($studentData['committee_note']) $committeeNote = $studentData['committee_note'];\n }\n if($disadvantaged == 'Yes') $disadvantagedYes = 'checked';\n if($disadvantaged == 'No') $disadvantagedNo = 'checked';\n \n if($firstGeneration == 'Yes') $firstGenerationYes = 'checked';\n if($firstGeneration == 'No') $firstGenerationNo = 'checked'; \n \n if($military == 'Yes') $militaryYes = 'checked';\n if($military == 'No') $militaryNo = 'checked'; \n \n if($packet == 'Yes') $packetYes = 'checked';\n if($packet == 'No') $packetNo = 'checked'; \n \n if($eligible == 'Yes') $eligibleYes = 'checked';\n if($eligible == 'No') $eligibleNo = 'checked'; \n \n if($participating == 'Yes') $participatingYes = 'checked';\n if($participating == 'No') $participatingNo = 'checked'; \n \n if($contacted == 'Yes') $contactedYes = 'checked';\n if($contacted == 'No') $contactedNo = 'checked';\n \n $this->formContent .= '\n <h2 class=\"center\">'.$formTitle.'</h2>\n <hr>\n <form action=\"index.php\" method=\"post\">\n <input type=\"hidden\" name=\"action\" value=\"submitForm\"><input type=\"hidden\" name=\"status\" value=\"' .$formStatus. '\">\n <input type=\"hidden\" name=\"groupSelect\" value=\"Student List\">\n <ul class=\"nav nav-tabs\" role=\"tablist\">\n <li class=\"nav-item\">\n <a class=\"nav-link active\" role=\"tab\" data-toggle=\"tab\" href=\"#demo\">Demographic Info</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#academicInfo\">Academic Info</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#healthInfo\">Health Profession Info</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#involvementInfo\">Involvement</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#experienceInfo\">Experience</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#eventInfo\">Event Info</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#writerInfo\">Recommendation Writer Info</a>\n </li>\n <li class=\"nav-item\">\n <a class=\"nav-link\" role=\"tab\" data-toggle=\"tab\" href=\"#interviewInfo\">Interview Info</a>\n </li>\n </ul>\n\n<div class=\"tab-content\">\n <div id=\"demo\" class=\"tab-pane fade show active\" role=\"tabpanel\">\n <table class=\"table table-striped tableBorder\">\n <tbody>\n <tr>\n <td>First / Middle / Last Name:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" id=\"first_name\" name=\"First_Name\" value=\"'.$firstName.'\" required>\n </div>\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" name=\"Middle_Name\" value=\"'.$middleName.'\">\n </div>\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" name=\"Last_Name\" value=\"'.$lastName.'\" required>\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>StudentID:</td>\n <td><input type=\"text\" pattern=\"[0-9]{8}\" class=\"form-control\" name=\"StudentID\" value=\"'.$studentID.'\" required '.$editStatus.'>\n <small id=\"stuIDHelp\" class=\"form-text text-muted\">8 digit MU Student ID</small></td>\n </tr>\n <tr>\n <td>MedOpp Advisor:</td>\n <td>' .$formOptions['Advisors']. '</td>\n </tr>\n <tr>\n <td>Email:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"Email\" value=\"'.$email.'\"></td>\n </tr>\n <tr>\n <td>Phone:</td>\n <td><input type=\"text\" pattern=\"[0-9]{3}[\\-][0-9]{3}[\\-][0-9]{4}\" class=\"form-control\" name=\"Phone\" value=\"'.$phone.'\">\n <small class=\"form-text text-muted\">Please supply in XXX-XXX-XXXX format.</small></td>\n </tr>\n <tr>\n <td>Date of Birth / Sex:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"text\" pattern=\"[0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}\" class=\"form-control\" name=\"DOB\" value=\"'.$dob.'\">\n <small class=\"form-text text-muted\">Please supply in XXXX-XX-XX format.</small>\n </div>\n <div class=\"col div-inline\">\n <select id=\"sex\" class=\"form-control\" name=\"Sex\">\n <option value=\"'.$sex.'\">'.$sex.'</option>\n <option value=\"Male\">Male</option>\n <option value=\"Female\">Female</option>\n <option value=\"Other\">Other</option>\n <option value=\"Prefer not to say\">Prefer not to say</option>\n </select>\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>Ethnic Group / Disadvantaged?:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" name=\"Ethnic_Group\" value=\"'.$ethnicGroup.'\">\n </div>\n <div class=\"col div-inline\">\n <input type=\"radio\" class=\"\" name=\"Disadvantaged\" value=\"Yes\"'.$disadvantagedYes.'> Yes\n <input type=\"radio\" class=\"\" name=\"Disadvantaged\" value=\"No\"'.$disadvantagedNo.'> No \n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>First Generation? / Military Service?:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"radio\" class=\"\" name=\"First_Generation\" value=\"Yes\"'.$firstGenerationYes.'> Yes \n <input type=\"radio\" class=\"\" name=\"First_Generation\" value=\"No\"'.$firstGenerationNo.'> No \n </div>\n <div class=\"col div-inline\">\n <input type=\"radio\" class=\"\" name=\"Military_Service\" value=\"Yes\"'.$militaryYes.'> Yes\n <input type=\"radio\" class=\"\" name=\"Military_Service\" value=\"No\"'.$militaryNo.'> No \n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>Local Address:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"Local_Address\" value=\"'.$address.'\"></td>\n </tr>\n <tr>\n <td>City, State:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" name=\"City\" value=\"'.$city.'\">\n </div>\n <div class=\"col div-inline\">\n <input type=\"text\" class=\"form-control\" name=\"State\" value=\"'.$state.'\">\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>County:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"County\" value=\"'.$county.'\"></td>\n </tr>\n <tr>\n <td>Postal:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"Postal\" value=\"'.$postal.'\"></td>\n </tr>\n <tr>\n <td>Country:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"Country\" value=\"'.$country.'\"></td>\n </tr>\n </tbody>\n </table>\n <hr>\n <h4>Languages Spoken</h4>\n <table id=\"languageTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th style=\"width: 85%\">Language</th>\n <th class=\"text-right\" style=\"width: 15%\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$languages.' \n </tbody>\n </table>\n </div>\n \n\n \n \n \n <div id=\"academicInfo\" class=\"tab-pane fade\" role=\"tabpanel\">\n <table class=\"table table-striped tableBorder\">\n <tbody>\n <tr>\n <td>Application Year:</td>\n <td><input type=\"text\" class=\"form-control\" pattern=\"[0-9]{4}\" name=\"Application_Year\" value=\"'.$applicationYear.'\"><small class=\"form-text text-muted\">XXXX Format</small></td>\n \n </tr>\n <tr>\n <td>Packet Received / Date Paid:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"radio\" class=\"\" name=\"Packet_Received\" value=\"Yes\" '.$packetYes.'> Yes \n <input type=\"radio\" class=\"\" name=\"Packet_Received\" value=\"No\" '.$packetNo.'> No \n </div>\n <div class=\"col div-inline\">\n <input type=\"text\" pattern=\"[0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}\" class=\"form-control\" name=\"Date_Paid\" value=\"'.$datePaid.'\">\n <small class=\"form-text text-muted\">Please supply in XXXX-XX-XX format.</small>\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>First Term:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"First_Term\" pattern=\"[(FS|SP)]{2}[0-9]{4}\" value=\"'.$firstTerm.'\"><small class=\"form-text text-muted\">Please supply in FSXXXX or SPXXXX format.</small></td>\n </tr>\n <tr>\n <td>Application Status:</td>\n <td>\n <select id=\"applicationstatus\" class=\"form-control\" name=\"Application_Status\">\n <option value=\"'.$applicationStatus.'\">'.$applicationStatus.'</option>\n <option value=\"Application Submitted\">Application Submitted</option>\n <option value=\"Applying this Cycle\">Applying this Cycle</option>\n <option value=\"Gap Year\">Gap Year</option>\n </select>\n </td>\n </tr>\n <tr>\n <td>High School Core GPA:</td>\n <td><input type=\"text\" class=\"form-control\" pattern=\"[0-9]{1}[.][0-9]{3}\" name=\"HS_GPA\" value=\"'.$hsGPA.'\"><small class=\"form-text text-muted\">Please supply in X.XXX format.</small></td>\n </tr>\n <tr>\n <td>Cumulative GPA / Total Credits:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"text\" pattern=\"[0-9]{1}[.][0-9]{3}\" class=\"form-control\" name=\"GPA\" value=\"'.$GPA.'\">\n <small class=\"form-text text-muted\">Please supply in X.XXX format.</small>\n </div>\n <div class=\"col div-inline\">\n <input type=\"text\" pattern=\"[0-9]+\" title=\"Numbers only please.\" class=\"form-control\" name=\"Credits\" value=\"'.$credits.'\">\n </div>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n <hr><h3>Honors Info</h3>\n <table class=\"table table-striped tableBorder\">\n <tbody>\n <tr>\n <td>Honors Eligible:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"radio\" class=\"\" name=\"Honors_Eligible\" value=\"Yes\" '.$eligibleYes.'> Yes \n <input type=\"radio\" class=\"\" name=\"Honors_Eligible\" value=\"No\" '.$eligibleNo.'> No \n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>Participating?:</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"radio\" class=\"\" name=\"Participating\" value=\"Yes\" '.$participatingYes.'> Yes \n <input type=\"radio\" class=\"\" name=\"Participating\" value=\"No\" '.$participatingNo.'> No \n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>Credit Hours:</td>\n <td><input type=\"text\" pattern=\"[0-9]+\" title=\"Numbers only please.\" class=\"form-control\" name=\"Credit_Hours\" value=\"'.$honorCredits.'\"></td>\n </tr>\n <tr>\n <td>Course Count:</td>\n <td><input type=\"text\" pattern=\"[0-9]+\" title=\"Numbers only please.\" class=\"form-control\" name=\"Course_Count\" value=\"'.$courses.'\"></td>\n </tr>\n </tbody>\n </table>\n <hr><h3>Academic Plan</h3>\n <table id=\"academicTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th style=\"width=40%\">Academic Program</th>\n <th style=\"width=40%\">Degree</th>\n <th class=\"text-right\" style=\"width: 15%\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$degrees.'\n </tbody>\n </table>\n </div>\n \n <div id=\"healthInfo\" class=\"tab-pane fade\" role=\"tabpanel\">\n <br><h3>Health Profession Tests</h3> \n <table id=\"testsTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th style=\"width=28%\">Test Name</th>\n <th style=\"width=28%\">Test Date</th>\n <th style=\"width=28%\">Test Score</th>\n <th class=\"text-right\" style=\"width: 15%\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$tests.' \n </tbody>\n </table> \n <hr><h3>Health Profession Schools</h3>\n <table id=\"schoolTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th style=\"width=28%\">School Name</th>\n <th style=\"width=28%\">Accepted?</th>\n <th style=\"width=28%\">Student Choice?</th>\n <th class=\"text-right\" style=\"width: 15%\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$schools.' \n </tbody>\n </table> \n </div>\n \n <div id=\"involvementInfo\" class=\"tab-pane fade\" role=\"tabpanel\">\n <br><h4>Extracurricular Activities</h4>\n <table id=\"extraTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th style=\"width=28%\">Organization</th>\n <th style=\"width=28%\">Start Date</th>\n <th style=\"width=28%\">End Date</th>\n <th class=\"text-right\" style=\"width: 15%\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$extras.' \n </tbody>\n </table> \n <hr><h3>Student Groups</h3>\n <table id=\"groupTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th style=\"width=28%\">Organization</th>\n <th style=\"width=28%\">Start Date</th>\n <th style=\"width=28%\">End Date</th>\n <th class=\"text-right\" style=\"width: 15%\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$groups.'\n </tbody>\n </table> \n <hr><h3>Leadership Positions</h3>\n <table id=\"leaderTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th style=\"width=21%\">Organization</th>\n <th style=\"width=21%\">Position</th>\n <th style=\"width=21%\">Start Date</th>\n <th style=\"width=21%\">End Date</th>\n <th class=\"text-right\" style=\"width: 15%\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$leadership.' \n </tbody>\n </table> \n </div>\n \n <div id=\"experienceInfo\" class=\"tab-pane fade\" role=\"tabpanel\">\n <br><h3>Research</h3>\n <table id=\"researchTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>Lab Name</th>\n <th>Position</th>\n <th>Mentor Last Name</th>\n <th>Mentor First Name</th>\n <th>Hours Per Week</th>\n <th>Volunteer</th>\n <th>Start Date</th>\n <th>End Date</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$research.' \n </tbody>\n </table>\n <hr><h3>Work</h3>\n <table id=\"workTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>Employer</th>\n <th>Position</th>\n <th>Hours Per Week</th>\n <th>Health Care Related</th>\n <th>Start Date</th>\n <th>End Date</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$work.' \n </tbody>\n </table>\n <hr><h3>Shadow</h3>\n <table id=\"shadowTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>Physician Last Name</th>\n <th>Physician First Name</th>\n <th>Specialty</th>\n <th>Total Hours</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$shadow.' \n </tbody>\n </table>\n <hr><h3>Volunteer</h3>\n <table id=\"volunteerTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>Organization</th>\n <th>Total Hours</th>\n <th>Average Hours Per Week</th>\n <th>Health Care Related</th>\n <th>Start Date</th>\n <th>End Date</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$volunteer.' \n </tbody>\n </table>\n <hr><h3>Study Abroad</h3>\n <table id=\"abroadTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>School Abroad</th>\n <th>City</th>\n <th>Country</th>\n <th>Start Date</th>\n <th>End Date</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$studyAbroad.' \n </tbody>\n </table>\n </div>\n \n <div id=\"eventInfo\" class=\"tab-pane fade\" role=\"tabpanel\">\n <table id=\"eventTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>Event Name</th>\n <th>Date Completed</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$events.' \n </tbody>\n </table> \n </div>\n <div id=\"writerInfo\" class=\"tab-pane fade\" role=\"tabpanel\"><br>\n <h3>Recommendation Writers</h3>\n <table id=\"writerTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>Writer</th>\n <th>Reception Date</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$formOptions['Writers'].' \n </tbody>\n </table> \n </div>\n <div id=\"interviewInfo\" class=\"tab-pane fade\" role=\"tabpanel\">\n <table class=\"table table-striped tableBorder\">\n <tbody>\n <tr>\n <td>Contacted Student</td>\n <td>\n <div class=\"form-row\">\n <div class=\"col div-inline\">\n <input type=\"radio\" class=\"\" name=\"Contacted_Student\" value=\"Yes\" '.$contactedYes.'> Yes \n <input type=\"radio\" class=\"\" name=\"Contacted_Student\" value=\"No\" '.$contactedNo.'> No \n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td>Interview Date:</td>\n <td><input type=\"text\" class=\"form-control\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" name=\"Interview_Date\" value=\"'.$interviewDate.'\"></td>\n </tr>\n <tr>\n <td>Transmit Date:</td>\n <td><input type=\"text\" class=\"form-control\" pattern=\"([0-9]{4}[\\-][0-9]{2}[\\-][0-9]{2}|[\\s])\" title=\"Please supply in XXXX-XX-XX format.\" name=\"Transmit_Date\" value=\"'.$transmitDate.'\"></td>\n </tr>\n <tr>\n <td>Committee Note:</td>\n <td><input type=\"text\" class=\"form-control\" name=\"Committee_Note\" value=\"'.$committeeNote.'\"></td>\n </tr>\n </tbody>\n </table>\n <hr><h3 class=\"center groupSelect\">Committee Member List</h3>\n <table id=\"memberTable\" class=\"table table-striped tableBorder\">\n <thead>\n <tr>\n <th>Committee Member</th>\n <th class=\"text-right\">Add/Remove Row</th>\n <tr>\n </thead> \n <tbody>\n '.$formOptions['Members'].'\n </tbody>\n </table> \n </div>\n \n</div>\n\n\n<input type=\"submit\" class=\"btn btn-primary\" value=\"Submit\">\n</form>';\n }}", "private function formProcess() {\n if (isset($_POST['firstname']) && $_POST['firstname']) {\n $this->set_fname(format_uppercase_text($_POST['firstname']));\n } // Required\n if (isset($_POST['lastname']) && $_POST['lastname']) {\n $this->set_lname(format_uppercase_text($_POST['lastname']));\n } // Required\n if (isset($_POST['addressOne']) && $_POST['addressOne']) {\n $this->set_addressOne(format_text($_POST['addressOne']));\n } // Required\n if (isset($_POST['addressTwo']) && $_POST['addressTwo']) {\n $this->set_addressTwo(format_text($_POST['addressTwo']));\n } else {\n $this->set_addressTwo(\"\");\n }\n if (isset($_POST['city']) && $_POST['city']) {\n $this->set_city(format_uppercase_text($_POST['city']));\n } //Required\n if (isset($_POST['state']) && $_POST['state']) {\n $this->set_state(format_text($_POST['state']));\n } //Required\n if (isset($_POST['postalCode']) && $_POST['postalCode']) {\n $this->set_postalcode(format_text($_POST['postalCode']));\n } //Required\n if (isset($_POST['email']) && $_POST['email']) {\n $this->set_email(format_text(strtolower($_POST['email'])));\n } else {\n $this->set_email(\"\");\n }\n if (isset($_POST['homePhone']) && $_POST['homePhone']) {\n $this->set_homephone(format_text($_POST['homePhone']));\n } else {\n $this->set_homephone(\"\");\n }\n if (isset($_POST['workPhone']) && $_POST['workPhone']) {\n $this->set_workphone(format_text($_POST['workPhone']));\n } else {\n $this->set_workphone(\"\");\n }\n if (isset($_POST['cellPhone']) && $_POST['cellPhone']) {\n $this->set_cellphone(format_text($_POST['cellPhone']));\n } else {\n $this->set_cellphone(\"\");\n }\n /**\n if (isset($_POST['goalie']) && $_POST['goalie'] == \"on\") {\n $goalie = \"Y\";\n } else {\n $goalie = \"N\";\n }\n if (isset($_POST['defense']) && $_POST['defense'] == \"on\") {\n $defense = \"Y\";\n } else {\n $defense = \"N\";\n }\n if (isset($_POST['center']) && $_POST['center'] == \"on\") {\n $center = \"Y\";\n } else {\n $center = \"N\";\n }\n if (isset($_POST['wing']) && $_POST['wing'] == \"on\") {\n $wing = \"Y\";\n } else {\n $wing = \"N\";\n }\n */\n if (isset($_POST['position']) && $_POST['position']) {\n $this->set_position($_POST['position']);\n } //Required\n if (isset($_POST['jerseySize']) && $_POST['jerseySize']) {\n $this->set_jerseysize($_POST['jerseySize']);\n } //Required\n if ((isset($_POST['jerseyNumChoiceOne']) && $_POST['jerseyNumChoiceOne']) || $_POST['jerseyNumChoiceOne'] == 0) {\n $this->set_jerseyNumberOne($_POST['jerseyNumChoiceOne']);\n } //Required\n if ((isset($_POST['jerseyNumChoiceTwo']) && $_POST['jerseyNumChoiceTwo']) || $_POST['jerseyNumChoiceTwo'] == 0) {\n $this->set_jerseyNumberTwo($_POST['jerseyNumChoiceTwo']);\n } //Required\n if ((isset($_POST['jerseyNumChoiceThree']) && $_POST['jerseyNumChoiceThree']) || $_POST['jerseyNumChoiceThree'] == 0) {\n $this->set_jerseyNumberThree($_POST['jerseyNumChoiceThree']);\n } //Required\n if (isset($_POST['travelWith']) && $_POST['travelWith']) {\n $this->set_travelingWithWho(format_text($_POST['travelWith']));\n } else {\n $this->set_travelingWithWho(\"\");\n }\n if (isset($_POST['additionalNotes']) && $_POST['additionalNotes']) {\n $this->set_notes(format_text($_POST['additionalNotes']));\n } else {\n $this->set_notes(\"\");\n }\n if (isset($_POST['skillLevel']) && $_POST['skillLevel']) {\n $this->set_skilllevel($_POST['skillLevel']);\n } //Required\n if (isset($_POST['willSub']) && $_POST['willSub'] == \"Y\") {\n $this->set_wantToSub(1);\n if (isset($_POST['sunSub']) && $_POST['sunSub'] == \"on\") {\n $this->set_subSunday(1);\n } else {\n $this->set_subSunday(0);\n }\n if (isset($_POST['monSub']) && $_POST['monSub'] == \"on\") {\n $this->set_subMonday(1);\n } else {\n $this->set_subMonday(0);\n }\n if (isset($_POST['tueSub']) && $_POST['tueSub'] == \"on\") {\n $this->set_subTuesday(1);\n } else {\n $this->set_subTuesday(0);\n }\n if (isset($_POST['wedSub']) && $_POST['wedSub'] == \"on\") {\n $this->set_subWednesday(1);\n } else {\n $this->set_subWednesday(0);\n }\n if (isset($_POST['thuSub']) && $_POST['thuSub'] == \"on\") {\n $this->set_subThursday(1);\n } else {\n $this->set_subThursday(0);\n }\n if (isset($_POST['friSub']) && $_POST['friSub'] == \"on\") {\n $this->set_subFriday(1);\n } else {\n $this->set_subFriday(0);\n }\n if (isset($_POST['satSub']) && $_POST['satSub'] == \"on\") {\n $this->set_subSaturday(1);\n } else {\n $this->set_subSaturday(0);\n }\n } else {\n $this->set_wantToSub(0);\n $this->set_subSunday(0);\n $this->set_subMonday(0);\n $this->set_subTuesday(0);\n $this->set_subWednesday(0);\n $this->set_subThursday(0);\n $this->set_subFriday(0);\n $this->set_subSaturday(0);\n }\n if (isset($_POST['teamRep']) && $_POST['teamRep'] == \"Y\") {\n $this->set_wantToBeATeamRep(1);\n } else {\n $this->set_wantToBeATeamRep(0);\n }\n if (isset($_POST['referee']) && $_POST['referee'] == \"Y\") {\n $this->set_wantToBeARef(1);\n } else {\n $this->set_wantToBeARef(0);\n }\n if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"1\") {\n $this->set_paymentPlan(1);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"2\") {\n $this->set_paymentPlan(2);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"3\") {\n $this->set_paymentPlan(3);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"4\") {\n $this->set_paymentPlan(4);\n } else if (isset($_POST['paymentPlan']) && $_POST['paymentPlan'] == \"5\") {\n $this->set_paymentPlan(1);\n }\n #Setup the positions comma separated value\n \n /** - This is no longer needed. We set positions directly above.\n $positions = \"\";\n if($goalie == \"Y\") {\n if($defense == \"Y\" || $center == \"Y\" || $wing == \"Y\") {\n $positions .= \"G, \";\n } else {\n $positions .= \"G\";\n }\n }\n if($defense == \"Y\") {\n if($center == \"Y\" || $wing == \"Y\") {\n $positions .= \"D, \";\n } else {\n $positions .= \"D\";\n }\n }\n if($center == \"Y\") {\n if($wing == \"Y\") {\n $positions .= \"C, \";\n } else {\n $positions .= \"C\";\n }\n }\n if($wing == \"Y\") {\n $positions .= \"W\";\n }\n $this->set_position($positions);\n */\n if (isset($_POST['drilLeague']) && $_POST['drilLeague']) {\n $this->set_drilLeague($_POST['drilLeague']);\n } //Required\n if (isset($_POST['payToday']) && $_POST['payToday'] == \"on\") {\n $this->set_payToday(1);\n } else {\n $this->set_payToday(0);\n }\n if (isset($_POST['usaHockeyMembership']) && $_POST['usaHockeyMembership']) {\n $this->set_usaHockeyMembership(format_trim(strtoupper($_POST['usaHockeyMembership'])));\n } else {\n $this->set_usaHockeyMembership(\"\");\n }\n }", "function createFieldForm($arrLang)\n{\n\n $arrFields = array(\"conference_name\" => array(\"LABEL\" => $arrLang['Conference Name'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:300px;\"),\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_owner\" => array(\"LABEL\" => $arrLang['Conference Owner'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"conference_number\" => array(\"LABEL\" => $arrLang['Conference Number'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_pin\" => array(\"LABEL\" => $arrLang['Moderator PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_1\" => array(\"LABEL\" => $arrLang['Moderator Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"moderator_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_pin\" => array(\"LABEL\" => $arrLang['User PIN'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_1\" => array(\"LABEL\" => $arrLang['User Options'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_2\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"user_options_3\" => array(\"LABEL\" => \"\",\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"start_time\" => array(\"LABEL\" => $arrLang['Start Time (PST/PDT)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"DATE\",\n \"INPUT_EXTRA_PARAM\" => array(\"TIME\" => true, \"FORMAT\" => \"%Y-%m-%d %H:%M\",\"TIMEFORMAT\" => \"12\"),\n \"VALIDATION_TYPE\" => \"ereg\",\n \"VALIDATION_EXTRA_PARAM\" => \"^(([1-2][0,9][0-9][0-9])-((0[1-9])|(1[0-2]))-((0[1-9])|([1-2][0-9])|(3[0-1]))) (([0-1][0-9]|2[0-3]):[0-5][0-9])$\"),\n \"duration\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"duration_min\" => array(\"LABEL\" => $arrLang['Duration (HH:MM)'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:20px;text-align:center\",\"maxlength\" =>\"2\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n/*\n \"recurs\" => array(\"LABEL\" => $arrLang['Recurs'],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"CHECKBOX\",\n \"INPUT_EXTRA_PARAM\" => \"\",\n \"VALIDATION_TYPE\" => \"\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n \"reoccurs_period\" => array(\"LABEL\" => $arrLang[\"Reoccurs\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_period,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n \"reoccurs_days\" => array(\"LABEL\" => $arrLang[\"for\"],\n \"REQUIRED\" => \"no\",\n \"INPUT_TYPE\" => \"SELECT\",\n \"INPUT_EXTRA_PARAM\" => $arrReoccurs_days,\n \"VALIDATION_TYPE\" => \"text\",\n \"VALIDATION_EXTRA_PARAM\" => \"\",\n \"EDITABLE\" => \"no\",\n \"SIZE\" => \"1\"),\n*/\n \"max_participants\" => array(\"LABEL\" => $arrLang['Max Participants'],\n \"REQUIRED\" => \"yes\",\n \"INPUT_TYPE\" => \"TEXT\",\n \"INPUT_EXTRA_PARAM\" => array(\"style\" => \"width:50px;\"),\n \"VALIDATION_TYPE\" => \"numeric\",\n \"VALIDATION_EXTRA_PARAM\" => \"\"),\n );\n return $arrFields;\n}", "protected function create() {\n $this->db->insertRow($this->table_name, $this->update);\n storeDbMsg($this->db,\"New \" . $this->form_ID . \" successfully created!\");\n }", "abstract protected function _setNewForm();", "function execute()\n\t{\n\t\t$this->obj_form = New form_input;\n\t\t$this->obj_form->formname = \"vendor_add\";\n\t\t$this->obj_form->language = $_SESSION[\"user\"][\"lang\"];\n\n\t\t$this->obj_form->action = \"vendors/edit-process.php\";\n\t\t$this->obj_form->method = \"post\";\n\t\t\n\n\t\t// general\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"code_vendor\";\n\t\t$structure[\"type\"]\t\t= \"input\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"name_vendor\";\n\t\t$structure[\"type\"]\t\t= \"input\";\n\t\t$structure[\"options\"][\"req\"]\t= \"yes\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"date_start\";\n\t\t$structure[\"type\"]\t\t= \"date\";\n\t\t$structure[\"defaultvalue\"]\t= date(\"Y-m-d\");\n\t\t$structure[\"options\"][\"req\"]\t= \"yes\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"date_end\";\n\t\t$structure[\"type\"]\t= \"date\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\t\t\t//contacts\n\t\tif (!empty($_SESSION[\"error\"][\"num_contacts\"]))\n\t\t{\n\t\t\t$this->num_contacts = stripslashes($_SESSION[\"error\"][\"num_contacts\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->num_contacts = 1;\n\t\t}\n\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"]\t\t= \"num_contacts\";\n\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t$structure[\"defaultvalue\"]\t= $this->num_contacts;\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t\n\t\tfor ($i=0; $i<$this->num_contacts; $i++)\n\t\t{\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"]\t\t= \"contact_id_\" .$i;\n\t\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"]\t\t= \"delete_contact_\" .$i;\n\t\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t\t$structure[\"defaultvalue\"]\t= \"false\";\n\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"]\t\t= \"contact_\" .$i;\n\t\t\t$structure[\"type\"]\t\t= \"input\";\n\t\t\t$structure[\"defaultvalue\"]\t= \"\";\n\t\t\tif (isset($_SESSION[\"error\"][\"contact_\" .$i. \"-error\"]))\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field_error\";\n\t\t\t}\n\t\t\telse if (empty($_SESSION[\"error\"]) && $i == 0)\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field_error\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field\";\n\t\t\t}\n\t\t\t$structure[\"options\"][\"width\"]\t\t\t= \"200\";\n\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\n\t\t\t\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"]\t\t= \"role_\" .$i;\n\t\t\t$structure[\"type\"]\t\t= \"dropdown\";\n\t\t\t$structure[\"options\"][\"width\"]\t= \"205\";\n\t\t\tif ($i == 0)\n\t\t\t{\n\t\t\t\t$structure[\"values\"]\t\t\t= array(\"accounts\");\n\t\t\t\t$structure[\"options\"][\"autoselect\"]\t= \"yes\";\n\t\t\t\t$structure[\"options\"][\"disabled\"]\t= \"yes\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$structure[\"values\"]\t\t\t= array(\"other\");\n\t\t\t\t$structure[\"options\"][\"autoselect\"]\t= \"yes\";\n\t\t\t}\n\t\t\tif (isset($_SESSION[\"error\"][\"contact_\" .$i. \"-error\"]))\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field_error\";\n\t\t\t}\n\t\t\telse if (empty($_SESSION[\"error\"]) && $i == 0)\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field_error\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field\";\n\t\t\t}\t\t\t\n\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"]\t\t= \"description_\" .$i;\n\t\t\t$structure[\"type\"]\t\t= \"textarea\";\n\t\t\t$structure[\"defaultvalue\"]\t= \"\";\n\t\t\tif (isset($_SESSION[\"error\"][\"contact_\" .$i. \"-error\"]))\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field_error\";\n\t\t\t}\n\t\t\telse if (empty($_SESSION[\"error\"]) && $i == 0)\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field_error\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$structure[\"options\"][\"css_field_class\"]\t= \"hidden_form_field\";\n\t\t\t}\n\t\t\t$structure[\"options\"][\"width\"]\t\t\t= \"205\";\n\t\t\t$structure[\"options\"][\"height\"]\t\t\t= \"\";\n\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\n\t\t\t//contact records\n\t\t\tif (!empty($_SESSION[\"error\"][\"num_records_$i\"]))\n\t\t\t{\n\t\t\t\t$num_records = stripslashes($_SESSION[\"error\"][\"num_records_$i\"]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$num_records = 0;\n\t\t\t}\n\t\t\t\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"]\t\t= \"num_records_\" .$i;\n\t\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t\t$structure[\"defaultvalue\"]\t= $num_records;\n\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\n\t\t\tif ($num_records > 0)\n\t\t\t{\n\t\t\t\tfor ($j=0; $j<$num_records; $j++)\n\t\t\t\t{\n\t\t\t\t\t$structure = NULL;\n\t\t\t\t\t$structure[\"fieldname\"]\t\t= \"contact_\" .$i. \"_record_id_\" .$j;\n\t\t\t\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\t\t\n\t\t\t\t\t$structure = NULL;\n\t\t\t\t\t$structure[\"fieldname\"]\t\t= \"contact_\" .$i. \"_delete_\" .$j;\n\t\t\t\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t\t\t\t$structure[\"defaultvalue\"]\t= \"false\";\n\t\t\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\t\t\n\t\t\t\t\t$structure = NULL;\n\t\t\t\t\t$structure[\"fieldname\"]\t\t= \"contact_\" .$i. \"_type_\" .$j;\n\t\t\t\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\t\t\n\t\t\t\t\t$structure = NULL;\n\t\t\t\t\t$structure[\"fieldname\"]\t\t= \"contact_\" .$i. \"_label_\" .$j;\n\t\t\t\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\t\t\n\t\t\t\t\t$structure = NULL;\n\t\t\t\t\t$structure[\"fieldname\"]\t\t= \"contact_\" .$i. \"_detail_\" .$j;\n\t\t\t\t\t$structure[\"type\"]\t\t= \"input\";\n\t\t\t\t\t$structure[\"options\"][\"width\"] = \"\";\n\t\t\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// taxes\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"tax_number\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure = form_helper_prepare_dropdownfromdb(\"tax_default\", \"SELECT id, name_tax as label FROM account_taxes\");\n\t\t$this->obj_form->add_input($structure);\n\n\n\n\n\t\t// list all the taxes so the user can enable or disable the taxes\n\t\t$sql_tax_obj\t\t= New sql_query;\n\t\t$sql_tax_obj->string\t= \"SELECT id, name_tax, description, default_vendors FROM account_taxes ORDER BY name_tax\";\n\t\t$sql_tax_obj->execute();\n\n\t\tif ($sql_tax_obj->num_rows())\n\t\t{\n\t\t\t// user note\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"] \t\t= \"tax_message\";\n\t\t\t$structure[\"type\"]\t\t\t= \"message\";\n\t\t\t$structure[\"defaultvalue\"]\t\t= \"<p>Select all the taxes below which apply to this vendor. Any taxes not selected, will not be added to invoices for this vendor.</p>\";\n\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\t\n\n\n\t\t\t// run through all the taxes\n\t\t\t$sql_tax_obj->fetch_array();\n\n\t\t\tforeach ($sql_tax_obj->data as $data_tax)\n\t\t\t{\n\t\t\t\t// define tax checkbox\n\t\t\t\t$structure = NULL;\n\t\t\t\t$structure[\"fieldname\"] \t\t= \"tax_\". $data_tax[\"id\"];\n\t\t\t\t$structure[\"type\"]\t\t\t= \"checkbox\";\n\t\t\t\t$structure[\"options\"][\"label\"]\t\t= $data_tax[\"name_tax\"] .\" -- \". $data_tax[\"description\"];\n\t\t\t\t$structure[\"options\"][\"no_fieldname\"]\t= \"enable\";\n\t\t\t\t\n\t\t\t\tif ($data_tax[\"default_vendors\"])\n\t\t\t\t{\n\t\t\t\t\t$structure[\"defaultvalue\"]\t= \"on\";\n\t\t\t\t}\n\n\t\t\t\t// add to form\n\t\t\t\t$this->obj_form->add_input($structure);\n\t\t\t\t$this->tax_array[] = \"tax_\". $data_tax[\"id\"];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->tax_array = array();\n\n\t\t\t$structure = NULL;\n\t\t\t$structure[\"fieldname\"] \t\t= \"tax_message\";\n\t\t\t$structure[\"type\"]\t\t\t= \"message\";\n\t\t\t$structure[\"defaultvalue\"]\t\t= \"<p>No taxes can be selected for this vendor, as there have been no taxes configured yet.</p>\";\n\t\t\t$this->obj_form->add_input($structure);\n\t\t}\n\n\n\t\t// purchase options\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t\t= \"discount\";\n\t\t$structure[\"type\"]\t\t\t= \"input\";\n\t\t$structure[\"options\"][\"width\"]\t\t= 50;\n\t\t$structure[\"options\"][\"label\"]\t\t= \" %\";\n\t\t$structure[\"options\"][\"max_length\"]\t= \"6\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\n\n\t\t// billing address\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address1_street\";\n\t\t$structure[\"type\"]\t= \"textarea\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address1_city\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address1_state\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address1_country\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address1_zipcode\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\n\t\t// shipping address\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"]\t\t\t= \"address1_same_as_2\";\n\t\t$structure[\"type\"]\t\t\t= \"checkbox\";\n\t\t$structure[\"options\"][\"label\"]\t\t= \" \". lang_trans(\"address1_same_as_2_help\");\n\t\t$structure[\"options\"][\"css_row_class\"]\t= \"shipping_same_address\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address2_street\";\n\t\t$structure[\"type\"]\t= \"textarea\";\n\t\t$structure[\"options\"][\"css_row_class\"]\t= \"shipping_address\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address2_city\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$structure[\"options\"][\"css_row_class\"]\t= \"shipping_address\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address2_state\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$structure[\"options\"][\"css_row_class\"]\t= \"shipping_address\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address2_country\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$structure[\"options\"][\"css_row_class\"]\t= \"shipping_address\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"address2_zipcode\";\n\t\t$structure[\"type\"]\t= \"input\";\n\t\t$structure[\"options\"][\"css_row_class\"]\t= \"shipping_address\";\n\t\t$this->obj_form->add_input($structure);\n\t\n\n\n\n\n\t\t// submit button\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"submit\";\n\t\t$structure[\"type\"]\t\t= \"submit\";\n\t\t$structure[\"defaultvalue\"]\t= \"Create Vendor\";\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\n\t\n\t\t// load any data returned due to errors\n\t\t$this->obj_form->load_data_error();\n\t}", "function addFields($table,$postedArray) \t{\n\t\tforeach($postedArray as $key=>$val){\n\t\t\t$postedArray[$key] = mysql_real_escape_string($postedArray[$key]); \n\t\t}\n\t\treturn $this->insert($this->tablePrefix.$table, $postedArray);\n\t}", "function addrec()\r\n{\r\n?>\r\n\t<table class=\"bd\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">\r\n\t\t<tr>\r\n\t\t\t<td><input type=\"button\" name=\"btnBack\" value=\"Back\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','company/company.php?status=true&')\"></td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<hr size=\"1\" noshade>\r\n\t<form name=\"customer_validate\" enctype=\"multipart/form-data\" action=\"company/processCompany.php?status=true&action=add\" method=\"post\">\r\n\t\t<p><input type=\"hidden\" name=\"sql\" value=\"insert\"></p>\r\n <p><input type=\"hidden\" name=\"action\" value=\"add\"></p>\r\n\t\t<?php\r\n\t\t\t$row = array(\r\n\t\t\t\t\r\n \t\t\t\t\t\"comp_name\" => \"\",\r\n \t\t\t\t\t\"comp_add\" => \"\",\r\n\t\t\t\t\t\"customer_cperson\" => \"\",\r\n\t\t\t\t\t\"customer_city\" => \"\",\r\n\t\t\t\t\t\"customer_mobno\" => \"\",\r\n\t\t\t\t\t\"customer_landno\" => \"\",\r\n\t\t\t\t\t\"customer_email\" => \"\",\r\n\t\t\t\t\t\"customer_web\" => \"\"\r\n \t\t\t\t\t);\r\n\t\t\tshowroweditor($row, false);\r\n\t\t?>\r\n\t\t<p><input type=\"button\" name=\"btnAdd\" id=\"btnAdd\" value=\"Save\" onClick=\"if(customervalidate()==true){javascript: formget(this.form, 'company/processCompany.php');}\"></p>\r\n <div id=\"output\" style=\"color: blue;\"></div>\r\n\t</form>\r\n<?php \r\n}", "function AjaxSetForm(&$objResponse)\n\t\t{\n\t\t\t// Kiem tra neu khong dung class thi bo qua\n\t\t\t$sClassName = strtolower(get_class($objResponse));\n\t\t\tif( $sClassName != 'xajaxresponse')\n\t\t\t{\n\t\t\t\treturn(false);\n\t\t\t}\n\t\t\t// Ham gan gia tri cho cac o nhap trong form, du lieu lay tu database\n\t\t\t$arrFields = $this->getAttributeNames();\n\t\t\t// Kien sua :: Fix loi khong lay duoc danh sach field\n\t\t\tif(!is_array($arrFields))\n\t\t\t{\n\t\t\t\t$arrFields = array();\n\t\t\t}\n\t\t\tforeach($arrFields as $key=>$value)\n\t\t\t{\n\t\t\t\tif (in_array($value, $this->arrInputFields))\n\t\t\t\t{\n\t\t\t\t\t$sInputName = (isset($this->arrFieldsMap[$value])) ? $this->arrFieldsMap[$value] : $value;\n\t\t\t\t\t$sInputValue = $this->$value;\n\t\t\t\t\t$objResponse->addAssign($sInputName, 'value', $sInputValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "function _submit_data()\n {\n\t$data = $this->_get_data_from_post();\n\t//$this->debug($_FILES);\n\tif (isset($_FILES['photo']) && $_FILES['photo']['name'] != NULL) {\n\t $data['image'] = Modules::run('upload_manager/upload', 'photo', 'profile');\n\t}\n\n\t$id = $this->uri->segment(3) == 'edit' ? $this->session->user_id : '';\n\tif (is_numeric($id)) {\n\t $this->_update($id, $data);\n\t Modules::run('auth/create_session', $this->session->user_id);\n\t redirect($this->uri->segment(3) == 'edit' ? 'users/profile' : 'users');\n\t} else {\n\t $this->_insert($data);\n\t redirect('login');\n\t}\n }", "protected function _processValidForm()\n {\n $table = $this->_getTable();\n\n $formValues = $this->_getForm()->getValues();\n\n if (!empty($formValues[$this->_getPrimaryIdKey()])) {\n $row = $this->_getRow($this->_getPrimaryId());\n } else {\n $row = $table->createRow();\n }\n\n foreach ($formValues as $key => $value) {\n if (isset($row->$key) && !$table->isIdentity($key)) {\n $row->$key = $value;\n }\n }\n\n $row->save();\n\n $this->_goto($this->_getBrowseAction());\n }", "public function updateContactInfo($form) {\r\n $success = true;\r\n $id = (array_key_exists('contact_id', $form) && strlen($form['contact_id']) > 0) ? $form['contact_id'] : null;\r\n $sex = (array_key_exists('sex', $form) && ($form['sex'] == 'm' || $form['sex'] == 'f')) ? $form['sex'] : null;\r\n $name = $form['name'];\r\n if (strlen($name) < 1) $success = false;\r\n $first_name = (array_key_exists('first_name', $form) && strlen($form['first_name']) > 0) ? $form['first_name'] : null;\r\n $middle_name = (array_key_exists('middle_name', $form) && strlen($form['middle_name']) > 0) ? $form['middle_name'] : null;\r\n $suffix = (array_key_exists('suffix', $form) && strlen($form['suffix']) > 0) ? $form['suffix'] : null;\r\n $dob=null; \r\n if (array_key_exists('dob', $form) && strlen($form['dob']) > 0) {\r\n $dob_date = DateTime::createFromFormat('m-d-Y', $form['dob']);\r\n $dob = $dob_date->format('Y-m-d');\r\n }\r\n $ssn=null;\r\n if (array_key_exists('ssn', $form) && strlen($form['ssn']) > 0) {\r\n if (strlen($form['ssn']) < 10) $ssn = $form['ssn'];\r\n else $success = false;\r\n }\r\n $aka = (array_key_exists('aka', $form) && strlen($form['aka']) > 0) ? $form['aka'] : null;\r\n $dba = (array_key_exists('dba', $form) && strlen($form['dba']) > 0) ? $form['dba'] : null;\r\n if ($success) {\r\n if ($id) {\r\n // edit contact, return true on success\r\n $sth = $this->db->prepare('UPDATE `contacts` '\r\n .\"SET `sex`=?,`name`=?,`first_name`=?,`middle_name`=?,\"\r\n .\"`suffix`=?,`dob`=?,`ssn`=?,`aka`=?,`dba`=? WHERE `id`=?\");\r\n $sth->execute(array($sex, $name, $first_name, $middle_name, \r\n $suffix, $dob, $ssn, $aka, $dba, $id));\r\n } else {\r\n // new contact, return new contact id on success\r\n $sth = $this->db->prepare('INSERT INTO `contacts` '\r\n .'(`sex`,`name`,`first_name`,`middle_name`,`suffix`,`dob`,`ssn`,`aka`,`dba`) VALUES '\r\n .'(?,?,?,?,?,?,?,?,?)');\r\n $sth->execute(array($sex, $name, $first_name, $middle_name, $suffix, $dob, $ssn, $aka, $dba));\r\n if ($sth->rowCount()) {\r\n // get id\r\n $success = $this->db->lastInsertId();\r\n } else $success = false;\r\n }\r\n }\r\n return $success;\r\n }", "function dbRowInsert($table_name, $form_data, $conn)\n{\n $fields = array_keys($form_data);\n\n // build the query\n $sql = \"INSERT INTO \".$table_name.\"\n (`\".implode('`,`', $fields).\"`)\n VALUES('\".implode(\"','\", $form_data).\"')\";\n\n // run and return the query result resource\n return mysqli_query($conn, $sql);\n}", "function setFormData(){\n // formdata in database zetten\n // checken of de data is opgeslagen\n global $con;\n\n\n if(isset($_POST['field_firstname']) && $_POST['field_firstname'] != ''){\n $firstName = dbp($_POST['field_firstname']);\n } else {\n echo \"Voornaam is verplicht\";\n }\n\n if(isset($_POST['field_infixname'])){\n $middleName = dbp($_POST['field_infixname']);\n } \n\n if(isset($_POST['field_lastname']) && $_POST['field_lastname'] != ''){\n $lastName = dbp($_POST['field_lastname']);\n } else {\n echo \"Achternaam is verplicht\";\n }\n\n if(isset($_POST['field_birthdate']) && $_POST['field_birthdate'] != ''){\n $birthDate = dbp($_POST['field_birthdate']);\n } else {\n echo \"Geboorte datum is verplicht\";\n }\n\n if(isset($_POST['field_email']) && $_POST['field_email'] != ''){\n $email = dbp($_POST['field_email']);\n } else {\n echo \"Email is verplicht\";\n }\n\n if(isset($_POST['field_password']) && $_POST['field_password'] != ''){\n $password = dbp($_POST['field_password']);\n } else {\n echo \"Wachtwoord is verplicht\";\n }\n\n\n\n\n $query1 = $con->prepare('INSERT INTO user (firstName, middleName, lastName, birthDate, `e-mailadres`, password) VALUES (?, ?, ?, ?, ?, ?);');\n if ($query1 === false) {\n \techo mysqli_error($con).\" - \";\n \texit(__LINE__);\n }\n $query1->bind_param('ssssss', $firstName, $middleName, $lastName, $birthDate, $email, $password);\n if ($query1->execute() === false) {\n \techo mysqli_error($con).\" - \";\n \texit(__LINE__);\n } else {\n echo \"Gebruiker toegevoegd\";\n header(\"Location: ../index\");\n \n \t$query1->close();\n }\n\n}", "function save_object()\n {\n if (isset($_POST['scalixTab'])){\n\n /* Save ldap attributes */\n plugin::save_object();\n\n /* Check if given value is not empty */\n if (isset($_POST['email_address']) && !empty($_POST['email_address']) && isset($_POST['add_email'])){\n $valid= FALSE;\n\n /* Valid mail address */\n if( ($this->is_template && !tests::is_email($_POST['email_address'], TRUE)) ||\n (!$this->is_template && !tests::is_email($_POST['email_address']))){\n msg_dialog::display(_(\"Error\"), _(\"Cannot add invalid mail address!\"), ERROR_DIALOG);\n }else{\n $valid = TRUE;\n }\n\n /* Check write access */\n if(!$this->acl_is_writeable(\"scalixEmailAddress\")){\n msg_dialog::display(_(\"Error\"), _(\"You have no permission to modify these addresses.\"), ERROR_DIALOG);\n }else{\n\n /* Mail address already in use ? */\n if ($valid && ($user= $this->addEmail (get_post('email_address'))) != \"\"){\n $ui= get_userinfo();\n if ($user != $ui->username){\n msg_dialog::display(_(\"Error\"), sprintf(_(\"Cannot add mail address: it is already used by user '%s'.\"), $user),\n ERROR_DIALOG);\n }\n }\n }\n }\n\n /* Delete email addresses */\n if (isset($_POST['delete_email']) && isset ($_POST['emails_list']) && $this->acl_is_writeable(\"scalixEmailAddress\")){\n if(!$this->acl_is_writeable(\"scalixEmailAddress\")){\n msg_dialog::display(_(\"Error\"), _(\"You have no permission to modify these addresses.\"), ERROR_DIALOG);\n }else{\n if (count($_POST['emails_list'])){\n $this->delEmail ($_POST['emails_list']);\n }\n }\n }\n\n /* Save fakeBooleanAttributes*/\n foreach ($this->fakeBooleanAttributes as $val){\n if ($this->acl_is_writeable($val)) {\n if( isset ($_POST[\"$val\"])) {\n $data = TRUE;\n } else {\n $data = FALSE;\n }\n if ($this->$val != $data){\n $this->is_modified= TRUE;\n }\n\n $this->$val= $data;\n }\n }\n }\n }", "public static function init($arr)\n {\n //print_r($arr);\n //exit;\n self::makeFormString($arr);\n }", "private function parseForm($form)\n\t{\n $fields = $this->fields;\n $config = $this->config;\n $entries = [];\n $missing = [];\n foreach ($fields as $field => $data) {\n //check for required, push to $missing array if not present\n $alias = null;\n $value = '';\n // if $field not present, look for alias\n if (!isset($form[$field])) {\n $alias = $data['alias'] ?? null;\n if ($alias && isset($form[$alias])) {\n $value = $form[$alias];\n }\n } else {\n $value = $form[$field];\n }\n if (!empty($data['required']) && trim($value) === '') {\n if ($alias) {\n array_push($missing, $field);\n } else {\n array_push($missing, $field);\n }\n continue;\n }\n if (is_array($value)) {\n $value = implode(', ', $value);\n }\n /* type coercion */\n $data_type = strtoupper($data['type']);\n switch ($data_type) {\n case 'TEXT':\n $value = trim(stripslashes($value));\n $value = preg_replace('/\\r|\\n/i', '', $value); // to prevent injection attacks\n break;\n case 'INTEGER':\n if ($value === 'true'){\n $value = 1;\n } else if ($value === 'false') {\n $value = 0;\n } else if ($value === '') {\n $value = null;\n } else {\n $value = intval($value);\n }\n break;\n case 'REAL':\n $value = floatval($value);\n }\n $entries[$field] = $value;\n }\n \n if (count($missing) > 0) {\n return 'Required fields missing: ' . implode(', ', $missing);\n }\n\n if (!empty($config['submission_date_column'])) {\n $date_column = $config['submission_date_column'];\n $now = new \\DateTime();\n $entries[$date_column] = $now->format('Y-m-d H:i:s');\n }\n \n $attachment_config = $this->attachment_config;\n if (!!count($_FILES)) {\n if (!empty($attachment_config['save_path']) && !empty($attachment_config['column_name'])) {\n $file_handler = new AttachmentHandler($attachment_config);\n $attachment_urls = $file_handler->getAttachmentUrls();\n if ($attachment_urls) {\n $attach_col = $attachment_config['column_name'];\n $entries[$attach_col] = $attachment_urls;\n }\n }\n } else if (!empty($attachment_config['required']) && $attachment_config['required'] === true) {\n return 'Required attachments are missing.'; \n }\n\n if (count($entries) === 0) {\n return 'Form submitted without any valid fields!';\n }\n\n return $entries;\n\t}", "function process($data, $form) {\n\t\t// submitted form object\n\t\t$submittedForm = new SubmittedForm();\n\t\t$submittedForm->SubmittedByID = ($id = Member::currentUserID()) ? $id : 0;\n\t\t$submittedForm->ParentID = $this->ID;\n\t\t$submittedForm->Recipient = $this->EmailTo;\n\t\tif(!$this->DisableSaveSubmissions) $submittedForm->write();\n\t\t\n\t\t// email values\n\t\t$values = array();\n\t\t$recipientAddresses = array();\n\t\t$sendCopy = false;\n $attachments = array();\n\n\t\t$submittedFields = new DataObjectSet();\n\t\t\n\t\tforeach($this->Fields() as $field) {\n\t\t\t// don't show fields that shouldn't be shown\n\t\t\tif(!$field->showInReports()) continue;\n\t\t\t\n\t\t\t$submittedField = $field->getSubmittedFormField();\n\t\t\t$submittedField->ParentID = $submittedForm->ID;\n\t\t\t$submittedField->Name = $field->Name;\n\t\t\t$submittedField->Title = $field->Title;\n\t\t\t\t\t\n\t\t\tif($field->hasMethod('getValueFromData')) {\n\t\t\t\t$submittedField->Value = $field->getValueFromData($data);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(isset($data[$field->Name])) $submittedField->Value = $data[$field->Name];\n\t\t\t}\n\n\t\t\tif(!empty($data[$field->Name])){\n\t\t\t\tif(in_array(\"EditableFileField\", $field->getClassAncestry())) {\n\t\t\t\t\tif(isset($_FILES[$field->Name])) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// create the file from post data\n\t\t\t\t\t\t$upload = new Upload();\n\t\t\t\t\t\t$file = new File();\n\t\t\t\t\t\t$upload->loadIntoFile($_FILES[$field->Name], $file);\n\n\t\t\t\t\t\t// write file to form field\n\t\t\t\t\t\t$submittedField->UploadedFileID = $file->ID;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Attach the file if its less than 1MB, provide a link if its over.\n\t\t\t\t\t\tif($file->getAbsoluteSize() < 1024*1024*1){\n\t\t\t\t\t\t\t$attachments[] = $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!$this->DisableSaveSubmissions) $submittedField->write();\n\t\t\t\n\t\t\t$submittedFields->push($submittedField);\n\t\t}\t\n\t\t$emailData = array(\n\t\t\t\"Sender\" => Member::currentUser(),\n\t\t\t\"Fields\" => $submittedFields\n\t\t);\n\n\t\t// email users on submit. All have their own custom options. \n\t\tif($this->EmailRecipients()) {\n\t\t\t$email = new UserDefinedForm_SubmittedFormEmail($submittedFields); \n\t\t\t$email->populateTemplate($emailData);\n\t\t\tif($attachments){\n\t\t\t\tforeach($attachments as $file){\n\t\t\t\t\t// bug with double decorated fields, valid ones should have an ID.\n\t\t\t\t\tif($file->ID != 0) {\n\t\t\t\t\t\t$email->attachFile($file->Filename,$file->Filename, $file->getFileType());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->EmailRecipients() as $recipient) {\n\t\t\t\t$email->populateTemplate($recipient);\n\t\t\t\t$email->populateTemplate($emailData);\n\t\t\t\t$email->setFrom($recipient->EmailFrom);\n\t\t\t\t$email->setBody($recipient->EmailBody);\n\t\t\t\t$email->setSubject($recipient->EmailSubject);\n\t\t\t\t$email->setTo($recipient->EmailAddress);\n\t\t\t\t\n\t\t\t\t// check to see if they are a dynamic sender. eg based on a email field a user selected\n\t\t\t\tif($recipient->SendEmailFromField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailFromField()->Name);\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setFrom($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// check to see if they are a dynamic reciever eg based on a dropdown field a user selected\n\t\t\t\tif($recipient->SendEmailToField()) {\n\t\t\t\t\t$submittedFormField = $submittedFields->find('Name', $recipient->SendEmailToField()->Name);\n\t\t\t\t\t\n\t\t\t\t\tif($submittedFormField) {\n\t\t\t\t\t\t$email->setTo($submittedFormField->Value);\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($recipient->SendPlain) {\n\t\t\t\t\t$body = strip_tags($recipient->EmailBody) . \"\\n \";\n\t\t\t\t\tif(isset($emailData['Fields']) && !$recipient->HideFormData) {\n\t\t\t\t\t\tforeach($emailData['Fields'] as $Field) {\n\t\t\t\t\t\t\t$body .= $Field->Title .' - '. $Field->Value .' \\n';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$email->setBody($body);\n\t\t\t\t\t$email->sendPlain();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$email->send();\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn Director::redirect($this->Link() . 'finished?referrer=' . urlencode($data['Referrer']));\n\t}", "function sac_salesforce_integration( $cf7 ) {\n\n\n\n\t$form = WPCF7_Submission::get_instance();\n\n\n\n\tif ( $form ) {\n\n\n\n $black_list = array('_wpcf7', '_wpcf7_version', '_wpcf7_locale', '_wpcf7_unit_tag',\n\n '_wpcf7_is_ajax_call','cfdb7_name', '_wpcf7_container_post');\n\n\n\n $data = $form->get_posted_data();\n\n $form_data = array();\n\n\n\n foreach ($data as $key => $d) {\n\n if ( !in_array($key, $black_list ) ) {\n\n \n\n $tmpD = $d;\n\n \n\n if ( ! is_array($d) ){\n\n\n\n $bl = array('\\\"',\"\\'\",'/','\\\\');\n\n $wl = array('&quot;','&#039;','&#047;', '&#092;');\n\n\n\n $tmpD = str_replace($bl, $wl, $tmpD );\n\n } \n\n\n\n $form_data[$key] = $tmpD; \n\n }\n\n }\n\n\n\n $subject = (isset($form_data['subject'])) ? $form_data['subject'] : '';\n\n\t \t$first_name = (isset($form_data['first_name'])) ? $form_data[\"first_name\"] : $form_data[\"full_name\"];\n\n\t\t$last_name = (isset($form_data['last_name'])) ? $form_data[\"last_name\"] : '';\n\n\t\t$job_title = (isset($form_data['job_title'])) ? $form_data[\"job_title\"] : '';\n\n\t\t$institution = (isset($form_data['institution'])) ? $form_data[\"institution\"] : '';\n\n\t\t$phone = (isset($form_data['phone'])) ? $form_data[\"phone\"] : '';\n\n\t\t$email = (isset($form_data['email'])) ? $form_data[\"email\"] : '';\n\n\t\t$country = (isset($form_data['country'])) ? $form_data[\"country\"] : '';\n\n\t\t$state = (isset($form_data[\"state\"])) ? $form_data[\"state\"] : '';\n\n\t\t$message = (isset($form_data['message'])) ? $form_data[\"message\"] : '';\n\n\t\t$ckey = (isset($form_data['ckey'])) ? $form_data[\"ckey\"] : '';\n\n\t\t\n\n\t\t$post_items[] = 'oid=00DK000000XGIGZMA5'; //'.get_option('sf_oid','option');\n\n\t\t$post_items[] = 'subject=' . $subject;\n\n\t\t$post_items[] = 'first_name=' . $first_name;\n\n\t\t$post_items[] = 'last_name=' . $last_name;\n\n\t\t$post_items[] = 'title=' . $job_title;\n\n\t\t$post_items[] = 'company=' . $institution;\n\n\t\t$post_items[] = 'campaign_id=' . $ckey;\n\n\t\t$post_items[] = 'country=' . $country;\n\n\t\t$post_items[] = 'state=' . $state;\n\n\t\t$post_items[] = 'description='.$message;\n\n\t\t$post_items[] = 'email=' . $email;\n\n\t\t$post_items[] = 'phone=' . $phone;\n\n\t\t//$post_items[] = 'debug=1';\n\n\t\t//$post_items[] = '[email protected]';\n\n\t\t\n\n\t\t\n\n\t \tif(!empty($email) ) {\n\n\t\t $post_string = implode ('&', $post_items);\n\n\t\t // Create a new cURL resource\n\n\t\t $ch = curl_init();\n\n\t\t \n\n\t\t if (curl_error($ch) != \"\")\n\n\t\t {\n\n\t\t // error handling\n\n\t\t }\n\n\t\t\t\t\n\n\t\t curl_setopt($ch, CURLOPT_URL, 'https://test.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8'); // SANDBOX\n\n\t\t //curl_setopt($ch, CURLOPT_URL, 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8'); // PRODUCTION\n\n\t\t\t\t\n\n\t\t // Set the method to POST\n\n\t\t curl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t // Pass POST data\n\n\t\t curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_string);\n\n\t\t $sf_res = curl_exec($ch); // Post to Salesforce\n\n\t\t\t\t$fp = fopen('sf_log.txt', 'w');\n\n\t\t\t\tfwrite($fp, print_r($post_items,true));\n\n\t\t\t\tfclose($fp);\n\n\t\t curl_close($ch); // close cURL resource\n\n\t \t}\n\n }\n\n}", "public function savecontact(){\n\t\t\n\t\t$instcode = $this->input->post('instcode');\n\t\t$contactname = $this->input->post('contactname');\n\t\t$position = $this->input->post('position');\n\t\t$email = $this->input->post('email');\n\t\t$telno = $this->input->post('telno');\n\t\t$address = $this->input->post('address');\n\t\t\n\t\t$sql = \"INSERT INTO contacts (contactname,telno,position,address,email,instcode) VALUES (\".$this->db->escape($contactname).\", \".$this->db->escape($telno).\", \".$this->db->escape($position).\", \".$this->db->escape($address).\", \".$this->db->escape($email).\", \".$this->db->escape($instcode).\")\";\n\t\t$this->db->query($sql);\n\t\techo $this->db->affected_rows();\n\t\t\n\t}", "function gatherFormFields($submitType)\n{\n\t// then pass the data to the appropriate function for\n\t// editing or insertion.\n\t\n\t$arrFields = array(); // To hold the sanitized values\n\t\n\t// Field: ID\n\tif (isset($_POST['dealid']))\n\t{\n\t\t$id = (int)$_POST['dealid'];\n\t}\n\telse\n\t{\n\t\t$submitType = 'new';\t// Even if this was submitted as an edit, if no dealid was provided, create a new record.\n\t}\n\t\n\t// Field: company\n\tif (isset($_POST['edit_company']))\n\t{\n\t\t$arrFields['store'] = intval($_POST['edit_company']);\n\t}\n\telse\n\t{\n\t\t$arrFields['store'] = null;\n\t}\n\t\n\t// Field: dealurl\n\tif (isset($_POST['edit_dealurl']))\n\t{\n\t\t$arrFields['dealurl'] = mysql_real_escape_string($_POST['edit_dealurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['dealurl'] = '';\n\t}\n\n\t// Field: img\n\tif (isset($_POST['edit_image']))\n\t{\n\t\t$arrFields['img'] = mysql_real_escape_string($_POST['edit_image']);\n\t}\n\telse\n\t{\n\t\t$arrFields['img'] = '';\n\t}\n\n\t// Field: imgurl\n\tif (isset($_POST['edit_imageurl']))\n\t{\n\t\t$arrFields['imgurl'] = mysql_real_escape_string($_POST['edit_imageurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['imgurl'] = '';\n\t}\n\n\t// Field: showdate\n\tif (isset($_POST['edit_show_date']))\n\t{\n\t\t$arrFields['showdate'] = mysql_real_escape_string($_POST['edit_show_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['showdate'] = date('Y-m-d H:i:s');\n\t}\n\n\t// Field: expire\n\tif (isset($_POST['edit_expiration_date']))\n\t{\n\t\t$arrFields['expire'] = mysql_real_escape_string($_POST['edit_expiration_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['expire'] = null;\n\t}\n\n\t// Field: valid\n\tif (isset($_POST['edit_valid']))\n\t{\n\t\t$arrFields['valid'] = intval($_POST['edit_valid']);\n\t}\n\telse\n\t{\n\t\t$arrFields['valid'] = 1;\n\t}\n\t\n\t// Field: invalidreason\n\tif (isset($_POST['edit_invalidreason']))\n\t{\n\t\t$arrFields['invalidreason'] = mysql_real_escape_string($_POST['edit_invalidreason']);\n\t}\n\telse\n\t{\n\t\t$arrFields['invalidreason'] = '';\n\t}\n\t\n\t// Field: subject\n\tif (isset($_POST['edit_subject']))\n\t{\n\t\t$arrFields['subject'] = mysql_real_escape_string($_POST['edit_subject']);\n\t}\n\telse\n\t{\n\t\t$arrFields['subject'] = '';\n\t}\n\t\n\t// Field: brief\n\tif (isset($_POST['edit_brief']))\n\t{\n\t\t$arrFields['brief'] = mysql_real_escape_string($_POST['edit_brief']);\n\t\t$arrFields['verbose'] = mysql_real_escape_string($_POST['edit_brief']);\n\t}\n\telse\n\t{\n\t\t$arrFields['brief'] = '';\n\t\t$arrFields['verbose'] = '';\n\t}\n\n\t// Field: updated\n\t$arrFields['updated']\t\t= date('Y-m-d H:i:s');\n\t$arrFields['whoupdated']\t= $_SESSION['firstname'];\n\t\n\tif ($submitType == 'edit')\n\t{\n\t\tsaveEdit($arrFields, $id);\n\t}\n\telse\n\t{\n\t\tsaveNew($arrFields);\n\t}\n}", "public function formdata_add($posts,$json){\n \n $input = array('radio','select','checkbox');\n $this->db->insert('form_submission',$json);\n foreach($posts as $post){\n if(in_array($post['type'],$input)){\n $form = array(\n 'form_field_id'=>$post['form_field_id'],\n 'user_id'=> $post['user_id'],\n 'form_id'=>$post['form_id'],\n 'form_option_id'=>$post['option_id']\n );\n $this->db->insert('user_form_info_options',$form);\n }else{\n $form = array(\n 'form_field_id'=>$post['form_field_id'],\n 'user_id'=> $post['user_id'],\n 'form_id'=>$post['form_id'],\n 'answer'=>$post['answer']\n );\n $this->db->insert('user_form_info_text',$form);\n }\n }\n //$loc_id = $this->db->insert_id();\n //print_r($country); exit;\n return $post['form_id'];\n }", "public function saveContactInfo() {\n\t\t//~ $query->createCommand()->insert('website_queries', ['name' => $this->name, 'email' => $this->email, 'phone' => $this->phone, 'description' => $this->description, 'subject' => $this->subject])->execute();\n\t\t//~ $id = Yii::$app->db->getLastInsertID();\n\t\t//~ if($id){\n\t\t\t//~ return true;\n\t\t//~ } else {\n\t\t\t//~ return false;\n\t\t//~ }\t\t\n\t\t$model \t\t\t= new Contactus1;\n\t\t$model->name\t\t= $this->name;\n\t\t$model->email \t\t= $this->email;\n\t\t$model->zip_code \t= $this->zip_code;\n\t\t$model->subject \t= $this->subject;\t\n\t\n\t\t\n\t\t\n\t\tif($model->save()) { \n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function InlineInsert() {\n\t\tglobal $Language, $objForm, $gsFormError;\n\t\t$this->LoadOldRecord(); // Load old recordset\n\t\t$objForm->Index = 0;\n\t\t$this->LoadFormValues(); // Get form values\n\n\t\t// Validate form\n\t\tif (!$this->ValidateForm()) {\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t\treturn;\n\t\t}\n\t\t$this->SendEmail = TRUE; // Send email on add success\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\n\t\t\tif ($this->getSuccessMessage() == \"\")\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\n\t\t} else { // Add failed\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\n\t\t}\n\t}", "function insert_record($obj,$param_method=\"request\",$param_obj=\"\")\n\n\t{\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::insert_record() - PARAMETER LIST : ', $param_array);\n\n\t\t\n\n\t\t$initial_qry = \"insert into \" . $obj->cls_tbl . \" (\";\n\n\t\t\n\n\t\t$obj = set_values($obj,$param_method,$param_obj,\"insert\");\n\n\n\n\t\t$fld_arr = get_object_vars($obj);\n\n\n\n\t\t$qry_fld_list = \"\";\n\n\t\t$mid_qry = \") values (\";\n\n\t\t$qry_val_list = \"\";\n\n\t\t$file_attachment_status = 1;\n\n\t\t//added on 26-04-2007\n\n\t\t$del_file_name = array();\n\n\t\t//end\n\n\t\tforeach($fld_arr as $key => $value)\n\n\t\t{\n\n\t\t\n\n\t\t\tif(is_array($value) && strtolower($key) != \"image_copies\" && strtolower($key) != \"image_dimensions\" && strtolower($key) != \"upload_msgs\")\n\n\t\t\t{\n\n\t\t\t\t\n\n\t\t\t\t//print_r($_REQUEST);\n\n\t\t\t\t\n\n\t\t\t\t//if(1 == 1 || isset($GLOBALS['param_arr'][$value['frm_fldname']]) || (!isset($GLOBALS['param_arr'][$value['frm_fldname']]) && $value['save_todb'] == 'true'))\n\n\t\t\t\t//if(isset($value['value']) && !$value['save_todb'])\n\n\t\t\t\t{\n\n\t\t\t\t\t\n\n\t\t\t\t\t//27012007 - need to handle file fields. - Start\n\n\n\n\t\t\t\t\tif(strtolower($value['frm_fld_type']) == \"file\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\n\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t//end\n\n\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if((strtolower($value['frm_fld_type']) == \"img\" || strtolower($value['frm_fld_type']) == \"imgcopy\") && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['s'] > 0)\n\n\t\t\t\t\t\t\t$s = $obj->image_dimensions[$value['frm_fldname']]['s'];\n\n\t\t\t\t\t\telse if($obj->attachment_s > 0)\n\n\t\t\t\t\t\t\t$s = $obj->attachment_s;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$s = $GLOBALS['site_config']['files_allowed_size'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['h'] > 0)\n\n\t\t\t\t\t\t\t$h = $obj->image_dimensions[$value['frm_fldname']]['h'];\n\n\t\t\t\t\t\telse if($obj->attachment_h > 0)\n\n\t\t\t\t\t\t\t$h = $obj->attachment_h;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$h = $GLOBALS['site_config']['files_allowed_h'];\n\n\t\t\t\t\t\t\n\n\t\t\t\t\t\tif($obj->image_dimensions[$value['frm_fldname']]['w'] > 0)\n\n\t\t\t\t\t\t\t$w = $obj->image_dimensions[$value['frm_fldname']]['w'];\n\n\t\t\t\t\t\telse if($obj->attachment_w > 0)\n\n\t\t\t\t\t\t\t$w = $obj->attachment_w;\n\n\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t$w = $GLOBALS['site_config']['files_allowed_w'];\n\n\n\n\t\t\t\t\t\tif(strtolower($value['frm_fld_type']) == \"imgcopy\" && $obj->image_copies[$value['frm_fldname']][0] > 0 && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$ret_val = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], \"s\", $s);\n\t\t\t\t\t\tif($ret_val == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t$file_attachment_status = 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"img\")\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t//$value['value'] = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $obj->attachment_conditions, $s, $h, $w);\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$attach_cond = $obj->image_dimensions[$value['frm_fldname']]['chk_cond'];\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tif(strlen(trim($attach_cond)) <= 0)\n\n\t\t\t\t\t\t\t$attach_cond = $obj->attachment_conditions;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$temp_file_name = $GLOBALS['img_obj']->upload_file($obj, $value['frm_fldname'], $value['frm_fld_type'], $attach_cond, $s, $h, $w);\n\n\t\t\t\t\t\t\t$value['value'] = $temp_file_name;\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $value['value'];\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t\tif($temp_file_name == \"File Not Uploaded.\")\n\n\t\t\t\t\t\t\t$file_attachment_status = 0;\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\n\n\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\t//27012007 - need to handle file fields. - End\n\n\n\n\t\t\t\t\tif((((strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\") && $_FILES[$value['frm_fldname']]['size'] > 0 && trim($value['value']) != \"File Not Uploaded.\") || !(strtolower($value['frm_fld_type']) == \"file\" || strtolower($value['frm_fld_type']) == \"img\")) && $value['value'] != \"do_not_frame_in_sql\" && strtolower($value['frm_fld_type']) != \"imgcopy\")\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$qry_fld_list .= $key . \", \";\n\n\t\t\t\t\t\t$qry_val_list .= \"'\" . wrap_values($value['value']) . \"', \";\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse if(strtolower($value['frm_fld_type']) == \"imgcopy\" && $_FILES[$value['frm_fldname']]['size'] > 0)\n\n\t\t\t\t\t{\n\n\t\t\t\t\t\tforeach($ret_val as $imgc_key => $imgc_val)\n\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$qry_fld_list .= $imgc_key . \", \";\n\n\t\t\t\t\t\t\t$qry_val_list .= \"'\" . wrap_values($imgc_val) . \"', \";\n\n\t\t\t\t\t\t\t//added on 26-04-2006\n\n\t\t\t\t\t\t\t$del_file_name[] = $imgc_val;\n\n\t\t\t\t\t\t\t//end\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\n\t\t\t\t}\n\n\n\n\t\t\t}\n\n\t\t\n\n\t\t}//end foreach\n\n\t\t\n\n\t\t$qry_fld_list = substr($qry_fld_list, 0, -2);\n\n\t\t$qry_val_list = substr($qry_val_list, 0, -2);\n\n\t\t\n\n\t\t$final_insert_query = $initial_qry . $qry_fld_list . $mid_qry . $qry_val_list . \")\";\n\n\t\t\n\n\t\tif($file_attachment_status == 1)//10042007\n\n\t\t\t$res = $this->execute_sql($final_insert_query,\"insert\");\n\n\t\telse\n\n\t\t{\n\n\t\t\t//added on 26-04-2006\n\n\t\t\tforeach($del_file_name as $key => $del_value)\n\n\t\t\t{\n\n\t\t\t\t$del_filename = $del_value;\n\n\t\t\t\t$del_filepath = $obj->attachment_path . $del_filename;\n\n\t\t\t\t\n\n\t\t\t\tif(file_exists($del_filepath) && is_file($del_filepath))\n\n\t\t\t\tunlink($del_filepath);\n\n\t\t\t}//end\n\n\t\t\t\n\n\t\t\t$res = array(\"insertion failed\");\n\n\t\t}\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::insert_record() - Return Value : ', $res);\n\n\t\t\n\n\t\treturn $res;\n\n\t\t\n\n\t}", "function psc_save_form($data) {\n\tglobal $wpdb, $psc;\n\t\n\t$old_fields = $data['data'];\n\t$fields = array();\n\tforeach($old_fields as $field) {\n\t\t$fields[] = $field;\n\t}\n\t\n\tforeach($fields as $key => $value) {\n\t\tif(empty($value['options']) || !in_array($value['type'], array('select', 'multiselect', 'radio', 'checkbox'))) {\n\t\t\tunset($fields[$key]['options']);\n\t\t}\n\t\t\n\t\tif(isset($fields[$key]['options'])) {\n\t\t\t$fields[$key]['options'] = explode(',', $fields[$key]['options']);\n\t\t\t$fields[$key]['options'] = array_map('trim', $fields[$key]['options']);\n\t\t}\n\t\t\n\t\t$fields[$key]['slug'] = 'psc_'.str_replace('psc_', '', $value['slug']);\n\t\tif(isset($value['required']) && $value['required']=='on') {\n\t\t\t$fields[$key]['required'] = 'true';\n\t\t} else {\n\t\t\t$fields[$key]['required'] = 'false';\n\t\t}\n\t\t\n\t\tif(isset($value['maps_as']) && $value['maps_as']=='on') {\n\t\t\t$fields[$key]['maps_as'] = 'content';\n\t\t} else {\n\t\t}\n\t}\n\t\n \tif(isset($data['captcha']) && $data['captcha']=='on') {\n\t\t// nothing\n\t\t$data['captcha'] = 1;\n\t} else {\n\t\t$data['captcha'] = 0;\n\t}\n\t\n\tif(isset($data['thanks_url']) && !empty($data['thanks_url'])) {\n\t\t// nothing\n\t} else {\n\t\t$data['thanks_url'] = null;\n\t}\n\t\n\t// echo '<br /><br />';\n\t// var_dump('SET data=\\''.mysql_escape_string(serialize($fields)).'\\', name=\"'.mysql_escape_string($data['title']).'\", slug=\"'.mysql_escape_string($data['slug']).'\", thanks_url=\"'.mysql_escape_string($data['thanks_url']).'\", default_status=\"'.mysql_escape_string($data['default_status']).'\", default_category=\"'.mysql_escape_string($data['default_category']).'\", captcha=\"'.mysql_escape_string($data['captcha']).'\"');\n\t\n\tif(isset($data['psc_id'])) {\n\t\t$wpdb->query('UPDATE '.$psc->forms.' SET data=\\''.serialize($fields).'\\', name=\"'.$data['title'].'\", slug=\"'.$data['slug'].'\", thanks_url=\"'.$data['thanks_url'].'\", default_status=\"'.$data['default_status'].'\", default_category=\"'.$data['default_category'].'\", captcha=\"'.$data['captcha'].'\" WHERE id=\"'.$data['psc_id'].'\"');\n\t\treturn true;\n\t} else {\n\t\t$insert_array = array('data' => serialize($fields), 'name' => $data['title'], 'slug' => $data['slug'], 'thanks_url' => $data['thanks_url'], 'default_status' => $data['default_status'], 'default_category' => $data['default_category'], 'captcha' => $data['catpcha']);\n\t\t$wpdb->insert($psc->forms, $insert_array);\n\t\treturn $wpdb->insert_id;\n\t}\n}", "public function getDealerForm($array) {\n\t\t/* If user has requested to edit a dealer, get dealer info and load form with form values filled in.\n\t\t * Check for input error $_SESSION vars first, in case user already submitted form and there were form errors.\n\t\t * Note: $submit_type is included in form hidden input & dictates UPDATE or INSERT db action via process.inc.php file\n\t\t**/\n\t\tif(isset($_SESSION['edit_dealername'])) {\n\t\t\t$edit_dealerID = $_SESSION['edit_dealerID']\t\t;\n\t\t\t$dealername \t= $_SESSION['edit_dealername']\t\t;\n\t\t\t$dealercode \t= $_SESSION['edit_dealercode']\t\t;\n\t\t\t$dealeraddress \t= $_SESSION['edit_dealeraddress']\t;\n\t\t\t$dealercity \t= $_SESSION['edit_dealercity']\t\t;\n\t\t\t$state_ID \t\t= $_SESSION['edit_state_ID']\t\t;\n\t\t\t$state_name \t= $_SESSION['edit_state_name']\t\t;\n\t\t\t$dealerzip \t\t= $_SESSION['edit_dealerzip']\t\t;\n\t\t\t$dealerphone \t= $_SESSION['edit_dealerphone']\t\t;\n\t\t\t$regionID \t\t= $_SESSION['edit_regionID']\t\t;\n\t\t\t$region_name \t= $_SESSION['edit_region_name']\t ;\n\t\t\t$area_ID \t\t= $_SESSION['edit_area_ID']\t\t\t;\n\t\t\t$area_name \t\t= $_SESSION['edit_area_name']\t ;\n\t\t\t$district_ID \t= $_SESSION['edit_district_ID']\t\t;\n\t\t\t$district_name \t= $_SESSION['edit_district_name'] ;\n\t\t\t$submit_type = ($_SESSION['submit_type'] == 'add_dealer') ? 'add_dealer' : 'edit_dealer';\n\t\t\t$submit_value = 'Save Changes';\n\t\t} elseif($array['dealerID']) {\n\t\t\t$array = $this->getDealerData(array('dealerID'=>$array['dealerID']));\n\t\t\t$edit_dealerID = $array[0]['dealerID']\t\t;\n\t\t\t$dealername \t= $array[0]['dealername']\t;\n\t\t\t$dealercode \t= $array[0]['dealercode']\t;\n\t\t\t// Set global var for ensuring user does not try to enter a duplicate dealer code\n\t\t\t$_SESSION['orig_dealercode'] = $dealercode ;\n\t\t\t$dealeraddress \t= $array[0]['dealeraddress'];\n\t\t\t$dealercity \t= $array[0]['dealercity']\t;\n\t\t\t$state_ID \t\t= $array[0]['state_ID']\t\t;\n\t\t\t$state_name \t= $array[0]['state_name']\t;\n\t\t\t$dealerzip \t\t= $array[0]['dealerzip']\t;\n\t\t\t$dealerphone \t= $array[0]['dealerphone']\t;\n\t\t\t$regionID \t\t= $array[0]['regionID']\t\t;\n\t\t\t$region_name \t= $array[0]['region']\t ;\n\t\t\t$area_ID \t\t= $array[0]['area_ID']\t\t;\n\t\t\t$area_name \t\t= $array[0]['area']\t ;\n\t\t\t$district_ID \t= $array[0]['district_ID']\t;\n\t\t\t$district_name \t= $array[0]['district'] ;\n\t\t\t$submit_type = 'edit_dealer';\n\t\t\t$submit_value = 'Save Changes';\n\t\t} else {\n\t\t\t$edit_dealerID = null;\n\t\t\t$dealername \t= null;\n\t\t $dealercode \t= null;\n\t\t $dealeraddress \t= null;\n\t\t $dealercity \t= null;\n\t\t $state_ID \t\t= null;\n\t\t $state_name \t= 'Select...';\n\t\t $dealerzip \t\t= null;\n\t\t $dealerphone \t= null;\n\t\t $regionID \t\t= null;\n\t\t $region_name \t= 'Select...';\n\t\t $area_ID \t\t= null;\n\t\t $area_name \t\t= 'Select...';\n\t\t $district_ID \t= null;\n\t\t $district_name \t= 'Select...';\n\t\t $submit_type = 'add_dealer';\n\t\t $_SESSION['submit_type'] = 'add_dealer';\n\t\t $submit_value = 'Register '.ENTITY.' &raquo';\n\t\t}\n\t\t$html ='\n\t\t<form method=\"post\" action=\"system/utils/process.inc.php\" class=\"dealer_form\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"small-12 medium-12 large-12 columns\">\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Name\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealername.'\" id=\"dealername\" name=\"dealername\" autofocus>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Code\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealercode.'\" id=\"dealercode\" name=\"dealercode\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Address\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealeraddress.'\" id=\"dealeraddress\" name=\"dealeraddress\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' City\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealercity.'\" id=\"dealercity\" name=\"dealercity\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' State\n\t\t\t\t\t\t\t<select id=\"state\" name=\"state\">\n\t\t\t\t\t\t\t\t<option value=\"'.$state_ID.','.$state_name.'\">'.$state_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getStateData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['state_ID'].', '.$data[$i]['state_name'].'\">'.$data[$i]['state_name'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Zip Code\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealerzip.'\" id=\"dealerzip\" name=\"dealerzip\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>Phone Number\n\t\t\t\t\t\t\t<input type=\"text\" value=\"'.$dealerphone.'\" id=\"dealerphone\" name=\"dealerphone\">\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Region\n\t\t\t\t\t\t\t<select id=\"region\" name=\"region\">\n\t\t\t\t\t\t\t\t<option value=\"'.$regionID.','.$region_name.'\">'.$region_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getRegionData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['regionID'].', '.$data[$i]['region'].'\">'.$data[$i]['region'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' District\n\t\t\t\t\t\t\t<select id=\"district\" name=\"district\">\n\t\t\t\t\t\t\t\t<option value=\"'.$district_ID.','.$district_name.'\">'.$district_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getDistrictData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['district_ID'].', '.$data[$i]['district'].'\">'.$data[$i]['district'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-6 large-4 columns\">\n\t\t\t\t\t\t<label>'.ENTITY.' Area\n\t\t\t\t\t\t\t<select id=\"area\" name=\"area\">\n\t\t\t\t\t\t\t\t<option value=\"'.$area_ID.','.$area_name.'\">'.$area_name.'</option>';\n\t\t\t\t\t\t\t\t$data = $this->getAreaData();\n\t\t\t\t\t\t\t\tfor ($i=0; $i<count($data); $i++) {\n\t\t\t\t\t\t\t\t\t$html .='<option value=\"'.$data[$i]['area_ID'].', '.$data[$i]['area'].'\">'.$data[$i]['area'].'</option>';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$html .='\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"small-12 medium-12 large-12 columns\">\n\t\t\t\t\t\t<input type=\"hidden\" id=\"action\" name=\"action\" value=\"'.$submit_type.'\" />\n\t\t\t\t\t\t<input type=\"hidden\" id=\"edit_dealerID\" name=\"edit_dealerID\" value=\"'.$edit_dealerID.'\" />\n\t\t\t\t\t\t<input type=\"submit\" id=\"submit\" name=\"submit\" value=\"'.$submit_value.'\" class=\"tiny button radius\">\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\n\t\t<div class=\"row\">\n\t\t\t<div class=\"small-12 medium-12 large-12 columns\">\n\t\t\t\t<hr>\n\t\t\t</div>\n\t\t</div>';\n\t\treturn $html;\n\t}", "public function storeFormValues( $params ) {\r\n \r\n // store the parameters\r\n $this->__construct( $params );\r\n \r\n }", "function InlineInsert() {\r\n\t\tglobal $Language, $objForm, $gsFormError;\r\n\t\t$this->LoadOldRecord(); // Load old recordset\r\n\t\t$objForm->Index = 0;\r\n\t\t$this->LoadFormValues(); // Get form values\r\n\r\n\t\t// Validate form\r\n\t\tif (!$this->ValidateForm()) {\r\n\t\t\t$this->setFailureMessage($gsFormError); // Set validation error message\r\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\r\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->SendEmail = TRUE; // Send email on add success\r\n\t\tif ($this->AddRow($this->OldRecordset)) { // Add record\r\n\t\t\tif ($this->getSuccessMessage() == \"\")\r\n\t\t\t\t$this->setSuccessMessage($Language->Phrase(\"AddSuccess\")); // Set up add success message\r\n\t\t\t$this->ClearInlineMode(); // Clear inline add mode\r\n\t\t} else { // Add failed\r\n\t\t\t$this->EventCancelled = TRUE; // Set event cancelled\r\n\t\t\t$this->CurrentAction = \"add\"; // Stay in add mode\r\n\t\t}\r\n\t}", "function form_process($db,$action,$table,$pk){\n\t\t// build sql\n\t\tif($action=='new') {\n\t\t\t$sql = \"INSERT INTO `{$table}`(\";\n\n\t\t\tforeach ($_POST as $key => $value) \n\t\t\t{\n\t\t\t\t$sql .= \"`\".$key.\"`,\";\n\t\t\t}\n\t\t\t\n\t\t\t$sql = substr($sql,0,-1).\") VALUES (\";\n\t\t\t\n\t\t\tforeach ($_POST as $key => $value) \n\t\t\t{\n\t\t\t\t$sql .= \"\\\"\".$value.\"\\\",\";\n\t\t\t}\n\t\t\t\n\t\t\t$sql = substr($sql,0,-1).\")\";\n\t\t} elseif($action=='edit') {\n\t\t\t$sql = \"UPDATE `{$table}` SET \";\n\t\t\tforeach ($_POST as $key => $value) {\n\t\t\t\t$sql .= \"`\".$key.\"` = '\".$value.\"', \";\n\t\t\t\tif($key==$pk) { $pval=$value; }\n\t\t\t}\n\t\t\t$sql = substr($sql,0,-2); \n\t\t\t\n\t\t\t$sql .= \" WHERE `{$pk}` = '\".$pval.\"'\";\n\t\t\t$_SESSION['m'] = \"Item gewijzigd.\";\n\t\t}\n\t\t//echo $sql;\n\t\t$db->query($sql);\n\t}", "public function store_form_values($form_values){\n\t\t$this->__construct($form_values);\n\t}", "public function saveToDCA(array &$arrData)\n {\n parent::saveToDCA($arrData);\n $arrData['fields'][$this->field_name]['inputType'] = \"checkboxWizard\";\n $arrData['fields'][$this->field_name]['sql'] = \"mediumtext NULL\";\n }", "public function saveContact() {\n $this->checkValidUser();\n\n $this->db->sql = 'UPDATE '.$this->db->dbTbl['contact'].' SET '.$this->getData('field').' = :value WHERE id = :id';\n\n $res = $this->db->execute(array(\n ':value' => $this->getData('value'),\n ':id' => $this->getData('id')\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sGty6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'gSeD5'\n );\n }\n\n $this->renderOutput();\n }", "function do_contact_supplier_form($adata, $aerr_entry, $aret_flag=0) {\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Some HTML Strings (reduce text)\n\t\t$_td_str_left_vtop\t= '<td class=\"TP1SML_NR\" width=\"30%\" valign=\"top\">';\n\t\t$_td_str_left\t\t= '<td class=\"TP1SML_NR\" width=\"30%\">';\n\t\t$_td_str_right\t\t= '<td class=\"TP1SML_NL\" width=\"70%\">';\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr .= $_CCFG['_PKG_NAME_SHORT'].$_sp.$_LANG['_MAIL']['Contact_Supplier_Form'].$_sp.'('.$_LANG['_MAIL']['all_fields_required'].')';\n\n\t# Do data entry error string check and build\n\t\tIF ($aerr_entry['flag']) {\n\t\t \t$err_str = $_LANG['_MAIL']['CC_FORM_ERR_HDR1'].'<br>'.$_LANG['_MAIL']['CC_FORM_ERR_HDR2'].'<br>'.$_nl;\n\n\t \t\tIF ($aerr_entry['cc_s_id']) \t{$err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR01']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_mc_id']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR02']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_subj']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR03']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['cc_msg']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CC_FORM_ERR_ERR04']; $err_prv = 1;}\n\n\t \t\t$_cstr .= '<p align=\"center\"><b>'.$err_str.'</b>'.$_nl;\n\t\t}\n\n\t# Formatting tweak for spacing\n\t\tIF ($aerr_entry['flag']) {$_cstr .= '<br><br>'.$_nl;}\n\n\t\t$_cstr .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">'.$_nl;\n\t\t$_cstr .= '<tr><td align=\"center\">'.$_nl;\n\t\t$_cstr .= '<form action=\"mod.php\" method=\"post\" name=\"supplier\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mod\" value=\"mail\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mode\" value=\"supplier\">'.$_nl;\n\t\t$_cstr .= '<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\">'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_To_Supplier'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_select_list_suppliers('cc_s_id', $adata['cc_s_id'], '1').$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_From'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_select_list_mail_contacts('cc_mc_id', $adata['cc_mc_id']);\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Subject'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= '<INPUT class=\"PSML_NL\" TYPE=TEXT name=\"cc_subj\" size=\"30\" maxlength=\"50\" value=\"'.htmlspecialchars($adata['cc_subj']).'\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left_vtop.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Message'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\tIF ($_CCFG['WYSIWYG_OPEN']) {$_cols = 100;} ELSE {$_cols = 75;}\n\t\t$_cstr .= '<TEXTAREA class=\"PSML_NL\" NAME=\"cc_msg\" COLS=\"'.$_cols.'\" ROWS=\"15\">'.$adata['cc_msg'].'</TEXTAREA>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<INPUT TYPE=hidden name=\"stage\" value=\"1\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_email', 'SUBMIT', $_LANG['_MAIL']['B_Send_Email'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_reset', 'RESET', $_LANG['_MAIL']['B_Reset'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= '</tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</form>'.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr \t\t= ''.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t# Return / Echo Final Output\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "function InsertProperty($formid=false)\n\t{\t\n\t\t$data=$_POST;\n\t\t\n\t\t$date=date(\"Y-m-d h:i:s\");\n\t\t\n\t\tif(!empty($formid))\n\t\t{\n\t\t\t$formname=\"form-\";\n\t\t\t$formname.=$formid;\n\t\t}\n\t\t\n\t\tif(!empty($data) || $formname==\"form-2\")\n\t\t\t{\n\t\t\t\t$data1=array();\n\t\t\t\t$data2=array();\n\t\t\t\t$mappingtabledata=array();\n\t\t\t\t$mappingtableplanid='';\n\t\t\t\t\n\t\t\t\tif($formname==\"form-1\")\n\t\t\t\t{\n\t\t\t\t\t$propertyprice=array();\n\t\t\t\t\t$selectattribute=array();\n\t\t\t\t\t$selectattributeval=array();\n\t\t\t\t\t$textattribute=array();\n\t\t\t\t\t$multiattribute=array();\n\t\t\t\t\t$amenitiesdata=array();\n\t\t\t\t\t$amenitiesvalue=array();\n\t\t\t\t\t$newpassiondate='';\n\t\t\t\t\t$noofbedroom='';$propertytypename='';$coveredarea='';$projectname='';$propertypurpose='';$sublocality='';$locality='';\n\t\t\t\t\tforeach($data as $key=> $datas)\n\t\t\t\t\t{\n\t\t\t\t\t\t$datas=preg_replace('/\\s\\s+/', ' ',$datas);\n\t\t\t\t\t\tif($key==\"userID\"){\n\t\t\t\t\t\t $data1['userID']=$datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyTypeID\"){\n\t\t\t\t\t\t $data1['propertyTypeID']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyPurpose\"){\n\t\t\t\t\t\t $data1['propertyPurpose']=$propertypurpose= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyStatus\"){\n\t\t\t\t\t\t $data1['propertyStatus']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"projectID\"){\n\t\t\t\t\t\t $data1['projectID']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"type\"){\n\t\t\t\t\t\t $data1['type']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"isNegotiable\"){\n\t\t\t\t\t\t $data1['isNegotiable']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyName\") //Data 2 start..................................................\n\t\t\t\t\t\t{\n\t\t\t\t\t\t $data2['propertyName']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyDescription\"){\n\t\t\t\t\t\t $data2['propertyDescription']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"showpriceas\"){\n\t\t\t\t\t\t $data1['isNegotiable']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"lat\"){\n\t\t\t\t\t\t $data1['propertyLatitude']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"lng\"){\n\t\t\t\t\t\t $data1['propertyLongitude']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"postal_code\"){\n\t\t\t\t\t\t $data1['propertyZipCode']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"sublocality\"){\n\t\t\t\t\t\t $data2['propertyLocality']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyAddress2\"){\n\t\t\t\t\t\t $data2['propertyAddress2']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyAddress1\"){\n\t\t\t\t\t\t $data2['propertyAddress1']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyPrice\"){\n\t\t\t\t\t\t $propertyprice['propertyPrice']= $datas;\n\t\t\t\t\t\t} \n\t\t\t\t\t\telseif($key==\"currentstatus\"){\n\t\t\t\t\t\t $data1['propertyCurrentStatus']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"year\"){\n\t\t\t\t\t\t $year= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"month\"){\n\t\t\t\t\t\t $month= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"day\"){\n\t\t\t\t\t\t $day= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"propertyAddress\"){\n\t\t\t\t\t\t $add3= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n/********************************Code for city,state,county,citylocality Get ID For insert start**********************************/\n\t\t\t\t\t/* if(!empty($add3))\n\t\t\t\t\t{ */\n\t\t\t\t\t\tif($key==\"country\"){\n\t\t\t\t\t\t $addarray['country']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"administrative_area_level_1\"){\n\t\t\t\t\t\t $addarray['administrative_area_level_1']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"locality\"){\n\t\t\t\t\t\t $addarray['locality']=$locality= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"sublocality\"){\n\t\t\t\t\t\t $addarray['sublocality']=$sublocality= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"lat\"){\n\t\t\t\t\t\t $addarray['propertyLatitude']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif($key==\"lng\"){\n\t\t\t\t\t\t $addarray['propertyLongitude']= $datas;\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data1['propertyFeatured']= 'OFF';\n\t\t\t\t\t\n\t\t\t\t\t//}\n/*******************************Code for city,state,county,citylocality Get ID For insert END*************************************/\t\t\t\t\t\n\t\t\t\t\t\t\n/*************************************paln id mapping with property***************************************************************/\n\t\t\t\t\t\tif($key==\"planid\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$mappingtableplanid= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n/************************************paln id mapping with property*****************************************************************/\n\t\n/***************************************Amenities Start***************************************************************************/\n\t\t\t\t\t\telseif($key==\"Amenities\"){\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$string1 = '';\n\t\t\t\t\t\t\t$string2 = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!empty($datas)){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($datas as $amenities){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$amenitiesarr=explode(\"#\",$amenities);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$string1.= rtrim($amenitiesarr[1]).'#|#';\n\t\t\t\t\t\t\t\t\t$string2.= rtrim($amenitiesarr[2]).'#|#';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$amenitiesdata[]=array('attributeID'=>$amenitiesarr[0],'attrOptionID'=>substr($string1,0,-3));\n\t\t\t\t\t\t\t\t$amenitiesvalue[]=array('attrDetValue'=>substr($string2,0,-3));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\t\t\t\t\t\t\t\t\t\t\t\n/****************************************Attributes strat************************************************************************/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(!empty($key)){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$typeofattribute=explode(\"-\",$key);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(count($typeofattribute)>1){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($typeofattribute[0]==\"select\"){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($datas)){\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\t$optionidselect=explode(\"#\",$datas);\n\t\t\t\t\t\t\t\t\t\t\t\t\tif($typeofattribute[1]==1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$noofbedroom=$optionidselect[1];\n\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$selectattribute[]=array('attributeID'=>$typeofattribute[1],'attrOptionID'=>$optionidselect[0]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$selectattributeval[]=array('attrDetValue'=>$optionidselect[1]);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telseif($typeofattribute[0]==\"text\"){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t if(!empty($datas)){\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 $size='';\n\t\t\t\t\t\t\t\t\t\t\t\t if($typeofattribute[1]==4){\n\t\t\t\t\t\t\t\t\t\t\t\t\t $coveredarea=$datas;\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$selectattribute[]=array('attributeID'=>$typeofattribute[1],'attrOptionID'=>0);\n\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$selectattributeval[]=array('attrDetValue'=>\"$datas \");\n\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\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t} \n\t\t\t\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\telseif($typeofattribute[0]==\"multi\"){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$stringmulti1 = '';\n\t\t\t\t\t\t\t\t\t\t\t$stringmulti2 = '';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(!empty($datas)){\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\tforeach($datas as $attributemulti){\n\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$multiarr=explode(\"#\",$attributemulti);\n\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$stringmulti1.= rtrim($multiarr[0]).'#|#';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$stringmulti2.= rtrim($multiarr[1]).'#|#';\n\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}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$selectattribute[]=array('attributeID'=>$typeofattribute[1],'attrOptionID'=>substr($stringmulti1,0,-3));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$selectattributeval[]=array('attrDetValue'=>substr($stringmulti2,0,-3));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n/*******************************************************Passession Date************************************************************/\n\t\t\t\t\tif(!empty($month)){\n\t\t\t\t\t\t$newpassiondate.=$month;\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($year)){ \n\t\t\t\t\t\t$newpassiondate.=',';$newpassiondate.=$year;\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($day)){\n\t\t\t\t\t\t$newpassiondate.=',';$newpassiondate.=$day;\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($newpassiondate)){\n\t\t\t\t\t\t\t$data1['possessionDate']= $newpassiondate;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($addarray))\n\t\t\t\t\t{\n\t\t\t\t\t\t$addressids=$this->AddProperty_model->Getaddressids($addarray);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($addressids)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t $data1['countryID']= $addressids['countryID'];\n\t\t\t\t\t\t $data1['stateID']= $addressids['stateID'];\n\t\t\t\t\t\t $data1['cityID']= $addressids['cityID'];\n\t\t\t\t\t\t $data1['cityLocID']= $addressids['cityLocID'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t $data1['countryID']= '99';\n\t\t\t\t\t\t\t $data1['stateID']= '1';\n\t\t\t\t\t\t\t $data1['cityID']= '1';\n\t\t\t\t\t\t\t $data1['cityLocID']= '';\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($data['propertyID'])){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$filter1=array('propertyID'=>$data['propertyID']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($data1['projectID']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$projectid=$data1['projectID'];\n\t\t\t\t\t\t\t$projectnames=$this->AddProperty_model->get_project(\" and rp_projects.projectID=$projectid\");\n\t\t\t\t\t\t\tif(!empty($projectnames)){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($projectnames[0]->cityID){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$cityinfo=$this->AddProperty_model->Getotherdata('rp_city_details',array('cityID'=>$projectnames[0]->cityID,'languageID'=>1));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$citylocinfo=$this->AddProperty_model->Getotherdata('rp_city_locations',array('cityLocID'=>$projectnames[0]->cityLocID));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!empty($cityinfo)){\n\t\t\t\t\t\t\t\t\t\t$locality=$cityinfo[0]->cityName;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!empty($citylocinfo)){\n\t\t\t\t\t\t\t\t\t\t$sublocality=$citylocinfo[0]->googleLocName;\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$projectname=$projectnames[0]->projectName;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data1['propertyLatitude']= $projectnames[0]->projectLatitude;\n\t\t\t\t\t\t\t\t$data1['propertyLongitude']= $projectnames[0]->projectLongitude;\n\t\t\t\t\t\t\t\t$data1['propertyZipCode']= \t $projectnames[0]->projectZipCode;\n\t\t\t\t\t\t\t\t$data2['propertyLocality']= $sublocality;\n\t\t\t\t\t\t\t\t$data2['propertyAddress2']= $projectnames[0]->projectAddress2;\n\t\t\t\t\t\t\t\t$data2['propertyAddress1']= $projectnames[0]->projectAddress1;\n\t\t\t\t\t\t\t\t$data1['countryID']= $projectnames[0]->countryID;\n\t\t\t\t\t\t\t\t$data1['stateID']= $projectnames[0]->stateID;\n\t\t\t\t\t\t\t\t$data1['cityID']= $projectnames[0]->cityID;\n\t\t\t\t\t\t\t\t$data1['cityLocID']= $projectnames[0]->cityLocID;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_properties',$data1,$filter1);\n\t\t\t\t\t\t\n/**************************************Meta Details autogenerate start********************************************************/\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($data1['propertyTypeID'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$propertytypeid=$data1['propertyTypeID'];\n\t\t\t\t\t\t\t$propertytypenames=$this->AddProperty_model->getPropertyType(\" AND t2.propertyTypeID=$propertytypeid\");\n\t\t\t\t\t\t\t$propertytypename=$propertytypenames[0]->propertyTypeName;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$propertyMetaTitle=\"$noofbedroom BHK $propertytypename $coveredarea sqft for $propertypurpose in $projectname $sublocality $locality | Homeonline\";\n\t\t\t\t\t\t$propertyMetaKeyword=\"$noofbedroom BHK $propertytypename for $propertypurpose in $projectname $locality,\n\t\t\t\t\t\t$noofbedroom BHK $propertytypename in $locality for $propertypurpose, $noofbedroom BHK $propertytypename\n\t\t\t\t\t\tfor $propertypurpose in $projectname $sublocality $locality, $noofbedroom BHK $propertytypename for $propertypurpose in $sublocality $locality, $noofbedroom BHK $propertytypename in $projectname, $noofbedroom BHK $propertytypename $coveredarea sqft for $propertypurpose in $projectname $locality, $propertytypename for $propertypurpose in $locality.\";\n\t\t\t\t\t\t$propertyMetaDescription=\"$noofbedroom BHK $propertytypename $coveredarea sqft for $propertypurpose in $projectname $sublocality $locality with all modern amenities. Browse $noofbedroom BHK $propertytypename for $propertypurpose in $locality and get best deals from real estate agents at homeonline.com\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data2['propertyMetaTitle']= preg_replace('/\\s\\s+/', ' ',$propertyMetaTitle);\n\t\t\t\t\t\t$data2['propertyMetaKeyword']= preg_replace('/\\s\\s+/', ' ',$propertyMetaKeyword);\n\t\t\t\t\t\t$data2['propertyMetaDescription']= preg_replace('/\\s\\s+/', ' ',$propertyMetaDescription);\n/**************************************Meta Details autogenerate END********************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($this->languages as $language){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$filter2=array('languageID'=>$language->languageID,'propertyID'=>$data['propertyID']);\n\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_details',$data2,$filter2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$localityid=$data1['cityLocID'];$lat=$data1['propertyLatitude'];$long=$data1['propertyLongitude'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(empty($data1['projectID'])){\n\t\t\t\t\t\t$this->AddProperty_model->Insertareacode($localityid,$lat,$long,$data['propertyID']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************Insert rp_dbho_plan_mapping Data start*************************************/\n\t\t\t\t\t\n\t\t\t\t\t\t$mappingdatafilter=array('objectID'=>$data['propertyID'],'objectType'=>'property');\n\t\t\t\t\t\t$oldplancheck=$this->AddProperty_model->Getotherdata('rp_dbho_plan_mapping',$mappingdatafilter);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($oldplancheck)){\n\t\t\t\t\t\t\t$oldplanID=$oldplancheck[0]->planID;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($oldplanID==$mappingtableplanid){\n\t\t\t\t\t\t\t\t$logdata=array('propertyID'=>$data['propertyID'],'userName'=>$this->userinfo['adminUserFirstName'],'userID'=>$this->userinfo['adminUserID'],'createdBy'=>$this->userinfo['adminUserFirstName'],'actionType'=>'Edit','userAccessType'=>'Admin');\n\t\t\t\t\t\t\t\t$this->AddProperty_model->Insert_data('rp_dbho_property_log',$logdata);\n\t\t\t\t\t\t\t}elseif($oldplanID !='' && $mappingtableplanid==''){\n\t\t\t\t\t\t\t\t$logdata=array('propertyID'=>$data['propertyID'],'userName'=>$this->userinfo['adminUserFirstName'],'userID'=>$this->userinfo['adminUserID'],'createdBy'=>$this->userinfo['adminUserFirstName'],'actionType'=>'Edit','userAccessType'=>'Admin');\n\t\t\t\t\t\t\t\t$this->AddProperty_model->Insert_data('rp_dbho_property_log',$logdata);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_properties',array('propertyStatus'=>'Draft'),array('propertyID'=>$data['propertyID']));\n\t\t\t\t\t\t\t\t$mappingtablefinaldata['planID']=$mappingtableplanid;\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_dbho_plan_mapping',$mappingtablefinaldata,$mappingdatafilter);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$logdata=array('propertyID'=>$data['propertyID'],'userName'=>$this->userinfo['adminUserFirstName'],'userID'=>$this->userinfo['adminUserID'],'createdBy'=>$this->userinfo['adminUserFirstName'],'actionType'=>'Update Plan And Status Draft','userAccessType'=>'Admin');\n\t\t\t\t\t\t\t\t$this->AddProperty_model->Insert_data('rp_dbho_property_log',$logdata);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$mappingtablefinaldata['planID']=$mappingtableplanid;\n\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_dbho_plan_mapping',$mappingtablefinaldata,$mappingdatafilter);\n\t\t\t\t\t\t\t$logdata=array('propertyID'=>$data['propertyID'],'userName'=>$this->userinfo['adminUserFirstName'],'userID'=>$this->userinfo['adminUserID'],'createdBy'=>$this->userinfo['adminUserFirstName'],'actionType'=>'Update Plan','userAccessType'=>'Admin');\n\t\t\t\t\t\t\t$this->AddProperty_model->Insert_data('rp_dbho_property_log',$logdata);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************Insert rp_dbho_plan_mapping Data END*************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($propertyprice))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($this->currencies as $currency){\n\t\t\t\t\t\t\t$filter3=array('currencyID'=>$currency->currencyID,'propertyID'=>$data['propertyID']);\n\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_price',$propertyprice,$filter3);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$in=\"178,179,180,181,182,183,197\";\n\t\t\t\t\t\t$this->AddProperty_model->deleteattributesandvalues($data['propertyID'],$in);\n\t\t\t\t\t\tif(!empty($amenitiesdata) && !empty($amenitiesvalue))\n\t\t\t\t\t\t{\t$i=0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($amenitiesdata as $amenitiesdatainsert)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t$amenitiesdatainsert['propertyID']=$data['propertyID'];\n\t\t\t\t\t\t\t\t$attributevalueId=$this->AddProperty_model->InsertProperty('rp_property_attribute_values',$amenitiesdatainsert);\n\t\t\t\t\t\t\t\t$amenitiesvalue[$i]['attrValueID']=$attributevalueId;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tforeach($this->languages as $language){\n\t\t\t\t\t\t\t\t$amenitiesvalue[$i]['languageID']=$language->languageID;\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_attribute_value_details',$amenitiesvalue[$i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($selectattribute) && !empty($selectattributeval))\n\t\t\t\t\t\t{\t$j=0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($selectattribute as $selectattributeinsert)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t$selectattributeinsert['propertyID']=$data['propertyID'];\n\t\t\t\t\t\t\t\t$attributevalueId=$this->AddProperty_model->InsertProperty('rp_property_attribute_values',$selectattributeinsert);\n\t\t\t\t\t\t\t\t$selectattributeval[$j]['attrValueID']=$attributevalueId;\n\t\t\t\t\t\t\t\tforeach($this->languages as $language){\n\t\t\t\t\t\t\t\t$selectattributeval[$j]['languageID']=$language->languageID;\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_attribute_value_details',$selectattributeval[$j]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$propertykey=strtoupper(bin2hex(mcrypt_create_iv(4, MCRYPT_DEV_RANDOM)));\n\t\t\t\t\t\n\t\t\t\t\t\t$data1['propertyKey']= $propertykey;\n\t\t\t\t\t\t$data1['propertyAddedDate']= $date;\n\t\t\t\t\t\t$data1['propertyStatus']= 'Draft';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($data1['projectID']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$projectid=$data1['projectID'];\n\t\t\t\t\t\t\t$projectnames=$this->AddProperty_model->get_project(\" and rp_projects.projectID=$projectid\");\n\t\t\t\t\t\t\tif(!empty($projectnames)){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($projectnames[0]->cityID){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$cityinfo=$this->AddProperty_model->Getotherdata('rp_city_details',array('cityID'=>$projectnames[0]->cityID,'languageID'=>1));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$citylocinfo=$this->AddProperty_model->Getotherdata('rp_city_locations',array('cityLocID'=>$projectnames[0]->cityLocID));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!empty($cityinfo)){\n\t\t\t\t\t\t\t\t\t\t$locality=$cityinfo[0]->cityName;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(!empty($citylocinfo)){\n\t\t\t\t\t\t\t\t\t\t$sublocality=$citylocinfo[0]->googleLocName;\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$projectname=$projectnames[0]->projectName;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data1['propertyLatitude']= $projectnames[0]->projectLatitude;\n\t\t\t\t\t\t\t\t$data1['propertyLongitude']= $projectnames[0]->projectLongitude;\n\t\t\t\t\t\t\t\t$data1['propertyZipCode']= \t $projectnames[0]->projectZipCode;\n\t\t\t\t\t\t\t\t$data2['propertyLocality']= $sublocality;\n\t\t\t\t\t\t\t\t$data2['propertyAddress2']= $projectnames[0]->projectAddress2;\n\t\t\t\t\t\t\t\t$data2['propertyAddress1']= $projectnames[0]->projectAddress1;\n\t\t\t\t\t\t\t\t$data1['countryID']= $projectnames[0]->countryID;\n\t\t\t\t\t\t\t\t$data1['stateID']= $projectnames[0]->stateID;\n\t\t\t\t\t\t\t\t$data1['cityID']= $projectnames[0]->cityID;\n\t\t\t\t\t\t\t\t$data1['cityLocID']= $projectnames[0]->cityLocID;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$propertyid=$this->AddProperty_model->InsertProperty('rp_properties',$data1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data2['propertyID']= $propertyid;\n/**************************************Meta Details autogenerate start********************************************************/\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($data1['propertyTypeID'])){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$propertytypeid=$data1['propertyTypeID'];\n\t\t\t\t\t\t\t$propertytypenames=$this->AddProperty_model->getPropertyType(\" AND t2.propertyTypeID=$propertytypeid\");\n\t\t\t\t\t\t\t$propertytypename=$propertytypenames[0]->propertyTypeName;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$propertyMetaTitle=\"$noofbedroom BHK $propertytypename $coveredarea sqft for $propertypurpose in $projectname $sublocality $locality | Homeonline\";\n\t\t\t\t\t\t$propertyMetaKeyword=\"$noofbedroom BHK $propertytypename for $propertypurpose in $projectname $locality,\n\t\t\t\t\t\t$noofbedroom BHK $propertytypename in $locality for $propertypurpose, $noofbedroom BHK $propertytypename\n\t\t\t\t\t\tfor $propertypurpose in $projectname $sublocality $locality, $noofbedroom BHK $propertytypename for $propertypurpose in $sublocality $locality, $noofbedroom BHK $propertytypename in $projectname, $noofbedroom BHK $propertytypename $coveredarea sqft for $propertypurpose in $projectname $locality, $propertytypename for $propertypurpose in $locality.\";\n\t\t\t\t\t\t$propertyMetaDescription=\"$noofbedroom BHK $propertytypename $coveredarea sqft for $propertypurpose in $projectname $sublocality $locality with all modern amenities. Browse $noofbedroom BHK $propertytypename for $propertypurpose in $locality and get best deals from real estate agents at homeonline.com\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data2['propertyMetaTitle']= preg_replace('/\\s\\s+/', ' ',$propertyMetaTitle);\n\t\t\t\t\t\t$data2['propertyMetaKeyword']= preg_replace('/\\s\\s+/', ' ',$propertyMetaKeyword);\n\t\t\t\t\t\t$data2['propertyMetaDescription']= preg_replace('/\\s\\s+/', ' ',$propertyMetaDescription);\n/**************************************Meta Details autogenerate END********************************************************/\t\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($this->languages as $language){\n\t\t\t\t\t\t\t$data2['languageID']= $language->languageID;\n\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_details',$data2);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t if(empty($data1['projectID']))\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t$localityid=$data1['cityLocID'];$lat=$data1['propertyLatitude'];$long=$data1['propertyLongitude'];\n\t\t\t\t\t\t$this->AddProperty_model->Insertareacode($localityid,$lat,$long,$propertyid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************Insert rp_dbho_plan_mapping Data start*************************************/\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($mappingtableplanid))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$mappingtablefinaldata['planID']=$mappingtableplanid;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$mappingtablefinaldata['planID']='';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$mappingtablefinaldata['objectType']='property';\n\t\t\t\t\t\t$mappingtablefinaldata['objectID']= $propertyid;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_dbho_plan_mapping',$mappingtablefinaldata);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$logdata=array('propertyID'=>$propertyid,'userName'=>$this->userinfo['adminUserFirstName'],'userID'=>$this->userinfo['adminUserID'],'createdBy'=>$this->userinfo['adminUserFirstName'],'actionType'=>'Add','userAccessType'=>'Admin');\n\t\t\t\t\t\t$this->AddProperty_model->Insert_data('rp_dbho_property_log',$logdata);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************Insert rp_dbho_plan_mapping Data END*************************************/\n\t\t\t\t\t\tif(!empty($propertyprice))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$propertyprice['propertyID']= $propertyid;\n\t\t\t\t\t\t\tforeach($this->currencies as $currency){\n\t\t\t\t\t\t\t$propertyprice['currencyID']=$currency->currencyID;\n\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_price',$propertyprice);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->AddProperty_model->deleteallattributesandvalues($propertyid);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($amenitiesdata) && !empty($amenitiesvalue)){\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$i=0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($amenitiesdata as $amenitiesdatainsert)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t$amenitiesdatainsert['propertyID']=$propertyid;\n\t\t\t\t\t\t\t\t$attributevalueId=$this->AddProperty_model->InsertProperty('rp_property_attribute_values',$amenitiesdatainsert);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$amenitiesvalue[$i]['attrValueID']=$attributevalueId;\n\t\t\t\t\t\t\t\tforeach($this->languages as $language){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$amenitiesvalue[$i]['languageID']=$language->languageID;\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_attribute_value_details',$amenitiesvalue[$i]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!empty($selectattribute) && !empty($selectattributeval)){\n\n\t\t\t\t\t\t\t$j=0;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach($selectattribute as $selectattributeinsert)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t$selectattributeinsert['propertyID']=$propertyid;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$attributevalueId=$this->AddProperty_model->InsertProperty('rp_property_attribute_values',$selectattributeinsert);\n\t\t\t\t\t\t\t\t$selectattributeval[$j]['attrValueID']=$attributevalueId;\n\t\t\t\t\t\t\t\tforeach($this->languages as $language){\n\t\t\t\t\t\t\t\t$selectattributeval[$j]['languageID']=$language->languageID;\n\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_attribute_value_details',$selectattributeval[$j]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($propertyid) && !empty($data1['propertyLatitude']) && !empty($data1['propertyLongitude']))\n\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$this->googleLocalPropertyInfoAction($propertyid,$data1['propertyLatitude'], $data1['propertyLongitude']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif($formname==\"form-2\"){\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($data['propertyID'])){\n\t\t\t\t\t\t\n\t\t\t\t\t\tforeach($data as $key=> $datas)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($key==\"propertyMetaTitle\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t $data1['propertyMetaTitle']=$datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($key==\"propertyMetaKeyword\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t $data1['propertyMetaKeyword']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($key==\"propertyMetaDescription\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t $data1['propertyMetaDescription']= $datas;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t///$filter1=array('propertyID'=>$data['propertyID']);\n\t\t\t\t\t\t/* foreach($this->languages as $language){\n\t\t\t\t\t\t$filter1=array('propertyID'=>$data['propertyID'],'languageID'=>$language->languageID);\n\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_details',$data1,$filter1);\n\t\t\t\t\t\t} */\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif($formname==\"form-3\"){\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($data['propertyID']))\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t//..................................................................Bed Room\n\t\t\t\t\t\t\tif(!empty($data['flooringTypebedroom'])){\n\t\t\t\t\t\t\t$bedi=1;\n\t\t\t\t\t\t\t$this->AddProperty_model->deletestep3data('rp_dbho_bed_room',array('propertyID'=>$data['propertyID']));\n\t\t\t\t\t\t\tforeach($data['flooringTypebedroom'] as $flooringTypebedroom)\n\t\t\t\t\t\t\t{\t$bedroom=array();\n\t\t\t\t\t\t\t\t$bedroom['bedroomKey']=\"BedRoom$bedi\";\n\t\t\t\t\t\t\t\tif(!empty($flooringTypebedroom))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$bedroom['flooringType']=$flooringTypebedroom;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($data[\"$bedi-othersbedroom\"]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$otherscomaseparated=implode(\",\",$data[\"$bedi-othersbedroom\"]);\n\t\t\t\t\t\t\t\t\t\t$bedroom['others']=$otherscomaseparated;\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\tif(!empty($bedroom))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$bedroom['propertyID']=$data['propertyID'];\n\t\t\t\t\t\t\t\t\t$this->AddProperty_model->Insertotherinfo('rp_dbho_bed_room',$bedroom);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$bedi++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//.......................................................................Living Room\n\t\t\t\t\t\t\tif(!empty($data['flooringTypelivingroom'])){\n\t\t\t\t\t\t\t$livingi=1;\n\t\t\t\t\t\t\t$this->AddProperty_model->deletestep3data('rp_dbho_living_room',array('propertyID'=>$data['propertyID']));\n\t\t\t\t\t\t\tforeach($data['flooringTypelivingroom'] as $flooringTypelivingroom)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$livingroom=array();\n\t\t\t\t\t\t\t\tif(!empty($flooringTypelivingroom))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$livingroom['flooringType']=$flooringTypelivingroom;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($data[\"$livingi-otherslivingroom\"]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$otherscomaseparated=implode(\",\",$data[\"$livingi-otherslivingroom\"]);\n\t\t\t\t\t\t\t\t\t\t$livingroom['others']=$otherscomaseparated;\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\tif(!empty($livingroom))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$livingroom['propertyID']=$data['propertyID'];\n\t\t\t\t\t\t\t\t\t$this->AddProperty_model->Insertotherinfo('rp_dbho_living_room',$livingroom);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$livingi++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//.......................................................................................Bath Room\n\t\t\t\t\t\t\tif(!empty($data['flooringTypebathroom'])){\n\t\t\t\t\t\t\t$bathi=1;\n\t\t\t\t\t\t\t$this->AddProperty_model->deletestep3data('rp_dbho_bath_room',array('propertyID'=>$data['propertyID']));\n\t\t\t\t\t\t\tforeach($data['flooringTypebathroom'] as $flooringTypebathroom)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t$bathroom=array();$kitchen=array();\n\t\t\t\t\t\t\t\t$bathroom['bathroomKey']=\"Toilet$bathi\";\n\t\t\t\t\t\t\t\tif(!empty($flooringTypebathroom))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$bathroom['flooringType']=$flooringTypebathroom;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($data['hotwatersupply'][$bathi-1]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$bathroom['hotwatersupply']=$data['hotwatersupply'][$bathi-1];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($data[\"toilet$bathi\"]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$bathroom['toilet']=$data[\"toilet$bathi\"];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($data[\"$bathi-othersbathroom\"]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$otherscomaseparated=implode(\",\",$data[\"$bathi-othersbathroom\"]);\n\t\t\t\t\t\t\t\t\t\t$bathroom['others']=$otherscomaseparated;\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\tif(!empty($bathroom))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$bathroom['propertyID']=$data['propertyID'];\n\t\t\t\t\t\t\t\t\t$this->AddProperty_model->Insertotherinfo('rp_dbho_bath_room',$bathroom);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$bathi++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//.......................................................................................................Kitchen\n\t\t\t\t\t\t\tif(!empty($data['platform'])){\n\t\t\t\t\t\t\t$kitcheni=1;\n\t\t\t\t\t\t\t$this->AddProperty_model->deletestep3data('rp_dbho_kitchen',array('propertyID'=>$data['propertyID']));\n\t\t\t\t\t\t\tforeach($data['platform'] as $platform)\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t$kitchen=array();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(!empty($data['platform']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$kitchen['platformType']=$platform;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!empty($data['Cabinet']))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$kitchen['cabinet']=$data['Cabinet'];\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\tif(!empty($data[\"$kitcheni-otherskitchen\"]))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$otherscomaseparated=implode(\",\",$data[\"$kitcheni-otherskitchen\"]);\n\t\t\t\t\t\t\t\t\t\t$kitchen['others']=$otherscomaseparated;\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\tif(!empty($kitchen))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$kitchen['propertyID']=$data['propertyID'];\n\t\t\t\t\t\t\t\t\t$this->AddProperty_model->Insertotherinfo('rp_dbho_kitchen',$kitchen);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$kitcheni++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//.....................................................................................................\n\t\t\t\t\t\t\t\n\t\t\t\t\tforeach($data as $key=> $datas)\n\t\t\t\t\t{ \n\t\t\t\t\t\t\tif(!empty($key))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$typeofattribute=explode(\"-\",$key);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(count($typeofattribute)>1)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$this->AddProperty_model->deleteattributesandvaluesflooring($data['propertyID'],$typeofattribute[1]);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($typeofattribute[0]==\"multi\")\n\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$stringmulti1 = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$stringmulti2 = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!empty($datas))\n\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\tforeach($datas as $attributemulti){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$multiarr=explode(\"#\",$attributemulti);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$stringmulti1.= rtrim($multiarr[0]).'#|#';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$stringmulti2.= rtrim($multiarr[1]).'#|#';\n\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\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$selectattribute[]=array('attributeID'=>$typeofattribute[1],'attrOptionID'=>substr($stringmulti1,0,-3));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$selectattributeval[]=array('attrDetValue'=>substr($stringmulti2,0,-3));\n\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}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\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\n\t\t\t\t\t\t\t\t\t\tif(!empty($selectattribute) && !empty($selectattributeval))\n\t\t\t\t\t\t\t\t\t\t{\t$j=0;\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tforeach($selectattribute as $selectattributeinsert)\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$selectattributeinsert['propertyID']=$data['propertyID'];\n\t\t\t\t\t\t\t\t\t\t\t\t$attributevalueId=$this->AddProperty_model->InsertProperty('rp_property_attribute_values',$selectattributeinsert);\n\t\t\t\t\t\t\t\t\t\t\t\t$selectattributeval[$j]['attrValueID']=$attributevalueId;\n\t\t\t\t\t\t\t\t\t\t\t\tforeach($this->languages as $language){\n\t\t\t\t\t\t\t\t\t\t\t\t$selectattributeval[$j]['languageID']=$language->languageID;\n\t\t\t\t\t\t\t\t\t\t\t\t$this->AddProperty_model->InsertProperty('rp_property_attribute_value_details',$selectattributeval[$j]);\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$j++;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//////////////\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif($formname==\"form-4\")\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tif(!empty($propertyid)){ echo $propertyid;\t}else{ if(!empty($data['propertyID'])){ echo $data['propertyID']; }}\n\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\techo\"Add Property Fail!!\";\n\t\t\t}\n\t\t\n\t}", "protected function fillFormWithDbValues($record_array) {\n foreach($record_array as $column_name => $value) {\n $_SESSION[$this->form_ID][$column_name] = $value;\n }\n }", "function do_contact_form($adata, $aerr_entry, $aret_flag=0) {\n\t# Get security vars\n\t\t$_SEC \t= get_security_flags();\n\t\t$_PERMS\t= do_decode_perms_admin($_SEC['_sadmin_perms']);\n\n\t# Dim some Vars:\n\t\tglobal $_CCFG, $_TCFG, $_DBCFG, $_UVAR, $_LANG, $_SERVER, $_nl, $_sp;\n\n\t# Check for admin / user and get email address accordingly\n\t\tIF ($_SEC['_sadmin_flg'] && $_SEC['_sadmin_name'] && !$adata['mc_email']) {\n\t\t\t$adata['mc_email'] = get_user_name_email($_SEC['_sadmin_name'], 'admin');\n\t\t}\n\t\tIF ($_SEC['_suser_flg'] && $_SEC['_suser_name'] && !$adata['mc_email']) {\n\t\t\t$adata['mc_email'] = get_user_name_email($_SEC['_suser_name'], 'user');\n\t\t}\n\n\t# Some HTML Strings (reduce text)\n\t\t$_td_str_left_vtop\t= '<td class=\"TP1SML_NR\" width=\"30%\" valign=\"top\">';\n\t\t$_td_str_left\t\t= '<td class=\"TP1SML_NR\" width=\"30%\">';\n\t\t$_td_str_right\t\t= '<td class=\"TP1SML_NL\" width=\"70%\">';\n\n\t# Build Title String, Content String, and Footer Menu String\n\t\t$_tstr .= $_CCFG['_PKG_NAME_SHORT'].$_sp.$_LANG['_MAIL']['Contact_Form'].$_sp.'('.$_LANG['_MAIL']['all_fields_required'].')';\n\n\t# Add \"Edit\" button for editing contact info parameters if admin and has permission\n\t\tIF ($_SEC['_sadmin_flg'] && $_CCFG['ENABLE_QUICK_EDIT'] && ($_PERMS['AP16'] == 1 || $_PERMS['AP15'] == 1)) {\n\t\t\t$_tstr .= ' <a href=\"admin.php?cp=parms&fpg=user\">'.$_TCFG['_S_IMG_PM_S'].'</a>';\n\t\t}\n\n\t# Do data entry error string check and build\n\t\tIF ($aerr_entry['flag']) {\n\t\t \t$err_str = $_LANG['_MAIL']['CS_FORM_ERR_HDR1'].'<br>'.$_LANG['_MAIL']['CS_FORM_ERR_HDR2'].'<br>'.$_nl;\n\t \t\tIF ($aerr_entry['mc_id']) \t{$err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR01']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['mc_name']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR02']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['mc_email']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR03']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['mc_subj']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR04']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['mc_msg']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR05']; $err_prv = 1;}\n\t\t\tIF ($aerr_entry['sec_code']) \t{IF ($err_prv) {$err_str .= ', ';} $err_str .= $_LANG['_MAIL']['CS_FORM_ERR_ERR06']; $err_prv = 1;}\n\t \t\t$_cstr .= '<p align=\"center\"><b>'.$err_str.'</b>'.$_nl;\n\t\t}\n\n\t# Check Stage for extra data validation\n\t\tIF ($adata['stage'] == 1) {\n\t\t# Email\n\t\t\tIF ($aerr_entry['err_email_invalid']) {$_err_more .= '<br>'.$_LANG['_MAIL']['CS_FORM_ERR_MSG_01'].$_nl;}\n\n\t\t# Print out more errors\n\t\t\tIF ($_err_more) {$_cstr .= '<b>'.$_err_more.'</b>'.$_nl;}\n\t\t}\n\n\t# Formatting tweak for spacing\n\t\tIF ($aerr_entry['flag'] || $_err_more) {$_cstr .= '<br><br>'.$_nl;}\n\n\t\t$_cstr .= '<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">'.$_nl;\n\n\t# Display othr contact info, if enabled\n\t\tIF ($_UVAR['DISPLAY_ON_CONTACT_FORM']) {\n\t\t\t$_cstr .= '<tr><td>'.$_nl;\n\t\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['CC_FORM_TITLE_MAIL'].'</b><br>';\n\t\t\tIF ($_UVAR['CO_INFO_01_NAME'])\t\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_UVAR['CO_INFO_01_NAME'].'<br>';}\n\t\t\tIF ($_UVAR['CO_INFO_12_TAGLINE'])\t\t\t\t{$_cstr .= $_sp.$_sp.$_sp.'<i>\"'.$_UVAR['CO_INFO_12_TAGLINE'].'\"</i><br>';}\n\t\t\tIF ($_UVAR['CO_INFO_02_ADDR_01'])\t\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_UVAR['CO_INFO_02_ADDR_01'].'<br>';}\n\t\t\tIF ($_UVAR['CO_INFO_03_ADDR_02'])\t\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_UVAR['CO_INFO_03_ADDR_02'].'<br>';}\n\t\t\tIF ($_UVAR['CO_INFO_04_CITY'])\t\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_UVAR['CO_INFO_04_CITY'].', ';}\n\t\t\tIF ($_UVAR['CO_INFO_05_STATE_PROV'])\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_UVAR['CO_INFO_05_STATE_PROV'].', ';}\n\t\t\tIF ($_UVAR['CO_INFO_06_POSTAL_CODE'])\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_UVAR['CO_INFO_06_POSTAL_CODE'].'<br>';}\n\t\t\tIF ($_UVAR['CO_INFO_07_COUNTRY'])\t\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_UVAR['CO_INFO_07_COUNTRY'].'<br>';}\n\t\t\tIF ($_UVAR['CO_INFO_08_PHONE'] || $_UVAR['CO_INFO_09_FAX'] || $_UVAR['CO_INFO_11_TOLL_FREE'] || $_LANG['_MAIL']['CC_FORM_DATA_TELECOM']) {\n\t\t\t\t$_cstr .= '<br><b>'.$_LANG['_MAIL']['CC_FORM_TITLE_TELECOM'].'</b><br>';\n\t\t\t\tIF ($_UVAR['CO_INFO_08_PHONE'])\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_LANG['_BASE']['LABEL_PHONE'].' '.$_UVAR['CO_INFO_08_PHONE'].'<br>';}\n\t\t\t\tIF ($_UVAR['CO_INFO_09_FAX'])\t\t\t\t{$_cstr .= $_sp.$_sp.$_sp.$_LANG['_BASE']['LABEL_FAX'].' '.$_UVAR['CO_INFO_09_FAX'].'<br>';}\n\t\t\t\tIF ($_UVAR['CO_INFO_11_TOLL_FREE'])\t\t{$_cstr .= $_sp.$_sp.$_sp.$_LANG['_BASE']['LABEL_TOLL_FREE'].' '.$_UVAR['CO_INFO_11_TOLL_FREE'].'<br>';}\n\t\t\t\tIF ($_LANG['_MAIL']['CC_FORM_DATA_TELECOM']) {$_cstr .= '&nbsp;&nbsp;&nbsp;'.$_LANG['_MAIL']['CC_FORM_DATA_TELECOM'].'</b><br>';}\n\t\t\t}\n\t\t\tIF ($_LANG['_MAIL']['CC_FORM_DATA_OTHER']) {\n\t\t\t\t$_cstr .= '<br><b>'.$_LANG['_MAIL']['CC_FORM_TITLE_OTHER'].'</b><br>';\n\t\t\t\t$_cstr .= '&nbsp;&nbsp;&nbsp;'.$_LANG['_MAIL']['CC_FORM_DATA_OTHER'].'</b><br>';\n\t\t\t}\n\t\t\t$_cstr .= '<br><b>'.$_LANG['_MAIL']['CC_FORM_TITLE_EMAIL'].'</b><br>';\n\t\t\t$_cstr .= '<br></td></tr>';\n\t\t}\n\n\t\t$_cstr .= '<tr><td align=\"center\">'.$_nl;\n\t\t$_cstr .= '<form action=\"mod.php\" method=\"post\" name=\"contact\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mod\" value=\"mail\">'.$_nl;\n\t\t$_cstr .= '<input type=\"hidden\" name=\"mode\" value=\"contact\">'.$_nl;\n\t\t$_cstr .= '<table width=\"100%\" cellspacing=\"0\" cellpadding=\"5\" border=\"0\">'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_To'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_select_list_mail_contacts('mc_id', $adata['mc_id'], 1);\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Name'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= '<INPUT class=\"PSML_NL\" TYPE=TEXT name=\"mc_name\" size=\"30\" maxlength=\"50\" value=\"'.htmlspecialchars($adata['mc_name']).'\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Email'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= '<INPUT class=\"PSML_NL\" TYPE=TEXT name=\"mc_email\" size=\"30\" maxlength=\"50\" value=\"'.htmlspecialchars($adata['mc_email']).'\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Subject'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= '<INPUT class=\"PSML_NL\" TYPE=TEXT name=\"mc_subj\" size=\"30\" maxlength=\"50\" value=\"'.htmlspecialchars($adata['mc_subj']).'\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left_vtop.$_nl;\n\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Message'].$_sp.'</b>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\tIF ($_CCFG['WYSIWYG_OPEN']) {$_cols = 120;} ELSE {$_cols = 80;}\n\t\t$_cstr .= '<TEXTAREA class=\"PSML_NL\" NAME=\"mc_msg\" COLS=\"'.$_cols.'\" ROWS=\"15\">'.$adata['mc_msg'].'</TEXTAREA>'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= '</tr>'.$_nl;\n\n\t# Captcha if \"GD\" is loaded\n\t\tIF (extension_loaded('gd') && file_exists(PKG_PATH_ADDONS.'captcha')) {\n\t\t\t$_cstr .= '<tr>'.$_nl;\n\t\t\t$_cstr .= $_td_str_left_vtop.$_sp.'</td>'.$_nl;\n\t\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t\t$_cstr .= $_LANG['_MAIL']['SC_Instruct'].$_nl;\n\t\t\t$_cstr .= '</td>'.$_nl;\n\t\t\t$_cstr .= '</tr>'.$_nl;\n\t\t\t$_cstr .= '<tr>'.$_nl;\n\t\t\t$_cstr .= $_td_str_left_vtop.$_sp.'</td>'.$_nl;\n\t\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t\t$_cstr .= '<img src=\"'.PKG_URL_ADDONS.'captcha/CaptchaSecurityImages.php\">'.$_nl;\n\t\t\t$_cstr .= '</td>'.$_nl;\n\t\t\t$_cstr .= '</tr>'.$_nl;\n\t\t\t$_cstr .= '<tr>'.$_nl;\n\t\t\t$_cstr .= $_td_str_left_vtop.$_nl;\n\t\t\t$_cstr .= '<b>'.$_LANG['_MAIL']['l_Security_Code'].$_sp.'</b>'.$_nl;\n\t\t\t$_cstr .= '</td>'.$_nl;\n\t\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t\t$_cstr .= '<input class=\"PSML_NL\" id=\"security_code\" name=\"security_code\" type=\"text\" value=\"'.htmlspecialchars($adata['security_code']).'\">'.$_nl;\n\t\t\t$_cstr .= '</td>'.$_nl;\n\t\t\t$_cstr .= '</tr>'.$_nl;\n\t\t}\n\n\t\t$_cstr .= '<tr>'.$_nl;\n\t\t$_cstr .= $_td_str_left.$_nl;\n\t\t$_cstr .= '<INPUT TYPE=hidden name=\"stage\" value=\"1\">'.$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\t\t$_cstr .= $_td_str_right.$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_email', 'SUBMIT', $_LANG['_MAIL']['B_Send_Email'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= do_input_button_class_sw('b_reset', 'RESET', $_LANG['_MAIL']['B_Reset'], 'button_form_h', 'button_form', '1').$_nl;\n\t\t$_cstr .= '</td>'.$_nl;\n\n\t\t$_cstr .= '</tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\t\t$_cstr .= '</form>'.$_nl;\n\t\t$_cstr .= '</td></tr>'.$_nl;\n\t\t$_cstr .= '</table>'.$_nl;\n\n\t\t$_mstr_flag\t= 0;\n\t\t$_mstr \t\t= ''.$_nl;\n\n\t# Call block it function\n\t\t$_out .= do_mod_block_it($_tstr, $_cstr, $_mstr_flag, $_mstr, '1');\n\t\t$_out .= '<br>'.$_nl;\n\n\t# Return / Echo Final Output\n\t\tIF ($aret_flag) {return $_out;} ELSE {echo $_out;}\n}", "public function postPartnerFormEdits()\n {\n $input_array = array();\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\")\n {\n $input_array['title'] = $this->test_input($_POST['title']);\n $input_array['sub_title'] = $this->test_input($_POST['sub-title']);\n $input_array['desc_head'] = $this->test_input($_POST['desc-head']);\n $input_array['desc_body'] = $this->test_input($_POST['desc-body']);\n $input_array['desc_list_head'] = $this->test_input($_POST['desc-list-head']);\n $input_array['desc_list_data'] = $this->test_input($_POST['desc-list-data']);\n $input_array['desc_footer_head'] = $this->test_input($_POST['desc-footer-head']);\n $input_array['desc_footer_body'] = $this->test_input($_POST['desc-footer-body']);\n $input_array['info_head'] = $this->test_input($_POST['info-head']);\n $input_array['info_body'] = $this->test_input($_POST['info-body']);\n $input_array['info_list_head'] = $this->test_input($_POST['info-list-head']);\n $input_array['info_list_data'] = $this->test_input($_POST['info-list-data']);\n $input_array['info_footer_head'] = $this->test_input($_POST['info-footer-head']);\n $input_array['info_footer_body'] = $this->test_input($_POST['info-footer-body']);\n $input_array['footer_head'] = $this->test_input($_POST['footer-head']);\n $input_array['footer_body'] = $this->test_input($_POST['footer-body']);\n $input_array['footer_list_head'] = $this->test_input($_POST['footer-list-head']);\n $input_array['footer_list_data'] = $this->test_input($_POST['footer-list-data']);\n $input_array['contact_name'] = $this->test_input($_POST['contact-name']);\n $input_array['contact_title'] = $this->test_input($_POST['contact-title']);\n $input_array['contact_desc'] = $this->test_input($_POST['contact-desc']);\n $input_array['contact_phone'] = $this->test_input($_POST['contact-phone']);\n $input_array['contact_email'] = $this->test_input($_POST['contact-email']);\n\n if(!empty($_FILES[\"usr-file-upload\"][\"name\"]))\n {\n $img_path = $this->fileUpload();\n\n if(!is_array($img_path))\n {\n $input_array['img_path'] = $img_path;\n }\n else\n {\n $this->_errors = $img_path;\n }\n }\n else\n {\n $input_array['img_path'] = $this->test_input($_POST['img-path']);\n }\n $input_array['link'] = $this->test_input($_POST['link']);\n $input_array['link_text'] = $this->test_input($_POST['link-text']);\n }\n\n if(is_array($img_path))\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"alert alert-danger\">';\n echo '<strong>Danger!</strong>';\n if(is_array($img_path))\n {\n foreach ($img_path as $error)\n {\n echo '<p>' . $error . '</p>';\n }\n }\n echo '</div>';\n echo '</div>';\n }\n else\n {\n $database = new Database();\n\n if($database->updatePartner($input_array, $this->_params['id']))\n {\n $url = '/Admin/edit-partner/' . $this->_params['id'];\n $this->_f3->reroute($url . '/success');\n }\n else\n {\n $errors = $database->getErrors();\n\n if(!empty($errors))\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo '<div class=\"container-fluid\">';\n echo '<div class=\"alert alert-danger\">';\n echo '<strong>Danger!</strong>';\n foreach($errors as $error)\n {\n echo '<p>' . $error . '</p>';\n }\n echo '</div>';\n echo '</div>';\n }\n }\n }\n }", "public function getFormInObject()\n {\n $sExKey = null;\n\n if ($this->_iIdEntity > 0 && $this->_sSynchronizeEntity !== null && count($_POST) < 1) {\n\n $sModelName = str_replace('Entity', 'Model', $this->_sSynchronizeEntity);\n $oModel = new $sModelName;\n\n $oEntity = new $this->_sSynchronizeEntity;\n $sPrimaryKey = LibEntity::getPrimaryKeyNameWithoutMapping($oEntity);\n $sMethodName = 'findOneBy'.$sPrimaryKey;\n $oCompleteEntity = call_user_func_array(array(&$oModel, $sMethodName), array($this->_iIdEntity));\n\n if (is_object($oCompleteEntity)) {\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n\t\t\t\t\tif ($sValue instanceof \\Venus\\lib\\Form\\Input && $sValue->getType() == 'submit') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio) {\n\n $sExKey = $sKey;\n $sKey = substr($sKey, 0, -6);\n }\n\n if ($sValue instanceof Form) {\n\n ;\n } else {\n\n $sMethodNameInEntity = 'get_'.$sKey;\n\t\t\t\t\t\tif (method_exists($oCompleteEntity, $sMethodNameInEntity)) {\n\t\t\t\t\t\t\t$mValue = $oCompleteEntity->$sMethodNameInEntity();\n\t\t\t\t\t\t}\n\n if ($sValue instanceof \\Venus\\lib\\Form\\Radio && method_exists($this->_aElement[$sExKey], 'setValueChecked')) {\n\n $this->_aElement[$sExKey]->setValueChecked($mValue);\n } else if (isset($mValue) && method_exists($this->_aElement[$sKey], 'setValue')) {\n\n $this->_aElement[$sKey]->setValue($mValue);\n }\n }\n }\n }\n }\n\n $oForm = new \\StdClass();\n $oForm->start = '<form name=\"form'.$this->_iFormNumber.'\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\"1\" name=\"validform'.$this->_iFormNumber.'\">';\n $oForm->form = array();\n\n foreach ($this->_aElement as $sKey => $sValue) {\n\n if ($sValue instanceof Container) {\n\n $oForm->form[$sKey] = $sValue;\n } else {\n\n $oForm->form[$sKey] = $sValue->fetch();\n }\n }\n\n $oForm->end = '</form>';\n\n return $oForm;\n }", "function several_records_form($params, $action, $data)\n{\n $conn = $GLOBALS['connection_TBSM'];\n\n $show_fields_arr = array(\n 'PFR_FO',\n 'PFR_ID_FO',\n 'PFR_TORG',\n 'PFR_ID_TORG',\n 'PFR_NAZN',\n 'NODE',\n 'PFR_OBJECT',\n 'PFR_OBJECTSERVER',\n 'SUBCATEGORY',\n 'AGENT_NODE',\n 'SITFILTER',\n 'PFR_KE_TORS',\n 'SERVICE_NAME',\n 'URL',\n 'TEMS',\n );\n $actions_arr = array (\n \"cancel\" => array (\n \"text\" \t=> \"Вернуться\",\n \"image\" \t=> \"images/arrowdown.png\",\n \"title\" \t=> \"Вернуться назад\",\n \"onclick\" => \"return true;\", // return confirm('Сделанные изменения не будут сохранены! Вернуться?');\",\n ),\n \"save_several\" => array (\n \"text\" \t=> \"Сохранить\",\n \"image\" \t=> \"images/ok.png\",\n \"title\" \t=> \"Добавить записи в PFR_LOCATIONS\",\n \"onclick\" => \"return confirm('Добавить все записи в PFR_LOCATIONS?');\",\n ),\n );\n $example_subcategory = '';\n $return_status = true;\n\n // insert records into PFR_LOCATIONS\n if ($action == 'save') {\n foreach ($_POST['rec'] as $rec) {\n $fields = \"\";\n $values = \"\";\n foreach ($rec as $field => $value) {\n $fields .= \"{$field}, \";\n switch ($data[0][$field]['COLTYPE']) {\n case 'INTEGER':\n $values .= intval($value) . \", \";\n break;\n case 'TIMESTMP':\n $values .= \"'\" . date(\"Y-m-d H:i:s\") . \"', \";\n break;\n default:\n $values .= \"'{$value}', \";\n break;\n }\n }\n $fields = rtrim($fields, \", \");\n $values = rtrim($values, \", \");\n\n $ins = \"insert into DB2INST1.PFR_LOCATIONS ({$fields}) values ({$values})\";\n $stmt = db2_prepare($conn, $ins);\n $return_status = $return_status ? db2_execute($stmt) : $return_status;\n }\n return $return_status;\n }\n\n // web-form output\n echo \"<h3>Добавление записей в таблицу PFR_LOCATIONS</h3>\";\n echo \"<h4 class='tr_rec_toggle'>Показать/скрыть примеры записей</h4>\";\n echo \"<form action='{$_SERVER[\"PHP_SELF\"]}?{$params}' method='post'>\";\n echo \"<table border='1' cellspacing='0' cellpadding='5'>\";\n echo \"<tr>\";\n foreach ($data[0] as $field => $prop)\n if (in_array($field, $show_fields_arr))\n echo \"<th>{$field}</th>\";\n echo \"</tr>\";\n $i = 0;\n foreach ($data as $rec) {\n if ($i++ == 0)\n continue;\n echo \"<tr class='new_records'>\";\n foreach ($data[0] as $field => $prop) {\n if (in_array($field, $show_fields_arr)) {\n echo \"<td>\";\n if ($field == 'SUBCATEGORY') {\n echo \"<select size = '1' id = 'subcategory' name = 'rec[$i][$field]'>\";\n foreach (subcategory_expected($rec['NODE']['VALUE']) as $val) {\n echo \"<option value = '{$val}'>$val</option>\";\n if ($i == 2 and empty($example_subcategory))\n $example_subcategory = $val;\n }\n echo \"</select>\";\n }\n else\n echo \"<input type='text' name='rec[$i][$field]' value='\".(array_key_exists($field, $rec) ? $rec[$field]['VALUE'] : '').\n \"' maxlength='{$prop['LENGTH']}' \".($prop['COLTYPE'] == 'INTEGER' ? \"pattern=\\\"[-]?[0-9]+\\\"\" : '').\n \" onkeydown=\\\"this.style.width = ((this.value.length + 1) * 7) + 'px';\\\">\";\n// size='\".(($field == 'PFR_ID_FO' or $field == 'PFR_ID_TORG' or $field == 'TEMS') ? '10' : '20').\"'\n echo \"</td>\";\n }\n }\n echo \"</tr>\";\n // example records from PFR_LOCATIONS\n if ($i == 2) {\n $sel = \"select * from DB2INST1.PFR_LOCATIONS where SUBCATEGORY = '{$example_subcategory}' and PFR_NAZN <> 'AUTO_DEFAULT'\";\n $stmt = db2_prepare($conn, $sel);\n if (!db2_execute($stmt))\n return false;\n $k = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n echo \"<tr class='rec_hide example_records'>\";\n foreach ($data[0] as $field => $prop)\n if (in_array($field, $show_fields_arr))\n echo \"<td>{$row[$field]}</td>\";\n echo \"</tr>\";\n if (++$k == 10)\n break;\n }\n }\n }\n echo \"</table><br>\";\n foreach ($actions_arr as $key => $value)\n echo \"<button type='submit' name='sendRequest' value='{$key}' title='{$value['title']}' onclick=\\\"{$value['onclick']}\\\"><img src='{$value['image']}' width='16' height='16'>&nbsp;{$value['text']}</button>&emsp;\";\n echo \"</form>\";\n return true;\n}", "public static function insert($arr) {\n\t\tglobal $wtcDB, $query;\n\n\t\t$db = $wtcDB->massInsert($arr);\n\n\t\tnew Query($query['lang_words']['insert'], Array(1 => $db['fields'], 2 => $db['values']), 'query', false);\n\t\t\n\t\tLanguage::cache();\n\t}", "public function setForm(array $form): void\n {\n $this->form = $form;\n }", "public function gformAfterSubmission($entry, $form)\n {\n global $wpdb;\n\n $formData = new GFBitPayFormData($form);\n\n if (false === isset($formData) || true === empty($formData)) {\n error_log('[ERROR] In GFBitPayPlugin::gformAfterSubmission(): Could not create a new GFBitPayFormData object.');\n throw new \\Exception('An error occurred in the BitPay Payment plugin: Could not create a new GFBitPayFormData object.');\n }\n\n $leadId = $entry['id'];\n $email = $formData->buyerEmail;\n\n $wpdb->insert(\n 'bitpay_transactions', \n array( \n 'lead_id' => $leadId, \n 'buyer_email' => $email\n )\n );\n\n if (false === empty($this->txResult)) {\n foreach ($this->txResult as $key => $value) {\n switch ($key) {\n case 'authcode':\n gform_update_meta($entry['id'], $key, $value);\n break;\n default:\n $entry[$key] = $value;\n break;\n }\n }\n\n if (class_exists('RGFormsModel') == true) {\n RGFormsModel::update_lead($entry);\n } elseif (class_exists('GFAPI') == true) {\n GFAPI::update_entry($entry);\n } else {\n throw new Exception('[ERROR] In GFBitPayPlugin::gformAfterSubmission(): GFAPI or RGFormsModel won\\'t update lead.');\n }\n\n // record entry's unique ID in database\n $unique_id = RGFormsModel::get_form_unique_id($form['id']);\n\n gform_update_meta($entry['id'], 'gfbitpay_transaction_id', $unique_id);\n\n // record payment gateway\n gform_update_meta($entry['id'], 'payment_gateway', 'gfbitpay');\n }\n }", "function Save()\n\t{\t$fail = array();\n\t\t$success = array();\n\t\t$fields = array();\n\t\t$admin_actions = array();\n\t\t\n\t\tif ($cityname = $this->SQLSafe($_POST[\"cityname\"]))\n\t\t{\t$fields[] = \"cityname='$cityname'\";\n\t\t\tif ($this->id && ($data[\"cityname\"] != $this->details[\"cityname\"]))\n\t\t\t{\t$admin_actions[] = array(\"action\"=>\"Category name\", \"actionfrom\"=>$this->details[\"cityname\"], \"actionto\"=>$data[\"cityname\"]);\n\t\t\t}\n\t\t} else\n\t\t{\t$fail[] = \"city name missing\";\n\t\t}\n\t\t\n\t\tif ($country = $this->SQLSafe($_POST[\"country\"]))\n\t\t{\t$ctrylist = $this->CountriesList();\n\t\t\tif ($ctrylist[$country])\n\t\t\t{\t$fields[] = \"country='$country'\";\n\t\t\t\tif ($this->id && ($country != $this->details[\"country\"]))\n\t\t\t\t{\t$admin_actions[] = array(\"action\"=>\"Country\", \"actionfrom\"=>$this->details[\"country\"], \"actionto\"=>$country, \"actiontype\"=>\"link\", \"linkmask\"=>\"ctryedit.php?ctry={linkid}\");\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\t$fail[] = \"country not valid\";\n\t\t\t}\n\t\t} else\n\t\t{\t$fail[] = \"country name missing\";\n\t\t}\n\t\t\n\t\tif ($_POST[\"emailfrom\"])\n\t\t{\tif ($this->ValidEMail($_POST[\"emailfrom\"]))\n\t\t\t{\t$fields[] = \"emailfrom='{$_POST[\"emailfrom\"]}'\";\n\t\t\t\tif ($this->id && ($_POST[\"emailfrom\"] != $this->details[\"emailfrom\"]))\n\t\t\t\t{\t$admin_actions[] = array(\"action\"=>\"Email sent from\", \"actionfrom\"=>$this->details[\"emailfrom\"], \"actionto\"=>$_POST[\"emailfrom\"]);\n\t\t\t\t}\n\t\t\t} else\n\t\t\t{\t$fail[] = \"\\\"\\From\\\" email address is invalid\";\n\t\t\t}\n\t\t} else\n\t\t{\t$fields[] = \"emailfrom=''\";\n\t\t\tif ($this->id && $this->details[\"emailfrom\"])\n\t\t\t{\t$admin_actions[] = array(\"action\"=>\"Email sent from\", \"actionfrom\"=>$this->details[\"emailfrom\"]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->id || !$fail)\n\t\t{\t$set = implode(\", \", $fields);\n\t\t\tif ($this->id)\n\t\t\t{\t$sql = \"UPDATE cities SET $set WHERE cityid={$this->id}\";\n\t\t\t} else\n\t\t\t{\t$sql = \"INSERT INTO cities SET $set\";\n\t\t\t}\n\t\t\tif ($this->db->Query($sql))\n\t\t\t{\tif ($this->db->AffectedRows())\n\t\t\t\t{\tif ($this->id)\n\t\t\t\t\t{\t$base_parameters = array(\"tablename\"=>\"cities\", \"tableid\"=>$this->id, \"area\"=>\"cities\");\n\t\t\t\t\t\tif ($admin_actions)\n\t\t\t\t\t\t{\tforeach ($admin_actions as $admin_action)\n\t\t\t\t\t\t\t{\t$this->RecordAdminAction(array_merge($base_parameters, $admin_action));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$success[] = \"Changes saved\";\n\t\t\t\t\t} else\n\t\t\t\t\t{\t$this->id = $this->db->InsertID();\n\t\t\t\t\t\t$success[] = \"New city created\";\n\t\t\t\t\t\t$this->RecordAdminAction(array(\"tablename\"=>\"cities\", \"tableid\"=>$this->id, \"area\"=>\"cities\", \"action\"=>\"created\"));\n\t\t\t\t\t}\n\t\t\t\t\t$this->Get($this->id);\n\t\t\t\t\n\t\t\t\t} else\n\t\t\t\t{\tif ($this->id)\n\t\t\t\t\t{\t$fail[] = \"No changes made\";\n\t\t\t\t\t} else\n\t\t\t\t\t{\t$fail[] = \"Insert failed\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array(\"failmessage\"=>implode(\", \", $fail), \"successmessage\"=>implode(\", \", $success));\n\t\t\n\t}", "private function mod_prep($row){\n $meta = new dbMeta(); \n $cols = $meta->get_tabel_columns(); // array w/ all metadata \n $form_array_mod = $meta->buildFormArray($cols); // make to nice form ready\n // insert the values to the form array for mod form\n foreach($row as $k => $v) {\n $form_array_mod[$k]['VALUE'] = $v;\n } \n \n update_form($form_array_mod); // returns array ready to be processed \n }", "public function InsertData($table_name, $form_data)\n\t\t{\n\t\t\t$fields = array_keys($form_data);\n\n\t\t\t// build the query\n\t\t\t$sql = \"INSERT INTO \".$table_name.\"\n\t\t\t(`\".implode('`,`', $fields).\"`)\n\t\t\tVALUES('\".implode(\"','\", $form_data).\"')\";\n\n\t\t\t// run and return the query result resource\n\t\t\t\t//echo $sql; exit;\n\t\t\t\n\t\t\tif($this->conn->query($sql)==TRUE)\n\t\t\t{\n\t\t\t\treturn mysqli_insert_id($this->conn);\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\t\n\t\t}", "public function saveForm()\n\t{\n\t\tif ($this->request->isPost() && !empty($this->request[$this->connector . '_form']))\n\t\t{\n\t\t\t//If the session actual\n\t\t\tif (check_bitrix_sessid())\n\t\t\t{\n\t\t\t\t//Activation\n\t\t\t\tif ($this->request[$this->connector . '_active'] && empty($this->arResult['ACTIVE_STATUS']))\n\t\t\t\t{\n\t\t\t\t\t$this->status->setActive(true);\n\t\t\t\t\t$this->arResult['ACTIVE_STATUS'] = true;\n\n\t\t\t\t\t//Reset cache\n\t\t\t\t\t$this->cleanCache();\n\t\t\t\t}\n\n\t\t\t\tif (!empty($this->arResult['ACTIVE_STATUS']))\n\t\t\t\t{\n\t\t\t\t\t//If you remove the reference to the user\n\t\t\t\t\tif ($this->request[$this->connector . '_del_user'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$delUser = $this->connectorOutput->delUserActive($this->request['user_id']);\n\n\t\t\t\t\t\tif ($delUser->isSuccess())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->setStatus(false);\n\n\t\t\t\t\t\t\t$this->messages[] = Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_OK_DEL_USER');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->error[] = Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_NO_DEL_USER');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Reset cache\n\t\t\t\t\t\t$this->cleanCache();\n\t\t\t\t\t}\n\n\t\t\t\t\t//If you remove the reference to the group\n\t\t\t\t\tif ($this->request[$this->connector . '_del_page'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$delPage = $this->connectorOutput->delPageActive($this->request['page_id']);\n\n\t\t\t\t\t\tif ($delPage->isSuccess())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->setStatus(false);\n\n\t\t\t\t\t\t\t$this->messages[] = Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_OK_DEL_PAGE');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->error[] = Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_NO_DEL_PAGE');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Reset cache\n\t\t\t\t\t\t$this->cleanCache();\n\t\t\t\t\t}\n\n\t\t\t\t\t//If you bind to the group\n\t\t\t\t\tif ($this->request[$this->connector . '_authorization_page'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$authorizationPage = $this->connectorOutput->authorizationPage($this->request['page_id']);\n\n\t\t\t\t\t\tif ($authorizationPage->isSuccess())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($this->request['human_agent'] === 'Y')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$data = ['HUMAN_AGENT' => true];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$data = [];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this->setStatus(true, true, $data);\n\n\t\t\t\t\t\t\t$this->messages[] = Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_OK_AUTHORIZATION_PAGE');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->setStatus(false);\n\n\t\t\t\t\t\t\t$this->error[] = Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_NO_AUTHORIZATION_PAGE');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Reset cache\n\t\t\t\t\t\t$this->cleanCache();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->request[$this->connector . '_del'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$rawDelete = $this->connectorOutput->deleteConnector();\n\n\t\t\t\t\t\tif ($rawDelete->isSuccess())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tStatus::delete($this->connector, (int)$this->arParams['LINE']);\n\t\t\t\t\t\t\t$this->arResult['STATUS'] = false;\n\t\t\t\t\t\t\t$this->arResult['ACTIVE_STATUS'] = false;\n\t\t\t\t\t\t\t$this->arResult['CONNECTION_STATUS'] = false;\n\t\t\t\t\t\t\t$this->arResult['REGISTER_STATUS'] = false;\n\t\t\t\t\t\t\t$this->arResult['ERROR_STATUS'] = false;\n\t\t\t\t\t\t\t$this->arResult['DATA_STATUS'] = [];\n\t\t\t\t\t\t\t$this->arResult['PAGE'] = '';\n\n\t\t\t\t\t\t\t//$this->messages[] = Loc::getMessage('IMCONNECTOR_COMPONENT_SETTINGS_OK_DISABLE');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->error[] = Loc::getMessage('IMCONNECTOR_COMPONENT_SETTINGS_NO_DISABLE');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Reset cache\n\t\t\t\t\t\t$this->cleanCache();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->error[] = Loc::getMessage('IMCONNECTOR_COMPONENT_FACEBOOK_SESSION_HAS_EXPIRED');\n\t\t\t}\n\t\t}\n\t}", "private function validateFormData() {\n\n $this->firstName = $this->generalFieldValidation($this->firstName, \"firstName\", \"First name\", 40, false);\n $this->lastName = $this->generalFieldValidation($this->lastName, \"lastName\", \"Last name\", 40, false);\n $this->email = $this->generalFieldValidation($this->email, \"email\", \"E-mail\", 60, false);\n $this->address = $this->generalFieldValidation($this->address, \"address\", \"Address\", 255);\n $this->city = $this->generalFieldValidation($this->city, \"city\", \"City\", 60);\n $this->state = $this->generalFieldValidation($this->state, \"state\", \"State\", 2);\n $this->zip = $this->generalFieldValidation($this->zip, \"zip\", \"Zip code\", 5);\n $this->phone = $this->generalFieldValidation($this->phone, \"phone\", \"Phone number\", 10, false);\n $this->notes = $this->generalFieldValidation($this->notes, \"notes\", \"Notes\", -1, false);\n if ($this->phone !== \"\") {\n if (!is_numeric($this->phone)) {\n $this->errorArray[\"phone\"] = \"Phone number may only contain digits.\";\n } else {\n if (strlen($this->phone) < 10) {\n $this->errorArray[\"phone\"] = \"Phone number must contain 10 digits.\";\n }\n }\n }\n if ($this->zip !== \"\") {\n if (!is_numeric($this->zip)) {\n $this->errorArray[\"zip\"] = \"Zip code may only contain digits.\";\n } else {\n if (strlen($this->zip) !== 5) {\n $this->errorArray[\"zip\"] = \"Five digit zip code required.\";\n }\n }\n }\n if ($this->email !== \"\") {\n if (!preg_match(\"/^\\S+@\\S+\\.\\S+$/\", $this->email)) {\n $this->errorArray[\"email\"] = \"E-mail address is not valid.\";\n }\n }\n if (count($this->errorArray) === 0) {\n $this->passedValidation = true;\n }\n }", "function _submit_data()\n {\n\t$data = $this->get_data_from_post();\n\t\n\t//$data['photo'] = Modules::run('upload_manager/upload','image');\n\t$id = $this->uri->segment( 3 );\n\tif ( is_numeric( $id ) ) {\n\t $this->_update( $id, $data );\n\t redirect( 'auth/profile/' . $id );\n\t} else {\n\t $this->_insert( $data );\n\t redirect( 'auth/add_lecturer' );\n\t}\n }", "public function Addfamily($staff_enquiry) {\n\n /*\n * to add multiple family details\n */\n\n if (isset($_POST['createfamily']) && $_POST['createfamily'] != '') {\n\n\n $arrf = [];\n $k = 0;\n\n foreach ($_POST['createfamily']['name'] as $val) {\n $arrf[$k]['name'] = $val;\n $k++;\n }\n $k = 0;\n foreach ($_POST['createfamily']['relationship'] as $val) {\n $arrf[$k]['relationship'] = $val;\n $k++;\n }\n $k = 0;\n foreach ($_POST['createfamily']['job'] as $val) {\n $arrf[$k]['job'] = $val;\n $k++;\n }\n $k = 0;\n foreach ($_POST['createfamily']['mobile_no'] as $val) {\n $arrf[$k]['mobile_no'] = $val;\n $k++;\n }\n\n\n foreach ($arrf as $val) {\n $add_Family = new \\common\\models\\StaffEnquiryFamilyDetails;\n $add_Family->staff_id = $staff_enquiry->id;\n $add_Family->name = $val['name'];\n $add_Family->relationship = $val['relationship'];\n $add_Family->job = $val['job'];\n $add_Family->mobile_no = $val['mobile_no'];\n\n if (!empty($add_Family->name))\n $add_Family->save();\n }\n }\n\n /*\n * to update family details\n */\n\n if (isset($_POST['updatefamily']) && $_POST['updatefamily'] != '') {\n\n $arrfu = [];\n $l = 0;\n foreach ($_POST['updatefamily'] as $key => $val) {\n\n $arrfu[$key]['name'] = $val['name'][0];\n $arrfu[$key]['relationship'] = $val['relationship'][0];\n $arrfu[$key]['job'] = $val['job'][0];\n $arrfu[$key]['mobile_no'] = $val['mobile_no'][0];\n $l++;\n }\n\n foreach ($arrfu as $key => $value) {\n $add_family = \\common\\models\\StaffEnquiryFamilyDetails::findOne($key);\n if (!empty($add_family)) {\n $add_family->name = $value['name'];\n $add_family->relationship = $value['relationship'];\n $add_family->job = $value['job'];\n $add_family->mobile_no = $value['mobile_no'];\n $add_family->update();\n }\n }\n }\n\n /*\n * to delete additional previous employer\n */\n\n if (isset($_POST['delete_port_vals_family']) && $_POST['delete_port_vals_family'] != '') {\n\n $vals = rtrim($_POST['delete_port_vals_family'], ',');\n $vals = explode(',', $vals);\n foreach ($vals as $val) {\n \\common\\models\\StaffEnquiryFamilyDetails::findOne($val)->delete();\n }\n }\n }", "function handle_post($indata) {\n// showDebug('form_class POST:');\n// showArray($indata); \n return;\n }", "function parse_form($array) {\n// build reserved keyword array\n//Anything put in here will not show up in your email when form is processed\n $reserved_keys[] = \"MAX_FILE_SIZE\";\n $reserved_keys[] = \"required\";\n $reserved_keys[] = \"redirect\";\n //$reserved_keys[] = \"email\";\n $reserved_keys[] = \"require\";\n $reserved_keys[] = \"path_to_file\";\n $reserved_keys[] = \"recipient\";\n $reserved_keys[] = \"subject\";\n $reserved_keys[] = \"bgcolor\";\n $reserved_keys[] = \"text_color\";\n $reserved_keys[] = \"link_color\";\n $reserved_keys[] = \"vlink_color\";\n $reserved_keys[] = \"alink_color\";\n $reserved_keys[] = \"title\";\n $reserved_keys[] = \"missing_fields_redirect\";\n $reserved_keys[] = \"env_report\";\n $reserved_keys[] = \"Submit\";\n $reserved_keys[] = \"submit\";\n //$reserved_keys[] = \"name\";\n $reserved_keys[] = \"Name\";\n $reserved_keys[] = \"submit_x\";\n $reserved_keys[] = \"submit_y\";\n $reserved_keys[] = \"sendit\";\n if (count($array)) {\n while (list($key, $val) = each($array)) {\n//check for email injection\n\t\tif(!has_no_emailheaders($val)){\n\t\t\tprint_error(\"Please don't spam\");\n\t\t}\n\t\t\n// exclude reserved keywords\n $reserved_violation = 0;\n for ($ri=0; $ri<count($reserved_keys); $ri++) {\n if ($key == $reserved_keys[$ri]) $reserved_violation = 1;\n }\n// prepare content\n if ($reserved_violation != 1) {\n\t// let's check to see if they are check boxes\n if (is_array($val)) {\n for ($z=0; $z<count($val); $z++) {\n $nn=$z+1;\n $content .= \"$key #$nn: $val[$z]\\n\";\n }\n }\n\t // if the values contains nothing do nothing then\n\t // don't add it to the content)\n elseif($val != \"\") $content .= \"$key: $val\\n\";\n }\n } // end of while\nreturn $content;\n }\n}", "function add_registration_form($reg_form_data = array(),$items) \n {\n //$hash_pass = sha1($user_password);\n //echo \"<pre>\";\n // print_r($values_ary);\n $values_ary = array($reg_form_data['form_title'],$reg_form_data['form_intro'],$reg_form_data['form_thank_u'],$reg_form_data['form_menu'],$reg_form_data['form_menu_parent'],$reg_form_data['form_menu_item_text'],$reg_form_data['form_permissions'],$reg_form_data['form_payment_required'],$reg_form_data['form_complete_action'],$reg_form_data['form_publish'],$reg_form_data['form_email_to'],$reg_form_data['form_make_survey']);\n $query_str = \"INSERT INTO registration_form(form_title,form_intro,form_thank_u,form_menu,form_menu_parent,form_menu_item_text,form_permissions,form_payment_required,form_complete_action,form_publish,form_email_to,form_make_survey) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)\";\n $this->db->query($query_str,$values_ary );\n \n\n // $id = $this->getLastInserted('registration_form','form_id');\n $id = $this->db->insert_id();\n // adding dynamic manues \n foreach($items as $key => $item)\n { // is_array($items)\n \n $title = $item['title'];\n $type = $item['type'];\n $required = '';\n \n if (array_key_exists('required', $item))\n {\n $required ='Yes';\n }else\n {\n $required = 'No';\n }\n \n $order =$item['order'];\n if(!$item['order'])\n {\n $order = '0'; \n }\n $name =\"field_\".rand(0,9);\n $new_item = array ($id,$title,$name,$type,$required,$order ); \n \n $query = \"INSERT INTO fields(form_id,field_title,field_name,field_type,field_required,field_sequence) VALUES (?,?,?,?,?,?)\";\n $this->db->query($query,$new_item ); \n \n }\n \n }", "function form_action()\r\n {\r\n $success = true ;\r\n\r\n $file = $this->get_element($this->getUploadFileLabel()) ; \r\n $fileInfo = $file->get_file_info() ; \r\n\r\n $this->set_file_info($fileInfo) ; \r\n $this->set_file_info_table($fileInfo) ; \r\n\r\n // Read the file contents for processing\r\n \r\n $lines = file($fileInfo['tmp_name']) ; \r\n\r\n $line_number = 1 ;\r\n $record = array() ;\r\n\r\n // Establish a database connection\r\n \r\n $sdifqueue = new SDIFResultsQueue() ;\r\n\r\n // Need a record set to work with\r\n\r\n $rs = $sdifqueue->getEmptyRecordSet() ;\r\n\r\n // Process each line in the file, adding it to the SDIF queue\r\n\r\n foreach ($lines as $line)\r\n {\r\n if (trim($line) == \"\") continue ;\r\n\r\n $record_type = substr($line, 0, 2) ;\r\n $record[\"linenumber\"] = $line_number ;\r\n $record[\"recordtype\"] = $record_type ;\r\n $record[\"sdifrecord\"] = trim($line) ;\r\n\r\n $sql = $sdifqueue->getConnection()->GetInsertSQL($rs, $record) ;\r\n\r\n $sdifqueue->setQuery($sql) ;\r\n $sdifqueue->runInsertQuery() ;\r\n\r\n $line_number++ ;\r\n }\r\n\r\n unset($sdifqueue) ;\r\n\r\n // Delete the file so we don't keep a lot of stuff around. \r\n\r\n if (!unlink($fileInfo['tmp_name'])) \r\n $this->add_error(html_div('ft-error-msg',\r\n $this->getUploadFileLabel(),\r\n 'Unable to remove uploaded file.')) ; \r\n\r\n $this->set_action_message(html_div('ft-note-msg', 'File \"' . \r\n $this->get_element_value($this->getUploadFileLabel()) .\r\n '\" successfully uploaded.')) ; \r\n\r\n return $success ;\r\n }", "protected function _insert()\r\n\t{\r\n\t\t$oFlexSliderSlide = new FlexSliderSlider();\r\n\t\t$iInsertId = $oFlexSliderSlide -> insert($_POST);\r\n\t\t\r\n\t\tif ((int)$iInsertId > 0)\r\n\t\t{\r\n\t\t\t$this -> _iId = $iInsertId;\r\n\t\t\t$this -> _saveSlides($this -> _iId);\r\n\t\t\t\r\n\t\t\t$this -> _aRedirect['action'] = 'edit';\r\n\t\t\t$this -> _aRedirect['id'] = $this -> _iId;\r\n\t\t\t$this -> _aRedirect['message'] = 'saved';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this -> _aRedirect['message'] = 'error';\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function addContact() {\n\t\t$form = new form('add','addMailingContactSuccess',$_POST,'POST','form-horizontal');\n\t\t$form->add('name', 'input-text',lang::read('admin.content.controller.elementname'));\n\t\t$form->addRule('name', 'required', null,lang::read('admin.content.controller.giveelementname'));\n\n\t\t$form->add('email', 'input-text',lang::read('admin.users.controller.email'),null,array());\n\t\t$form->addRule('email', 'required', null, lang::read('admin.users.controller.giveemail'));\n\t\t$form->addRule('email', 'email', null, lang::read('admin.users.controller.givecorrectemail'));\n\t\t\n\t\t$form->add('telephone', 'input-text',lang::read('admin.tools.controller.telephone'));\n\t\t$form->add('mobile', 'input-text',lang::read('admin.tools.controller.mobile'));\n\t\t$form->add('adress', 'input-text',lang::read('admin.tools.controller.adress'));\n\t\t$form->add('city', 'input-text',lang::read('admin.tools.controller.city'));\n\t\t$form->add('code', 'input-text',lang::read('admin.tools.controller.code'));\n\t\t$form->add('country', 'input-text',lang::read('admin.tools.controller.country'));\n\t\t$form->add('taxid', 'input-text',lang::read('admin.tools.controller.taxid'));\n\t\t$form->add('other', 'input-text',lang::read('admin.tools.controller.other'));\n\t\t\n\n\t\t$form->setHandler($this);\n\t\t$form->handle();\n\n\t\t$this->smarty->assign('formContact',$form);\n\t\t$this->smarty->assign(lang::read('admin.tools.controller.editcontact'),$title);\n\n\t\t$this->pageDisplay('tools');\n\t}", "function insert_record () {\n // validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // insert data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"INSERT INTO customers (name,email,mobile) values(?, ?, ?)\";\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->create_record();\n }\n }", "protected function setForm(&$form) {\n if (is_array($form) && isset($form['#entity'])) {\n $this->form =& $form;\n $this->entity =& $form['#entity'];\n $this->type = \"{$this->entity->type}_entity_form\";\n }\n elseif (is_object($form) && $form instanceof Entity) {\n $entity =& $form;\n $type = $entity->type;\n $bundle = $type;\n $form_id = \"eck__entity__form__add_{$type}_{$bundle}\";\n\n $this->form = drupal_get_form($form_id, $entity);\n $this->entity =& $entity;\n $this->type = \"{$type}_entity_form\";\n }\n else {\n $this->form =& $form;\n $this->type = 'non_entity_form';\n }\n }", "function display_form($arrForm)\r\n{\r\n global $message;\r\n //Start of form\r\n echo '<form class=\"form-signin\" enctrype=\"multipart/form-data\" method=\"POST\" action=\"'.$_SERVER['PHP_SELF'].'\">';\r\n //form header message prompt\r\n echo '<h1 class=\"h3 mb-3 font-weight-normal text-nowrap\">Please fill in the following </h1>';\r\n //always have message echoed should it have one in the session\r\n echo $message;\r\n //create each field for form\r\n foreach($arrForm as $element){\r\n if( $element['type'] == \"text\" || $element['type'] == \"email\" || $element['type'] == \"password\" || $element['type'] == \"phone\" || $element['type'] == \"datetime-local\" ){\r\n echo '<label for=\"'.$element['name'].'\" class=\"sr-only\">'.$element['label'].'</label>';\r\n echo '<input type=\"'.$element['type'].'\" name=\"'.$element['name'].'\" id=\"'.$element['name'].'\" value=\"'.$element['value'].'\"class=\"form-control\" placeholder=\"'.$element['label'].'\">';\r\n }\r\n elseif(($element['type']==\"client\")){\r\n if((isset($_SESSION['type'])&&($_SESSION['type']==AGENT))){\r\n echo '<select name=\"'.$element['name'].'\" id=\"'.$element['name'].'\" class=\"form-control\" >';\r\n $result = salesperson_client_select($_SESSION['id']);\r\n echo '<option value=\"-1\"> Select Client </option>';\r\n for($i=0; $i < pg_numrows($result); $i++){\r\n $client = pg_fetch_assoc($result,$i);\r\n echo '<option value=\"'.$client['id'].'\"> '.$client[\"first_name\"].' '.$client[\"last_name\"].'</option>';\r\n } \r\n echo '</select>';\r\n \r\n }\r\n }\r\n elseif(($element['type']==\"extension\")){\r\n echo '<label for=\"'.$element['name'].'\" class=\"sr-only\">'.$element['label'].'</label>';\r\n echo '<input type=\"'.$element['type'].'\" name=\"'.$element['name'].'\" id=\"'.$element['name'].'\" value=\"'.$element['value'].'\"class=\"form-control\" placeholder=\"'.$element['label'].'\">';\r\n }\r\n\r\n //file upload box\r\n elseif ($element['type'] ==\"file\"){\r\n echo '<label for=\"'.$element['name'].'\" class=\"sr-only\">'.$element['label'].'</label>';\r\n echo '<input type=\"'.$element['type'].'\" name=\"'.$element['name'].'\" id=\"'.$element['name'].'\" class=\"form-control\" placeholder=\"'.$element['label'].'\">';\r\n }\r\n //selecting the salesperson for ADMIN\r\n elseif(($element['type']==\"select\")){\r\n if((isset($_SESSION['type'])&&($_SESSION['type']==ADMIN))){\r\n echo '<select name=\"'.$element['name'].'\" id=\"'.$element['name'].'\" class=\"form-control\" >';\r\n $result = user_type_select(AGENT);\r\n echo '<option value=\"-1\"> Select Sales Person </option>';\r\n for($i=0; $i < pg_numrows($result); $i++){\r\n $user = pg_fetch_assoc($result,$i);\r\n echo '<option value=\"'.$user['id'].'\"> '.$user[\"first_name\"].' '.$user[\"last_name\"].': [ '.$user[\"email_address\"].' ]</option>';\r\n }\r\n echo '</select>';\r\n\r\n\r\n }\r\n }\r\n // buttons\r\n elseif($element['type'] == \"submit\" || $element['type']==\"reset\"){\r\n echo '<button class=\"btn btn-lg btn-dark btn-block\" type=\"'.$element['type'].'\">'.$element['label'].'</button>';\r\n }\r\n }\r\n \r\n echo '</form>';\r\n echo '';\r\n}", "function do_save(){\n\t\t// check that number and post_ID is set\n\t\tif( empty($this->post_ID) || empty($this->number) ) return false;\n\t\t\n\t\t// check that we have data in POST\n\t\tif( $this->id_base != 'checkbox' && (\n\t\t\t\tempty($_POST['field-'.$this->id_base][$this->number]) ||\n\t\t\t\t!is_array($_POST['field-'.$this->id_base][$this->number])\n\t\t\t)\n\t\t )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$input = @$_POST['field-'.$this->id_base][$this->number];\n\t\t// get real values\n\t\t$values = $this->save( $input );\n\t\t// save to post meta\n\t\tupdate_post_meta($this->post_ID, $this->slug, $values);\n\t\treturn true;\n\t}", "public function SetFormArrays()\r {\r \r // ----- required javascript functions\r //$this->JavascriptToggleFunctionality(); // toggling show/hide a div area\r \r \r \r // ---------- GET LIST OF INSTRUCTIONS ----------\r $records = $this->SQL->GetArray(array(\r 'table' => \"help_instructions\",\r 'keys' => \"help_instructions_id, title\",\r 'where' => \"active=1\",\r ));\r \r $instructions_list = \"\";\r foreach($records as $record) {\r $instructions_list .= \"{$record['help_instructions_id']}=({$record['help_instructions_id']}) {$record['title']}|\";\r }\r $instructions_list = substr($instructions_list, 0, -1); // trim trailing slash\r \r \r \r // ---------- GET AND PROCESS CLASSES ----------\r $class_folder = \"Inventory\";\r $class_folder_name = \"Inventory_\";\r $class_extension = \".php\";\r $directory = CLASS_DIR . $class_folder . '/'; // directory to search\r $classes_all = GetDirectory($directory, '.php', 'autoload,archive' . DIRECTORY_SEPARATOR ); // get all classes\r $classes_used = $this->SQL->GetFieldValues($this->Table, 'class_name', \"class_name != '' AND active=1\"); // get already used classes\r foreach ($classes_all as $k => $v) { $classes_all[$k] = $class_folder_name . $v; } // add needed folder name to class name\r foreach ($classes_used as $k => $v) { $classes_used[$k] = $v . $class_extension; } // add needed extension class name\r \r $remove_used_classes = false; // turned off so help can be applied to multiple areas\r if ($remove_used_classes) {\r $classes_remaining = array_diff($classes_all, $classes_used); // remove used classes from all classes\r } else {\r $classes_remaining = $classes_all;\r }\r \r foreach ($classes_remaining as $key => $value) {\r $classes[$key] = str_replace(array('class.', '.php', DIRECTORY_SEPARATOR), array('', '', '_'), $value);\r }\r $class_list = implode('|', $classes);\r \r \r \r //if ($this->Action == 'ADD') {\r // $base_array = array(\r // \"form|$this->Action_Link|post|db_edit_form\",\r // \"select|Class Name|class_name|Y||{$class_list}\",\r // \"select|Help Instructions|help_instructions_id|Y||{$instructions_list}\",\r // \"text|Page Title|page_title|N|60|255\",\r // );\r //} else {\r $base_array = array(\r \"form|$this->Action_Link|post|db_edit_form\",\r //\"hidden|class_name\",\r \"select|Class Name|class_name|Y||{$class_list}\",\r //\"info|Class Name|{$_POST['FORM_class_name']}\",\r \"select|Help Instructions|help_instructions_id|Y||{$instructions_list}\",\r \"text|Page Title|page_title|N|60|255\",\r \r \"checkbox|List All Records|section_list||1|0\",\r \"checkbox|Add Record|section_add||1|0\",\r \"checkbox|Edit Record|section_edit||1|0\",\r \"checkbox|View Record|section_view||1|0\",\r \r );\r //}\r \r if ($this->Action == 'ADD') {\r $base_array[] = \"submit|Add Record|$this->Add_Submit_Name\";\r $base_array[] = 'endform';\r $this->Form_Data_Array_Add = $base_array;\r } else {\r $base_array[] = \"submit|Update Record|$this->Edit_Submit_Name\";\r $base_array[] = 'endform';\r $this->Form_Data_Array_Edit = $base_array;\r }\r }", "public static function activate()\n\t{\n\t\tif (get_option('magic_form')) {\n\t\t\treturn;\n\t\t}\n\t\t$emailSystem = array(\n\t\t\t\"selectedSystem\" => \"smtp\"\n\t\t);\n\t\tadd_option(\"magicform_email_system\", json_encode($emailSystem));\n\n\t\t/**\n\t\t * Create Database Tables\n\t\t * There are two tables that we use.\n\t\t * %prefix%_magicform_forms for forms\n\t\t * %prefix%_magicform_submissions for submissions\n\t\t */\n\t\t\n\t\trequire_once(ABSPATH . '/wp-admin/includes/upgrade.php');\n\t\t\n\t\tglobal $wpdb;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t$table_name = $wpdb->prefix . 'magicform_forms';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$table_name.\" (\n id int(11) NOT NULL AUTO_INCREMENT,\n form_name varchar(150) NOT NULL,\n create_date datetime NOT NULL,\n form_data mediumtext NULL,\n preview_form_data mediumtext NULL,\n short_code varchar(100) NOT NULL,\n status int(1) NOT NULL,\n views int(11) NOT NULL,\n owner_id mediumint(9) NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta($sql);\n \n $fieldTypeSql = \"SHOW FIELDS FROM \". $table_name .\" WHERE Field ='form_data'\";\n $result = $wpdb->get_results($fieldTypeSql)[0];\n if($result->Type != \"mediumtext\"){\n $sql = \"ALTER TABLE \". $table_name .\" MODIFY COLUMN \n `preview_form_data` MEDIUMTEXT , MODIFY COLUMN `form_data` MEDIUMTEXT\";\n $wpdb->get_results($sql);\n }\n\n\t\t$charset_collate = $wpdb->get_charset_collate();\n $submission_table_name = $wpdb->prefix . 'magicform_submissions';\n \n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$submission_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n form_id mediumint(9) NOT NULL,\n create_date datetime NOT NULL,\n data text NOT NULL,\n ip varchar(50) NULL,\n user_agent varchar(255) NULL,\n os varchar(50) NULL,\n browser varchar(50) NULL,\n device varchar(50) NULL,\n user_id int(11) NULL,\n user_username varchar(50) NULL,\n user_email varchar(200) NULL,\n gdpr int(1) NULL,\n page_title varchar(500) NOT NULL,\n page_url varchar (500) NOT NULL,\n read_status int(1) NOT NULL,\n payment_status int(1) NULL,\n total_amount varchar(200) NULL,\n payment_error varchar(500) NULL, \n PRIMARY KEY (id)\n ) $charset_collate;\";\n\t\tdbDelta($sql);\n\n $fieldTypeSql = \"SHOW FIELDS FROM \". $submission_table_name .\" WHERE Field ='ip'\";\n $result = $wpdb->get_results($fieldTypeSql)[0];\n if($result->Type != \"varchar(50)\"){\n $sql = \"ALTER TABLE \". $submission_table_name .\" MODIFY COLUMN \n `ip` varchar(50)\";\n $wpdb->get_results($sql);\n }\n\n $payment_fields = \"SHOW FIELDS FROM \". $submission_table_name .\" LIKE 'id'\";\n $result = $wpdb->get_results($payment_fields, ARRAY_A);\n if(count($result)>0){\n $payment_sql = \"ALTER TABLE \". $submission_table_name .\"\n ADD payment_status int(1) NULL,\n ADD total_amount varchar(200) NULL,\n ADD payment_error varchar(500) NULL\";\n $wpdb->get_results($payment_sql);\n }\n\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t$notifications_table_name = $wpdb->prefix . 'magicform_notifications';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$notifications_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n form_id mediumint(9) NOT NULL,\n create_date datetime NOT NULL,\n title varchar(255) NOT NULL,\n data text NOT NULL,\n read_status int(1) NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n dbDelta($sql);\n \n $charset_collate = $wpdb->get_charset_collate();\n\t\t$products_table_name = $wpdb->prefix . 'magicform_products';\n\t\t$sql = \"CREATE TABLE IF NOT EXISTS \".$products_table_name.\" (\n id mediumint(9) NOT NULL AUTO_INCREMENT,\n product_name varchar(255) NOT NULL,\n product text NOT NULL,\n status int(1) NOT NULL,\n create_date datetime NOT NULL,\n PRIMARY KEY (id)\n ) $charset_collate;\";\n\t\tdbDelta($sql);\n\t}" ]
[ "0.5889654", "0.58836126", "0.5765263", "0.57520115", "0.5687094", "0.56868714", "0.56360644", "0.5554503", "0.5480203", "0.5460281", "0.54574454", "0.5454157", "0.54475754", "0.5447162", "0.54355466", "0.54097307", "0.53602475", "0.5350493", "0.5347769", "0.5320692", "0.5311659", "0.53100777", "0.5303224", "0.5294403", "0.5292825", "0.52795875", "0.52413917", "0.52341175", "0.5233599", "0.52310115", "0.5225658", "0.52202505", "0.5217889", "0.52063024", "0.52018076", "0.5200706", "0.5200264", "0.51993144", "0.519764", "0.5197586", "0.5191491", "0.51890874", "0.51634467", "0.5155666", "0.51377845", "0.5133267", "0.51309365", "0.5129494", "0.51279134", "0.51238626", "0.51026165", "0.51018304", "0.51005167", "0.5099547", "0.50977695", "0.5078197", "0.5077756", "0.50721973", "0.50711405", "0.50709575", "0.50705755", "0.5068048", "0.505636", "0.5055911", "0.5054398", "0.5052527", "0.5048868", "0.50405484", "0.50313985", "0.5027699", "0.5014562", "0.50141376", "0.500708", "0.50047046", "0.50029033", "0.49982178", "0.49943587", "0.4992723", "0.4985516", "0.49848783", "0.4981332", "0.4976774", "0.4965531", "0.4962189", "0.4961625", "0.49598902", "0.4954829", "0.4948991", "0.49435294", "0.4933945", "0.4933756", "0.49264976", "0.4925402", "0.49225885", "0.49208185", "0.4917963", "0.49073994", "0.49014688", "0.49006596", "0.48977813" ]
0.7853629
0
end of setForm() ==== getRecByEmail() =================================================== Check how many rows exists in the database with the email parameter. Parameters: $email string of an email Return: $res string number of rows found ========================================================================
protected function getRecByEmail(string $email) { $sql = "SELECT COUNT(*) FROM " . $this->formsTableName . " WHERE email = ?"; $stmt = $this->connect()->prepare($sql); $stmt->bindParam(1, $email, \PDO::PARAM_STR); $stmt->execute(); $res = $stmt->fetchAll(); return $res[0]['COUNT(*)']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getRecByNameEmail(string $name, string $email) {\n $sql = \"SELECT COUNT(*) FROM \" . $this->formsTableName . \" WHERE name = ? AND email = ?\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->bindParam(1, $name, \\PDO::PARAM_STR);\n $stmt->bindParam(2, $email, \\PDO::PARAM_STR);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return $res[0]['COUNT(*)'];\n }", "function emailTaken($email) {\n\t$db = connectDB();\n $sql = <<<SQL\n \tSELECT userID\n \tFROM users\n \tWHERE email = ?\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->bind_param(\"s\", $email);\n $statement->execute();\n $statement->store_result();\n\t$res = $statement->num_rows;\n\n\t$statement->close();\n\t$db->close();\n\n return $res;\n}", "public function buscaEmail($email)\n {\n \n $query = $this->db\n ->where('email', $email)\n ->get('clientes');\n\n return $query->num_rows();\n }", "public function checkDuplicateEmail( $email )\n {\n include(\"config/database.php\");\n try {\n $sql = \"SELECT email FROM students where email='$email'\";\n $result = $pdoCon->prepare($sql);\n $result->execute();\n $rows = $result->rowCount();\n } catch (Exception $e) {\n echo \"Unable to retrieved results\";\n exit;\n }\n return $rows;\n }", "function isEmailPresent($email = NULL){\t\t\t\n\t\t$query = \" SELECT id\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organisers','dbtables');\n\t\t$query .= \" WHERE email = ? \";\t\t\n\t\t$dataBindArr = array($email);\n\t\t$res = $this->db->query($query, $dataBindArr);\n\t\t$resArr = $res->result();\t\t\n\t\treturn count($resArr);\n\t}", "static function email_available($email) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"';\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function searchIfMailExists($email)\n {\n $reqmail = $this->db->prepare(\"SELECT * FROM users WHERE email = ?\");\n $reqmail->execute(array($email));\n $mailexist = $reqmail->rowCount();\n\n return $mailexist;\n }", "public function findEmail($email = \"[email protected]\") {\n\t\t$users = $this->em->createQuery ( \" SELECT PARTIAL u.{id} FROM App\\Entity\\User u WHERE u.email = ?1 \" )->setParameter ( 1, $email )->execute ();\n\t\treturn count ( $users );\n\t}", "function sql_nemails($email)\n{\n global $connection, $trace, $tblmembre;\n $select = \"$tblmembre\";\n $tables = explode(\",\",$select);\n $where = \"\";\n for ($i=0;$i<count($tables);$i++) {\n $fields_array = sql_fields($tables[$i],'array');\n for ($j=0;$j<sql_fields($tables[$i],'');$j++) {\n if (strstr($fields_array[$j], \"email\")) {\n if\t($where !== '')\t$where .= \"OR\"\t;\n $where .= \" $fields_array[$j]='$email' \";\n }\n }\n }\n $sql = mysqli_query($connection, \"SELECT * FROM $select WHERE $where\");\n $row = mysqli_num_rows($sql);\n return $row;\n}", "private function isUserExists($email) {\n \n $result = $this->con->query(\"SELECT iduser from user WHERE email = '\".$email.\"';\");\n $num_rows=$result->num_rows;\n \n \n return $num_rows;\n }", "public function user_if_email_exists($email)\n\t{\n\t\t$sql = \"SELECT id FROM \".$this->table.\" WHERE email = ?\";\n\t\t$data = array($email);\n\t\t$query = $this->db->query($sql, $data);\n\t\treturn $query->num_rows();\n\t}", "public function getByEmail($email) {\n if (isset($this->contacts[$email])) {\n echo $this->formatContact($email, $this->contacts[$email]);\n\n return 1;\n } else {\n echo 'Error: Contact does not exist';\n return 0;\n }\n }", "public function searchUser($email) {\r\n\r\n\t\t//TODO: Look at bookmark class for sample try/catch block around DB code\r\n\t\t$sqlObj = new DataBase();\r\n\t\t$found = FALSE;\r\n\r\n\t\t$query = \"SELECT * FROM `user_credentials` WHERE `email`='$email'\";\r\n\r\n\t\ttry {\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$resultset = $sqlObj->GetData();\r\n\r\n\t\t\t$num = $sqlObj->getNumberOfRecords();\r\n\t\t} catch (MyException $e) {\r\n\t\t\t$e->getMyExceptionMessage();\r\n\t\t}\r\n\t\tif ($num == 1) {\r\n\t\t\t$id = $resultset[0]['id'];\r\n\t\t\t$found = $id;\r\n\t\t} else {\r\n\t\t\t$found = -1;\r\n\t\t}\r\n\t\t$sqlObj->destroy();\r\n\r\n\t\treturn $found;\r\n\t}", "function userExist($email){\n $users = json_decode($this->getAll());\n foreach ($users as &$user) {\n if($user->email == $email){\n return $user->counter;\n }\n }\n return NULL;\n }", "function numberOfSameEmailAddress($email) {\n $sql = \"SELECT * FROM member WHERE email = '\" . $email . \"'\";\n $result = getAll($sql);\n\n return count($result);\n}", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "public function availableEmail($email)\n {\n\n $pdo = DB::connect();\n $stmt = $pdo->prepare(\"SELECT COUNT(id) FROM users WHERE email = :email\");\n $stmt->bindParam(':email', $email);\n $stmt->execute();\n $result = $stmt->fetchColumn();\n\n if ($result > 0) {\n return false;\n } else {\n return true;\n }\n }", "private function check_for_email($email)\r\n\t{\r\n\t\t//We make use of the global dbCon that we've created in the config file\r\n\t\tglobal $dbCon;\r\n\r\n\t\t//SQL statement where we Count the occurances (it's faster!)\r\n\t\t$sql = \"SELECT COUNT(id) AS students FROM student WHERE email = ?;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('s', $email);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($students); //Get ResultSet\r\n\t\t$stmt->fetch();\r\n\t\t$stmt->close();\r\n\r\n\t\tif ($students > 0)\r\n\t\t{\r\n\t\t\treturn \"Email is already in system. Try to log in!\";\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "public function check_email($mail,$user_id)\r\n {\r\n try\r\n {\r\n $ret_=0;\r\n $s_qry=\"Select count(*) as i_total \"\r\n .\"From \".$this->tbl_recom.\" \"\r\n .\" Where s_referred_email='\".$mail.\"' AND i_referrer_id=\".$user_id;\r\n\t\t\t\t\r\n $rs=$this->db->query($s_qry);\r\n\t\t \r\n\t\t $s_qry1=\"Select count(*) as i_total \"\r\n .\"From \".$this->tbl_user.\" \"\r\n .\" Where s_email='\".$mail.\"' \";\r\n\t\t\t\t\r\n $rs1=$this->db->query($s_qry1);\r\n $i_cnt=0;\r\n\t\t// echo $ret_;\r\n if($rs->num_rows()>0)\r\n {\r\n\t\t \t foreach($rs->result() as $row)\r\n {\r\n $ret_=intval($row->i_total); \r\n } \r\n\t\t\t// echo $ret_;\r\n\t\t \tif($ret_!=0)\r\n\t\t\t$ret_ =1;\r\n }\r\n\t\t if($rs1->num_rows()>0 &&$ret_==0)\r\n {\r\n\t\t \t foreach($rs1->result() as $row)\r\n {\r\n $ret_=intval($row->i_total); \r\n } \r\n\t\t \tif($ret_!=0)\r\n\t\t\t $ret_ = 2; \r\n }\r\n\t\t // echo $ret_;\r\n \r\n return $ret_;\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n }\r\n }", "function email_exists($email){\n $sql = \"SELECT id FROM users WHERE email='$email'\";\n $result = query($sql);\n\n if(row_count($result)==1){\n return true;\n }else{\n return false;\n }\n}", "function KTEmail($email){\n\t\t\t\t$sql=\"SELECT * FROM user WHERE Email='$email'\";\n\t\t\t\t$re=mysql_query($sql) or die(mysql_error());\n\t\t\t\t$n=mysql_num_rows($re);\n\t\t\t\tif($n>=1)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}", "function check_if_email_is_in_use($email){\n\n $query = $this->db->get_where('tbl_doctor_account', array('dacc_email' => $email));\n return $query->num_rows();\n\n }", "public function validate_email_user_reset($email)\n {\n return $this->db->from('ec_client')->where('email', $email)->count_all_results();\n }", "function email_exists($email)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Protect variables to avoid any SQL injection\n $email = mysqli_real_escape_string($link, $email);\n\n // 3. Generate a query and return the result.\n $result = mysqli_query($link, \"\n SELECT id\n FROM tbl_users\n WHERE email = '{$email}'\n \");\n\n // 4. Disconnect from the database.\n disconnect($link);\n\n // 5. There should only be one row, or FALSE if nothing.\n return mysqli_num_rows($result) >= 1;\n }", "function search_by_email($tableName,$email) // searching employee by email\r\n {\r\n $conn = self::build_connection();\r\n $sql = \"select * from \".$tableName .\" WHERE email='{$email}'\";\r\n $result = $conn->query($sql);\r\n self::close_connection($conn);\r\n if($result->num_rows > 0){ //if value >0 true\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "private function checkEmail(){\n\n $request = $this->_connexion->prepare(\"SELECT COUNT(*) AS num FROM Users WHERE user_email=?\");\n $request->execute(array($this->_userEmail));\n $numberOfRows = $request->fetch();\n\n if($numberOfRows['num'] == 0)\n return false;\n else\n return true;\n\n }", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->Admins->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "function emailExists($email){\r\n $sql = \"SELECT email FROM users WHERE email = '$email'\";\r\n $count = $this->q($sql)->num_rows;\r\n if ($count > 0 ){ return true; } else{ return false; }\r\n }", "public function consultaEmail($email){\n \n if (filter_var($email, FILTER_VALIDATE_EMAIL)){\n \n $sql = new Sql();\n $res = $sql->select('SELECT * FROM usuarios \n WHERE email_usuario = :email_usuario',array(\n ':email_usuario'=>$email));\n \n if(count($res)>0){\n return 1001;//caso SIM email ja esta em uso\n }else{\n return 0;//tudo certo email NAO ESTA em uso\n }\n\n }else{\n return 1002;//email informado nao e valido\n }\n \n }", "function email_exist($email) {\n\n $sql = \"SELECT id FROM users WHERE email = '$email'\";\n\n $result = query($sql);\n \n if(row_count($result) == 1) {\n return true;\n } else {\n return false;\n }\n}", "public function emailExist($email){\n\t\t$query = $this->_db->prepare('SELECT COUNT(*) FROM utilisateur WHERE email=:email');\n\t\t$query->execute(array(':email' => $email));\n\t\t//get result\n\t\treturn (bool) $query->fetchColumn();\n\t}", "function emailExist($dbx, string $targetEmail){\n // debug($dbx->count(\"SELECT * FROM user WHERE email = ?\",[$targetEmail]));\n return $dbx->count(\"SELECT * FROM user WHERE email = ?\",[$targetEmail]);\n}", "function existUser($email){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT COUNT(*) AS Registered FROM User WHERE email='\" . $email . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $email . \" user\";\n\t\t}else{\n\t\t\t$assocResult = $result->fetch_assoc();\n\t\t\treturn $assocResult['Registered'];\n\t\t}\n\t}", "public function check_mail($email) {\n\n\n\t\treturn (mysql_result($this->query(\"SELECT COUNT(`id`) FROM `users` WHERE `email` = '$email'\"), 0) ? true: false);\n\n\t}", "public static function existeEmail($email){\n $db = DWESBaseDatos::obtenerInstancia();\n\n $db -> ejecuta(\"SELECT count(*) as cantidad\n FROM usuario WHERE email = ?\", $email);\n $datos= $db->obtenDatos();\n if ($datos[0]['cantidad'] > 0) {\n //echo 'true' .' es verdad';\n return true;\n }else{\n //echo 'false' .' no existe';\n return false;\n }\n\n }", "function checkUserByEmail($email)\n{\n // Make Database Connection\n $objDB = objDB();\n\n // Make The Statement\n $stmt = $objDB->prepare('SELECT * FROM users WHERE email=?');\n\n // Bind The Paramters\n $stmt->bind_param('s', $email);\n\n // execute\n $stmt->execute();\n\n // Store The Result\n $stmt->store_result();\n\n // Return Numbers of rows\n return $stmt->num_rows;\n}", "function check_mail($email){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT mail FROM utilisateur WHERE mail = :email\");\n\t\t$req->execute(array(\"email\"=>$email));\n\n\t\t$exist = $req->rowCount();\n\t\t$req->closeCursor();\n\n\t\treturn $exist;\n\t}", "public function exist_email()\r\n {\r\n $email = $this->input->post('email');\r\n \r\n $this->load->model('frontend/user_model');\r\n \r\n $record = $this->user_model->select('COUNT(id) as total')->find_by(array('email' => $email));\r\n \r\n if ($record->total == 0)\r\n echo false;\r\n else\r\n echo true; \r\n }", "public function emailExists ($email){\n $con = connectPDO();\n $query = $con->prepare(\"SELECT COUNT(id) FROM users WHERE email = ?\");\n $query->execute(array($email));\n $rowcount = $query->fetchColumn();\n if ($rowcount > 0) {\n return true;\n }else{\n return false;\n }\n }", "function check_email_duplicate(){\n $this->SQL = \"SELECT email FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n return $this->results;\n \n }", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->User->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function getExistingEmail($email)\n {\n $query = \"SELECT identifier FROM \".$this->_name.\" WHERE email = '\".$email.\"'\";\n if(($result = $this->getQuery($query,false)) != NULL)\n {\n return \"yes\";\n }\n else\n return \"no\";\n }", "function email_exists($email)\n {\n $sql = \"\n SELECT id\n FROM {$this->_db}\n WHERE email = \" . $this->db->escape($email) . \"\n LIMIT 1\n \";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n return TRUE;\n }\n\n return FALSE;\n }", "public function verifyEmailExists($email)\r\n\t{\r\n\t\t$emailFull = $email['email'];\r\n\t\t\r\n\t\t$consult = $this->dbAdapter->query(\"SELECT count(email) as count FROM users WHERE email='$emailFull'\",Adapter::QUERY_MODE_EXECUTE);\r\n\t\t\r\n\t\t$result = $consult->toArray();\r\n\r\n\t\treturn $result;\r\n\t}", "function verificarMail($id, $email){\n $conn=connexioBD();\n $emailRepe=true;\n $sql=\"SELECT email FROM usuaris WHERE id='$id'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n if($usuari[\"email\"]==$email){\n $emailRepe=false;\n } \n }\n }\n return $emailRepe;\n $resultado->free();\n $conn->close();\n}", "public function check_email($email)\r\n\t{\r\n\t\t$query=$this->db->query(\"SELECT * FROM users WHERE emailid='\".$email.\"'\");\r\n\tforeach ($query->result() as $row)\r\n\t\t{\r\n\t\t$storeid=$row->storeid;\r\n\t\t}\r\n\t\t$rows=$query->num_rows();\r\n\t\t$result=array('afftected_rows'=>$rows,'storeid'=>$storeid);\r\n\t\treturn $result;\r\n\t}", "function email_exists($email){\n include 'connection.php';\n $query = \"SELECT email FROM basicusers WHERE email = '$email'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n for($i=0; $i<$rows; $i++){\n $result->data_seek($i);\n $row = $result->fetch_array(MYSQLI_ASSOC);\n if($row['email'] == $email){\n return true;\n }\n else return false;\n }\n}", "public function email_check($str){\n $con['returnType'] = 'count';\n $con['conditions'] = array('email'=>$str);\n $checkEmail = $this->user->getRows($con);\n if($checkEmail > 0){\n $this->form_validation->set_message('email_check', 'The given email already exists.');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function DB_email_existing_check($email){\n $connection = DB_get_connection();\n $queryCheck = \"SELECT * FROM `users` WHERE Email='$email'\";\n $result = mysqli_query($connection, $queryCheck);\n if(mysqli_num_rows($result) > 0){\n \n return true;\n \n }else{\n\n return false;\n\n }\n\n}", "public function isEmailExist($email){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Gmail = '$email'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "function checkemail() {\n\t\tConfigure::write('debug', 0);\n\t\t$this->autoRender = false;\n\t\t\n\t\t$email = $_REQUEST['data']['Member']['email'];\n\t\t\n\t\t$count = $this->Member->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'email' => $email\n\t\t\t)\n\t\t));\n\t\t\n\t\t/*echo $count;\n\t\tdie;*/\n\t\tif ($count > 0) {\n\t\t\techo \"false\";\n\t\t} else {\n\t\t\techo \"true\";\n\t\t}\n\t}", "function checkExistingEmail($clientEmail){\n $db = acmeConnect();\n $sql = 'SELECT clientEmail FROM clients WHERE clientEmail = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $clientEmail, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n }\n}", "public static function checkDuplicateUser($email)\n\t{\n\t\t$cnt = Doctrine_Query::create()\n\t\t->from(\"User\")->select()->where('email= ?', $email)->andWhere(\"deleted= 0\")->fetchArray();\n\t\t// ->findBy('email', $email)->count();\n\t\t\n\t\treturn count($cnt);\n\t}", "function franchiseExists($email) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT id\n\t\tFROM \" . $db_table_prefix . \"franchise\n\t\tWHERE\n\t\temail = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}", "function MailExists($email) {\n\n\t$query = \"SELECT email FROM usuarios WHERE email = '$email'\";\n\t$result = DBExecute($query);\n\n\tif (mysqli_num_rows($result) <= 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function verificacioBD($email){\n $conn=connexioBD();\n $usuariExisteix=false;\n $sql=\"SELECT * FROM usuaris WHERE email='$email'\";\n if (!$resultado = $conn->query($sql)) {\n die(\"Error en la consulta\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n $usuariExisteix=true; \n }\n }\n $resultado->free();\n $conn->close();\n return $usuariExisteix;\n}", "function verificar_email_usuario($e){\n\t\t\t\t\tinclude('../../conexion.php');/* mediante la consulta busca si concuerda algun usuario */\n\t\t\t\t\t$sql = \"SELECT email from usuarios WHERE status=1 AND BINARY email ='\".$e.\"'\";\n\t\t\t\t\t$rec = mysqli_query($con,$sql)or die(\"valio sombrilla'\".$sql.\"'\"); \n\t\t\t\t\t$count = 0;/* si la consulta es un exito aumenta un contador y como resultado retorna un valor */\n\t\t\t\t\twhile($row = mysqli_fetch_array($rec)){ $count++;}\t\n\t\t\t\t\tif($count == 1){return 1;}\n\t\t\t\t\telse{return 0; }\n\t\t\t}", "private function check_If_Email_Exists($email){\r\n\r\n // Prepare query\r\n $query = \"SELECT * FROM `users` WHERE (Fuid = '' AND Guid = '' AND email = '{$email}')\";\r\n\r\n // Send query into server\r\n $this->_db->get_Rows($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "public function accountExists($email) {\r\n $this->db = new Db();\r\n \r\n $this->db->scrub($email);\r\n $query = \"SELECT UID FROM MEMBER WHERE EMAIL = '\".$email.\"'\";\r\n $results = $this->db->select($query);\r\n return(sizeof($results)>0);\r\n }", "public function emailCounts($email);", "function checkForAccount($email, $db) {\n $sql = 'SELECT email FROM users WHERE email = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $email, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n \n }\n }", "function userEmailTaken($email){\r\n\t $email = mysql_real_escape_string($email);\r\n if(!get_magic_quotes_gpc()){\r\n $email = addslashes($email);\r\n }\r\n $q = \"SELECT email FROM users WHERE email = '$email'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "function check_email_exist(){\n //TODO syntize the query\n $this->SQL = \"SELECT id,private_name,family_name ,email,password FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n \n \n if ( !empty( $this->results[0]['email'] ) ){\n //found mail - check password\n \n if ($this->results[0]['password'] === $this->params['password']){\n \n $this->success_login();\n \n \n } else {\n // if password incorrect\n $this->results =array( 'results'=>'fail');\n \n }\n \n \n } else {\n //didnt found email \n $this->results =array( 'results'=>'fail');\n \n }\n return $this->results;\n \n }", "function admin_email_exists($email){\n include 'connection.php';\n $query = \"SELECT email FROM admin_users WHERE email = '$email'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n for($i=0; $i<$rows; $i++){\n $result->data_seek($i);\n $row = $result->fetch_array(MYSQLI_ASSOC);\n if($row['email'] == $email){\n return true;\n }\n else return false;\n }\n}", "function emailExists(){\n\t\t\t\t \n\t\t\t\t // query to check if email exists\n\t\t\t\t $query = \"SELECT rep_id, rep_name, rep_surname, rep_pwd, rep_email\n\t\t\t\t FROM \" . $this->table . \"\n\t\t\t\t WHERE rep_email = :rep_email\n\t\t\t\t LIMIT 0,1\";\n\t\t\t\t \n\t\t\t\t // prepare the query\n\t\t\t\t $stmt = $this->conn->prepare($query);\n\t\t\t\t \n\t\t\t\t // sanitize\n\t\t\t\t $this->rep_email=htmlspecialchars(strip_tags($this->rep_email));\n\t\t\t\t \n\t\t\t\t // bind given email value\n\t\t\t\t $stmt->bindParam(':rep_email', $this->rep_email);\n\t\t\t\t \n\t\t\t\t // execute the query\n\t\t\t\t $stmt->execute();\n\t\t\t\t \n\t\t\t\t // get number of rows\n\t\t\t\t $num = $stmt->rowCount();\n\t\t\t\t \n\t\t\t\t // if email exists, assign values to object properties for easy access and use for php sessions\n\t\t\t\t if($num>0){\n\t\t\t\t \n\t\t\t\t // get record details / values\n\t\t\t\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t \n\t\t\t\t // assign values to object properties\n\t\t\t\t $this->rep_id = $row['rep_id'];\n\t\t\t\t $this->rep_name = $row['rep_name'];\n\t\t\t\t $this->rep_surname = $row['rep_surname'];\n\t\t\t\t $this->rep_pwd = $row['rep_pwd'];\n\t\t\t\t $this->rep_email = $row['rep_email'];\n\t\t\t\t \n\t\t\t\t // return true because email exists in the database\n\t\t\t\t return true;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t // return false if email does not exist in the database\n\t\t\t\t return false;\n\t\t\t\t}", "public function isEmailExist($email){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\",$email);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "function checkEmail($email){\n\t\t\t$database = new connect();\n\t\t\t$result = false;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM users WHERE email='$email'\";\n\t\t\t$resultQuery = mysql_query($query); \n\t\t\t\n\t\t\tif(mysql_num_rows($resultQuery) == 1){\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "public function check_user_exist($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from users WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "function emailExist($email)\n{\n\n global $connection;\n global $errors;\n\n $sql = \"SELECT * FROM tbl_users WHERE email = '$email'\";\n $result = mysqli_query($connection, $sql);\n $row = mysqli_fetch_all($result);\n mysqli_free_result($result);\n\n if (count($row) > 0) {\n\n $errors[] = \"This email has been taken before.\";\n return false;\n }\n\n return true;\n\n}", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function email_exists($email) {\n $email = sanitize($email);\n $query = mysql_query(\"SELECT COUNT(`user_id`) FROM `users` WHERE `email` = '$email'\");\n return (mysql_result($query, 0) == 1) ? true : false;\n}", "public function check_email_if_exist($email = \"\"){\r\n $query = $this->db->get_where('view_customer_info', array('email' => $email,'is_finish_registration'=>\"1\"));\r\n return $query->row_array();\r\n }", "function check_app_email($connection, $school_key, $app_email){\n $query = \"SELECT email FROM applicants WHERE email = '$app_email' AND school_email = '$school_key'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n if ($rows < 1) {\n return false;\n }\n else{\n return true;\n }\n}", "public function checkMailUserExist()\n {\n $checkMailPatientExist = $this->db->prepare(\n 'SELECT \n COUNT(id) AS isIdPatientExist\n FROM `dom20_users`\n WHERE `mail` = :mail\n '\n );\n $checkMailPatientExist->bindvalue(':mail', $this->mail, PDO::PARAM_STR);\n $checkMailPatientExist->execute();\n $data = $checkMailPatientExist->fetch(PDO::FETCH_OBJ);\n return $data->isIdPatientExist;\n }", "protected function emailAlreadyInUse($email)\n {\n return (bool)self::select(['id'])->\n where('email', '=', $email)->\n count();\n }", "public function check_user_exist_android($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from androidusers WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "function emailExists($email) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT email FROM users WHERE email = ?\",array($email));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "protected function delRecByEmail(string $email) {\n try {\n $sql = \"DELETE FROM \" . $this->formsTableName . \" WHERE email = ? ORDER BY ts ASC LIMIT 1\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->bindParam(1, $email, \\PDO::PARAM_STR);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return TRUE;\n } catch(PDOException $e) {\n return FALSE;\n }\n }", "public function lookForUserByEmail($email)\n {\n self::connectToDB(); /* Using DB connection */\n\n $this->sql = \"SELECT email FROM users WHERE email = ?\";\n\n try\n {\n $this->query = $this->handler->prepare($this->sql);\n $this->query->execute(array($email));\n $this->result = $this->query->fetchAll(PDO::FETCH_ASSOC);\n\n /**\n * Closing DB connection\n */\n $this->query->closeCursor();\n $this->handler = null;\n\n return $this->result;\n }\n catch (Exception $e)\n {\n echo \"Error: query failure\";\n return false;\n }\n }", "function isAvailable($email){\n $ask = \"select * from users where email='$email'\";\n global $db;\n\n $result = $db->query($ask);\n\n if($result->num_rows == 1){\n return true;\n }\n else return false;\n}", "function recipientExists($id_email, $recip_email, $recip_name) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT * FROM scuola.email_recipients WHERE\n id_email = %s AND\n email = '%s' AND\n name = '%s'\", $id_email, $recip_email, $recip_name);\n\n // Perform Query\n $result = mysql_query($query);\n if (!$result) {\n setcookie('message', mysql_error());\n }\n }\n $this->closeConnection();\n return mysql_num_rows($result) == 1;\n }", "function iCheckIfClientEmailExists( $SafeEmail, $SafePWD,&$ID, &$Email_status, &$Email_code, &$Password_status )\r\n{\r\n global $mysqli;\r\n \r\n $QueryResultSet = \"SELECT count(*) AS row_exists, \r\n salt,\r\n password,\r\n id,\r\n\t\t\t\t email_active,\r\n\t\t\t\t email_code,\r\n\t\t\t\t password_recover\r\n FROM client_login_table\r\n WHERE email_address = '$SafeEmail'\";\r\n \r\n \r\n $objGetResult = $mysqli->query( $QueryResultSet );\r\n \r\nif(DEBUG)\r\n{\r\n echo \"$QueryResultSet<br>\";\r\n var_dump($objGetResult);\r\n}\r\n if( $objGetResult ) #remember that even if there is no single row has returned, it will return an object which is non-zero. \r\n {\r\n $anArray = $objGetResult->fetch_array( MYSQLI_ASSOC );\r\n \r\n $numof_rows = stripslashes($anArray['row_exists']);\r\n $salt = stripslashes($anArray['salt']);\r\n $password = stripslashes($anArray['password']);\r\n\t\t$Password_status = stripslashes( $anArray['password_recover'] );\r\n\r\nif(DEBUG)\r\n{\r\n echo \"From iCheckIfOwnerEmailExists():Numof_rows: $numof_rows<br>\";\r\n}\r\n\r\n if( $numof_rows >= 1 )\r\n {\r\n $hash = getHash( $SafePWD, $salt );\r\nif(DEBUG)\r\n{\r\n echo \"SafePWD: $SafePWD salt: $salt<br>\";\r\n}\r\n\t\t\tif( $hash == $password )\r\n\t\t\t{\r\n \t$ID = stripslashes($anArray['id']);\r\n\t\t\t\t$Email_status = stripslashes( $anArray['email_active'] );\r\n $Email_code = stripslashes( $anArray['email_code'] );\r\n\t\t\t\t$Email_Exists = 1;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$Email_Exists = 0;\r\n\t\t\t}\r\n }\r\n else\r\n {\r\n $Email_Exists = 0;\r\n }\r\n \r\n $objGetResult->free_result();\r\n }\r\n return $Email_Exists;\r\n}", "public function getUsersByEmail($email) {\n $sql = \"SELECT count(*) as total FROM \" . DB_PREFIX . \"wkpos_user WHERE email = '\" . $email . \"' AND user_id != '\" . $this->session->data['user_login_id'] . \"'\";\n $query = $this->db->query($sql);\n\n return $query->row['total'];\n }", "function email_existe($email){\n\t$sql = \"SELECT id FROM usuarios WHERE email = '$email'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "public function checkUserDuplicate($email){\n $q = $this->getRows($this->query(\"SELECT * FROM user WHERE email='$email' \"));\n return $q;\n }", "public function select_email_exist($email)\n {\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->All();\n if($count[0]['count']>0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public static function exists($email)\n {\n $conn = new MySqlConnect();\n $isFound = FALSE;\n\n // query the db for the value comparison\n $result = $conn -> executeQueryResult(\"SELECT userId FROM users WHERE emailAddress = '{$email}'\");\n\n // get a row count to verify only 1 row is returned\n $count = mysql_num_rows($result);\n if ($count > 0)\n {\n $isFound = TRUE;\n }\n $conn -> freeConnection();\n return $isFound;\n }", "public function checkIscrizione($email){\n $query = \"SELECT * FROM Amministratore WHERE email ='$email'\";\n\n $stmt = Dbh::getInstance()\n ->getDb()\n ->prepare($query);\n $stmt->execute();\n return $stmt ->fetchAll(PDO::FETCH_ASSOC); \n }", "private function isUserExists($email) {\n $stmt = $this->con->prepare(\"SELECT id from users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "function check_email_exists($email)\n\t{\n\n\t\tglobal $Oau_auth;\n\t\t$email = sanitize($email);\n\n\t\t$query = \"SELECT `student_Idn` FROM `student` WHERE `email` = '$email'\";\n\t\t$run_query = mysqli_query($Oau_auth, $query);\n\n\t\tif(mysqli_num_rows($run_query) > 0)\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\n\t}", "function emailExist($link, $useremail) {\n\t\t// use escape function to avoid sql injection attacks\n\t\t$email = mysqli_real_escape_string($link, $_POST[$useremail]);\n\t\t$query = \"SELECT `email` FROM users WHERE email='\".$email.\"'\";\n\n\t\t$result = mysqli_query($link, $query);\n\t\treturn mysqli_num_rows($result);\n\t}", "private function isStaffExists($email) {\n $stmt = $this->conn->prepare(\"SELECT staff_id from staff WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "function email_exists($db, $email)\n{\n\t$sql = 'SELECT * FROM users where email=:email';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "function email_exist($email)\n {\n $this->db->select(EMAIL_ID);\n $this->db->from(TBL_USERS);\n $this->db->where(EMAIL_ID, $email);\n $query = $this->db->get();\n if ($query->num_rows() == 1) {\n return $query->row();\n } else {\n return false;\n }\n }", "function VarEmail($email){\n $query = \"SELECT email FROM membros WHERE email=:email\";\n try {\n $result = MySQLStart()->prepare($query);\n $result->bindParam(':email', $email, PDO::PARAM_STR);\n $result->execute();\n $count = $result->rowCount();\n if ($count <= 0) {\n $resultado = true;\n } else {\n $resultado = false;\n }\n }catch (PDOException $erro_db){\n echo $erro_db;\n }\n return $resultado;\n }", "public function checkUserExist($email)\n {\n $sql = \"SELECT `id` FROM `user` WHERE email = '$email'\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n $count = sizeof($result);\n if ($count > 0)\n return true;\n else return false;\n }", "public function getLoginTries($email){\n $result=$this->con->query(\"SELECT lock_count FROM user WHERE email='\".$email.\"';\");\n $num_rows=$result->num_rows;\n if($num_rows==1){\n \n $lock=$result->fetch_assoc();\n $row=$lock['lock_count'];\n return $row;\n }\n else return NULL;\n \n }", "function leadExists($email) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT id\n\t\tFROM \" . $db_table_prefix . \"leads\n\t\tWHERE\n\t\temail = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}", "function exist_email($email, $dbh)\n {\n try {\n $sql = 'SELECT * from users WHERE email LIKE \"' . $email . '\"';\n $res = $dbh->query($sql);\n return ($res->rowCount());\n } catch (PDOException $e) {\n print \"Inscription (exist_email) -> Erreur !: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n }", "function chk_email($email)\n\t{\n\t\t$str = \"Select u_email from tbl_user where u_email = ?\";\n\t\t\n\t\t//Executes the query\n\t\t$res = $this -> db -> query($str, $email);\n\t\t\n\t\t//Checks whether the result is available in the table\n\t\tif($res -> num_rows() > 0)\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}" ]
[ "0.7195172", "0.71636033", "0.6947688", "0.69180524", "0.6747372", "0.6745044", "0.6716814", "0.67041016", "0.667102", "0.6626002", "0.6569871", "0.6568219", "0.6541039", "0.6529713", "0.65229553", "0.64886206", "0.644988", "0.64486545", "0.64356935", "0.6435421", "0.64329886", "0.6409118", "0.6408549", "0.6398264", "0.6384246", "0.6373837", "0.6372915", "0.63689816", "0.6341841", "0.63381946", "0.633369", "0.6331585", "0.6330828", "0.6326381", "0.6322479", "0.6305821", "0.6300207", "0.6265923", "0.6264666", "0.6245715", "0.62301296", "0.6226522", "0.622472", "0.6217363", "0.6208904", "0.6207209", "0.6194397", "0.6190885", "0.61866546", "0.6179413", "0.6177827", "0.61693865", "0.6153431", "0.6146173", "0.61440456", "0.6140083", "0.6133523", "0.61314464", "0.6130185", "0.61225265", "0.6118267", "0.6108727", "0.6108263", "0.6103199", "0.61018217", "0.6101379", "0.60983956", "0.6094292", "0.60767996", "0.6069429", "0.6065288", "0.6064005", "0.6055157", "0.60546386", "0.60499597", "0.6029472", "0.6027249", "0.60245156", "0.6017298", "0.60070163", "0.60038316", "0.599764", "0.59825903", "0.5978844", "0.5978412", "0.5977093", "0.5968648", "0.5963715", "0.5960309", "0.5954952", "0.5950903", "0.5941836", "0.5932421", "0.593242", "0.5925738", "0.5922778", "0.59223276", "0.59207624", "0.5914102", "0.59006554" ]
0.7843579
0
end of getRecByEmail() ==== getRecByNameEmail() =============================================== Check how many rows exists in the database with the name & email parameters. Parameters: $name string of a name $email string of an email Return: $res string number of rows found ========================================================================
protected function getRecByNameEmail(string $name, string $email) { $sql = "SELECT COUNT(*) FROM " . $this->formsTableName . " WHERE name = ? AND email = ?"; $stmt = $this->connect()->prepare($sql); $stmt->bindParam(1, $name, \PDO::PARAM_STR); $stmt->bindParam(2, $email, \PDO::PARAM_STR); $stmt->execute(); $res = $stmt->fetchAll(); return $res[0]['COUNT(*)']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailTaken($email) {\n\t$db = connectDB();\n $sql = <<<SQL\n \tSELECT userID\n \tFROM users\n \tWHERE email = ?\nSQL;\n\n $statement = $db->prepare($sql);\n $statement->bind_param(\"s\", $email);\n $statement->execute();\n $statement->store_result();\n\t$res = $statement->num_rows;\n\n\t$statement->close();\n\t$db->close();\n\n return $res;\n}", "public function checkDuplicateEmail( $email )\n {\n include(\"config/database.php\");\n try {\n $sql = \"SELECT email FROM students where email='$email'\";\n $result = $pdoCon->prepare($sql);\n $result->execute();\n $rows = $result->rowCount();\n } catch (Exception $e) {\n echo \"Unable to retrieved results\";\n exit;\n }\n return $rows;\n }", "protected function getRecByEmail(string $email) {\n $sql = \"SELECT COUNT(*) FROM \" . $this->formsTableName . \" WHERE email = ?\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->bindParam(1, $email, \\PDO::PARAM_STR);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return $res[0]['COUNT(*)'];\n }", "public function searchIfMailExists($email)\n {\n $reqmail = $this->db->prepare(\"SELECT * FROM users WHERE email = ?\");\n $reqmail->execute(array($email));\n $mailexist = $reqmail->rowCount();\n\n return $mailexist;\n }", "function isEmailPresent($email = NULL){\t\t\t\n\t\t$query = \" SELECT id\";\n\t\t$query .= \" FROM \" . $this->config->item('ems_organisers','dbtables');\n\t\t$query .= \" WHERE email = ? \";\t\t\n\t\t$dataBindArr = array($email);\n\t\t$res = $this->db->query($query, $dataBindArr);\n\t\t$resArr = $res->result();\t\t\n\t\treturn count($resArr);\n\t}", "private function isUserExists($email) {\n \n $result = $this->con->query(\"SELECT iduser from user WHERE email = '\".$email.\"';\");\n $num_rows=$result->num_rows;\n \n \n return $num_rows;\n }", "static function email_available($email) {\n global $con;\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"';\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function email_exists($email){\n $sql = \"SELECT id FROM users WHERE email='$email'\";\n $result = query($sql);\n\n if(row_count($result)==1){\n return true;\n }else{\n return false;\n }\n}", "function numberOfSameEmailAddress($email) {\n $sql = \"SELECT * FROM member WHERE email = '\" . $email . \"'\";\n $result = getAll($sql);\n\n return count($result);\n}", "function existUser($email){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT COUNT(*) AS Registered FROM User WHERE email='\" . $email . \"'\";\n\n\t\t$result = $conn->query($query);\n\n\t\tif($result->num_rows != 1){\n\t\t\techo \"Error selecting \" . $email . \" user\";\n\t\t}else{\n\t\t\t$assocResult = $result->fetch_assoc();\n\t\t\treturn $assocResult['Registered'];\n\t\t}\n\t}", "function recipientExists($id_email, $recip_email, $recip_name) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT * FROM scuola.email_recipients WHERE\n id_email = %s AND\n email = '%s' AND\n name = '%s'\", $id_email, $recip_email, $recip_name);\n\n // Perform Query\n $result = mysql_query($query);\n if (!$result) {\n setcookie('message', mysql_error());\n }\n }\n $this->closeConnection();\n return mysql_num_rows($result) == 1;\n }", "function emailExists($email){\r\n $sql = \"SELECT email FROM users WHERE email = '$email'\";\r\n $count = $this->q($sql)->num_rows;\r\n if ($count > 0 ){ return true; } else{ return false; }\r\n }", "function emailExist($dbx, string $targetEmail){\n // debug($dbx->count(\"SELECT * FROM user WHERE email = ?\",[$targetEmail]));\n return $dbx->count(\"SELECT * FROM user WHERE email = ?\",[$targetEmail]);\n}", "function email_exist($email) {\n\n $sql = \"SELECT id FROM users WHERE email = '$email'\";\n\n $result = query($sql);\n \n if(row_count($result) == 1) {\n return true;\n } else {\n return false;\n }\n}", "public function user_if_email_exists($email)\n\t{\n\t\t$sql = \"SELECT id FROM \".$this->table.\" WHERE email = ?\";\n\t\t$data = array($email);\n\t\t$query = $this->db->query($sql, $data);\n\t\treturn $query->num_rows();\n\t}", "function userExist($email){\n $users = json_decode($this->getAll());\n foreach ($users as &$user) {\n if($user->email == $email){\n return $user->counter;\n }\n }\n return NULL;\n }", "function checkUserByEmail($email)\n{\n // Make Database Connection\n $objDB = objDB();\n\n // Make The Statement\n $stmt = $objDB->prepare('SELECT * FROM users WHERE email=?');\n\n // Bind The Paramters\n $stmt->bind_param('s', $email);\n\n // execute\n $stmt->execute();\n\n // Store The Result\n $stmt->store_result();\n\n // Return Numbers of rows\n return $stmt->num_rows;\n}", "function search_by_email($tableName,$email) // searching employee by email\r\n {\r\n $conn = self::build_connection();\r\n $sql = \"select * from \".$tableName .\" WHERE email='{$email}'\";\r\n $result = $conn->query($sql);\r\n self::close_connection($conn);\r\n if($result->num_rows > 0){ //if value >0 true\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function email_exists($email)\n {\n // 1. Connect to the database.\n $link = connect();\n\n // 2. Protect variables to avoid any SQL injection\n $email = mysqli_real_escape_string($link, $email);\n\n // 3. Generate a query and return the result.\n $result = mysqli_query($link, \"\n SELECT id\n FROM tbl_users\n WHERE email = '{$email}'\n \");\n\n // 4. Disconnect from the database.\n disconnect($link);\n\n // 5. There should only be one row, or FALSE if nothing.\n return mysqli_num_rows($result) >= 1;\n }", "public function check_user_exist($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from users WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "function email_exists($email){\n include 'connection.php';\n $query = \"SELECT email FROM basicusers WHERE email = '$email'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n for($i=0; $i<$rows; $i++){\n $result->data_seek($i);\n $row = $result->fetch_array(MYSQLI_ASSOC);\n if($row['email'] == $email){\n return true;\n }\n else return false;\n }\n}", "function check_email_duplicate(){\n $this->SQL = \"SELECT email FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n return $this->results;\n \n }", "public function searchUser($email) {\r\n\r\n\t\t//TODO: Look at bookmark class for sample try/catch block around DB code\r\n\t\t$sqlObj = new DataBase();\r\n\t\t$found = FALSE;\r\n\r\n\t\t$query = \"SELECT * FROM `user_credentials` WHERE `email`='$email'\";\r\n\r\n\t\ttry {\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$resultset = $sqlObj->GetData();\r\n\r\n\t\t\t$num = $sqlObj->getNumberOfRecords();\r\n\t\t} catch (MyException $e) {\r\n\t\t\t$e->getMyExceptionMessage();\r\n\t\t}\r\n\t\tif ($num == 1) {\r\n\t\t\t$id = $resultset[0]['id'];\r\n\t\t\t$found = $id;\r\n\t\t} else {\r\n\t\t\t$found = -1;\r\n\t\t}\r\n\t\t$sqlObj->destroy();\r\n\r\n\t\treturn $found;\r\n\t}", "public function findEmail($email = \"[email protected]\") {\n\t\t$users = $this->em->createQuery ( \" SELECT PARTIAL u.{id} FROM App\\Entity\\User u WHERE u.email = ?1 \" )->setParameter ( 1, $email )->execute ();\n\t\treturn count ( $users );\n\t}", "public function emailExist($email){\n\t\t$query = $this->_db->prepare('SELECT COUNT(*) FROM utilisateur WHERE email=:email');\n\t\t$query->execute(array(':email' => $email));\n\t\t//get result\n\t\treturn (bool) $query->fetchColumn();\n\t}", "public function emailExists ($email){\n $con = connectPDO();\n $query = $con->prepare(\"SELECT COUNT(id) FROM users WHERE email = ?\");\n $query->execute(array($email));\n $rowcount = $query->fetchColumn();\n if ($rowcount > 0) {\n return true;\n }else{\n return false;\n }\n }", "public function check_user_exist_android($email){\n\n $query = $this -> conn -> prepare('SELECT COUNT(*) from androidusers WHERE email =:email');\n $query -> execute(array('email' => $email));\n\n if($query){\n\n $row_count = $query -> fetchColumn();\n\n if ($row_count == 0){\n\n return false;\n\n } else {\n\n return true;\n\n }\n } else {\n\n return false;\n }\n }", "function sql_nemails($email)\n{\n global $connection, $trace, $tblmembre;\n $select = \"$tblmembre\";\n $tables = explode(\",\",$select);\n $where = \"\";\n for ($i=0;$i<count($tables);$i++) {\n $fields_array = sql_fields($tables[$i],'array');\n for ($j=0;$j<sql_fields($tables[$i],'');$j++) {\n if (strstr($fields_array[$j], \"email\")) {\n if\t($where !== '')\t$where .= \"OR\"\t;\n $where .= \" $fields_array[$j]='$email' \";\n }\n }\n }\n $sql = mysqli_query($connection, \"SELECT * FROM $select WHERE $where\");\n $row = mysqli_num_rows($sql);\n return $row;\n}", "public static function existeEmail($email){\n $db = DWESBaseDatos::obtenerInstancia();\n\n $db -> ejecuta(\"SELECT count(*) as cantidad\n FROM usuario WHERE email = ?\", $email);\n $datos= $db->obtenDatos();\n if ($datos[0]['cantidad'] > 0) {\n //echo 'true' .' es verdad';\n return true;\n }else{\n //echo 'false' .' no existe';\n return false;\n }\n\n }", "public function check_email_existence() {\n\t\t$email = $_GET['email'];\n\t\t$checkExistEmail = $this->User->find('count', array('conditions'=>array('User.email' => $email)));\n\t\techo $checkExistEmail;\n\t\texit();\n\t}", "public function checkMailUserExist()\n {\n $checkMailPatientExist = $this->db->prepare(\n 'SELECT \n COUNT(id) AS isIdPatientExist\n FROM `dom20_users`\n WHERE `mail` = :mail\n '\n );\n $checkMailPatientExist->bindvalue(':mail', $this->mail, PDO::PARAM_STR);\n $checkMailPatientExist->execute();\n $data = $checkMailPatientExist->fetch(PDO::FETCH_OBJ);\n return $data->isIdPatientExist;\n }", "function check_if_email_is_in_use($email){\n\n $query = $this->db->get_where('tbl_doctor_account', array('dacc_email' => $email));\n return $query->num_rows();\n\n }", "public function buscaEmail($email)\n {\n \n $query = $this->db\n ->where('email', $email)\n ->get('clientes');\n\n return $query->num_rows();\n }", "public function availableEmail($email)\n {\n\n $pdo = DB::connect();\n $stmt = $pdo->prepare(\"SELECT COUNT(id) FROM users WHERE email = :email\");\n $stmt->bindParam(':email', $email);\n $stmt->execute();\n $result = $stmt->fetchColumn();\n\n if ($result > 0) {\n return false;\n } else {\n return true;\n }\n }", "function check_mail($email){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"SELECT mail FROM utilisateur WHERE mail = :email\");\n\t\t$req->execute(array(\"email\"=>$email));\n\n\t\t$exist = $req->rowCount();\n\t\t$req->closeCursor();\n\n\t\treturn $exist;\n\t}", "function present($rname)\n{\n\ttry{\n\t\t$DBH = openDBConnection();\n\t\t\n\t\t$stmt = $DBH->prepare(\"select count(RName) from Resume where RName = ? and Login = ?\");\n\t\t$stmt->bindValue(1, $rname);\n\t\t$stmt->bindValue(2, $_SESSION['login']);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetch();\n\t\t\n\t\tif($result['count(RName)'] == '0')\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\tcatch (PDOException $e){\n\t\t\n\t}\n}", "public function isEmailExist($email){\n\n $stmt = $this->con->prepare(\"SELECT uid FROM users WHERE email = ?\");\n $stmt->bind_param(\"s\",$email);\n $stmt->execute();\n $stmt->store_result();\n return $stmt->num_rows > 0;\n\n }", "function email_exists($email) {\n $email = sanitize($email);\n $query = mysql_query(\"SELECT COUNT(`user_id`) FROM `users` WHERE `email` = '$email'\");\n return (mysql_result($query, 0) == 1) ? true : false;\n}", "public function isEmailExist($email){ \n $query = mysqli_query($this->database, \"SELECT * FROM users WHERE Gmail = '$email'\"); \n $row = mysqli_num_rows($query); \n if($row > 0){ \n return true; \n } else { \n return false; \n } \n }", "function email_exists($email)\n {\n $sql = \"\n SELECT id\n FROM {$this->_db}\n WHERE email = \" . $this->db->escape($email) . \"\n LIMIT 1\n \";\n\n $query = $this->db->query($sql);\n\n if ($query->num_rows())\n {\n return TRUE;\n }\n\n return FALSE;\n }", "function MailExists($email) {\n\n\t$query = \"SELECT email FROM usuarios WHERE email = '$email'\";\n\t$result = DBExecute($query);\n\n\tif (mysqli_num_rows($result) <= 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function emailExists($email) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT email FROM users WHERE email = ?\",array($email));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "private function checkEmail(){\n\n $request = $this->_connexion->prepare(\"SELECT COUNT(*) AS num FROM Users WHERE user_email=?\");\n $request->execute(array($this->_userEmail));\n $numberOfRows = $request->fetch();\n\n if($numberOfRows['num'] == 0)\n return false;\n else\n return true;\n\n }", "function emailExists(){\n\t\t\t\t \n\t\t\t\t // query to check if email exists\n\t\t\t\t $query = \"SELECT rep_id, rep_name, rep_surname, rep_pwd, rep_email\n\t\t\t\t FROM \" . $this->table . \"\n\t\t\t\t WHERE rep_email = :rep_email\n\t\t\t\t LIMIT 0,1\";\n\t\t\t\t \n\t\t\t\t // prepare the query\n\t\t\t\t $stmt = $this->conn->prepare($query);\n\t\t\t\t \n\t\t\t\t // sanitize\n\t\t\t\t $this->rep_email=htmlspecialchars(strip_tags($this->rep_email));\n\t\t\t\t \n\t\t\t\t // bind given email value\n\t\t\t\t $stmt->bindParam(':rep_email', $this->rep_email);\n\t\t\t\t \n\t\t\t\t // execute the query\n\t\t\t\t $stmt->execute();\n\t\t\t\t \n\t\t\t\t // get number of rows\n\t\t\t\t $num = $stmt->rowCount();\n\t\t\t\t \n\t\t\t\t // if email exists, assign values to object properties for easy access and use for php sessions\n\t\t\t\t if($num>0){\n\t\t\t\t \n\t\t\t\t // get record details / values\n\t\t\t\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t \n\t\t\t\t // assign values to object properties\n\t\t\t\t $this->rep_id = $row['rep_id'];\n\t\t\t\t $this->rep_name = $row['rep_name'];\n\t\t\t\t $this->rep_surname = $row['rep_surname'];\n\t\t\t\t $this->rep_pwd = $row['rep_pwd'];\n\t\t\t\t $this->rep_email = $row['rep_email'];\n\t\t\t\t \n\t\t\t\t // return true because email exists in the database\n\t\t\t\t return true;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t // return false if email does not exist in the database\n\t\t\t\t return false;\n\t\t\t\t}", "public function check_email($mail,$user_id)\r\n {\r\n try\r\n {\r\n $ret_=0;\r\n $s_qry=\"Select count(*) as i_total \"\r\n .\"From \".$this->tbl_recom.\" \"\r\n .\" Where s_referred_email='\".$mail.\"' AND i_referrer_id=\".$user_id;\r\n\t\t\t\t\r\n $rs=$this->db->query($s_qry);\r\n\t\t \r\n\t\t $s_qry1=\"Select count(*) as i_total \"\r\n .\"From \".$this->tbl_user.\" \"\r\n .\" Where s_email='\".$mail.\"' \";\r\n\t\t\t\t\r\n $rs1=$this->db->query($s_qry1);\r\n $i_cnt=0;\r\n\t\t// echo $ret_;\r\n if($rs->num_rows()>0)\r\n {\r\n\t\t \t foreach($rs->result() as $row)\r\n {\r\n $ret_=intval($row->i_total); \r\n } \r\n\t\t\t// echo $ret_;\r\n\t\t \tif($ret_!=0)\r\n\t\t\t$ret_ =1;\r\n }\r\n\t\t if($rs1->num_rows()>0 &&$ret_==0)\r\n {\r\n\t\t \t foreach($rs1->result() as $row)\r\n {\r\n $ret_=intval($row->i_total); \r\n } \r\n\t\t \tif($ret_!=0)\r\n\t\t\t $ret_ = 2; \r\n }\r\n\t\t // echo $ret_;\r\n \r\n return $ret_;\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n }\r\n }", "function DB_email_existing_check($email){\n $connection = DB_get_connection();\n $queryCheck = \"SELECT * FROM `users` WHERE Email='$email'\";\n $result = mysqli_query($connection, $queryCheck);\n if(mysqli_num_rows($result) > 0){\n \n return true;\n \n }else{\n\n return false;\n\n }\n\n}", "function KTEmail($email){\n\t\t\t\t$sql=\"SELECT * FROM user WHERE Email='$email'\";\n\t\t\t\t$re=mysql_query($sql) or die(mysql_error());\n\t\t\t\t$n=mysql_num_rows($re);\n\t\t\t\tif($n>=1)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}", "private function check_for_email($email)\r\n\t{\r\n\t\t//We make use of the global dbCon that we've created in the config file\r\n\t\tglobal $dbCon;\r\n\r\n\t\t//SQL statement where we Count the occurances (it's faster!)\r\n\t\t$sql = \"SELECT COUNT(id) AS students FROM student WHERE email = ?;\";\r\n\t\t$stmt = $dbCon->prepare($sql); //Prepare Statement\r\n\t\tif ($stmt === false)\r\n\t\t{\r\n\t\t\ttrigger_error('SQL Error: ' . $dbCon->error, E_USER_ERROR);\r\n\t\t}\r\n\t\t$stmt->bind_param('s', $email);\r\n\t\t$stmt->execute(); //Execute\r\n\t\t$stmt->bind_result($students); //Get ResultSet\r\n\t\t$stmt->fetch();\r\n\t\t$stmt->close();\r\n\r\n\t\tif ($students > 0)\r\n\t\t{\r\n\t\t\treturn \"Email is already in system. Try to log in!\";\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}", "function doesEmailExist($email) {\n global $db;\n\n $query = \"SELECT * FROM user WHERE email=:email\";\n $statement = $db->prepare($query);\n $statement->bindValue(':email', $email); \n $statement->execute();\n $results = $statement->fetchAll();\n $statement->closeCursor();\n return (count($results) > 0);\n}", "private function check_If_Email_Exists($email){\r\n\r\n // Prepare query\r\n $query = \"SELECT * FROM `users` WHERE (Fuid = '' AND Guid = '' AND email = '{$email}')\";\r\n\r\n // Send query into server\r\n $this->_db->get_Rows($query);\r\n\r\n // Return result of query\r\n // True - if find\r\n // False - in dont\r\n return ($this->_db->count() > 0 ) ? true : false;\r\n }", "function admin_email_exists($email){\n include 'connection.php';\n $query = \"SELECT email FROM admin_users WHERE email = '$email'\";\n $result = $connection->query($query);\n $rows = $result->num_rows;\n for($i=0; $i<$rows; $i++){\n $result->data_seek($i);\n $row = $result->fetch_array(MYSQLI_ASSOC);\n if($row['email'] == $email){\n return true;\n }\n else return false;\n }\n}", "function get_mail($data) {\n $sql = \"SELECT\n *\n FROM\n logins\n WHERE \n email\n LIKE \n '$data'\n \";\n\n $query = $this->data->prepare($sql);\n $query->execute();\n\n $result = $query->rowCount();\n return $result;\n }", "function franchiseExists($email) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT id\n\t\tFROM \" . $db_table_prefix . \"franchise\n\t\tWHERE\n\t\temail = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}", "function leadExists($email) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT id\n\t\tFROM \" . $db_table_prefix . \"leads\n\t\tWHERE\n\t\temail = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}", "public static function exists($email)\n {\n $conn = new MySqlConnect();\n $isFound = FALSE;\n\n // query the db for the value comparison\n $result = $conn -> executeQueryResult(\"SELECT userId FROM users WHERE emailAddress = '{$email}'\");\n\n // get a row count to verify only 1 row is returned\n $count = mysql_num_rows($result);\n if ($count > 0)\n {\n $isFound = TRUE;\n }\n $conn -> freeConnection();\n return $isFound;\n }", "function isAvailable($email){\n $ask = \"select * from users where email='$email'\";\n global $db;\n\n $result = $db->query($ask);\n\n if($result->num_rows == 1){\n return true;\n }\n else return false;\n}", "public function accountExists($email) {\r\n $this->db = new Db();\r\n \r\n $this->db->scrub($email);\r\n $query = \"SELECT UID FROM MEMBER WHERE EMAIL = '\".$email.\"'\";\r\n $results = $this->db->select($query);\r\n return(sizeof($results)>0);\r\n }", "function exist_email($email, $dbh)\n {\n try {\n $sql = 'SELECT * from users WHERE email LIKE \"' . $email . '\"';\n $res = $dbh->query($sql);\n return ($res->rowCount());\n } catch (PDOException $e) {\n print \"Inscription (exist_email) -> Erreur !: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n }", "function check_email_exist(){\n //TODO syntize the query\n $this->SQL = \"SELECT id,private_name,family_name ,email,password FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n \n \n if ( !empty( $this->results[0]['email'] ) ){\n //found mail - check password\n \n if ($this->results[0]['password'] === $this->params['password']){\n \n $this->success_login();\n \n \n } else {\n // if password incorrect\n $this->results =array( 'results'=>'fail');\n \n }\n \n \n } else {\n //didnt found email \n $this->results =array( 'results'=>'fail');\n \n }\n return $this->results;\n \n }", "function email_exists($email){\n\t\t$emailexistsql = \"SELECT email FROM users WHERE email = :email\";\n\n\t\t$stmt = $database->prepare();\n\n\t\t$stmt->bindParam(':email', $email);\n\n\t\t$stmt->execute();\n\n\t\tif ($stmt->rowCount() > 0){\n\t\t\techo(\"Email Exists\");\n\t\t\treturn true;\n\t\t}\n\t}", "public static function checkDuplicateUser($email)\n\t{\n\t\t$cnt = Doctrine_Query::create()\n\t\t->from(\"User\")->select()->where('email= ?', $email)->andWhere(\"deleted= 0\")->fetchArray();\n\t\t// ->findBy('email', $email)->count();\n\t\t\n\t\treturn count($cnt);\n\t}", "public function check_mail($email) {\n\n\n\t\treturn (mysql_result($this->query(\"SELECT COUNT(`id`) FROM `users` WHERE `email` = '$email'\"), 0) ? true: false);\n\n\t}", "function email_exists($email)\n {\n global $connection;\n $query = \"select user_email from users where user_email = '{$email}'\";\n $result = mysqli_query($connection, $query);\n confirmQuery($result);\n if(mysqli_num_rows($result) > 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function emailExist($email)\n{\n\n global $connection;\n global $errors;\n\n $sql = \"SELECT * FROM tbl_users WHERE email = '$email'\";\n $result = mysqli_query($connection, $sql);\n $row = mysqli_fetch_all($result);\n mysqli_free_result($result);\n\n if (count($row) > 0) {\n\n $errors[] = \"This email has been taken before.\";\n return false;\n }\n\n return true;\n\n}", "public function verifyEmailExists($email)\r\n\t{\r\n\t\t$emailFull = $email['email'];\r\n\t\t\r\n\t\t$consult = $this->dbAdapter->query(\"SELECT count(email) as count FROM users WHERE email='$emailFull'\",Adapter::QUERY_MODE_EXECUTE);\r\n\t\t\r\n\t\t$result = $consult->toArray();\r\n\r\n\t\treturn $result;\r\n\t}", "function isUserExist($email)\n\t{\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ?\");\n\t\t$stmt->bind_param(\"s\", $email);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}", "function checkExistingEmail($clientEmail){\n $db = acmeConnect();\n $sql = 'SELECT clientEmail FROM clients WHERE clientEmail = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $clientEmail, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n }\n}", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->Admins->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function Check_Email_Exists($email)\n\t\t{\n\t\t\tglobal $connection;\n\t\t\t$sql = \"call users_email_check('$email')\";\t\t\t\t\t\n\t\t\t$connection->next_result();\n\t\t\tif($retrieved = $connection->query($sql))\n\t\t\t{\t\t\t\n\t\t\t\tif($retrieved->num_rows)\n\t\t\t\t{\n\t\t\t\t\treturn 0 ; // email in use\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn 1; // email not found\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\n\t\t\t\treturn 1 ; \n\t\t\t}\n\t\t}", "private function isUserExists($email) {\n $stmt = $this->con->prepare(\"SELECT id from users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "public function exist_email()\r\n {\r\n $email = $this->input->post('email');\r\n \r\n $this->load->model('frontend/user_model');\r\n \r\n $record = $this->user_model->select('COUNT(id) as total')->find_by(array('email' => $email));\r\n \r\n if ($record->total == 0)\r\n echo false;\r\n else\r\n echo true; \r\n }", "function emailExists($email) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT active\n\t\tFROM \" . $db_table_prefix . \"users\n\t\tWHERE\n\t\temail = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}", "function checkForAccount($email, $db) {\n $sql = 'SELECT email FROM users WHERE email = :email';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':email', $email, PDO::PARAM_STR);\n $stmt->execute();\n $matchEmail = $stmt->fetch(PDO::FETCH_NUM);\n $stmt->closeCursor();\n if(empty($matchEmail)){\n return 0;\n } else {\n return 1;\n \n }\n }", "function email_exists($db, $email)\n{\n\t$sql = 'SELECT * FROM users where email=:email';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':email'=>$email));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}", "function checkEmail($email){\n\t\t\t$database = new connect();\n\t\t\t$result = false;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM users WHERE email='$email'\";\n\t\t\t$resultQuery = mysql_query($query); \n\t\t\t\n\t\t\tif(mysql_num_rows($resultQuery) == 1){\n\t\t\t\t$result = true;\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function emailExist($link, $useremail) {\n\t\t// use escape function to avoid sql injection attacks\n\t\t$email = mysqli_real_escape_string($link, $_POST[$useremail]);\n\t\t$query = \"SELECT `email` FROM users WHERE email='\".$email.\"'\";\n\n\t\t$result = mysqli_query($link, $query);\n\t\treturn mysqli_num_rows($result);\n\t}", "public function email_check($str){ \n $con = array( \n 'returnType' => 'count', \n 'conditions' => array( \n 'email' => $str \n ) \n ); \n $checkEmail = $this->User->getRows($con); \n if($checkEmail > 0){ \n $this->form_validation->set_message('email_check', 'The given email already exists.'); \n return FALSE; \n }else{ \n return TRUE; \n } \n }", "public function consultaEmail($email){\n \n if (filter_var($email, FILTER_VALIDATE_EMAIL)){\n \n $sql = new Sql();\n $res = $sql->select('SELECT * FROM usuarios \n WHERE email_usuario = :email_usuario',array(\n ':email_usuario'=>$email));\n \n if(count($res)>0){\n return 1001;//caso SIM email ja esta em uso\n }else{\n return 0;//tudo certo email NAO ESTA em uso\n }\n\n }else{\n return 1002;//email informado nao e valido\n }\n \n }", "function userEmailTaken($email){\r\n\t $email = mysql_real_escape_string($email);\r\n if(!get_magic_quotes_gpc()){\r\n $email = addslashes($email);\r\n }\r\n $q = \"SELECT email FROM users WHERE email = '$email'\";\r\n $result = mysql_query($q, $this->connection);\r\n return (mysql_numrows($result) > 0);\r\n }", "function email_existe($email){\n\t$sql = \"SELECT id FROM usuarios WHERE email = '$email'\";\n\n\t$resultado = query($sql);\n\n\tif(contar_filas($resultado) == 1){\n\n\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n\n}", "public function email_check($str){\n $con['returnType'] = 'count';\n $con['conditions'] = array('email'=>$str);\n $checkEmail = $this->user->getRows($con);\n if($checkEmail > 0){\n $this->form_validation->set_message('email_check', 'The given email already exists.');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function exist_user($conn,$column_name,$column_value,$table_name)\r\n\t{\r\n\t\t$qry=\"select count(*) as count from $table_name where $column_name='$column_value'\";\r\n\t\t$res=mysql_query($qry);\r\n\t $result=mysql_fetch_array($res);\r\n\t $email_count=$result['count'];\r\n\t\t\tif($email_count>0)\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\t}", "public function checkUserExist($email)\n {\n $sql = \"SELECT `id` FROM `user` WHERE email = '$email'\";\n $query = $this->db->prepare($sql);\n $query->execute();\n $result = $query->fetchAll();\n $count = sizeof($result);\n if ($count > 0)\n return true;\n else return false;\n }", "function emailExists($email)\n\t{\n\t\tglobal $db,$db_table_prefix;\n\t\n\t\t$sql = \"SELECT Active FROM \".$db_table_prefix.\"Users\n\t\t\t\tWHERE\n\t\t\t\tEmail = '\".$db->sql_escape(sanitize($email)).\"'\n\t\t\t\tLIMIT 1\";\n\t\n\t\tif(returns_result($sql) > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\t\n\t}", "function checkIfExsits($email){\n global $mysqli;\n $sql = \"SELECT * FROM users WHERE `email`='$email'\";\n $results = $mysqli->query( $sql );\n if ($results->num_rows !=0){\n return true;\n } else{\n return false;\n }\n}", "function check_email_exist($emailCheck) {\n\t\t\t$DBConnect = @mysqli_connect(\"feenix-mariadb.swin.edu.au\", \"s101664795\",\"250394\", \"s101664795_db\")\n\t\t\tOr die (\"<p>Unable to connect to the database server.</p>\". \"<p>Error code \". mysqli_connect_errno().\": \". mysqli_connect_error()). \"</p>\";\n\t\t\t\n\t\t\t$SQLstring = \" SELECT email_address FROM customer WHERE email_address = '\".$emailCheck.\"' \";\n\t\t\t\n\t\t\t$queryResult = @mysqli_query($DBConnect, $SQLstring)\n\t\t\tOr die (\"<p>Unable to query the customer table.</p>\".\"<p>Error code \". mysqli_errno($DBConnect). \": \".mysqli_error($DBConnect)). \"</p>\";\n\n\t\t\t// if number of rows > 0, customer exists\n\t\t\tif (mysqli_num_rows($queryResult)>0) {\n\t\t\t\t// $row = mysqli_num_rows($queryResult);\n\t\t\t\t// clost the result\n\t\t\t\tmysqli_free_result($queryResult);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t// customer not exist\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Connection close\n\t\t\tmysqli_close($DBConnect);\n\t\t}", "function email_exist($link, $email){\n\n $exist = false;\n\n $sql = \"SELECT email FROM users WHERE email = '$email'\";\n $result = mysqli_query($link, $sql);\n\n if( $result && mysqli_num_rows($result) == 1 ){\n\n $exist = true;\n\n }\n\n return $exist;\n\n }", "function checkExistsUser($email){\n\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM user Where email=:email\");\n\t\t$stmt->execute(['email'=>$email]);\n\t\t$result = $stmt->fetchAll();\n\t\t$num_rows = count($result);\n\n\t\tif($num_rows > 0){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getExistingEmail($email)\n {\n $query = \"SELECT identifier FROM \".$this->_name.\" WHERE email = '\".$email.\"'\";\n if(($result = $this->getQuery($query,false)) != NULL)\n {\n return \"yes\";\n }\n else\n return \"no\";\n }", "private function isStaffExists($email) {\n $stmt = $this->conn->prepare(\"SELECT staff_id from staff WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "function verificacioBD($email){\n $conn=connexioBD();\n $usuariExisteix=false;\n $sql=\"SELECT * FROM usuaris WHERE email='$email'\";\n if (!$resultado = $conn->query($sql)) {\n die(\"Error en la consulta\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($usuari=$resultado->fetch_assoc()){\n $usuariExisteix=true; \n }\n }\n $resultado->free();\n $conn->close();\n return $usuariExisteix;\n}", "function email_exist($email)\n {\n $this->db->select(EMAIL_ID);\n $this->db->from(TBL_USERS);\n $this->db->where(EMAIL_ID, $email);\n $query = $this->db->get();\n if ($query->num_rows() == 1) {\n return $query->row();\n } else {\n return false;\n }\n }", "private function isUserExists($email) {\n $stmt = $this->conn->prepare(\"SELECT id FROM app_users WHERE email = ?\");\n $stmt->bind_param(\"s\", $email);\n $stmt->execute();\n $stmt->store_result();\n $num_rows = $stmt->num_rows;\n $stmt->close();\n return $num_rows > 0;\n }", "function checkUserByUsername($email)\n{\n // Make Database Connection\n $objDB = objDB();\n\n // Make The Statement\n $stmt = $objDB->prepare('SELECT * FROM users WHERE username=?');\n\n // Bind The Paramters\n $stmt->bind_param('s', $email);\n\n // execute\n $stmt->execute();\n\n // Store The Result\n $stmt->store_result();\n\n // Return Numbers of rows\n return $stmt->num_rows;\n}", "function emailExists($email)\r\n{\r\n\tglobal $mysqli,$db_table_prefix;\r\n\t$stmt = $mysqli->prepare(\"SELECT active\r\n\t\tFROM \".$db_table_prefix.\"users\r\n\t\tWHERE\r\n\t\temail = ?\r\n\t\tLIMIT 1\");\r\n\t$stmt->bind_param(\"s\", $email);\t\r\n\t$stmt->execute();\r\n\t$stmt->store_result();\r\n\t$num_returns = $stmt->num_rows;\r\n\t$stmt->close();\r\n\t\r\n\tif ($num_returns > 0)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn false;\t\r\n\t}\r\n}", "function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }", "private function alreadyExists($nickname, $mail){\r\n\t\t$command = \"SELECT * FROM Student\r\n\t\tWHERE nickname = '$nickname' OR mail = '$mail'\";\r\n\t\t$db = new Database();\r\n\t\t$result = $db->runCommand($command);\r\n\r\n\t\tif($result == TRUE && $result->num_rows == 1){\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "function verificar_email_usuario($e){\n\t\t\t\t\tinclude('../../conexion.php');/* mediante la consulta busca si concuerda algun usuario */\n\t\t\t\t\t$sql = \"SELECT email from usuarios WHERE status=1 AND BINARY email ='\".$e.\"'\";\n\t\t\t\t\t$rec = mysqli_query($con,$sql)or die(\"valio sombrilla'\".$sql.\"'\"); \n\t\t\t\t\t$count = 0;/* si la consulta es un exito aumenta un contador y como resultado retorna un valor */\n\t\t\t\t\twhile($row = mysqli_fetch_array($rec)){ $count++;}\t\n\t\t\t\t\tif($count == 1){return 1;}\n\t\t\t\t\telse{return 0; }\n\t\t\t}", "function isUserExistsByEmail($email) {\n $query = \"select * from user_profile_details WHERE email='{$email}' \";\n $result_set = mysql_query($query);\n if(isQuerySuccess($result_set)){\n\t\tif (mysql_num_rows($result_set) > 0) { \n\t\t\treturn true;\n\t\t} else { \n\t\t\treturn false;\n\t\t}\t\n\t}\t\n}", "public function check_email($email)\r\n\t{\r\n\t\t$query=$this->db->query(\"SELECT * FROM users WHERE emailid='\".$email.\"'\");\r\n\tforeach ($query->result() as $row)\r\n\t\t{\r\n\t\t$storeid=$row->storeid;\r\n\t\t}\r\n\t\t$rows=$query->num_rows();\r\n\t\t$result=array('afftected_rows'=>$rows,'storeid'=>$storeid);\r\n\t\treturn $result;\r\n\t}" ]
[ "0.72584003", "0.6987202", "0.68426913", "0.680507", "0.67845136", "0.6750169", "0.6718966", "0.67175156", "0.6664361", "0.66412026", "0.6638678", "0.6634671", "0.66083956", "0.6603715", "0.65979105", "0.6587985", "0.6562047", "0.65560746", "0.6551698", "0.6508218", "0.6508178", "0.6488898", "0.64835745", "0.6481918", "0.64234465", "0.6421208", "0.6400808", "0.6395552", "0.63853264", "0.638356", "0.6381437", "0.6378632", "0.63770276", "0.63726187", "0.63673955", "0.636598", "0.63641596", "0.6360007", "0.6352281", "0.63128394", "0.63123184", "0.63109684", "0.62972707", "0.62960225", "0.6278234", "0.6276601", "0.6267195", "0.62632906", "0.6259052", "0.6258976", "0.6255874", "0.62508297", "0.62483084", "0.6243304", "0.6215698", "0.62015086", "0.61991763", "0.61966115", "0.6186275", "0.6184268", "0.6171434", "0.61647683", "0.6160322", "0.61549914", "0.61543876", "0.61411905", "0.6139363", "0.6129777", "0.6119696", "0.6118843", "0.6113896", "0.61125994", "0.61073434", "0.61065984", "0.6099743", "0.60960865", "0.60896933", "0.6088723", "0.6082123", "0.607517", "0.60718864", "0.6070505", "0.6067319", "0.6059281", "0.60506475", "0.60486764", "0.6045009", "0.6042983", "0.60404044", "0.60333246", "0.6018111", "0.6010565", "0.6009589", "0.60075474", "0.6003722", "0.6001209", "0.6000624", "0.59966815", "0.5993051", "0.5986625" ]
0.78417575
0
end of getRecByNameEmail() ==== delRecByEmail() =================================================== Find and delete the oldest contact form using the email parameter Parameters: $email string of a email Return: TRUE row deletion successful FALSE row deletion failed ========================================================================
protected function delRecByEmail(string $email) { try { $sql = "DELETE FROM " . $this->formsTableName . " WHERE email = ? ORDER BY ts ASC LIMIT 1"; $stmt = $this->connect()->prepare($sql); $stmt->bindParam(1, $email, \PDO::PARAM_STR); $stmt->execute(); $res = $stmt->fetchAll(); return TRUE; } catch(PDOException $e) { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeEmail( $email ){\n \n $conn = $this->connect();\n \n $sql = 'select email from ' . $this->dbtable . ' where email = lower(\"' . trim($email) . '\")';\n\t\t\t$query = mysql_query( $sql, $conn);\n\t\t\t\n\t\t\tif( mysql_num_rows( $query ) > 0 ){\n\t\t\t\t$sql = 'delete from ' . $this->dbtable . ' where email = \"' . trim($email) . '\"';\n\t\t\t\tmysql_query( $sql, $conn);\n\t\t\t} else {\n\t\t\t\treturn 'EMAIL NÃO CADASTRADO'; //Email not exists msg\n\t\t\t}\n \n mysql_close( $conn );\n \n return 'EMAIL REMOVIDO COM SUCESSO'; //Email removed sucefully\n }", "public function deleteByEmail($email) {\n\t\treturn $this->delete(array('email' => $email));\n\t}", "public function deleteEddEntries($email)\n { \n $this->edd_gdpr_delete_orders($email); \n }", "public function delete($email);", "public static function remove($email)\n\t{\n\t\t// Delete from database\n\t\t$db = BluApplication::getDatabase();\n\t\t$query = 'DELETE FROM maillist\n\t\t\tWHERE email = \"'.$email.'\"';\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\n\t\t// Remove from constant contact\n\t\t$constantContact = self::_getConstantContact();\n\t\treturn $constantContact->remove($email);\n\t}", "public function deleteContact(EmailAddress $email);", "public function deleteRecord(){\n\t\t/* Variable initialization */\n\t\t$intEmailCode \t= ($this->input->post('txtDeleteRecordCode') !='') ? getDecyptionValue($this->input->post('txtDeleteRecordCode')) : 0;\n\n\t\t/* if email code is not pass then do needful */\n\t\tif($intEmailCode == 0){\n\t\t\t/* Return error message */\n\t\t\tjsonReturn(array('status'=>0,'message'=>\"Invalid email template code requested.\"), true);\n\t\t}\n\t\t/* Setting the updated array */\n\t\t$strUpdatedArr\t= array(\n\t\t\t\t\t\t\t\t\t'table'=>$this->_strPrimaryTableName,\n\t\t\t\t\t\t\t\t\t'data'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t'deleted'=>1,\n\t\t\t\t\t\t\t\t\t\t\t\t'updated_by'=>$this->getUserCode(),\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'where'=>array(\n\t\t\t\t\t\t\t\t\t\t\t\t'id'=>$intEmailCode\n\t\t\t\t\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\t\t);\n\t\t/* Updating the requested record set */\n\t\t$intNunberOfRecordUpdated = $this->_objDataOperation->setUpdateData($strUpdatedArr);\n\n\t\tif($intNunberOfRecordUpdated > 0){\n\t\t\tjsonReturn(array('status'=>1,'message'=>'Requested email template deleted successfully.'), true);\n\t\t}else{\n\t\t\tjsonReturn(array('status'=>0,'message'=>DML_ERROR), true);\n\t\t}\n\n\t\t/* removed variables */\n\t\tunset($strUpdatedArr);\n\t}", "private function delete_email($email = false, $email_id = false, $delete_code = false) {\n\n\t\tif(($delete_code) && ($email_id)) {\n\n $search = Emails::find('first', array(\n 'conditions' => array(\n '_id' => $email_id,\n 'DeleteCode' => $delete_code,\n\t\t\t\t\t\t'Verified' => false,\n 'Default' => false,\n ) ))->delete();\n\t\t}elseif($email) {\n\n\t\t\t$search = Emails::find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Email' => $email,\n\t\t\t\t\t\t'Verified' => false,\n\t\t\t\t\t\t'Default' => false)\n\t\t\t\t\t\t))->delete();\n\t\t}\n\t}", "public function deleteFromDb() {\n\n // calling configuration of database\n include('database/config.php');\n\n // Accessing cookie stored in validate-user-login.php\n $email = $_COOKIE['email'];\n\n // Removing data by using json_remove function\n $result = mysqli_query($connection, \"UPDATE users SET contact=json_remove(contact, '$.{$this->contactToDelete}') WHERE email='$email'\");\n\n // Refreshing page by redirecting\n header(\"Location: main.php#\");\n }", "function do_delete_additional_email($s_id, $contacts_id) {\n\t# Dim some Vars:\n\t\tglobal $_DBCFG, $db_coin;\n\n\t# Do purge contact\n\t\t$query\t= 'DELETE FROM '.$_DBCFG['suppliers_contacts'].' WHERE contacts_id='.$contacts_id.' AND contacts_s_id='.$s_id;\n\t\t$db_coin->db_query_execute($query) OR DIE(\"Unable to complete request\");\n\t\treturn $db_coin->db_query_affected_rows();\n}", "function removeEmail($email) {\n\t$query = sprintf(\"DELETE FROM Emails WHERE email='%s'\",\n\t\tmysql_real_escape_string($email)\n\t);\n\t\n\tdb_query($query);\n}", "public function remove_row() {\n\t\t\t$email = $this->input->post('email');\n\n\t\t\t$this->load->model('users_table');\n\t\t\t$data = $this->users_table->remove_row($email);\n\t\t}", "function removeEmail($email) {\n\t\tglobal $polarbear_db;\n\t\t$emailSafe = $polarbear_db->escape($email);\n\t\t$sql = \"DELETE FROM \" . POLARBEAR_DB_PREFIX . \"_emaillist_emails WHERE listID = '{$this->id}' AND email = '$emailSafe'\";\n\t\t$polarbear_db->query($sql);\n\t}", "public function remove($email)\n {\n $retorno = 'false';\n if (($position = $this->findUser('Email', $email)) !== false) {\n unset($this->registros[$position]);\n $this->saveFileJson();\n $retorno = 'true';\n }\n return $retorno;\n }", "public static function deleteMessage($name,$email) {\n $query = \"DELETE from message where name = '$name' and email = '$email' \";\n $result = mysql_query($query);\n return $result;\n }", "public function deleted(Email $email)\n {\n //\n }", "function hapus($email) {\n\tglobal $conn;\n\tmysqli_query($conn, \"DELETE FROM pengguna WHERE email='$email'\");\n\n\treturn mysqli_affected_rows($conn); \n}", "function deleteRecord(mysqli $conn, $email){\r\n $sql = \"DELETE FROM users WHERE email = '$email'\";\r\n $result = $conn->query($sql);\r\n if(!$result){\r\n echo \"Failed to delete record\";\r\n // End if()\r\n }\r\n// Close function\r\n}", "function delete_contact()\n {\nrequire_once 'Zend/Loader.php';\nZend_Loader::loadClass('Zend_Gdata');\nZend_Loader::loadClass('Zend_Gdata_ClientLogin');\nZend_Loader::loadClass('Zend_Http_Client');\nZend_Loader::loadClass('Zend_Gdata_Query');\nZend_Loader::loadClass('Zend_Gdata_Feed');\n\n// set credentials for ClientLogin authentication\n$user = \"[email protected]\";\n$pass = \"guessme\";\n\n// set ID of entry to delete\n// from <link rel=edit>\n$id = 'http://www.google.com/m8/feeds/contacts/default/base/29e98jf648c495c7b';\n\ntry {\n // perform login and set protocol version to 3.0\n $client = Zend_Gdata_ClientLogin::getHttpClient(\n $user, $pass, 'cp');\n $client->setHeaders('If-Match: *');\n $gdata = new Zend_Gdata($client);\n $gdata->setMajorProtocolVersion(3);\n \n // delete entry\n $gdata->delete($id);\n echo '<h2>Delete Contact</h2>';\n echo 'Entry deleted';\n} catch (Exception $e) {\n die('ERROR:' . $e->getMessage());\n}\n }", "function function_delete($input_array){\t\n\n$email_id = $input_array[\"email_id\"]; \n$email_address = $input_array[\"email_address\"]; \n$datetime_now = $input_array[\"datetime_now\"]; \n\n\nif ($email_id != \"\" ) { \n$sql_command = \"\t\nupdate \tapp_newsletter_email \nset \t\nsystem_delete = 'delete' , \ndatetime_delete = '$datetime_now'\n\nwhere \nemail_id = '$email_id' \n\";\t\t\n$result_update = $this->db->Execute($sql_command);\t\n} //////\n\n\n\nif ($email_address != \"\" ) { \n$sql_command = \"\t\nupdate \tapp_newsletter_email \nset \t\nsystem_delete = 'delete' , \ndatetime_delete = '$datetime_now'\n\nwhere \nemail_address = '$email_address' \n\";\t\t\n$result_update = $this->db->Execute($sql_command);\t\n} //////\n\n\nif (!$result_update) {$show_status = \"error\" ; } else { $show_status = \"success\" ; }\n\n$result_return = array(\n\"show_status\"=>\"$show_status\" , \n\"email_id\"=>\"$email_id\" , \n);\nreturn $result_return ;\t\n\t\t\n}", "function deleterec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n \tshowrecnav(\"del\", $recid, $count);\r\n?>\r\n\t<br>\r\n\t<form action=\"company/processCompany.php?status=true&action=delete\" method=\"post\">\r\n\t\t<input type=\"hidden\" name=\"sql\" value=\"delete\">\r\n\t\t<input type=\"hidden\" name=\"customer_id\" value=\"<?php echo $row[\"customer_id\"] ?>\">\r\n\t\t<?php showrow($row, $recid) ?>\r\n\t\t<p><input type=\"submit\" name=\"action\" value=\"Confirm\"></p>\r\n\t</form>\r\n<?php\r\n mysqli_free_result($res);\r\n}", "function delContact ($p) {\r\n\r\n\t// pre checks\r\n\tif (!isAdmin()) return false;\r\n\tif (!isset($p['user'])) return false;\r\n\tif (empty($p['user'])) return false;\r\n\r\n\t// security\r\n\t$userPrep = prepareDBValue($p['user']);\r\n\r\n\t// get contact id\r\n\t$dbResult = queryDB('select id from contacts where username=\\'' . $userPrep . '\\'');\r\n\tif (!isset($dbResult[0]['id'])) return false;\r\n\t$userID = $dbResult[0]['id'];\r\n\r\n\t// delete all notifications assigned to the posted contact\r\n\tqueryDB('delete from notifications_to_contacts where contact_id=\\'' . $userID . '\\'');\r\n\r\n\t// disable all notifications and change usernames of all notifications owned by this user\r\n\tqueryDB('update notifications set active=\\'0\\', username=\\'' . prepareDBValue('[' . $p['user'] . ']') . '\\' where username=\\'' . $userPrep . '\\'');\r\n\r\n\t// finally, delete the user\r\n\tqueryDB('delete from contacts where id=\\'' . $userID . '\\'');\r\n\r\n\treturn true;\r\n\r\n}", "public function forceDeleted(Email $email)\n {\n //\n }", "function delete_contact_from_list($cat_id, $email) {\n require_once 'createsend-php-5.1.2/csrest_subscribers.php';\n $auth = array('api_key' => CM_API_KEY);\n\n $wrap = new CS_REST_Subscribers(get_term_meta($cat_id, 'list_id', true), $auth);\n $result = $wrap->delete($email);\n}", "public function delEmail($id)\n {\n\n $this->db->query('DELETE FROM email_list WHERE em_id = :id');\n $this->db->bind(':id', $id);\n\n // Execute\n if ($this->db->execute()) {\n return true;\n } else {\n return false;\n }\n }", "function aaModelDeleteIEmailAccount($imailid) {\r\n\r\n\tglobal $pdo_conn, $pdo_t;\r\n\r\n\t$sql = \"DELETE FROM \".$pdo_t['t_iemail'].\" WHERE IMAILID = :imailid\";\r\n\t\t\r\n\t$q = $pdo_conn->prepare($sql);\r\n\t$q->execute(array('imailid' => $imailid));\r\n\t\t\r\n\theader('Location: '.$_SERVER['REQUEST_URI']);\r\n\texit;\r\n\r\n}", "public function delete_user($email) \n\t{\n\t\treturn $this->vpopmail_readline(sprintf(\"D %s\", $email));\n\t}", "public function deleteUser($email) {\r\n\t\t$sqlObj = new DataBase();\r\n\t\t$id = (int) $this->searchUser($email);\r\n\t\tif ($id != FALSE) {\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`user_credentials` WHERE `user_credentials`.`id`=$id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`user_profile` WHERE `user_profile`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`track` WHERE `track`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`bmk_activity` WHERE `bmk_activity`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`bmk_entry` WHERE `bmk_entry`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t$query = \"DELETE FROM `db_tackster`.`bmk_activity` WHERE `bmk_activity`.`uc_id` = $id\";\r\n\t\t\t$sqlObj->DoQuery($query);\r\n\t\t}\r\n\t\t$sqlObj->destroy();\r\n\t}", "function delete($email) {\n return $this->delete_request($this->_subscribers_base_route.'.json?email='.urlencode($email));\n }", "function delEmailHandler1() {\n global $inputs;\n\n $sql = \"DELETE FROM mail WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}", "function delete_mail($id)\n {\n return $this->db->delete('mail',array('id'=>$id));\n }", "public function Delete() {\r\n\t\t$sql = \"\r\n\t\tDELETE FROM redefinicao_senha\r\n\t\tWHERE email = '$this->email';\r\n\t\t\";\r\n\t\t$DB = new DB();\r\n\t\t\r\n\t\t$DB->open();\r\n\t\t$result =$DB->query($sql);\r\n\t\t$DB->close();\r\n\t\treturn $result;\r\n\t}", "public function deleteResetPassToken($email) {\r\n\t\t$sqlObj = new DataBase();\r\n\t\ttry {\r\n\t\t\t$ucId = (int) $this->searchUser($email);\r\n\t\t} catch (MyException $e) {\r\n\t\t\t$e->getMyExceptionMessage();\r\n\t\t}\r\n\r\n\t\tif ($ucId != -1) {\r\n\t\t\ttry {\r\n\t\t\t\t$query = \"DELETE FROM tkn_password_reset WHERE uc_id='{$ucId}';\";\r\n\t\t\t\t$sqlObj->DoQuery($query);\r\n\t\t\t\t$sqlObj->destroy();\r\n\t\t\t} catch (MyException $e) {\r\n\t\t\t\t$e->getMyExceptionMessage();\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn TRUE;\r\n\t}", "public function delete()\n{\n $query = \"DELETE FROM \" . $this->table_name . \" WHERE `user_id`=:user_id\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n // unique ID of record to be edited\n $this->user_id=htmlspecialchars(strip_tags($this->user_id));\n $stmt->bindParam(':user_id', $this->user_id);\n\n \n if($stmt->execute()){\n return true;\n }\n \n // return false if email does not exist in the database\n $this->errmsg=implode(\",\",$stmt->errorInfo());\n return false;\n}", "public function smartDelete($email)\n {\n $usermdl = new UserModel();\n $this->delete($email);\n $usermdl->smartDelete($email);\n }", "function deleteRecord()\t{\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif (is_array($origArr))\t{\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\tif (!$GLOBALS['TCA'][$this->theTable]['ctrl']['delete'])\t{\t// If the record is fully deleted... then remove the image (or any file) attached.\n\t\t\t\t\t\t\t$this->deleteFilesFromRecord($this->recUid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->cObj->DBgetDelete($this->theTable, $this->recUid, TRUE);\n\t\t\t\t\t\t$this->currentArr = $origArr;\n\t\t\t\t\t\t$this->saved = 1;\n\t\t\t\t\t\t$this->userProcess_alt($conf['edit.']['userFunc_afterDelete'],$conf['edit.']['userFunc_afterDelete.'],array('rec'=>$this->currentArr, 'origRec'=>$origArr));\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t }\n\t\t}\n\t}", "function deleteNullEmail($id_user, $id_email) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"DELETE FROM scuola.email_store WHERE id_user = '%s'\" .\n \" AND id_email = '%s'\" .\n \" AND isnull(data_email)\", $id_user, $id_email);\n\n // Perform Query\n $result = mysql_query($query);\n if (!$result) {\n setcookie('message', mysql_error());\n }//else\n //setcookie('message','Creata nuova Email');\n }\n $this->closeConnection();\n return $result;\n }", "public function eliminarCorreo(){\n\t\t$session = $this->session->userdata['logged_in'];\n\n\t\tif($session[\"is_loged\"] == true){\n\t\t$id = $session['user_id'];\n\t\t$cid = $_REQUEST['cid'];\n\n\t\t$this->load->model('model_correo','correo');\n\t\t$v = $this->correo->deleteEmail($cid,$id);\n\t\tif ($v == 1) {\n\t\t\t$urln = base_url().\"correo/vistaCorreo/\";\n\t\tredirect($urln);\n\t\t}else{\n\t\t\t$urln = base_url().\"correo/vistaCorreo/\";\n\t\tredirect($urln);\n\t\t}\n\t\t}else{\n\t\t\t$urln = base_url().\"user/loginUsuario\";\n\t\t\tredirect($urln);\n\t\t}\n\t}", "function webform_confirm_email_webform_component_delete($component) {\n $nid = (int) $component['nid'];\n $cid = (int) $component['cid'];\n if (!$nid || !$cid) {\n return;\n }\n\n $results = db_query(\n 'SELECT eid ' .\n ' FROM {webform_emails} ' .\n ' WHERE nid = :nid ' .\n ' AND email = :email ',\n array(\n ':nid' => $nid,\n ':email' => $cid\n )\n );\n foreach ($results as $wfemail) {\n if (empty($wfemail->eid)) {\n continue;\n }\n $eid = (int) $wfemail->eid;\n db_delete('webform_confirm_email')\n ->condition('nid', $nid)\n ->condition('eid', $eid)\n ->execute();\n\n // the webform module should take care of the following but since it doesn't...\n db_delete('webform_emails')\n ->condition('nid', $nid)\n ->condition('eid', $eid)\n ->execute();\n }\n}", "public function edd_gdpr_delete_orders($email)\n { \n /*\n * delete order with all information\n */\n global $wpdb;\n \n $delete_customermeta = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}edd_customermeta WHERE customer_id IN (SELECT user_id FROM {$wpdb->prefix}edd_customers WHERE email = %s)\",$email));\n\n $delete_customer = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}edd_customers WHERE email =%s\",$email)); \n \n $delete_purchase = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}posts WHERE ID IN (SELECT post_id FROM {$wpdb->prefix}postmeta WHERE meta_key = %s AND meta_value = %s)\",'_edd_payment_user_email',$email));\n \n\t\t$delete_purchasemeta = $wpdb->query($wpdb->prepare(\"DELETE FROM {$wpdb->prefix}postmeta WHERE post_id IN (select edd_id from(SELECT post_id as edd_id FROM {$wpdb->prefix}postmeta WHERE meta_key = %s AND meta_value = %d) post_ids)\",'_edd_payment_user_email',$email));\n }", "protected function delete_old() {\n // this will delete anything odler than 30 days\n $search = 'BEFORE \"' . date(\"j F Y\", strtotime(\"-30 days\")) . '\"';\n $emails = imap_search($this->mbox, $search, SE_UID);\n if(!empty($emails)){\n foreach($emails as $email){\n try {\n imap_delete($this->mbox, $email, FT_UID);\n }\n catch (\\Exception $e) {\n print \"Error processing email (UID $email): \" . $e->getMessage() . \"\\n\";\n }\n }\n }\n\n imap_expunge($this->mbox);\n }", "public function excluir(){\n\t\tglobal $tabela_links;\n\t\t$consulta = new conexao();\n\t\t$endereco = $consulta->sanitizaString($this->end_link);\n\t\t$funcionalidade_tipo = (int) $this->funcionalidade_tipo;\n\t\t$funcionalidade_id = (int) $this->funcionalidade_id;\n\t\t//echo(\"$endereco\t $funcionalidade_tipo\t$funcionalidade_id\");\n\t\t$consulta->connect();\n\t\t$consulta->solicitar(\"DELETE FROM $tabela_links \n\t\t\t\t\t\t\t\tWHERE endereco = '$endereco'\n\t\t\t\t\t\t\t\tAND funcionalidade_tipo\t= '$funcionalidade_tipo'\n\t\t\t\t\t\t\t\tAND funcionalidade_id\t= '$funcionalidade_id'\");\n\t\t\n\t\n\t}", "public function deregisterUser($email)\n {\n // Create a db instance\n $db = new Database();\n // Create a user DB connection to get data from User_Event_Details table\n $userDB = $db->getUserDBConnection();\n // Query to delete user for the EID\n $query = \"DELETE FROM User_Event_Details WHERE Email='\" . $email . \"' AND EID='\" . $this->eid . \"';\";\n // Prepare query statement\n $stmt = $userDB->prepare($query);\n // Execute query\n return $stmt->execute();\n }", "public function delete()\n {\n $oRemark = oxNew(\"oxRemark\");\n $oRemark->delete(oxRegistry::getConfig()->getRequestParameter(\"rem_oxid\"));\n }", "function _webform_confirm_email_delete_submit($form, &$form_state) {\n\n $node = $form_state['values']['node'];\n $email = $form_state['values']['email'];\n\n if ( isset($email['eid']) == TRUE\n && isset($node->nid) == TRUE) {\n db_query(\n 'DELETE FROM {webform_confirm_email} ' .\n ' WHERE nid = :nid ' .\n ' AND eid = :eid ',\n array(\n ':nid' => $node->nid,\n ':eid' => $email['eid']\n )\n );\n }\n}", "private function deleteUserDepartments($email)\r\n {\r\n $sqlQuery = \"DELETE FROM user_department WHERE useremail = '$email'\";\r\n $this->_dbHandle->exec($sqlQuery);\r\n }", "function AfterDelete($where,&$deleted_values,&$message,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid = $deleted_values['proid'];\n\n\n//get related bill in student record\n$sql_bill= \"select student_bill_id from student_billing where proid='$proid'\";\n$q_bill = db_query($sql_bill,$conn);\n$row_bill=db_fetch_array($q_bill);\n\n//delete payment record\ndo{\n$student_bill_id=$q_bill['student_bill_id'];\n$sql_del2=\"DELETE FROM student_payment WHERE student_bill_id='$student_bill_id'\";\ndb_exec($sql_del2,$conn);\t \n}while($row_bill=db_fetch_array($q_bill));\n\n//then delete student bill\n$sql_del=\"DELETE FROM student_billing WHERE proid='$proid'\";\ndb_exec($sql_del,$conn);\t \n\n\n\n\n\n\n\n\n\n\n\n\n;\t\t\n}", "function del_relais($domain){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"DELETE FROM `relais_mail` WHERE `nom_domain` = :domain\");\n\t\t$req->execute(array('domain'=>$domain));\n\t\t$req->closeCursor();\n\t}", "function deleteContact( $sessionID, $contactID ) {\r\n\t\tif( $this->userCanDeleteContact( $sessionID, $contactID ) ) {\r\n\t\t\r\n\t\t\t// delete attached files and references in db\r\n\t\t\tif(!$this->deleteAllFiles($contactID)){\r\n\t\t\t\techo 'Error deleting files for contact '.$contactID;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t// Michael Thompson * 12/14/2005 * Always delete contact, delete issue if last contact, \r\n\t\t// added code to delete watches, xrefs, etc...\r\n\t\t\t$query = \"select id from contacts where issue in (\r\n\t\t\t\t \tselect issue from contacts where id='$contactID'\r\n\t\t\t\t )\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t// this is the last contact. delete the issue.\r\n\t\t\tif( mysql_num_rows($result) <= 1 ) {\r\n\t\t\t\t$query = \"delete from issues where id in (\r\n\t\t\t\t\t \tselect issue from contacts\r\n\t\t\t\t\t\twhere id='$contactID'\r\n\t\t\t\t\t )\";\r\n\t\t\t\t$result = mysql_query($query);\r\n\t\t\t\t$query = \"delete from `issuealert` where IssueID in (\r\n\t\t\t\t\t \tselect issue from contacts\r\n\t\t\t\t\t\twhere id='$contactID'\r\n\t\t\t\t\t )\";\r\n\t\t\t\t$result = mysql_query($query);\r\n\t\t\t\t$query = \"delete from `issuewatch` where IssueID in (\r\n\t\t\t\t\t \tselect issue from contacts\r\n\t\t\t\t\t\twhere id='$contactID'\r\n\t\t\t\t\t )\";\r\n\t\t\t\t$result = mysql_query($query);\r\n\t\t\t}\r\n\t\t\t// if its not the last contact for the issue, update whos the modifier\r\n\t\t\telse{\r\n\t\t\t\t$modifier = $_SESSION['userid'];\r\n\t\t\t\t$query=\"update issues set modifier='$modifier' where id in (\r\n\t\t\t\t\t \tselect issue from contacts\r\n\t\t\t\t\t\twhere id='$contactID')\";\r\n\t\t\t\t$result = mysql_query($query);\r\n\t\t\t}\r\n\t\t\t// now delete the contact itself\r\n\t\t\t$query = \"delete from contacts where id='$contactID'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t$query = \"delete from `contacts-students` where ContactID='$contactID'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\t$query = \"delete from `contacts-users` where ContactID='$contactID'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "function address_book_contact_deleteform_submit($form_id, $form_values) {\n $contact = address_book_contact_load($form_values['values']['cid']);\n\n // delete contact\n $delete_contact_query = db_delete('edu_contacts')\n ->condition('cid', $contact->cid)\n ->execute();\n\n //delete photo\n $photo = file_load($contact->photo);\n if ($photo) {\n file_delete($photo);\n }\n\n\n drupal_set_message(t('Contact deleted successful'));\n drupal_goto('address_book');\n}", "function deleterec($adata)\n\t{\n\t\t$this->db->where(\"noteman\", $adata[\"noteman\"]);\n\t\t$this->db->delete(\"tblteman\");\n\n\t\t/* ATAU BISA JUGA DENGAN INI\n\t\t$kriteria = array(\"noteman\" => $adata[\"noteman\"]);\n\t\t$this->db->delete(\"tblteman\", $kriteria);\n\t\treturn (($this->db->affected_rows() > 0)?TRUE:FALSE);\n\t\t*/\n\n\t\treturn (($this->db->affected_rows() > 0)?TRUE:FALSE);\n\t}", "public function deleteUsingEmail( $email )\n {\n $customer = Customer::byEmail( $email )->first();\n\n if ( ! $customer instanceof Customer ) {\n throw new NotFoundException([\n 'status' => 'failed',\n 'message' => __( 'Unable to find the customer using the provided email.' )\n ]);\n }\n\n CustomerAddress::where( 'customer_id', $customer->id )->delete();\n $customer->delete();\n\n return [\n 'status' => 'success',\n 'message' => __( 'The customer has been deleted.' )\n ];\n }", "function removeFromCart($email, $id){\n $db = databaseConnection();\n $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $email = $db -> quote($email);\n $query = \"DELETE FROM Carrello WHERE email=$email AND id_prodotto=$id;\";\n $rows = $db -> query($query);\n return 0;\n}", "function deleterec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n \tshowrecnav(\"del\", $recid, $count);\r\n?>\r\n\t<br>\r\n\t<form action=\"products/processProduct.php?status=true&action=delete\" method=\"post\">\r\n\t\t<input type=\"hidden\" name=\"sql\" value=\"delete\">\r\n\t\t<input type=\"hidden\" name=\"cat_id\" value=\"<?php echo $row[\"prod_code\"] ?>\">\r\n\t\t<?php showrow($row, $recid) ?>\r\n\t\t<p><input type=\"submit\" name=\"action\" value=\"Confirm\"></p>\r\n\t</form>\r\n<?php\r\n mysqli_free_result($res);\r\n}", "function delete_contact($contactID) {\r\n $db = Database::getDB();\r\n $query = 'DELETE FROM contact\r\n WHERE contactID = :contactID';\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':contactID', $contactID);\r\n $statement->execute();\r\n $statement->closeCursor();\r\n}", "public function delete($email)\n {\n $consents = $this->getAllConsents($email);\n foreach ($consents as $consent) \n {\n $this->deleteConsent($email, $consent);\n }\n }", "public function removeNlAbo()\n\t{\n\t\t$t=array('email'=>$_POST['email']);\n\t\t$req= self::$bdd->prepare('DELETE FROM `AbonnementNlGW` WHERE email= (:email);');\n\t\t$req->execute($t);\n\t}", "public function delete() {\r\n $page = $this->api->getParam('page', '1');\r\n $this->model->id = $_REQUEST['id'];\r\n $this->checkOwner();\r\n $message = 'Cannot Be Deleted';\r\n if ($this->model->delete()) {\r\n $message = 'Deleted Successfully';\r\n }\r\n $this->api->redirect('contact/home?message=' . $message . '&page=' . $page);\r\n }", "function do_update_additional_email($s_id,$fname,$lname,$email,$contacts_id) {\n\t# Dim some Vars:\n\t\tglobal $_DBCFG, $db_coin;\n\n\t# Do purge contact\n\t\t$query \t = \"UPDATE \".$_DBCFG['suppliers_contacts'].\" SET \";\n\t\t$query\t.= \"contacts_name_first='\".$db_coin->db_sanitize_data($fname).\"', \";\n\t\t$query\t.= \"contacts_name_last='\".$db_coin->db_sanitize_data($lname).\"', \";\n\t\t$query\t.= \"contacts_email='\".$db_coin->db_sanitize_data($email).\"' \";\n\t\t$query\t.= 'WHERE contacts_id='.$contacts_id.' AND contacts_s_id='.$s_id;\n\t\t$db_coin->db_query_execute($query) OR DIE(\"Unable to complete request\");\n\t\treturn $db_coin->db_query_affected_rows();\n}", "function del_mail($id){\n\t\tglobal $bdd;\n\n\t\t$req = $bdd->prepare(\"UPDATE `utilisateur` SET `mail_open` = NULL WHERE id_utilisateur = :id\");\n\t\t$req->execute(array('id'=>$id));\n\t\t$req->closeCursor();\n\t}", "public function delete($id){\n Auth::checkAdminLogin();\n // Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Email', 'Email');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = 'Email Delete';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Emails';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Email Index';\n\n //Check we got ID\n if(!empty($id)){\n\t\t\t$selectDataByID = $this->_model->selectDataByID($id);\n $this->_view->selectedData = $selectDataByID;\n\n //Check ID returns an Emails\n\t\t\tif(isset($selectDataByID[0]['id']) && !empty($selectDataByID[0]['id'])){\n if(isset($_POST) && !empty($_POST)) {\n if (!empty($_POST['delete'])) {\n $deleteAttempt = $this->_model->deleteData($id);\n //Check we have deleted Emails\n if (!empty($deleteAttempt)) {\n\n // Redirect to next page\n $this->_view->flash[] = \"Emails deleted successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('backoffice/emails/index');\n } else {\n $this->_view->error[] = 'A problem has occurred when trying to delete this award.';\n }\n } elseif (!empty($_POST['cancel'])) {\n Url::redirect('backoffice/emails/index');\n }\n }\n\t\t\t}else{\n $this->_view->flash[] = \"No Emails matches this id\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\t\tUrl::redirect('backoffice/emails/index');\n\t\t\t}\n\t\t}else{\n $this->_view->flash[] = \"No ID provided for Emails\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n\t\t\tUrl::redirect('backoffice/emails/index');\n\t\t}\n // Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('emails/delete', 'layout', 'backoffice');\n }", "public function delete()\r\n {\r\n $recordId = $this->getRecId();\r\n $command = static::getDb()->newDeleteCommand(static::$defaultLayout, $recordId);\r\n try {\r\n $command->execute();\r\n return 1;\r\n } catch (FileMakerException $e) {\r\n $this->addError('delete', $e->getMessage());\r\n return 0;\r\n }\r\n }", "public function remove_row($mark) {\n\n\t\t$this->db->where('oznaka', $mark); // email must be unique !\n\t\t$this->db->delete('sale');\n\t}", "function delete_quick_contact(){\n\t$user_id=$_REQUEST['user_id'];\n\t$contact_id = $_REQUEST['quick_contacts_id'];\n\tif(!empty($user_id)&& ($contact_id)){\n\t\t\t$records_contact_no = $this -> conn -> get_table_field_doubles('quick_contacts', 'quick_contact_user_id', $user_id,'quick_contacts_id',$contact_id);\n\t\t\t\n\t\t\tif(!empty($records_contact_no)){\n\t\t\t\t$name=$records_contact_no[0]['quick_contacts_name'] ;\n\t\t\t\t$mobile=$records_contact_no[0]['quick_contacts_number'];\n\t\t\t\t$pic=$records_contact_no[0]['user_contact_pic'];\n\t\t\t\t$delete=$this->conn->deletedataintablebytwocol('quick_contacts','quick_contact_user_id',$user_id,'quick_contacts_id',$contact_id);\n\t\t\t\tif(!empty($delete)){\n\t\t\t\t\t$post = array('status' => \"true\",\"message\" => \"Successfully delete\",'user_id'=>$user_id,'quick_contact_id'=>$contact_id,'contact_no'=>$mobile,'contact_name'=>$name);\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"error in deleting contact\",'user_id'=>$user_id,'quick_contact_id'=>$contact_id);\t\n\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"Quick Contact not exist\",'user_id'=>$user_id,'quick_contact_id'=>$contact_id);\t\n\t\t\t}\n\t\t\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'user_id'=>$user_id,'quick_contact_id'=>$contact_id);\n\t}\n\techo $this -> json($post);\n\t\t\n}", "function deleteReceipt()\n\t{\n\t\tglobal $db;\n\n\t\t$query = 'DELETE FROM '.receipt_table.' WHERE receipt_id = '.$this->receipt_id;\n\t\t$db->query($query);\n\t}", "protected function getRecByEmail(string $email) {\n $sql = \"SELECT COUNT(*) FROM \" . $this->formsTableName . \" WHERE email = ?\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->bindParam(1, $email, \\PDO::PARAM_STR);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return $res[0]['COUNT(*)'];\n }", "public function deleteUserByEmail(string $email): bool\r\n {\r\n $query = $this->db->prepare(\"UPDATE `users`\r\n SET `deleted` = 1\r\n WHERE `Email` = ?\");\r\n\r\n return $query->execute([$email]);\r\n }", "function webform_confirm_email_delete($node, $email = array()) {\n\n $form_state = array(\n 'build_info' => array(\n 'args' => array(\n $node,\n $email,\n ),\n ),\n 'submit_handlers' => array(\n 'webform_email_delete_form_submit',\n '_webform_confirm_email_delete_submit',\n ),\n );\n $form = drupal_build_form(\n 'webform_email_delete_form',\n $form_state\n );\n\n return $form;\n}", "static public function ctrEliminarTipoContacto(){\n\t\tif(isset($_POST[\"accionTipoContacto\"]) && $_POST[\"accionTipoContacto\"] == \"eliminar\"){\n\t\t\t$tabla =\"vtama_tipo_contacto\";\n\t\t\t$datos = $_POST[\"codigoTipoContacto\"];\n\t\t\t$respuesta = ModeloTipoContacto::mdlEliminarTipoContacto($tabla, $datos);\n\t\t\treturn $respuesta;\n\t\t}//if\n\t}", "public function deleteByEmail($account, $email)\n {\n return $this->requestDelete(\n sprintf('users/%s/invitations/%s', $account, $email)\n );\n }", "function deleteContactRequest($request_id) {\n global $pdo;\n $request = getContactRequest($request_id);\n if ($request['attachment'] != \"\") // check if attachment exists\n deleteFile($request['attachment']); // delete file out of database\n $statement = $pdo->prepare('DELETE FROM `contact` WHERE `id` = :id');\n $statement->bindParam(\":id\", $request_id);\n return $statement->execute();\n}", "public function delete_email_template($del_email_tmpid) {\n\t\treturn $this->db->delete('email_template_detail',array('templateid'=>$del_email_tmpid));\n\t}", "function ciniki_mail_mailingDelete($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 'mailing_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Mailing'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'mail', 'private', 'checkAccess');\n $rc = ciniki_mail_checkAccess($ciniki, $args['tnid'], 'ciniki.mail.mailingDelete', 0); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $modules = $rc['modules'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki);\n\n //\n // Get the uuid of the mailing to be deleted\n //\n $strsql = \"SELECT uuid FROM ciniki_mailings \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['mailing_id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.mail', 'mailing');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['mailing']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.mail.31', 'msg'=>'The mailing does not exist'));\n }\n $mailing_uuid = $rc['mailing']['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', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.mail');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Remove the mail subscriptions\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_mailing_subscriptions \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND mailing_id = '\" . ciniki_core_dbQuote($ciniki, $args['mailing_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.mail', 'item');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc;\n }\n if( isset($rc['rows']) && count($rc['rows']) > 0 ) {\n $items = $rc['rows'];\n foreach($items as $iid => $item) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.mail.mailing_subscription', \n $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc; \n }\n }\n }\n\n //\n // Remove the mail messages\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_mail \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND mailing_id = '\" . ciniki_core_dbQuote($ciniki, $args['mailing_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.mail', 'image');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc;\n }\n if( isset($rc['rows']) && count($rc['rows']) > 0 ) {\n $items = $rc['rows'];\n foreach($items as $iid => $item) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.mail.message', \n $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc; \n }\n }\n }\n\n //\n // Remove the images\n //\n $strsql = \"SELECT id, uuid, image_id FROM ciniki_mailing_images \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND mailing_id = '\" . ciniki_core_dbQuote($ciniki, $args['mailing_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.mail', 'image');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc;\n }\n if( isset($rc['rows']) && count($rc['rows']) > 0 ) {\n $images = $rc['rows'];\n foreach($images as $iid => $image) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.mail.mailing_image', \n $image['id'], $image['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc; \n }\n }\n }\n\n //\n // Remove the files for the mailing\n //\n/* $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_mailing_files \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND mailing_id = '\" . ciniki_core_dbQuote($ciniki, $args['mailing_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.mail', 'file');\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc;\n }\n if( isset($rc['rows']) && count($rc['rows']) > 0 ) {\n $files = $rc['rows'];\n foreach($files as $fid => $file) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.mail.mailing_file', \n $file['id'], $file['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc; \n }\n }\n } */\n\n //\n // Delete the mailing\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.mail.mailing', $args['mailing_id'], $mailing_uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.mail');\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.mail');\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', 'mail');\n\n return array('stat'=>'ok');\n}", "public function delete_email($list,$val){\n if(get_instance()->ecl('Instance')->mod('lists', 'delete_meta', [get_instance()->ecl('Instance')->user(),$list,$val]))\n {\n echo 1;\n } else {\n echo 0;\n }\n }", "protected function getRecByNameEmail(string $name, string $email) {\n $sql = \"SELECT COUNT(*) FROM \" . $this->formsTableName . \" WHERE name = ? AND email = ?\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->bindParam(1, $name, \\PDO::PARAM_STR);\n $stmt->bindParam(2, $email, \\PDO::PARAM_STR);\n $stmt->execute();\n $res = $stmt->fetchAll();\n return $res[0]['COUNT(*)'];\n }", "function do_insert_additional_email($s_id,$fname,$lname,$email) {\n\t# Dim some Vars:\n\t\tglobal $_DBCFG, $db_coin;\n\n\t# Do purge contact\n\t\t$query \t = 'INSERT INTO '.$_DBCFG['suppliers_contacts'];\n\t\t$query\t.= ' (contacts_id, contacts_s_id, contacts_name_first, contacts_name_last, contacts_email)';\n\t\t$query\t.= \"VALUES ('', \";\n\t\t$query\t.= \"'\".$db_coin->db_sanitize_data($s_id).\"', \";\n\t\t$query\t.= \"'\".$db_coin->db_sanitize_data($fname).\"', \";\n\t\t$query\t.= \"'\".$db_coin->db_sanitize_data($lname).\"', \";\n\t\t$query\t.= \"'\".$db_coin->db_sanitize_data($email).\"')\";\n\t\t$db_coin->db_query_execute($query) OR DIE(\"Unable to complete request\");\n\t\treturn $db_coin->db_query_affected_rows();\n}", "public function delete()\n {\n /* delete alert emails if there are any */\n foreach ($this->emails as $email) {\n $email->delete();\n }\n DeletedAlert::create(array(\n \"content\" => $this->toJson()\n ));\n return parent::delete(); // TODO: Change the autogenerated stub\n }", "public function deleteEmails(int $id, array $emails): bool;", "public function DeleteRecord()\n {\n // TODO: support delete multiple records\n // read the id array from the check box list _REQUEST['row_selections']\n global $g_BizSystem;\n $values = $g_BizSystem->GetClientProxy()->GetFormInputs('row_selections',false);\n if ($values)\n {\n foreach ($values as $id)\n {\n $recArray = $this->GetDataObj()->FetchById($id);\n $dataRec = new DataRecord($recArray, $this->GetDataObj());\n // take care of exception\n try {\n $dataRec->Delete();\n }\n catch (BDOException $e)\n {\n // call $this->ProcessBDOException($e);\n $this->ProcessBDOException($e);\n return;\n }\n }\n }\n else // delete current focused record\n {\n $rec = $this->GetActiveRecord();\n if (!$rec) return;\n global $g_BizSystem;\n //$recId = $this->m_ActiveRecord[\"Id\"];\n $ok = $this->GetDataObj()->DeleteRecord($rec);\n if (!$ok)\n return $this->ProcessDataObjError($ok);\n }\n $this->m_RecordId = null; // clean the current record id\n // TODO: adjust current page. if current page return no record, goto prev page\n \n return $this->ReRender();\n }", "function deleteMails($accountId, $status)\n\t\t{\n\t\t\t// delete the specified mails\n\t\t\tif($status == null)\n\t\t\t{\n\t\t\t\t// if deleteType is null which means that the user wants to delete all articles\n\t\t\t\tmysql_query(\"DELETE FROM argus_mails WHERE account_id = '\".$accountId.\"'\") or die(mysql_error());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// if not null, then delete only the specified type\n\t\t\t\tmysql_query(\"DELETE FROM argus_mails WHERE account_id = '\".$accountId.\"' AND status = '\".$status.\"'\") or die(mysql_error());\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function delete()\n\t{\n\t\tif ((int) $this->list_id < 1) {\n\t\t\tthrow new SurveyGizmoException(\"Contact needs to belong to a contact list\", 500);\n\t\t}\n\t\treturn self::_delete(array(\n\t\t\t'id' => $this->id,\n\t\t\t'list_id' => $this->list_id\n\t\t));\n\t}", "function delete_contact_from_phonebook($contact_id){\n\t\tif( isset($_POST[$contact_id]) ){\n\t\t\tphonebook::delete_phonebook_info($_POST[$contact_id]);\n\t\t}\n\t}", "public function removeContact(Request $request){\n $cid = $request->cid;\n $gid = $request->gid;\n $emailcontact = EmailContact::find($cid);\n $removeContact=$emailcontact->groups()->detach($gid);\n if(isset($removeContact)){\n return 'true';\n\n }else{\n return 'false';\n }\n }", "public function delete_subscriber( $email, $arguments = array() ) {\n\t\t$api = $this->get_api();\n\t\tif ( ! empty( $email ) && ! empty( $arguments['list_identifier'] ) ) {\n\n\t\t\t$contact = $this->get_contact( $arguments['list_identifier'], $email );\n\n\t\t\tif ( ! empty( $contact ) && $contact->status !== 'archived' ) {\n\t\t\t\t$user_hash = md5( $email );\n\t\t\t\t$api->request( 'lists/' . $arguments['list_identifier'] . '/members/' . $user_hash, array(), 'DELETE' );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "function delete_enquiry($enquiry_id)\n {\n $this->db->update('tbl_enquiry',$this,array('enquiry_id'=>$enquiry_id));\n //echo $this->db->last_query();\n }", "function delete()\n{\n $cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );\n $row =& $this->getTable();\n \n foreach($cids as $cid) {\n \techo $cid;\n if (!$row->delete( $cid )) {\n $this->setError( $row->getErrorMsg() );\n return false;\n }\n }\n \n return true;\n}", "public function deleteAction()\n {\n $recordId = (int) $this->params('id', null);\n\n if (null === $recordId) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/accounts/emails');\n }\n\n $record = $this->emailsService->getEmails($recordId);\n\n if (null === $record) {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('You have attempted to access an invalid record.');\n\n return $this->redirect()->toRoute('rocket-admin/accounts/emails');\n }\n\n $this->emailsService->deleteEmails($record, $this->identity());\n \n $this->flashMessenger()->setNamespace('success')\n ->addMessage('You have successfully deleted a Emails.');\n\n return $this->redirect()->toRoute('rocket-admin/accounts/emails');\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function remove($emailAddress, $vendorName)\n {\n $sql = \"DELETE FROM `{$this->table}` WHERE `vendor_email` = :email AND `vendor_name` = :vendor LIMIT 1\";\n $stmt = $this->dbConnection->prepare($sql);\n $stmt->bindParam(':email', $emailAddress, PDO::PARAM_STR);\n $stmt->bindParam(':vendor', $vendorName, PDO::PARAM_STR);\n return $stmt->execute();\n }", "public function unsubscribe_user($email) {\n if($json_file = file_get_contents($this->json_file)) {\n $this->subscribers_arr = json_decode($json_file, true);\n $return_value = 3;\n foreach($this->subscribers_arr as $key => $value) {\n if ($key !== $email) { // Save list without $email\n $this->subscribers_arr[\"$email\"] = $value;\n } else {\n $email_removed = true;\n }\n }\n if ($email_removed == true) {\n $return_value = $this->write_subscribers_to_file();\n }\n return $return_value;\n }\n }", "function deleteJob() {\n $job = $_POST['job'];\n \n if (count($job) > 1) {\n $default = 1;\n\n foreach ($job as $value) {\n if ($default == 1)\n $pk = $value;\n else {\n $pk .= \" OR pk = $value\";\n }\n \n $default++;\n }\n } else {\n $pk = array_shift($job);\n }\n\n connectDatabase();\n\n $result = queryDatabase(\"UPDATE job\n SET active = 0\n WHERE pk = $pk\");\n header('Location: ' . HOME . 'member.php?feedback=10');\n}", "public function deleteUser($email,$telefon=''){\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n if (isAdmin($_SESSION[\"jog\"])) {\n try{\n if ($this->userModel->deleteUserByAdmin($telefon) && $this->userModel->deleteUserByAdmin0($email) && $this->userModel->deleteFromUserCartItems($email)) { \n flash('deleted','A '.$email.' felhasználó törlése sikeres volt!','alert alert-success');\n redirect('admins/userHandler');\n }else{\n flash('deleted','A '.$email.' felhasználó törlése sikertelen volt sajnos!','alert alert-danger');\n redirect('admins/userHandler');\n }\n }catch(PDOException $ex){\n flash('deleted',$ex->getMessage(),'alert alert-danger');\n redirect('admins/userHandler');\n }finally{\n flash('deleted', 'Egyéb hiba történt');\n redirect('admins/userHandler');\n }\n }else{\n redirect('index');\n }\n }\n }", "public function delete() {\n global $db;\n $this->_predelete();\n $result = $db->query(\"DELETE FROM \".$this->table.\" WHERE \".$this->id_field.\"=?\", array($this->{$this->id_field}));\n $this->_postdelete($result);\n return $result;\n }", "function removeemail($member){\n\t\t$f3=$this->f3; \n\t\t$uselog=$f3->get('uselog');\n\t\t$email_logger=$f3->new('email_log');\n\t\t$email_logger->write('in removeemail for member = '.$member->forename. ' '.$member->surname.'email was '.$member->email ,$uselog);\n\t\t\n\t\t// now check if its in use elsewhere other than this membnum\n\t\t$this->mailmanunsub($member);\n}", "public function deleteEmail($id)\r\n {\r\n $this->setTable('subscribed');\r\n $table = $this->getTable();\r\n\r\n $this->query(\"DELETE FROM \" . $table . \" WHERE id = :id\");\r\n $this->bind(':id', $id);\r\n\r\n if($this->execute())\r\n {\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "function delete_record ($fieldName,$id,$tblName){\n\t\n\t\t$this->load->model('Common_function_model','common');\n\t\t\n\t\t$this->db->where($fieldName, $id);\n\n\t\tif($this->db->delete($tblName))\n\t\t\treturn true;\n\t\telse\n\t\t\t return false;\n\t\t\n }", "function delete()\r\n {\r\n $cids = JRequest::getVar( 'cid', array(0), 'post', 'array' );\r\n\r\n $row =& $this->getTable();\r\n\r\n if (count( $cids )) {\r\n foreach($cids as $cid) {\r\n if (!$row->delete( $cid )) {\r\n $this->setError( $row->getErrorMsg() );\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "function deleteItem($iid, $userid, $fullname){\n $sendMail = 0;\n \n $query = \"select itemSortOrder as iso, categories.cid as cid from items, categories where categories.cid=items.cid and iid=\" . $iid . \" and userid='\" . $userid . \"'\";\n $item_rs = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n\n if(!($item_row = mysql_fetch_assoc($item_rs))){ \n return \"Item does not belong to you!\";\n }\n\n // check to see if the item has been bought\n $query = \"select title, items.description, email from items, purchaseHistory, people where items.iid=\" . $iid . \" and items.iid=purchaseHistory.iid and people.userid=purchaseHistory.userid\";\n \n $rs1 = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n\n if(mysql_num_rows($rs1) > 0){ \n // the item has been puchased so may have to send warning email\n $sendMail = 1;\n }\n \n // delete from purchaseHistory\n $query = \"delete from purchaseHistory where purchaseHistory.iid=\" . $iid;\n $result = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n\n // delete from itemPriceHistory\n $query = \"DELETE FROM itemPriceHistory WHERE itemPriceHistory.iid=\" . $iid;\n $result = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n \n // delete from items\n $query = \"delete from items where items.iid=\" . $iid;\n $result = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n \n $query = \"update items set itemSortOrder = itemSortOrder - 1 where itemSortOrder > \" . \n $item_row[\"iso\"] . \" and cid=\" . $item_row[\"cid\"];\n $result = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n \n $query = \"update people set lastModDate=NOW() where userid='\" . $userid . \"'\";\n $result = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n \n if($sendMail == 1){\n\n // get userid's bday and bmonth\n $query = \"select bday, bmonth from people where userid='\" . $userid . \"'\";\n $rs2 = mysql_query($query) or die(\"Could not query: \" . mysql_error());\n \n $array = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May',\n 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', \n 10 => 'October', 11 => 'November', 12 => 'December');\n \n if($row2 = mysql_fetch_assoc($rs2)){\n $bmonth = array_search($row2[\"bmonth\"], $array);\n $bday = $row2[\"bday\"];\n $d1 = mktime(0,0,0, $bmonth, $bday);\n }\n \n $diff = ceil(($d1 - time())/(60*60*24));\n \n $d2 = mktime(0,0,0, 12, 25); // christmas\n $xmas = ceil(($d2 - time())/(60*60*24));\n \n if(($diff > 0 and $diff <= 20) or ($xmas > 0 and $xmas <= 20)){\n // less than 20 days till bday or xmas so \n // send an email to each person who has purchased this gift\n \n while($row1 = mysql_fetch_assoc($rs1)){\n $to .= $row1[\"email\"] .\", \";\n }\n\n // rewind cursor so that we can get the title and description\n mysql_data_seek($rs1, 0);\n $row1 = mysql_fetch_assoc($rs1); \n\n $from = \"\";\n $subject = $fullname . \"'s WishList has been modified\";\n $message = \"<p><font color=indianred><b>\" . $fullname .\n \"</b></font> has <b>deleted</b> the following item that you have already bought <dir>\" .\n \"<i>\" . $row1[\"title\"] . \"</i> - \" . $row1[\"description\"] . \"</dir>\" .\n \"Remember, \" . $fullname . \" had no way of knowing that the item \" .\n \"had been purchased. This warning is sent out if a person deletes an item (which has been \" .\n \"purchased) from their list \" .\n \"within 20 days of their birthday or Christmas<br>\" .\n \"<br>Day until \" . $fullname . \"'s bday is \" . $diff . \"<br>Days till xmas=\" . $xmas . \n \"</body></html>\";\n sendEmail($to,$from,$subject,$message,0);\n } \n }\n return \"Success\";\n}", "public function delete(){\n try {\n // delete contact query\n $this->_query = \"DELETE FROM \" . $this->_dbtable . \" WHERE id = :id\";\n\n // preparing statement\n $statement = $this->_conn->prepare($this->_query);\n\n //binding params\n $statement->bindParam(':id', $this->_id, PDO::PARAM_INT);\n\n // executing statement\n $statement->execute();\n\n // count affected rows\n $deletedrow = $statement->rowCount();\n\n // check if a row has been affected\n if($deletedrow == 1 ) {\n return true;\n }\n return false;\n }\n\n catch(PDOException $ex){\n echo \"Error\" . $ex->getMessage();\n }\n }", "private function removeFormData() {\n\t\tif (isset($_SESSION[\"dsgvo\"][\"remove_formdata_cronjob\"]) && $_SESSION[\"dsgvo\"][\"remove_formdata_cronjob\"] === date(\"Ymd\")) {\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\t$_SESSION[\"dsgvo\"][\"remove_formdata_cronjob\"] = date(\"Ymd\");\n\t\t}\n\n\t\t$expire = date(\"Y-m-d\", time() - 86400 * (int)$this->settings[\"formdata_autoremove_interval\"]);\n\n\t\t$GLOBALS[\"db\"]->query(\n\t\t\t\"DELETE _lead, _content \".\n\t\t\t\"FROM {$GLOBALS[\"cms\"]->tbname[\"papoo_form_manager_leads\"]} _lead \".\n\t\t\t\"LEFT JOIN {$GLOBALS[\"cms\"]->tbname[\"papoo_form_manager_lead_content\"]} _content ON _content.form_manager_content_lead_id_id = _lead.form_manager_lead_id \".\n\t\t\t\"WHERE DATE(FROM_UNIXTIME(_lead.form_manager_form_datum)) <= '$expire'\"\n\t\t);\n\t}" ]
[ "0.66217035", "0.65925646", "0.6545741", "0.6542247", "0.6494282", "0.64216745", "0.6401216", "0.637896", "0.6308607", "0.6303122", "0.6250834", "0.61782515", "0.61770433", "0.6162416", "0.6112688", "0.6103987", "0.6094252", "0.60901666", "0.6050489", "0.6047234", "0.6010882", "0.5999712", "0.5984761", "0.5962121", "0.59379524", "0.59252787", "0.5915291", "0.5904005", "0.58816683", "0.58144003", "0.5811244", "0.57743746", "0.5773791", "0.57675356", "0.57631356", "0.57484454", "0.571793", "0.5716511", "0.5705498", "0.5673391", "0.56489235", "0.5642399", "0.5634637", "0.56306535", "0.56213945", "0.5616354", "0.5610222", "0.560849", "0.56030864", "0.5596708", "0.5584688", "0.5578212", "0.5569688", "0.55588865", "0.5556649", "0.5532212", "0.55276555", "0.5524381", "0.5515805", "0.5512638", "0.5508932", "0.5458849", "0.5455196", "0.54486436", "0.5443852", "0.5441869", "0.54413295", "0.54396147", "0.543955", "0.54269207", "0.54236305", "0.54200494", "0.54165787", "0.5414935", "0.540691", "0.539029", "0.5376508", "0.5372513", "0.53675526", "0.5361191", "0.5358827", "0.5357789", "0.5354456", "0.53339934", "0.533335", "0.5319444", "0.5308428", "0.52986056", "0.5296415", "0.52910995", "0.5284592", "0.52807635", "0.52733713", "0.52726835", "0.52705413", "0.5263854", "0.526163", "0.52563167", "0.52481186", "0.5243742" ]
0.8066477
0
all files used to handle user session go here
function sign_out() { session_destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _read_user_session()\n {\t\t\n\t\tif($this->sh_Options['keeping_logic'] == 'db'){\n\t\t\t$this->is_present = $this->_read_user_session_db();\n\t\t} else {\n\t\t\t$this->is_present = $this->_read_user_session_ss();\n\t\t}\n\t}", "function getUserSession(){\n\t\t\tChromePhp::log(\"inside retrieveCurrentUserInSession\");\n\t\t\tretrieveCurrentUserInSession();\n\t\t}", "function loadSession() {}", "function requestSessionInfo()\n {\n //para pasarselo al aside;\n\n $sessionLevel = $this->loginController->GetSessionAuthLevel();\n $this->view->setSessionLevel($sessionLevel);\n\n $sessionName = $this->loginController->GetSessionUsername();\n $this->view->setSessionName($sessionName);\n }", "private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }", "function session(){\n\t\t$t = strtolower($_SERVER['HTTP_USER_AGENT']);\n\t\tif(strpos($t,'esnc.net') !== FALSE || strpos($t,'search') !== FALSE || strpos($t,'bot') !== FALSE || strpos($t,'spider') !== FALSE || strpos($t,'crawler') !== FALSE) return;//exclude search engine and other browser\n\t\tsession_save_path(PATH_SESSION);\n\t\tsession_cache_limiter(SESSION_CACHE);\n\t\tsession_cache_expire(SESSION_TIMEOUT);\n\t\tsession_name(SESSION_NAME);\n\t\tsession_set_cookie_params(0,URL_ROOT);\n\t\tsession_start();\n\t\tif(!isset($_SESSION['ctrl'])){\n\t\t\t$_SESSION['USip'] = $t=$_SERVER['REMOTE_ADDR'];\n\t\t\t$_SESSION['UA'] = $_SERVER['HTTP_USER_AGENT'];\n\t\t\t$_SESSION['ctrl']=1;//guest session start\n\t\t\t$_SESSION['USid']=-1;\n\t\t\t$_SESSION['USname']='';\n\t\t\t$_SESSION['USemail']='';\n\t\t\t$_SESSION['USlastlogin']='';\n\t\t\t$_SESSION['priv']=0;\n\t\t\t$_SESSION['logontries'] = 0;\n\t\t\t/* implement hit counter\t\n\t\t\texclude ip from 192.168.0.x,10.x.x.x,\n\t\t\t*/\n\t\t\tif(strpos($t,'192.') !== 0 && strpos($t,'10.') !== 0 && ($visit=(int)@file_get_contents(PATH_GLOBAL.'visit.txt')))\n\t\t\t\tfile_put_contents(PATH_GLOBAL.'visit.txt',++$visit,LOCK_EX);\n\t\t};\n\t\t$this->load();\n\t}", "private function _sess_run() {\n\t\t// session\n\t\tini_set('session.save_handler', $this->sess_save_handler);\n\t\t$path = array();\n\t\tforeach ($this->sess_server as $server) {\n\t\t\tif (isset($server['host']) && isset($server['port'])) {\n\t\t\t\t$path[] = \"tcp://{$server['host']}:{$server['port']}?\" . http_build_query(isset($server['params']) ? $server['params'] : array());\n\t\t\t}\n\t\t}\n\t\tif (empty($path)) {\n\t\t\tshow_error('Session save_path is empty');\n\t\t}\n\t\tini_set('session.save_path', implode(',', $path));\n\n\t\tini_set('session.gc_maxlifetime', $this->sess_expiration);\t// 过期时间\n\t\t// cookie\n\t\tini_set('session.cookie_secure', 0);\t\t// 0 http:// 1 https://\n\t\tini_set('session.cookie_httponly', 1);\t\t// 不让JS读取session的cookie\n\t\tsession_name($this->sess_cookie_name);\n\n\t\tsession_start();\n\t\t// delete old flashdata (from last request)\n\t\t$this->_flashdata_sweep();\n\t\t// mark all new flashdata as old (data will be deleted before next request)\n\t\t$this->_flashdata_mark();\n\t}", "private function updateSession() {\n\t\t//update the login time.\n\t\tif (isset ( $this->session )) {\n\t\t\t$this->session ['lastlogin'] = time ();\n\t\t}\n\t\t\n\t\t//write $session['uid'], $session['name'], $session['lastlogin'] to file\n\t\tif (isset ( $this->session )) {\n\t\t\tfile_put_contents ( self::SESSION_FILE, serialize ( $this->session ) );\n\t\t} elseif (file_exists ( self::SESSION_FILE )) { //remove session information\n\t\t\tsession_destroy();\n\t\t\tunlink ( self::SESSION_FILE );\n\t\t}\n\t}", "public function setup_session(){\n if(!(isset($_SESSION))){\n session_start();\n }\n\n $_SESSION['user_id'] = $this->user_id;\n $_SESSION['name'] = $this->firstname;\n\n //Remove anon flag\n if(isset($_SESSION['anon'])){\n unset($_SESSION['anon']);\n }\n\n }", "protected function get_sessions()\n {\n }", "private function aim() {\n\t\t# The class pretends to use the session for storing the\n\t\t# permanent memory of one application\n\t\t# wheteher it does or doesn't a log in to execute it.\n\t\t# It has two ways of make the logout:\n\t\t#\ta) The logout is performed by calling to a website from\n\t\t#\t\twhich yhe user will need to login again to come back\n\t\t#\t\tinside the app.\n\t\t#\tb) The logout is performed changing to the anonymous user\n\t\t#\t\tand accessing to the places suitable for that user.\n\t}", "function action_userLogged() {\n if (!isset($_SESSION['logged']) || !$_SESSION['logged']) {\n $_SESSION['logged'] = false;\n header('Location: /');\n } else {\n $_SESSION['logged'] = true;\n header('Location: /home/track');\n // Include view for this page.\n @include_once APP_PATH . 'view/track_page.tpl.php';\n }\n }", "protected function init_session () {\n\t\t$Request = Request::instance();\n\t\t/**\n\t\t * If session exists\n\t\t */\n\t\tif ($Request->cookie('session')) {\n\t\t\t$this->user_id = $this->load();\n\t\t}\n\t\t$this->update_user_is();\n\t}", "public function checkUsersSession(){\n\t}", "function sess_run()\n {\n //If we are, update the session length to reflect the \"user specific length\"\n if ($this->persistant_session() != FALSE) {\n $this->sess_length = $this->persistant_session();\n }\n\n //Set Session Name\n session_name($this->sess_name);\n\n //Set Session Lifetime (this is in seconds, unlike setting a normal cookie which requires a date/time)\n ini_set('session.cookie_lifetime', $this->sess_length);\n\n $current_session_id = session_id();\n if ($current_session_id != '') {\n //By calling Session_ID - with the current session_id - we force to renew the cookie (and the expiry time)\n session_id($current_session_id);\n }\n //If the session doesn't exist yet, there is no need to do this.\n\n //Start or Continue our Session\n session_start();\n\n //User IP Match - Run if required to do so\n if ($this->sess_match_ip == TRUE) {\n if (!isset($_SESSION['ip_address'])) {\n //If our session does not previously contain an IP address, this is the user's first visit. Record their IP.\n //Do not check again now until next page load.\n $_SESSION['ip_address'] = $this->_ra_encode($this->CI->input->ip_address());\n } else {\n if ($this->_ra_decode($_SESSION['ip_address']) != $this->CI->input->ip_address()) {\n //User IP Match failed - destory the session (and any stored data) immediantly.\n $this->sess_destroy();\n //Do not continue, and return \"FALSE\"\n return FALSE;\n }\n }\n }\n\n //User UserAgent (browser) Match - Run if required to do so\n if ($this->sess_match_useragent == TRUE) {\n if (!isset($_SESSION['user_agent'])) {\n //If our session does not previously contain a UserAgent, this is the user's first visit. Record their UserAgent.\n //Do not check again now until next page load.\n $_SESSION['user_agent'] = $this->_ra_encode(trim(substr($this->CI->input->user_agent(), 0, 50)));\n } else {\n if ($this->_ra_decode($_SESSION['user_agent']) != trim(substr($this->CI->input->user_agent(), 0, 50))) {\n //User UserAgent (browser) Match failed - destory the session (and any stored data) immediantly.\n $this->sess_destroy();\n //Do not continue, and return \"FALSE\";\n return FALSE;\n }\n }\n }\n\n //If session encryption is enabled, decode the session data and pass it to the array userdata() for compatability reasons.\n $this->userdata = $this->_ra_decode($_SESSION);\n\n //Return TRUE - successfully started/continued our session\n return TRUE;\n }", "private function getSession() {\n\t\t//read session file and fill the array\n\t\tif (file_exists ( self::SESSION_FILE )) {\n\t\t\t$this->session = unserialize ( file_get_contents ( self::SESSION_FILE ) );\n\t\t}\n\t\t\n\t\t//If the last session has expired, remove the session\n\t\tif (isset ( $this->session ) && $this->session ['lastlogin'] + (10 * 60) <= time ()) {\n\t\t\tunset ( $this->session );\n\t\t\t$this->updateSession ();\n\t\t}\n\t}", "function checkSessionAll(){\r\n \tif($this->Session->check('User')){\r\n \t\t//the user is logged in, allow the wiki edit featur\r\n \t\t//the layout will know more than we do now \r\n \t\t$cuser = $this->Session->read('User');\r\n \t\tif($cuser['account_type'] == 'admin'){\r\n \t\t\t$this->set('admin_enable', true);\r\n \t\t}else{\r\n \t\t\t$this->set('admin_enable', false);\r\n \t\t}\r\n \t\t\r\n \t}else{\r\n \t\t$this->set('admin_enabled', false);\r\n \t}\r\n }", "function phpbb_user_session_handler()\n{\n\tglobal $phpbb_hook;\n\n\tif (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__))\n\t{\n\t\tif ($phpbb_hook->hook_return(__FUNCTION__))\n\t\t{\n\t\t\treturn $phpbb_hook->hook_return_result(__FUNCTION__);\n\t\t}\n\t}\n\n\treturn;\n}", "function Session() {\n $sesskey = $_COOKIE['FortissimoSession'];\n if (! $sesskey) {\n # they don't have one, so let's ignore\n return;\n }\n\n # try to parse their cookie\n $ct = sscanf($sesskey, \"%d %s %d\", $sessid, $auth, $exptime);\n\n # return if bad cookie, or they say it's expired, or the auth length is wrong or bad sessid\n if ($ct != 3 || $exptime < time() || strlen($auth) != 64 || $sessid <= 0) {\n return;\n }\n\n # okay, so try loading it\n global $ft;\n $row = $ft->dbh->_select_row_as_object('SELECT * FROM tbl:sessions WHERE sessid = ? AND sesskey = ?',\n array($sessid, $auth));\n $userid = $row->userid;\n if (is_null($userid) || $userid <= 0 || $row->exptime < time()) {\n return;\n }\n\n # get the user this refers to\n $this->user = new User($userid);\n }", "public function controlSession(){\n $session = $_SESSION['wifiGuardSharingEmail'];\n $sessionID = $_SESSION[\"wifiGuardSharingID\"];\n $uri = $_SERVER['REQUEST_URI'];\n \n if(!empty($session) && !empty($sessionID)){\n $result = dibi::query('SELECT sessionID\n FROM [user]\n WHERE [email] = %s', $session, 'LIMIT 1');\n $databaseSessionID = $result->fetchSingle();\n \n //if user is in index.php with valid session\n if (preg_match(\"/index.php/\",$uri) && $databaseSessionID===$sessionID){\n parent::redirection(\"app.php?page=showrecord\");\n }\n //if user try load app.php with invalid session\n elseif (preg_match(\"/app.php/\",$uri) && $databaseSessionID!==$sessionID){\n parent::redirection(\"index.php\");\n }\n } \n //if user try load app.php without session\n elseif(preg_match(\"/app.php/\",$uri)){\n parent::redirection(\"index.php\");\n }\n }", "private function getSessionSavePath() {}", "function login_process_with_previous_sessions() {\r\n\r\n\t\t$userId = $this->session->userdata('userId');\r\n\r\n\t\tif ( ! empty($userId)) {\r\n\r\n\t\t\tswitch ($this->get_login_mode($userId)) :\r\n\r\n\t\t\t\tcase 'auto-login' :\r\n\r\n\t\t\t\t\t$param = \"update_record\";\r\n\r\n\t\t\t\t\t$this->login_process($userId, $param, $this->accessName, $this->accessTo);\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'lockscreen' :\r\n\r\n\t\t\t\t\tredirect('lockscreen/user_id/' . $userId, 'location');\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tendswitch;\r\n\r\n\t\t}\r\n\r\n\t\t/* \r\n\t\t\tNote: There is no process if no previous sessions or sign-in mode\r\n\t\t*/\r\n\r\n\t}", "function __construct() {\n\t\tkataMakeTmpPath('sessions');\n\t}", "private function synchronize()\n {\n $_SESSION['user'] = $this->user;\n }", "public function startSession() {\n\n session_start(); //Tell PHP to start the session\n\n /* Determine if user is logged in */\n $this->logged_in = $this->checkLogin();\n\n /**\n * Set guest value to users not logged in, and update\n * active guests table accordingly.\n */\n if (!$this->logged_in) {\n $this->username = $_SESSION['username'] = GUEST_NAME;\n $this->userlevel = GUEST_LEVEL;\n $this->connection->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time);\n }\n /* Update users active timestamp */ else {\n $this->connection->addActiveUser($this->username, $this->time);\n }\n\n /* Remove inactive visitors from database */\n $this->connection->removeInactiveUsers();\n $this->connection->removeInactiveGuests();\n\n /* Set referrer page */\n if (isset($_SESSION['url'])) {\n $this->referrer = $_SESSION['url'];\n } else {\n $this->referrer = \"/\";\n }\n\n /* Set current url */\n $this->url = $_SESSION['url'] = $_SERVER['PHP_SELF'];\n }", "public static function use_sessions()\n {\n \\Session::started() or \\Session::load();\n }", "public static function session()\n {\n //Sjekker om en bruker er logget in\n if (isset($_SESSION['user'])) {\n //Hvis verifyUser() returnerer falskt er sessionene kapret\n if(!$_SESSION['user']->verifyUser()){\n unset($_SESSION['user']);\n $alert = new Alert(Alert::ERROR, \"Sessionen er kapret og du har blitt logget ut. Husk å bruke beskyttelse\");\n $alert->displayOnIndex();\n }\n }\n }", "protected function fetchUserSessionFromDB() {}", "function hook_session() {\n session_set_save_handler(array($this, '_open'),\n array($this, '_close'),\n array($this, '_read'),\n array($this, '_write'),\n array($this, '_destroy'),\n array($this, '_clean'));\n }", "public function start(){\n\t\t$this->current_time = $this->time->time;\n\t\t$this->data['user_id'] = ANONYMOUS;\n\t\t$boolValid = false;\n\n\t\t//Return, if we don't want a session\n\t\tif (defined('NO_SESSION')) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Remove old sessions and update user information if necessary.\n\t\tif($this->current_time - $this->session_length > $this->config->get('session_last_cleanup')){\n\t\t\t$this->cleanup($this->current_time);\n\t\t}\n\t\t//Cookie-Data\n\t\t$arrCookieData = array();\n\t\t$arrCookieData['sid']\t= get_cookie('sid');\n\t\t$arrCookieData['data']\t= get_cookie('data');\n\t\t$arrCookieData['data']\t= ( !empty($arrCookieData['data']) ) ? unserialize(base64_decode(stripslashes($arrCookieData['data']))) : '';\n\n\t\t//Let's get a Session\n\t\tif ($this->in->exists('s') && $this->in->get('s', '') != \"\"){\n\t\t\t//s-param\n\t\t\t$this->sid = $this->in->get('s', '');\n\t\t} else {\n\t\t\t$this->sid = $arrCookieData['sid'];\n\t\t}\n\n\t\t//Do we have an session? If yes, try to look if it's a valid session and get all information about it\n\t\tif ($this->sid != ''){\n\t\t\t$query = $this->db->query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM __sessions s\n\t\t\t\t\t\t\t\tLEFT JOIN __users u\n\t\t\t\t\t\t\t\tON u.user_id = s.session_user_id\n\t\t\t\t\t\t\t\tWHERE s.session_id = '\".$this->db->escape($this->sid).\"'\n\t\t\t\t\t\t\t\tAND session_type = '\".$this->db->escape((defined('SESSION_TYPE')) ? SESSION_TYPE : '').\"'\");\n\t\t\t$arrResult = $this->db->fetch_record($query);\n\t\t\t$this->db->free_result($query);\n\n\t\t\t$this->data = $arrResult;\n\t\t\tif (!isset($this->data['user_id'])){\n\t\t\t\t$this->data['user_id'] = ANONYMOUS;\n\t\t\t}\n\n\t\t\t//If the Session is in our Table && is the session_length ok && the IP&Browser fits\n\t\t\t//prevent too short session_length\n\t\t\tif ($arrResult && (($arrResult['session_start'] + $this->session_length) > $this->current_time) ){\n\t\t\t\t//If the IP&Browser fits\n\t\t\t\tif (($arrResult['session_ip'] === $this->env->ip) && ($arrResult['session_browser'] === $this->env->useragent)){\n\t\t\t\t\t//We have a valid session\n\t\t\t\t\t$this->data['user_id'] = ($this->data['user_id'] == (int)$arrResult['session_user_id']) ? intval($arrResult['session_user_id']) : $this->data['user_id'];\n\t\t\t\t\t$this->id = $this->data['user_id'];\n\t\t\t\t\t// Only update session DB a minute or so after last update or if page changes\n\t\t\t\t\tif ( ($this->current_time - $arrResult['session_current'] > 60) || ($arrResult['session_page'] != $this->env->current_page) ){\n\t\t\t\t\t\t$this->db->query(\"UPDATE __sessions SET :params WHERE session_id = ?\", array(\n\t\t\t\t\t\t\t'session_current'\t=> $this->current_time,\n\t\t\t\t\t\t\t'session_page'\t\t=> strlen($this->env->current_page) ? $this->env->current_page : '',\n\t\t\t\t\t\t), $this->sid);\n\t\t\t\t\t}\n\t\t\t\t\t//The Session is valid, copy the user-data to the data-array and finish the init. You you can work with this data.\n\n\t\t\t\t\tregistry::add_const('SID', \"?s=\".((!empty($arrCookieData['sid'])) ? '' : $this->sid));\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//START Autologin\n\t\t$boolSetAutoLogin = false;\n\n\t\t//Loginmethod Autologin\n\t\t$arrAuthObjects = $this->get_login_objects();\n\t\tforeach($arrAuthObjects as $strMethods => $objMethod){\n\t\t\tif (method_exists($objMethod, 'autologin')){\n\t\t\t\t$arrAutologin = $objMethod->autologin($arrCookieData);\n\t\t\t\tif ($arrAutologin){\n\t\t\t\t\t$this->data = $arrAutologin;\n\t\t\t\t\t$boolSetAutoLogin = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//EQdkp Autologin\n\t\tif (!$boolSetAutoLogin){\n\t\t\t$arrAutologin = $this->autologin($arrCookieData);\n\t\t\tif ($arrAutologin){\n\t\t\t\t$this->data = $arrAutologin;\n\t\t\t\t$boolSetAutoLogin = true;\n\t\t\t}\n\t\t}\n\n\t\t//Bridge Autologin\n\t\tif (!$boolSetAutoLogin && $this->config->get('cmsbridge_active') == 1 && $this->config->get('pk_maintenance_mode') != 1){\n\t\t\t$arrAutologin = $this->bridge->autologin($arrCookieData);\n\t\t\tif ($arrAutologin){\n\t\t\t\t$this->data = $arrAutologin;\n\t\t\t\t$boolSetAutoLogin = true;\n\t\t\t}\n\t\t}\n\t\t//END Autologin\n\n\t\t//Let's create a session\n\t\t$this->create($this->data['user_id'], (isset($this->data['user_login_key']) ? $this->data['user_login_key'] : ''), $boolSetAutoLogin);\n\t\t$this->id = $this->data['user_id'];\n\t\treturn true;\n\t}", "protected abstract function get_sessions();", "public static function init() {\n\t\t\t\n\t\t\t/* Run session */\n\t\t\tsession_start();\n\t\t\t\n\t\t}", "public static function userLoggedIn()\n {\n //Hvis en bruker ikke er logget inn, vil han bli sent til login.php\n if (!isset($_SESSION['user'])) {\n //Lagrer siden brukeren er på nå slik at han kan bli redirigert hit etter han har logget inn\n $_SESSION['returnPage'] = $_SERVER['REQUEST_URI'];\n $alert = new Alert(Alert::ERROR, \"Du er nøtt til å være logget inn for å se den siden. Ikke prøv deg på noe.\");\n $alert->displayOnOtherPage('login.php');\n\n }\n }", "function loggedin() {\n $this->checkAccess('user',false,false);\n\n $template = new Template;\n $user = new User($this->db);\n\n //get user details\n $user->getByEmail($this->f3->get('SESSION.email'));\n $this->f3->set('user', $user);\n\n //get user followers\n $this->f3->set('followers', $user->getUserFollowers($this->f3->get('SESSION.cid'))[0]);\n\n //get user waiting position\n $this->f3->set('waitrank', $user->getUserWaitPosition($this->f3->get('SESSION.cid'))[0]);\n\n echo $template->render('header.html');\n echo $template->render('user/user.html');\n echo $template->render('footer.html');\n }", "public static function saveUserSession(){\n\t\t$_SESSION['user']=self::$_leuser;\n\t}", "function _read_user_session_ss()\n {\n\t\t$ret = false;\n\t\t\n\t\treturn $ret;\n\t}", "function _read_user_session_db()\n {\n if (!$this->sessionModel->read()) {return false;}\n\t\t\n\t\t$this->user = SHIN_Core::$_models['sys_user_model']->get_instance();\n\n if (!$this->user->fetchByID($this->sessionModel->uid)) {\n\t\t\t$pk = $this->user->primary_key;\n $this->user->$pk = 0;\n return false;\n }\n\n\t\t$pk = $this->user->primary_key;\n\t\tSHIN_Core::$_user = $this->user;\n\t\t\n\t\t// addons for new field added //////////////////////////\n\t\t// request by Stefano. Detail: http://binary-studio.office-on-the.net/issues/5287\n\t\t//$data = array('updated' => date('Y-m-d H:i:s'));\n\t\t//SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->where('idUser', SHIN_Core::$_user->idUser);\n\t\t//SHIN_Core::$_db[SHIN_Core::$_shdb->active_group]->update('sys_user', $data); \t\t\n\t\t////////////////////////////////////////////////////////\t\t\n\n\t\t// lang //////////////////////////////////////////////////////////////////////////////\n\t\t$_current_language = '';\n\t\t//dump(SHIN_Core::$_libs['session']->userdata('language'));\n\t\tif(SHIN_Core::$_libs['session']->userdata('language')){\n\t\t\t$_current_language = SHIN_Core::$_libs['session']->userdata('language');\n\t\t} else {\n\t\t\t$_current_language = SHIN_Core::$_user->lang;\n\t\t}\n\t\tif($_current_language == '') {$_current_language = SHIN_Core::$_config['lang']['language'];} \n//\t\tSHIN_Core::$_libs['session']->set_userdata('language', $_current_language);\n\t\t//dump($_current_language);\n\t\t\n\t\t// addons from Dimas (need disscuss with Stefano) \n\t\t// Logic follow. each application can override native language /////\n\t\t// if($_current_language != SHIN_Core::$_config['lang']['language']){\n\t\t// $_current_language = SHIN_Core::$_config['lang']['language'];\n\t\t// }\n\t\t////////////////////////////////////////////////////////////////////\n\n\t\tSHIN_Core::$_language->load('app', $_current_language);\n\t SHIN_Core::$_current_lang = $_current_language;\n\t SHIN_Core::log('debug', '[LANGUAGE] Current language: '.SHIN_Core::$_current_lang);\n\t\t//////////////////////////////////////////////////////////////////////////////////////\n \n\t\t// theme /////////////////////////////////////////////////////////////////////////////\n\t\t$_current_theme = '';\n if(SHIN_Core::$_libs['session']->userdata('theme')){\n $_current_theme = SHIN_Core::$_libs['session']->userdata('theme');\n } else {\n\t\t\t$_current_theme = SHIN_Core::$_user->theme;\n }\n\t\tif($_current_theme == '') {SHIN_Core::$_config['theme']['default_theme'];}\n\n\t SHIN_Core::$_theme = $_current_theme;\n\t\t//////////////////////////////////////////////////////////////////////////////////////\n\n return true;\n }", "protected function setupSession()\n\t{\n\t\t$name = $this->appType . \"id\";\n\t\tsession_name($name);\n\n\t\t$path = getenv(\"P_SESSION_DIR\") ?: $GLOBALS[\"BASE_DIR\"] . \"/session\";\n\t\tif (! is_dir($path)) {\n\t\t\tif (! mkdir($path, 0777, true))\n\t\t\t\tjdRet(E_SERVER, \"fail to create session folder: $path\");\n\t\t}\n\t\tif (! is_writeable($path))\n\t\t\tjdRet(E_SERVER, \"session folder is NOT writeable: $path\");\n\t\tsession_save_path ($path);\n\n\t\tini_set(\"session.cookie_httponly\", 1);\n\n\t\t$path = getenv(\"P_URL_PATH\");\n\t\tif ($path)\n\t\t{\n\t\t\t// e.g. path=/cheguanjia\n\t\t\tini_set(\"session.cookie_path\", $path);\n\t\t}\n\t}", "function OnProcess() {\n\n $this->login = $this->Request->ToString(\"login\", \"\", 1, 32);\n $this->password = $this->Request->ToString(\"password\", \"\", 1, 32);\n $this->packagefrom = $this->Request->ToString(\"frompackage\", \"\");\n $this->former_query = $this->Request->ToString(\"query\", \"\");\n\n $UsersTable = new UsersTable($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"Authorization\", \"AuthorizeTable\"));\n //die(pr($UsersTable));\n $data = $UsersTable->GetByFields(array($this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_login\") => $this->login));\n\n if (!count($data) || $data[\"active\"]==0) {\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_LOGIN\");\n return;\n }\n\n $_pass = $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_password\")];\n if($this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n if($_pass != $this->password){\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_PASSWORD\");\n return;\n }\n\n if(!$this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n $this->Session = new ControlSession($this, $CookieName);\n session_start();\n $login_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\");\n $password_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\");\n\n $GLOBALS[$login_var] = $this->login;\n $GLOBALS[$password_var] = $this->password;\n\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\"), $this->login);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\"), $this->password);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_UserId\"), $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_user_id\")]);\n\n if (strlen($this->camefrom)) {\n $this->Response->Redirect($this->Kernel->Settings->GetItem(\"MODULE\",\"SiteURL\").$this->camefrom);\n } else {\n $this->Auth->DefaultRedirect(\"Frontend\");\n }\n }", "protected abstract function loadSessionData();", "protected function _session()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'set data on session markers',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n if ($this->_session && $this->_session->returns('display')) {\n foreach ($this->_session->returns('display') as $key => $val) {\n $this->generate('session_display;' . $key, $val);\n }\n }\n }", "public static function sessionReadHandler();", "function LoadFiles(){\n\n\t\t//open or create the user file\n\t\t$this->userFile = $this->fileHandler->rOpen('users.txt');\n\t\tif($this->userFile == NO_LOCK) $this->markFatal('User file is currently being edited, try again later');\n\t\telse if(!$this->userFile){\n\t\t\t$this->logMsg(WARNING, 'Failed to open user file, attempting to create one');\n\n\t\t\t$this->userFile = $this->fileHandler->rCreate('users.txt');\n\t\t\tif(!$this->userFile) $this->markFatal('Failed to create user file');\n\t\t}\n\n\t\t//open the schedule file\n\t\t$this->scheduleFile = $this->fileHandler->rOpen('schedule.txt');\n\t\tif($this->userFile == NO_LOCK) $this->markFatal('Schedule file is locked, try again later');\n\t\telse if(!$this->scheduleFile) $this->markFatal('Failed to open schedule file');\n\t}", "function initialize()\n\t{\n\t\t$accountsfile = \"/tmp/accounts\";\n\n\t\t$size = filesize($accountsfile);\n\t\tif (FALSE == $size || 0 == $size)\n\t\t\t$_SESSION[\"accounts\"] = array();\n\n\t\t$_SESSION[\"accounts\"] = unserialize(file_get_contents($accountsfile));\n\t}", "public function user_session($data)\n {\n session_start();\n $_SESSION[\"id\"] = $data['id'];\n $_SESSION[\"username\"]\t= $data['username'];\n $_SESSION[\"isloggedin\"] = true;\n }", "function initSession(){\n\n\t\t//load resource files\n\t\t$this->refreshDataSet();\n\n\t\tif($this->isFatal())return;\n\n\t\t//check the state\n\t\t$this->checkInput();\n\n\t\t\n\t\tif($this->isFatal())return;\n\n\t\t//construct the table from the data\n\t\t$this->buildTable($this->schedule, $this->users);\n\n\t\tif($this->isFatal())return;\t\n\n\t}", "public function init() {\n// $session->open();\n// if (empty($_SESSION['userid'])) {\n// return $this->redirect('index.php?r=login');\n// }\n }", "function CurrentUserFolder() {\n\treturn $_SESSION['username'];\n}", "public function get_user_log($filename) {\r\n\t\t//$filename = $_COOKIE['PHPSESSID'];\r\n\t\t$dim = file_get_contents($this->path_user.$filename);\r\n\t\t$this->user = json_decode($dim);\r\n\t}", "function user_init($env, $vars) {\n $user = UserFactory::current($env);\n // TODO: fix cookies.\n\t//setcookie('user', NULL, $env->getData('session_lifetime', 86400));\n}", "private static function configureSession()\n {\n if(!isset($_SESSION))\n {\n session_start();\n }\n }", "public static function sessionAndUserLoggedIn(){\n Verify::session();\n Verify::userLoggedIn();\n }", "public function init()\n {\n if (!$_SESSION[$this->cookie_prefix . '_user']) {\n $email = '';\n $password = '';\n \n if ($_COOKIE[$this->cookie_prefix . '_email'] and $_COOKIE[$this->cookie_prefix . '_password']) {\n $email = $_COOKIE[$this->cookie_prefix . '_email'];\n $password = $_COOKIE[$this->cookie_prefix . '_password'];\n } elseif ($_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']) { //check for basic authentication\n $email = $_SERVER['PHP_AUTH_USER'];\n $password = md5($this->secret_phrase . $_SERVER['PHP_AUTH_PW']);\n }/* elseif ($_GET['auth_user'] and $_GET['auth_pw']) {\n $email = $_GET['auth_user'];\n $password = md5($this->secret_phrase . $_GET['auth_pw']);\n }*/\n \n if ($email and $password and table_exists($this->table)) {\n $result = sql_query('SELECT * FROM ' . $this->table . \" WHERE\n \t\t\t\temail='\" . escape($email) . \"'\n \t\t\t\", 1);\n \n if ($result && $password == md5($this->secret_phrase . $result['password'])) {\n $_SESSION[$this->cookie_prefix . '_email'] = $result['email'];\n $_SESSION[$this->cookie_prefix . '_password'] = $result['password'];\n }\n }\n }\n\n //check if logged in\n if ($_SESSION[$this->cookie_prefix . '_user'] and time() < $_SESSION[$this->cookie_prefix . '_expires']) {\n $this->user = $_SESSION[$this->cookie_prefix . '_user'];\n } elseif ($_SESSION[$this->cookie_prefix . '_email'] and $_SESSION[$this->cookie_prefix . '_password'] and table_exists($this->table)) {\n $this->load();\n }\n\n if ($_GET['u']) {\n $_SESSION['request'] = $_GET['u'];\n }\n }", "function saveSession() {}", "private static function init(){\n\t\t\tif (session_status() != PHP_SESSION_ACTIVE) {\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t}", "function wpdev_session_start() {\n session_start();\n }", "public static function initUserSession(){\n\t\t//var_dump($_SESSION['user']);\n\t\tif(isset($_SESSION['user'])){\n\t\t\t//echo \"<h1>le user existe, je le recupere</h1>\";\n\t\t\tself::$_leuser=$_SESSION['user'];\n\t\t}\n\t}", "function login()\n\t{\n\t\tif(isset($this->cookie[$this->sets['cookie_prefix'] . 'user']) && isset($this->cookie[$this->sets['cookie_prefix'] . 'pass'])) {\n\t\t\t$cookie_user = intval($this->cookie[$this->sets['cookie_prefix'] . 'user']);\n\t\t\t$cookie_pass = $this->cookie[$this->sets['cookie_prefix'] . 'pass'];\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name, t.membertitle_icon\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tLEFT JOIN %pmembertitles t ON t.membertitle_id = m.user_level\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t m.user_password='%s' AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\",\t$cookie_user, $cookie_pass);\n\t\t} else if(isset($_SESSION['user']) && isset($_SESSION['pass'])) {\n\t\t\t$session_user = intval($_SESSION['user']);\n\t\t\t$session_pass = $_SESSION['pass'];\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name, t.membertitle_icon\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tLEFT JOIN %pmembertitles t ON t.membertitle_id = m.user_level\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t MD5(CONCAT(m.user_password,'%s'))='%s' AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\",\t$session_user, $this->ip, $session_pass);\n\t\t} else {\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\", USER_GUEST_UID);\n\t\t\t$user['user_language'] = $this->get_browser_lang($this->sets['default_lang']);\n\t\t}\n\n\t\tif (!isset($user['user_id'])) {\n\t\t\t$user = $this->db->fetch(\"SELECT m.*, s.skin_dir, g.group_perms, g.group_file_perms, g.group_name\n\t\t\t\tFROM (%pskins s, %pgroups g, %pusers m)\n\t\t\t\tWHERE m.user_id=%d AND\n\t\t\t\t s.skin_dir=m.user_skin AND\n\t\t\t\t g.group_id=m.user_group LIMIT 1\", USER_GUEST_UID);\n\n\t\t\tsetcookie($this->sets['cookie_prefix'] . 'user', '', $this->time - 9000, $this->sets['cookie_path'], $this->sets['cookie_domain'], $this->sets['cookie_secure'], true );\n\t\t\tsetcookie($this->sets['cookie_prefix'] . 'pass', '', $this->time - 9000, $this->sets['cookie_path'], $this->sets['cookie_domain'], $this->sets['cookie_secure'], true );\n\n\t\t\tunset($_SESSION['user']);\n\t\t\tunset($_SESSION['pass']);\n\t\t\t$user['user_language'] = $this->get_browser_lang($this->sets['default_lang']);\n\t\t}\n\t\treturn $user;\n\t}", "public function sess_write()\r\r\n\t{\r\r\n\t\tif( ! $this->parent->check_write())\r\r\n\t\t{\r\r\n\t\t\t$_SESSION = array();\r\r\n\t\t\tforeach($this->parent->userdata as $key => $val)\r\r\n\t\t\t{\r\r\n\t\t\t\t$_SESSION[$key] = $val;\r\r\n\t\t\t}\r\r\n\r\r\n\t\t\t$this->parent->track_write();\r\r\n\t\t}\r\r\n\t}", "protected function initializeSession() {}", "function startSessionLoged() {\n $this->session->set_ini(); //call ini_set. must be called in every script cause it doesnt remain!\n $this->session->regenerate(); //regenerate the session id\n $this->session->generateTokenId($this->connection,$this->user->getUsrID()); //return the tokenId \n $this->session->initiate($this->user->getKeepMeLogged()); //set values for ip, agent... confirmation\n $this->session->initiateToken($this->session->getToken(), $this->user->getUsrID());\n $this->session->setExpiration(); //set the expiration of idle session\n $this->session->setCookie(); //secure the session cookie\n $this->session->wClose();\n\n }", "public function setSession(){\n if( $this->status === True ){\n $_SESSION['username'] = $this->username;\n $_SESSION['userlvl'] = $this->userlevel;\n $_SESSION['status'] = True;\n }else{\n $_SESSION['status'] = False;\n }\n }", "private function loginWithSessionData()\n { \n $this->user_name = $_SESSION['user_name'];\n $this->user_email = $_SESSION['user_email'];\n\n // set logged in status to true, because we just checked for this:\n //if(!empty($_SESSION['user_name']) && ($_SESSION['user_logged_in'] == 1)\n // when we called this method (in the constructor)\n $this->user_is_logged_in = true;\n \n if($_SESSION['user_privileges'] == 1)\n $this->user_admin = true;\n }", "function MySessionStart() {\n\tif (defined('SET_SESSION_NAME')) session_name(SET_SESSION_NAME);\n\t\n\tif (TRACKPOINT_ISSETUP) {\n\t\tif (!defined('TABLEPREFIX')) define('TABLEPREFIX', TRACKPOINT_TABLEPREFIX);\n\t\t$ses_class = new Session();\n\t\tsession_set_save_handler(\n\t\t\tarray(&$ses_class, '_open'),\n\t\t\tarray(&$ses_class, '_close'),\n\t\t\tarray(&$ses_class, '_read'),\n\t\t\tarray(&$ses_class, '_write'),\n\t\t\tarray(&$ses_class, '_destroy'),\n\t\t\tarray(&$ses_class, '_gc')\n\t\t);\n\t} else {\n\t\tini_set('session.save_handler', 'files');\n\t\tif (defined('TEMP_DIRECTORY') && is_writable(TEMP_DIRECTORY)) ini_set('session.save_path', TEMP_DIRECTORY);\n\t}\n\tsession_start();\n}", "function handleSession() {\n\tif(!isset($GLOBALS[\"cacheLimiter\"]))\n\t\t$GLOBALS[\"cacheLimiter\"] = CACHE_LIMITER;\n\tsession_cache_expire($GLOBALS[\"cacheLimiter\"]);\n\tsession_cache_expire(CACHE_TIMEOUT);\n\tsession_start();\n\tif(hasSessionTimedOut())\n\t logout(true);\n else\n \trefreshSession();\n\tif(shouldRestoreRedirectVars()) {\n\t\trestoreRedirectVars();\n\t}\n}", "function user_session()\n\t{\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\t//To set notice message\n\t\t\tframe_notices(\"Please Login in to Continue !!\",\"failure\");\n\t\t\t//To Redirect Page\n\t\t\tredirect(SITEPATH.\"/administrator/index.php\");\n\t\t}\n\t}", "public static function Process()\n\t{\n\t\tif(isset($_GET['logout']))\n\t\t{\n\t\t\tunset($_SESSION['username']);\n\t\t\tunset($_SESSION['password']);\n\t\t\tunset($_SESSION['ip']);\n\n\t\t\tMessage::Send(\"success\", \"You have been logged out.\", \"login.php\");\n\t\t}\n\n\t\t//log de user uit als er een verandering is in het ip\n\t\tif(isset($_SESSION['ip']) && $_SESSION['ip'] != $_SERVER['REMOTE_ADDR'])\n\t\t{\n\t\t\tunset($_SESSION['username']);\n\t\t\tunset($_SESSION['password']);\n\t\t\tunset($_SESSION['ip']);\n\n\t\t\tMessage::Send(\"error\", \"Your session has expired. Please login again.\", \"login.php\");\n\t\t}\n\n\t\t//check voor wachtwoord veranderingen. (als de username / wachtwoord veranderd is, dan wordt je automatisch uitgelogd)\n\t\tif(User::Logged() && !User::Check($_SESSION['username'], $_SESSION['password']))\n\t\t{\n\t\t\tunset($_SESSION['username']);\n\t\t\tunset($_SESSION['password']);\n\t\t\tunset($_SESSION['ip']);\n\n\t\t\tMessage::Send(\"error\", \"Your session has expired. Please login again.\", \"login.php\");\n\t\t}\n\t}", "public function __construct()\n {\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.use_trans_sid', 0);\n ini_set('session.save_handler', 'files');\n ini_set('session.gc_maxlifetime', 3600);\n\n session_name($this->sessionName);\n session_set_cookie_params(\n $this->sessionMaxLifeTime,\n $this->sessionPath,\n $this->sessionDomain,\n $this->sessionSSL,\n $this->sessionHTTPOnly\n );\n session_save_path($this->sessionSavePath);\n\n /*\n * very important : so read, write \n * can use them form my class not from SessionHandler\n * */\n session_set_save_handler($this, true);\n }", "public static function sessionOpenHandler();", "function Session () {\r\n session_start();\r\n }", "protected function loginIfRequested() {}", "private function _initSession()\n {\n Zend_Session::setOptions(array('remember_me_seconds' => intval(App::config()->remember_me_seconds) , 'save_path' => VAR_PATH . \"session\" , 'gc_probability' => 1 , 'gc_divisor' => 5000 , 'name' => \"zfsession\" , 'use_only_cookies' => 0));\n $handler = strtolower(App::config()->session_save_handler);\n if('db' === $handler){\n Zend_Session::setSaveHandler(new App_Session_SaveHandler_DbTable(array('name' => DB_TABLE_PREFIX . 'session' , 'primary' => 'id' , 'modifiedColumn' => 'modified' , 'dataColumn' => 'data' , 'lifetimeColumn' => 'lifetime')));\n }\n Zend_Session::start();\n }", "public function userHome()\n {\n $isLoggedin = $this->sessionManager->isLoggedIn();\n $username = $this->sessionManager->usernameFromSession();\n require_once __DIR__ . '/../templates/userHome.php';\n }", "function userAccess() \n {\n //setup database connector\n $this->dbConn = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);\n if(!$this->dbConn) die(mysql_error($this->dbConn));\n mysql_select_db($this->dbName, $this->dbConn) or die(mysql_error($this->dbConn)); \n \n if(isset($_COOKIE[$this->cookieName]) && !$this->is_logged_in()){ // retrieve cookie if any\n $cookieInfo = unserialize(base64_decode($_COOKIE[$this->cookieName])); // unserialize cookie \n $this->login($cookieInfo['uname'],$cookieInfo['password']); // call login function\n } \n\n }", "abstract protected function getSession();", "public static function check_log_in ()\n {\n session_start();\n\n if (!$_SESSION['user_data']) {\n header('Location: ./../index.php');\n exit;\n }\n }", "public function storeSession() {}", "public function saveToSession()\n {\n $_SESSION[PMF_SESSION_CURRENT_USER] = $this->getUserId();\n }", "function __construct() {\n\t\t\t// Suppress the automatic garbage collection bug thats detailed \n\t\t\t// at: http://jed.mu/5Z7I\n\t\t\t@session_start();\n\t\t\t$this->check_login();\n\t\t}", "function isConnected()\n{\n return isset($_SESSION[\"userDataFileName\"]);\n}", "protected static function persistCurrentUser()\n {\n // Black hole\n trigger_error(\n \"Method for remembering the current user isn't implemented. \" .\n \"You can use the Jasny\\Auth\\Sessions trait to store the current user in a session\",\n E_USER_NOTICE\n );\n }", "protected function setupSessionVars()\n\t{\n\t\tif(!empty($_SESSION[SESSION_KEY]))\n\t\t{\n\t\t\tself::$session = $_SESSION[SESSION_KEY];\n\t\t}\n\t\telse \n\t\t{\n\t\t\tself::$session = $_SESSION[SESSION_KEY] = array();\n\t\t}\n\t\tif(!empty($_SESSION[SESSION_FLASH_KEY]))\n\t\t{\n\t\t\tself::$session_flash = $_SESSION[SESSION_FLASH_KEY];\n\t\t\t$_SESSION['session_flash_data'] = array();\n\t\t}\n\t\telse \n\t\t{\n\t\t\tself::$session_flash = $_SESSION[SESSION_FLASH_KEY] = array();\n\t\t}\n\t}", "public static function check_session() {\n\t\t\t// get redirect_to_default\n\t\t\t$redirect_to_default = Cookie::get('redirect_to_default');\n\t\t\t\n\t\t\t// if empty redirect_to_default set from default settings\n\t\t\tif(empty($redirect_to_default)){$redirect_to_default = REDIRECT_TO_DEFAULT;}\n\t\t\t\t\t\t\n\t\t\t// check if auth token is submitted\n\t\t\tif(isset($_GET['authtoken']))\n\t\t\t{\n\t\t\t\t// check auth token\n\t\t\t\t$authtoken = Functions::encrypt_decrypt('decrypt', $_GET['authtoken'], \"\\x73\\x6f\\x6d\\x31\\x34\\x31\\x30\\x40\\x73\\x6f\\x6d\\x6e\\x65\\x74\\x69\\x63\\x73\");\n\t\t\t\t\t\n\t\t\t\t// get auth token\n\t\t\t\t$authtoken = json_decode($authtoken);\n\t\t\t\t\n\t\t\t\t// set active session\n\t\t\t\tif(!isset($authtoken->keep_session)){$authtoken->keep_session = true;}\n\t\t\t\t\n\t\t\t\t// unset login state\n\t\t\t\tif(!$authtoken->keep_session){self::set_state(false);}\n\t\t\t}\n\t\t\t\n\t\t\t// if session exists\n\t\t\tif(!self::get_state())\n\t\t\t{\t\n\t\t\t\t// check requested url\n\t\t\t\tif(trim(REQUEST_URI) != trim(APP_PATH.'/'.$redirect_to_default))\n\t\t\t\t{\t\n\t\t\t\t\t// get return url\t\t\t\t\t\n\t\t\t\t\t$returnUrl = urlencode(ltrim(str_replace(APP_PATH, '', REQUEST_URI), '/'));\n\t\t\t\t\t\n\t\t\t\t\t// check if auth token is submitted\n\t\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t\t{\n\t\t\t\t\t\t/*\n // get guest user info\n\t\t\t\t\t\t$guest_user = ORM::for_table('sys_user_login');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user pass is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_pass))\n\t\t\t\t\t\t$guest_user = $guest_user->where('user_pass', $authtoken->auth_pass);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user company is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_comp))\n\t\t\t\t\t\t$guest_user = $guest_user->where('sys_company_id', $authtoken->auth_comp);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user name is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_name))\n\t\t\t\t\t\t\t$guest_user = $guest_user->where('user_name', $authtoken->auth_name)->find_one();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$guest_user = $guest_user->find_one($authtoken->auth_user);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// check if user exists\n\t\t\t\t\t\tif(is_object($guest_user))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t// start session and set session values\n\t\t\t\t\t\t\tself::set_state(true);\n\t\t\t\t\t\t\tself::set('user_id', $guest_user->id);\n\t\t\t\t\t\t\tself::set('user_name', $guest_user->user_name);\n\t\t\t\t\t\t\tself::set('first_name', $guest_user->first_name);\n\t\t\t\t\t\t\tself::set('last_name', $guest_user->last_name);\n\t\t\t\t\t\t\tself::set('full_name', trim($guest_user->first_name.' '.$guest_user->last_name));\n\t\t\t\t\t\t\tself::set('email', $guest_user->email);\n\t\t\t\t\t\t\tself::set('mobile', $guest_user->mobile);\n\t\t\t\t\t\t\tself::set('company_id', (empty($guest_user->sys_company_id) ? $authtoken->company_id : $guest_user->sys_company_id));\n\t\t\t\t\t\t\tself::set('is_super_admin', $guest_user->is_super_admin);\t\n\t\t\t\t\t\t\tself::set('is_guest', ($authtoken->auth_user==GUEST_ID ? 1 : 0));\t\n\t\t\t\t\t\t\tself::set('last_login', $guest_user->last_login);\t\n\t\t\t\t\t\t\tself::set('logged_with_master_password', false);\n\t\t\t\t\t\t\tself::set('authtoken', $authtoken);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t\t}\n */\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.(empty($returnUrl) ? '' : '?returnUrl='.$returnUrl));\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t// check if auth token is submitted\n\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t{\n\t\t\t\t\t// check for valid auth user\n\t\t\t\t\tif($authtoken->auth_user!=GUEST_ID)\n\t\t\t\t\t{\n\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}*/\n\t\t}", "public static function page_logic(){\n\t\t\tif (basename($_SERVER['PHP_SELF']) == basename(__FILE__)){\n\t\t\t session_start();\n\n\t\t\t if (isset($_GET['logout'])){\n\t\t\t \t sspp::logout();\n\t\t\t \t if (!empty($_GET['goto'])){\n\t\t\t \t\t\theader('Location: '.$_GET['goto']);\n\t\t\t \t\t\texit;\n\t\t\t \t }else{\n\t\t\t \t\t\tdie(\"Logged out <a href=\\\"javascript:history.back();\\\">Back to previous page</a>\");\n\t\t\t \t } \t \n\t\t\t }\n\n\t\t\t if (sspp::isloggedin() || sspp::auth_with_post()){\n\t\t\t \t\tif (!empty($_GET['goto'])){\n\t\t\t \t\t\theader('Location: '.$_GET['goto']);\n\t\t\t \t\t\texit;\n\t\t\t \t\t}else{\n\t\t\t \t\t\tdie('Logged in!');\n\t\t\t \t\t}\n\t\t\t }else{\n\t\t\t sspp::page_protect_with_login();\n\t\t\t exit;\n\t\t\t }\n\t\t\t}else{\n\t\t\t //die($_SERVER['PHP_SELF'].' <br> '.basename(__FILE__));\n\t\t\t //calling from a different page\n\t\t\t sspp::secure();\n\t\t\t return;\n\t\t\t //all code after this (from other files) are accessing protected content;\n\t\t\t}\n\t}", "public function checsession() {\n // using the default layout 'protected/views/layouts/main.php'\n $session = Yii::app()->session['isLoggedIn'];\n if(empty($session)){\n $this->redirect(Yii::app()->baseUrl.'/index.php');\n }\n }", "public function start()\n {\n session_name($this->getConfigVariable('name'));\n ini_set(\"session.use_only_cookies\", $this->getConfigVariable('use_only_cookies'));\n ini_set(\"session.cookie_secure\", $this->getConfigVariable('cookie_secure'));\n ini_set(\"session.hash_function\", $this->getConfigVariable('hash_function'));\n // create a private session directory so that another script\n // with a lower lifetime doesn't clean up our session\n $path = $this->getConfigVariable('save_path');\n if (!empty($path) and\n is_dir($path) and\n is_writable($path)\n ) {\n ini_set('session.save_path', $this->getConfigVariable('save_path'));\n }\n //When to destroy sessions on the filesystem\n ini_set('session.gc_maxlifetime', $this->getConfigVariable('gc_maxlifetime'));\n ini_set('session.gc_probability', $this->getConfigVariable('gc_probability'));\n ini_set('session.gc_divisor', $this->getConfigVariable('gc_divisor'));\n\n //session_set_cookie_params (lifetime,path,domain,secure)\n session_set_cookie_params(\n $this->getConfigVariable('cookie_lifetime'),\n $this->getConfigVariable('cookie_path'),\n $this->getConfigVariable('cookie_domain'),\n $this->getConfigVariable('cookie_secure')\n );\n\n //the session_cache_limiter cache-control line is there to kill a bug in\n //IE that causes the PDF not to be cached over ssl.\n //these lines allow the caching and let the file be downloaded.\n //This bug doesn't seem to affect the preview\n //it was present in IE6 and IE7\n session_cache_limiter('must-revalidate');\n\n session_start();\n //do a very small check to see if the browser is the same as the originating browser\n //this canbe fooled easily, but provides a bit of security\n if (empty($_SESSION)) {\n $this->setup();\n } elseif (empty($_SESSION['security']) or\n $_SESSION['security']['user-agent'] != md5(\n empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']\n )\n ) {\n $this->restart();\n }\n }", "function logged_in()\n {\n @session_start();\n $user_agent = md5($_SERVER['HTTP_USER_AGENT']);\n $session_id = session_id();\n\n if (isset($_SESSION['auth']))\n {\n if ($_SESSION['auth'] == 1)\n {\n //Get session data from session table\n $db = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);\n mysql_select_db(DB_NAME, $db);\n $res = mysql_query(\"SELECT user_id, user_agent, last_activity FROM sessions WHERE session_id = '$session_id'\", $db);\n\n $res = mysql_fetch_assoc($res);\n $db_user_agent = $res['user_agent'];\n\n //Determine if current user agent is the same as user agent in the db.\n if ($user_agent == $db_user_agent)\n {\n //return success IFF user has been active within the last 30 minutes\n \n $max_inactivity = 1800;\n $last_activity = $res['last_activity'];\n\n if ((time() - $last_activity) > $max_inactivity)\n {\n session_destroy();\n $this->redirect('portal/login');\n exit();\n }\n else\n {\n $user['id'] = $res['user_id'];\n\t\t\t\t\t\t$_SESSION['auth_id'] = $res['user_id'];\n\n $res = mysql_query(\"SELECT group_id, name, contact_email, logo FROM clients where id = '\" . $res['user_id'] . \"'\");\n $res = mysql_fetch_assoc($res);\n $user['group_id'] = $res['group_id'];\n $user['email'] = $res['contact_email'];\n $user['name'] = $res['name'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$_SESSION['name_id'] = $res['name'];\n\t\t\t\t\t\t$_SESSION['group_id'] = $res['group_id'];\n\t\t\t\t\t\t$_SESSION['logo_id'] = $res['logo'];\n\n $ip_address = $_SERVER['REMOTE_ADDR'];\n $last_activity = time();\n\n $res = mysql_query(\"UPDATE sessions SET ip_address = '$ip_address', user_agent = '$user_agent', last_activity = '$last_activity' WHERE session_id = '$session_id'\");\n\n return $user;\n }\n }\n else\n {\n return false;\n }\n }\n }\n else\n {\n return false;\n }\n }", "function login() {\n $this->checkAccess('user',true,true);\n\n\n $template = new Template;\n echo $template->render('header.html');\n echo $template->render('user/login.html');\n echo $template->render('footer.html');\n\n //clear error status\n $this->f3->set('SESSION.haserror', '');\n }", "public static function header_logged_in()\n {\n require_once(getcwd() . \"/views/Template/header-logged-in.php\");\n }", "function session_start2() \r\t{\r\t\tif (SIS_SECURE == true){\r\t\t\t$session_name = md5('lib'.$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);\t\t\t\r\t\t\t$httponly = true;\r\t\t\tif (ini_set('session.use_only_cookies', 1) === FALSE) {\r\t\t\t\tdie('Could not initiate a safe session (ini_set)');\r\t\t\t}\r\t\t\t$cookieParams = session_get_cookie_params();\r\t\t\tsession_set_cookie_params($cookieParams[\"lifetime\"],\r\t\t\t\t\t$cookieParams[\"path\"],\r\t\t\t\t\t$cookieParams[\"domain\"],\r\t\t\t\t\ttrue,\r\t\t\t\t\t$httponly);\t\t\r\t\t\tsession_name($session_name);\r\t\t\tsession_start();\r\t\t\tsession_regenerate_id();\r\t\t}else{\r\t\t\tsession_start();\r\t\t}\r\t}", "protected function CreateSession($_user_id)\n {\n // user has supplied valid credentials, so log them in\n // generate a 32-character session string to be used to identify the user for subsequent page views\n $charDump='abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n do\n {\n $sessionID='';\n for($t=0;$t<32;$t++)\n {\n $sessionID .= $charDump{mt_rand(0,strlen($charDump)-1)};\n }\n // check to see if 32-character string already exists\n\t$q = self::$DB->SelectQuery('sessions');\n\t$q->conditions = \"session_id = ?\";\n\t$q->limit = \"1\";\n\t$q->parameters = array($sessionID);\n\n\t$result = self::$DB->Process($q);\n\n } while($result);\n\n //Destroy previous user sessions\n $q = self::$DB->DeleteQuery('sessions');\n $q->conditions = \"user_id = ?\";\n $q->parameters = array($_user_id);\n\n self::$DB->Process($q);\n\n // add a row to the sessions table, containing login info\n $q = self::$DB->InsertQuery('sessions');\n $q->fields = array(\n\t\t\t \"session_id\" => $sessionID,\n\t\t\t \"user_id\" => $_user_id,\n\t\t\t \"started\" => time(),\n\t\t\t \"lastact\" => time(),\n\t\t\t \"useragent\" => self::$REQUEST->Server(\"HTTP_USER_AGENT\"),\n\t\t\t \"ipaddr\" => self::$REQUEST->Server(\"REMOTE_ADDR\")\n\t\t\t);\n\n self::$DB->Process($q);\n\n // set cookie\n setcookie(SETTINGS::COOKIENAME, $sessionID, ($this->_shouldRemember == \"yes\") ? time()+26352000 : 0, Krai::GetConfig(\"BASEURI\") == \"\" ? \"/\" : \"/\".Krai::GetConfig(\"BASEURI\"), SETTINGS::COOKIE_DOMAIN);\n }\n\n\n}", "function _load(){ \n //verificar la session \n if(isset($_GET['adm'])&&!inicie_sesion()){\n if(isset($_COOKIE['sessionHash'])&&$_COOKIE['sessionHash']!=''){\n login_user_hash($_COOKIE['sessionHash']);\n _load();\n exit;\n }\n if(isset($_GET['ajax'])){\n echo json_encode(array('error'=>'session'));\n exit;\n }else{\n header('Location: '.__url_real.'xlogin/login/'.base64_encode($_SERVER['REQUEST_URI']).'/');\n exit;\n }\n }\n\n if(isset($_GET['adm'])&&inicie_sesion()){\n //verifica si el usuario que inicio la sesion tiene permiso para acceder\n if(logueado::permitirAcceso()){//logueado::tieneAcceso()\n require('plantillas/admin/admin.php');\n }else{\n header('Location: '.__url_real.'xlogin/login/'.base64_encode($_SERVER['REQUEST_URI']).'/');\n exit;\n }\n }else{\n if (isMobile()) { \n if(file_exists(__path.'index.mobile.php')){\n require (__path.'index.mobile.php');\n }else{ \n require (__path.'index.php');\n }\n }else{\n require (__path.'index.php');\n }\n }\n}", "function PrepareUserSession(){\n\t\t\n\t\t$User = $this->input->post('frm_MJ_User_Login');\n\n\t\t$this->load->model('UserModel', 'UM');\n\t\t$UserID = $this->UM->getUser($User); //added by raquib\n\t\t$UserType = $this->UM->getUserType($UserID, $User);\n\t\n\t\t//echo \"Usertype\".$UserType;\n\n\t\t$UserRole = $this->UM->getUserRole($UserType); // added by raquib\t\t\n\t\t$LoginDtl= $this->UM->getLoginDtl($UserID, $User); //added by raquib\n\t\tif (count($LoginDtl) >0) {\n\t\t\tforeach($LoginDtl as $lstl):\n \t\t$UserPrev= $lstl->MJ_USER_ROLE_TP;\n\t\t\tendforeach;\n\n\t\t}\n\n\t\t// this if condition added by raquib\n\t\tif ($UserType == 2 || $UserType == 5) {//User is employee and Pensioner\n\t\t\t$EmpUserData = $this->UM->getEmpData($UserID);\t\n\t\t\tforeach($EmpUserData as $eudata):\n\t\t\t$UserName= $eudata->EMPNAME;\n\t\t\t$UserEmail = $eudata->EMP_EMAIL_ID;\n \t\t$DepId= $eudata->EMP_POST_DEP;\n \t\t$DepDesc= $eudata->DEP_DESC;\n\t\t\tendforeach;\n\n\t\t} elseif ($UserType == 1 || $UserType == 4) {//User is student and Alimni\n\t\t\t$StuUserData = $this->UM->getStuData($UserID);\n\t\t\tforeach($StuUserData as $sudata):\n\t\t\t$UserName=$sudata->STUNAME;\n \t\t$SsmId= $sudata->STU_SSM_ID;\n \t\t$DepId= $sudata->STU_DEPT;\n \t\t$DepDesc=$sudata->DEPTNAME;\n\t\t\tendforeach;\n\t\t} else { //added by raquib\n\t\t\t$AdminUserData = $this->UM->getAdminName($UserID);\n\t\t\tforeach($AdminUserData as $audata):\n\t\t\t$UserName= $audata->ADMINNAME;\n\t\t\t$UserEmail = $audata->EMAILID;\n \t\t$AdminDepId= $audata->DEPID;\n \t\t$AdminDepDesc= $audata->DEP_NAME;\n\t\t\tendforeach;\n\t\t}\n\t\t\n\t\t$this->load->model('MenuModel');\n\t\t$UserMenu = $this->MenuModel->getUserMenu($UserType);\n\t\t$MenuPrev = $this->MenuModel->getMenuPrev($UserType);\n\n\t\t$sessionData = array(\n\t\t\t'user'\t\t=> \t$User,\n\t\t\t'login'\t\t=> \t$UserID,\n \t'username' => \t$UserName,\n \t'useremail' => \t$UserEmail,\n \t'userprev'\t=>\t$UserPrev,\n \t'usertype'\t=>\t$UserType,\n \t'userrole'\t=>\t$UserRole,\n \t'menu' \t\t=> \t$UserMenu,\n \t'menuprev'\t=>\t$MenuPrev,\n \t'ssmid'\t\t=>\t$SsmId,\n \t'depid'\t\t=>\t$DepId,\n \t'depdesc'\t=>\t$DepDesc,\n \t'admindepid'=>\t$AdminDepId,\n \t'admindepdesc'=>$AdminDepDesc\n\t\t);\n\n\t\t$this->session->set_userdata($sessionData);\n\t}", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "private function preventSessionHijack() {\n if (isset($_SESSION[\"browser\"]) && isset($_SESSION[\\model\\UserModel::$sessionUser]) && $_SESSION[\\model\\UserModel::$sessionUser][\\model\\UserModel::$userLoggedIn]) {\n $this->user = new \\model\\UserModel($_SESSION[\\model\\UserModel::$sessionUser][\\model\\UserModel::$userName]);\n if ($_SESSION[\"browser\"] !== $_SERVER['HTTP_USER_AGENT']) {\n $this->user->logout();\n $this->loginView->deleteCookies();\n }\n }\n }", "public function pcr_auth_session_start() {\r\n\r\n // # check session_status()\r\n if(session_status() === PHP_SESSION_NONE) {\r\n session_start();\r\n }\r\n\r\n $request_uri = $_SERVER['REQUEST_URI'];\r\n\r\n // # due to wp nonce in some request_uri's, lets partial match login and logout strings\r\n // # also look for onesignal references even though we match on entire troublsome URL's below.\r\n if(stripos('login', $request_uri) !== true && stripos('logout', $request_uri) !== true && stripos('onesignal', $request_uri) !== true) {\r\n\r\n // # build the array of known url's to skip\r\n $skip_urls = array('/',\r\n '/login/',\r\n '/wp-admin/admin-ajax.php',\r\n '/wp-cron.php?doing_wp_cron',\r\n '/login/?login=false',\r\n '/login/?login=failed',\r\n '/wp-login.php'\r\n );\r\n\r\n // # check if reuest uri is empty and does not match skip_urls array\r\n if(!empty($request_uri) && !in_array($request_uri, $skip_urls)) {\r\n\r\n // # all is good, set the session\r\n $_SESSION['request_uri'] = $request_uri;\r\n }\r\n }\r\n }", "function cklogin($username, $password)\n{\n\n // to read all users from json\n $users = getUsers();\n\n if (isset($username) && isset($password)) {\n // to check each user psw and uname\n foreach ($users as $user) {\n\n if ($user[\"user\"] == $username && $user[\"password\"] == $password) {\n\n $_SESSION['username'] = $username;\n\n $message = ' Welcome ' . $_SESSION[\"username\"] ;\n\n require_once 'view/loginsuccess.php';\n\n }\n }\n }\n\n if (isset($_SESSION['username']) == false) {\n\n require_once 'view/loginsuccess.php';\n } else {\n $news = getNews();\n require_once 'view/home.php';\n }\n return true;\n}", "private function __construct(){\n // 1800 seconds = 30 minutes\n session_set_cookie_params(1800, \"/\");\n\n session_start();\n\n if(!empty($_SESSION[\"username\"])){\n self::$is_logged_in = true;\n self::$logged_user = array(\n \"user_id\" => $_SESSION[\"user_id\"],\n \"username\" => $_SESSION[\"username\"],\n );\n }\n }", "function requestUserLogInFromFacebook (){\n\t\tinclude ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/requestUserLogInFromFacebook.fb.inc.php');\n\t}", "protected function loadUserData()\n {\n $this->userData = ($this->session->userData?:[]) + $this->userDataTemplate;\n }", "private function ReadSession(){\n\n if( !file_exists(SESSIONS.$_COOKIE['USERID'].'.json') ){\n $json=array();\n $json['validatedBadges']=[];\n $json_enc=json_encode($json);\n $cookieID = '';\n if( !isset($_COOKIE['USERID']) ){\n $cookieID = date('ymdhis').md5(rand(0,9999999));\n setcookie('USERID', date('ymdhis').md5(rand(0,9999999)), time()+3600*24*30*12*10 );\n }else{\n $cookieID = $_COOKIE['USERID'];\n }\n file_put_contents(SESSIONS.$cookieID.'.json', $json_enc);\n\n return $json;\n }\n\n $json = file_get_contents(SESSIONS.$_COOKIE['USERID'].'.json');\n return json_decode($json,true);\n }" ]
[ "0.7287273", "0.6857692", "0.6821347", "0.6705255", "0.659079", "0.6566443", "0.6562858", "0.6552743", "0.6548169", "0.6522315", "0.6505147", "0.6478468", "0.63974047", "0.63933814", "0.63793594", "0.6348772", "0.63311255", "0.63299793", "0.63150555", "0.62952363", "0.6294093", "0.6284047", "0.62724155", "0.6257597", "0.62144005", "0.61940444", "0.61784035", "0.61760676", "0.6173749", "0.61675406", "0.6158149", "0.6140849", "0.6124518", "0.61136353", "0.61050284", "0.60995317", "0.6091082", "0.6089663", "0.6073777", "0.6073592", "0.6059001", "0.6042487", "0.6038009", "0.60232717", "0.60169435", "0.60148907", "0.60081667", "0.5997323", "0.599561", "0.5991431", "0.5988997", "0.5986726", "0.5977805", "0.597693", "0.59761727", "0.5975061", "0.59748507", "0.5971375", "0.5969158", "0.59643555", "0.59553665", "0.5954764", "0.5952882", "0.59490347", "0.5948203", "0.59458953", "0.5944352", "0.59430677", "0.5937435", "0.5932054", "0.5926683", "0.5922552", "0.5919793", "0.59088576", "0.5905411", "0.59044385", "0.5903836", "0.5901824", "0.5899216", "0.5898803", "0.58978736", "0.5897857", "0.5887823", "0.58830804", "0.58819145", "0.5879849", "0.58797264", "0.5875918", "0.58741367", "0.58714414", "0.58673155", "0.58638877", "0.5856333", "0.5852771", "0.58494544", "0.5848492", "0.584522", "0.58406854", "0.5839436", "0.58361673", "0.583478" ]
0.0
-1
first get the relationship ID
function processEConsentSignature( $studentID, $parentID, $date ) { $query = " SELECT r.id FROM civicrm_relationship r WHERE r.contact_id_a = %1 AND r.contact_id_b = %2 AND r.relationship_type_id = 1 AND r.is_active = 1 "; $params = array( 1 => array( $studentID, 'Integer' ), 2 => array( $parentID , 'Integer' ) ); $relationshipID = CRM_Core_DAO::singleValueQuery( $query, $params ); if ( ! $relationshipID ) { CRM_Core_Error::fatal( ); } // check if entry exists in civicrm_value_parent_relationship_data $query = " SELECT id FROM civicrm_value_parent_relationship_data WHERE entity_id = %1 "; $params = array( 1 => array( $relationshipID, 'Integer' ) ); $dataID = CRM_Core_DAO::singleValueQuery( $query, $params ); if ( $dataID ) { $query = " UPDATE civicrm_value_parent_relationship_data SET econsent_signed = 1, econsent_signed_date = %1 WHERE id = %2 "; $params = array( 1 => array( $date, 'Timestamp' ), 2 => array( $dataID, 'Integer' ) ); } else { $query = " INSERT INTO civicrm_value_parent_relationship_data ( entity_id, econsent_signed, econsent_signed_date ) VALUES ( %1, 1, %2 ) "; $params = array( 1 => array( $relationshipID, 'Integer' ), 2 => array( $date, 'Timestamp' ) ); } CRM_Core_DAO::executeQuery( $query, $params ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRelationChildRealId();", "public function getRelationParentRealId();", "public function getRelationChildId();", "public function getRelationId()\n {\n return $this->relation_id;\n }", "public function relationship(){\n return $this->hasOne('App\\Relationship','id','relationship_id');\n }", "public function getIdRelatorio0()\n {\n return $this->hasOne(Relatorio::className(), ['idRelatorio' => 'idRelatorio']);\n }", "public function getFirstId() {\n return $this->id[0];\n }", "public function getId() {\n\tif (isset($this->id)) {\n\t return $this->id;\n\t}\n\telse if (isset($this->refid)) {\n\t return $this->refid;\n\t}\n\telse {\n\t return null;\n\t}\n }", "public function getRelationObjectId()\n {\n return $this->relation_object_id;\n }", "public function getRelationParentId();", "public function activityForeignId();", "public function getRelaterId()\n {\n $value = $this->get(self::RELATER_ID);\n return $value === null ? (integer)$value : $value;\n }", "public function get_id();", "public function get_id();", "function get_id() {\n return $this->get_mapped_property('id');\n }", "public function getId() ;", "public function id()\n\t{\n\t\treturn $this->get($this->meta()->primary_key);\n\t}", "public function getForeignId()\r\n {\r\n return null;\r\n }", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "abstract public function get_id();", "public function getRelationshipName(): ?string;", "public function getId0()\n {\n return $this->hasOne(Doctor::className(), ['id' => 'id']);\n }", "function getId() {\n\t$this->load();\n\treturn $this->mId;\n }", "public function getID();", "public function getID();", "public function getID();", "function get_id()\r\n {\r\n return $this->id;\r\n }", "function get_id()\n {\n return $this->id;\n }", "public function getID()\n { return $this->get('id'); }", "public function getId()\n {\n return $this->id->getId();\n }", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function determineId() {}", "function get_id() {\n\t\treturn $this->id;\n\t}", "public function getId() {\n if (is_array($this->id) && count($this->id) === 1) {\n return current($this->id);\n }\n return $this->id;\n }" ]
[ "0.71979064", "0.71632993", "0.7117626", "0.7062072", "0.6941591", "0.6792069", "0.6783225", "0.6774943", "0.6650318", "0.66299284", "0.6565541", "0.6464398", "0.6398677", "0.6398677", "0.63569885", "0.63469553", "0.6327139", "0.63031787", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.62719786", "0.6259742", "0.6250281", "0.6248272", "0.62431526", "0.6240669", "0.6240669", "0.6240669", "0.6219368", "0.62123686", "0.62113845", "0.6209272", "0.6193923", "0.6193489", "0.6174747", "0.6168457" ]
0.0
-1
CJ defined this action 20160606
public function getDeliveryCityDetails($dkParamDataArr){ $rspDetails = array(); if(count($dkParamDataArr)>0 && $dkParamDataArr!=false){ $rsltJsonArr = array(); $rsltJsonArr['defaultSelectedDeliveryCityDetails'] = false; $rsltJsonArr['allCityList'] = false; // initial variable declare here $gcountry_ids = $dkParamDataArr['country_ids']; $gcity_ids = $dkParamDataArr['city_ids']; // prepare param obj $shopStoreProductDeliveryParamObj = array(); $shopStoreProductDeliveryParamObj['country_ids'] = $gcountry_ids; $shopStoreProductDeliveryParamObj['city_ids'] = $gcity_ids; $shopStoreProductDeliveryParamObj['groupby_city_ids'] = 'Y'; $retShopStoreDeliveryLocationDetailsArr = ShopStoreDao::getShopStoreDeliveryLocationFacilityDetails($shopStoreProductDeliveryParamObj); if(count($retShopStoreDeliveryLocationDetailsArr)>0 && $retShopStoreDeliveryLocationDetailsArr!=false){ // remove unused keys from fetched array data $removeJsonKeyFromEachInputJsonArr = array( "shopStoreId"=>"0", "shopStoreName"=>"0", "countryCityAreaAffiliationId"=>"0", "countryId"=>"0", "countryName"=>"0", "areaId"=>"0", "areaName"=>"0", "isPreorderAccept"=>"0", "takeAwayOrderAccept"=>"0", "cashOnDeliveryAccept"=>"0","isOnlinePaymentAccept"=>"0","isHomeDeliveryAccept"=>"0", "orderDeliveryOpenTime"=>"0", "orderDeliveryCloseTime"=>"0" ); $removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr = utils :: removeJsonKeyAndValuesFromArrayOfJsonArray($retShopStoreDeliveryLocationDetailsArr, $removeJsonKeyFromEachInputJsonArr, 'keyname'); if(count($removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr)>0 && $removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr!=false){ // final merging $finalDeliveryCityLocationDetailsArr = utils::array_merge_common_elements( $removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr, array(array("cityId"=>$gcity_ids)), array("cityId"), array(), array("isRequestedDeliveryCityMatched"=>"Y"), array("isRequestedDeliveryCityMatched"=>"N") ); if(count($finalDeliveryCityLocationDetailsArr)>0 && $finalDeliveryCityLocationDetailsArr!=false){ $rsltJsonArr['allCityList'] = $finalDeliveryCityLocationDetailsArr; //sorted on matched delievery city $sortedOnMatchedDeliveryCityDetailsArr = utils::arraySort($finalDeliveryCityLocationDetailsArr, array("isRequestedDeliveryCityMatched")); if($sortedOnMatchedDeliveryCityDetailsArr!=false && count($sortedOnMatchedDeliveryCityDetailsArr)>0){ if(array_key_exists('Y', $sortedOnMatchedDeliveryCityDetailsArr)){ // default selected delivery city to show $rsltJsonArr['defaultSelectedDeliveryCityDetails'] = array( "cityId"=>$sortedOnMatchedDeliveryCityDetailsArr['Y'][0]['cityId'], "cityName"=>$sortedOnMatchedDeliveryCityDetailsArr['Y'][0]['cityName'], "cityIcon"=>"fa fa-map-marker" ); }else{ // default selected delivery city to show $rsltJsonArr['defaultSelectedDeliveryCityDetails'] = array( "cityId"=>$sortedOnMatchedDeliveryCityDetailsArr['N'][0]['cityId'], "cityName"=>$sortedOnMatchedDeliveryCityDetailsArr['N'][0]['cityName'], "cityIcon"=>"fa fa-map-marker" ); } } } } } if($rsltJsonArr['allCityList']!=false && count($rsltJsonArr['allCityList'])>0){ $rspDetails["deliveryCityDetails"] = $rsltJsonArr; } } ComponentsJson::GenerateJsonAndSend($rspDetails); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAction() {}", "public function paroleAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "private function actions()\n {\n }", "public function executeAction() {\r\n\t\t\r\n\t}", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "protected function executeAction() {\n \n }", "public function otherAction() {\n\t}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "public function tempAction()\n\t{\n\t}", "public function recordAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "public function addAction()\n\t{\n\n\t}", "private function add_actions()\n {\n }", "protected function createAction()\n {\n }", "public function addAction() {\r\n\t}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "public function preAction()\n {\n }", "public function newAction()\n\t{\n\t}", "public function getAction() {}", "public function getAction() {}", "public function getAction() {}", "public function getAction() {}", "public function newAction() {\n\n\t}", "public function act()\n\t{\n\t\n\t}", "protected function setActionName() {\n return NULL;\n }", "public function preAction() {\n\n }", "public function requestAction()\n {\n }", "public function newAction() {\n\t}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function getCallbackAction() {}", "public function getCallbackAction() {}", "function _action($action)\n\t{\n\t // Lay input\n\t $ids = $this->uri->rsegment(3);\n\t $ids = (!$ids) ? $this->input->post('id') : $ids;\n\t $ids = (!is_array($ids)) ? array($ids) : $ids;\n\t\n\t // Thuc hien action\n\t foreach ($ids as $id)\n\t {\n\t // Xu ly id\n\t $id = (!is_numeric($id)) ? 0 : $id;\n\t \t\n\t // Kiem tra id\n\t $info = model('user_bank')->get_info($id);\n\t if (!$info) continue;\n\t \n\t // Chuyen den ham duoc yeu cau\n\t $this->{'_'.$action}($info);\n\t }\n\t}", "public function annimalAddAction()\n {\n }", "public function actions();", "public function act() {\n\t}", "public function createAction() {\n\t}", "public function actionSh()\n {\n\n\n }", "protected function initAction()\n {\n }", "public function relatorioAction() { \r\n \r\n }", "static function get_action_parameter()\r\n {\r\n return ComplexDisplay :: PARAM_DISPLAY_ACTION;\r\n }", "public function action();", "protected function updateAction()\n {\n }", "public function annimalEditAction()\n {\n }", "public function newAction()\n {\n }", "public function pesquisarAction() {\r\n \r\n }", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_ACTION;\r\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function indexAction() \n {\n \t\n }", "protected function callActionMethod() {}", "public function initializeAction() {\n\n\t}", "public function allAction() {}", "abstract public function getAction();", "public function compareAction() {}", "public function createAction()\n {\n }", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function headAction()\n {\n \n }", "public function annimalDelAction()\n {\n }", "protected function getActions() {}", "protected function beforeAction () {\n\t}", "public function trasnaction(){\n\n\t}", "public function\n\t\tdo_actions()\n\t{\n\t}", "public function getAction(){\r\n return $this->sAction;\r\n }", "public function setup_actions() {}", "abstract public function getControllerAction();", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}" ]
[ "0.67247856", "0.671649", "0.6437445", "0.643536", "0.63321656", "0.6312646", "0.6312553", "0.6310357", "0.6310357", "0.6310357", "0.6309152", "0.6302439", "0.6295318", "0.62454003", "0.62454003", "0.6235346", "0.6234184", "0.6219791", "0.61924374", "0.6182017", "0.6179075", "0.6179075", "0.61731786", "0.6168533", "0.61544764", "0.61544764", "0.61544764", "0.61544764", "0.613944", "0.61221844", "0.61124325", "0.61104596", "0.6104423", "0.60968894", "0.609196", "0.609196", "0.609196", "0.6080281", "0.6080094", "0.60715735", "0.6065187", "0.60544646", "0.60516584", "0.6046289", "0.6031962", "0.60282516", "0.60089356", "0.6005415", "0.5993361", "0.598269", "0.59818494", "0.597569", "0.5969331", "0.5950535", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5943711", "0.5932773", "0.5932359", "0.5925626", "0.5920214", "0.59174997", "0.59105724", "0.5903185", "0.5900638", "0.5900638", "0.5900638", "0.5900638", "0.5900638", "0.5886793", "0.5883093", "0.5882997", "0.58713675", "0.5852936", "0.58493364", "0.5847657", "0.5839565", "0.5839457", "0.5827335", "0.5827335", "0.5827335" ]
0.0
-1
CJ defined this action 20160606
public function getDeliveryAreaDetails($dkParamDataArr){ $rspDetails = array(); // checking requested param if(count($dkParamDataArr)>0 && $dkParamDataArr!=false){ $rsltJsonArr = array(); $rsltJsonArr['defaultSelectedDeliveryAreaDetails'] = false; $rsltJsonArr['allAreaList'] = false; // initial variable declare $gcountry_ids = $dkParamDataArr['country_ids']; $gcity_ids = $dkParamDataArr['city_ids']; $garea_ids = $dkParamDataArr['area_ids']; // prepare param obj $shopStoreProductDeliveryParamObj = array(); $shopStoreProductDeliveryParamObj['country_ids'] = $gcountry_ids; $shopStoreProductDeliveryParamObj['city_ids'] = $gcity_ids; $shopStoreProductDeliveryParamObj['groupby_area_ids'] = 'Y'; $retShopStoreDeliveryLocationDetailsArr = ShopStoreDao::getShopStoreDeliveryLocationFacilityDetails($shopStoreProductDeliveryParamObj); if(count($retShopStoreDeliveryLocationDetailsArr)>0 && $retShopStoreDeliveryLocationDetailsArr!=false){ // remove unused keys from fetched array data $removeJsonKeyFromEachInputJsonArr = array( "shopStoreId"=>"0", "shopStoreName"=>"0", "countryCityAreaAffiliationId"=>"0", "countryId"=>"0", "countryName"=>"0", "ciytId"=>"0", "cityName"=>"0", "isPreorderAccept"=>"0", "takeAwayOrderAccept"=>"0", "cashOnDeliveryAccept"=>"0", "isOnlinePaymentAccept"=>"0", "isHomeDeliveryAccept"=>"0", "orderDeliveryOpenTime"=>"0", "orderDeliveryCloseTime"=>"0" ); $removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr = utils :: removeJsonKeyAndValuesFromArrayOfJsonArray($retShopStoreDeliveryLocationDetailsArr, $removeJsonKeyFromEachInputJsonArr, 'keyname'); if(count($removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr)>0 && $removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr!=false){ // final merging $finalDeliveryLocationDetailsArr = utils::array_merge_common_elements( $removedUnusedKeynameFromShopStoresDeliveryLocationsDetailsArr, array(array("areaId"=>$garea_ids)), array("areaId"), array(), array("isRequestedDeliveryAreaMatched"=>"Y", "areaIcon"=>"fa fa-map-marker"), array("isRequestedDeliveryAreaMatched"=>"N", "areaIcon"=>"fa fa-map-marker") ); if(count($finalDeliveryLocationDetailsArr)>0 && $finalDeliveryLocationDetailsArr!=false){ $rsltJsonArr['allAreaList'] = $finalDeliveryLocationDetailsArr; //sorted on matched delivery area $sortedOnMatchedDeliveryAreaDetailsArr = utils::arraySort($finalDeliveryLocationDetailsArr, array("isRequestedDeliveryAreaMatched")); if($sortedOnMatchedDeliveryAreaDetailsArr!=false && count($sortedOnMatchedDeliveryAreaDetailsArr)>0){ if(array_key_exists('Y', $sortedOnMatchedDeliveryAreaDetailsArr)){ $rsltJsonArr['defaultSelectedDeliveryAreaDetails'] = $sortedOnMatchedDeliveryAreaDetailsArr['Y'][0]; } } } } } if($rsltJsonArr['allAreaList']!=false && count($rsltJsonArr['allAreaList'])>0){ $rspDetails["deliveryAreaDetails"] = $rsltJsonArr; } } ComponentsJson::GenerateJsonAndSend($rspDetails); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAction() {}", "public function paroleAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "private function actions()\n {\n }", "public function executeAction() {\r\n\t\t\r\n\t}", "private function setAction()\n\t\t{\n\t\t\t$this->_action = ($this->_separetor[2]);\n\t\t}", "protected function executeAction() {\n \n }", "public function otherAction() {\n\t}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "public function tempAction()\n\t{\n\t}", "public function recordAction() {\n\t\t \t\t\t\t\n\t\t\n\t}", "public function take_action()\n {\n }", "public function take_action()\n {\n }", "public function addAction()\n\t{\n\n\t}", "private function add_actions()\n {\n }", "protected function createAction()\n {\n }", "public function addAction() {\r\n\t}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "public function preAction()\n {\n }", "public function newAction()\n\t{\n\t}", "public function getAction() {}", "public function getAction() {}", "public function getAction() {}", "public function getAction() {}", "public function newAction() {\n\n\t}", "public function act()\n\t{\n\t\n\t}", "protected function setActionName() {\n return NULL;\n }", "public function preAction() {\n\n }", "public function requestAction()\n {\n }", "public function newAction() {\n\t}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function addAction() {\n\t}", "public function getCallbackAction() {}", "public function getCallbackAction() {}", "function _action($action)\n\t{\n\t // Lay input\n\t $ids = $this->uri->rsegment(3);\n\t $ids = (!$ids) ? $this->input->post('id') : $ids;\n\t $ids = (!is_array($ids)) ? array($ids) : $ids;\n\t\n\t // Thuc hien action\n\t foreach ($ids as $id)\n\t {\n\t // Xu ly id\n\t $id = (!is_numeric($id)) ? 0 : $id;\n\t \t\n\t // Kiem tra id\n\t $info = model('user_bank')->get_info($id);\n\t if (!$info) continue;\n\t \n\t // Chuyen den ham duoc yeu cau\n\t $this->{'_'.$action}($info);\n\t }\n\t}", "public function annimalAddAction()\n {\n }", "public function actions();", "public function act() {\n\t}", "public function createAction() {\n\t}", "public function actionSh()\n {\n\n\n }", "protected function initAction()\n {\n }", "public function relatorioAction() { \r\n \r\n }", "static function get_action_parameter()\r\n {\r\n return ComplexDisplay :: PARAM_DISPLAY_ACTION;\r\n }", "public function action();", "public function annimalEditAction()\n {\n }", "protected function updateAction()\n {\n }", "public function newAction()\n {\n }", "public function pesquisarAction() {\r\n \r\n }", "static function get_action_parameter()\r\n {\r\n return self :: PARAM_ACTION;\r\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function newAction()\n {\n\n }", "public function indexAction() \n {\n \t\n }", "protected function callActionMethod() {}", "public function initializeAction() {\n\n\t}", "public function allAction() {}", "abstract public function getAction();", "public function compareAction() {}", "public function createAction()\n {\n }", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function headAction()\n {\n \n }", "public function annimalDelAction()\n {\n }", "protected function getActions() {}", "protected function beforeAction () {\n\t}", "public function trasnaction(){\n\n\t}", "public function\n\t\tdo_actions()\n\t{\n\t}", "public function getAction(){\r\n return $this->sAction;\r\n }", "public function setup_actions() {}", "abstract public function getControllerAction();", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}", "private function get_action() {\n\t\treturn $this->action;\n\t}" ]
[ "0.67226774", "0.671597", "0.6436481", "0.64337945", "0.63307726", "0.63111645", "0.63107985", "0.6308534", "0.6308534", "0.6308534", "0.63073283", "0.63021153", "0.6294846", "0.62447226", "0.62447226", "0.62349534", "0.62333846", "0.6218814", "0.6191783", "0.61822855", "0.61793375", "0.61793375", "0.6173171", "0.61684", "0.6152166", "0.6152166", "0.6152166", "0.6152166", "0.6139139", "0.612105", "0.61115855", "0.6110203", "0.6103991", "0.60965556", "0.6091304", "0.6091304", "0.6091304", "0.6079607", "0.60794115", "0.60692185", "0.60653716", "0.60528463", "0.6050391", "0.60450435", "0.603043", "0.6028631", "0.6008635", "0.60043496", "0.5992082", "0.5982413", "0.5982186", "0.5975174", "0.59689724", "0.59491396", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.5943078", "0.59334713", "0.5930814", "0.5926308", "0.59195703", "0.5914766", "0.590853", "0.59019613", "0.5900938", "0.5900938", "0.5900938", "0.5900938", "0.5900938", "0.58866084", "0.58828926", "0.5880869", "0.58715326", "0.58526325", "0.584814", "0.58450097", "0.58391637", "0.58380497", "0.5825008", "0.5825008", "0.5825008" ]
0.0
-1
Genera un requerimiento sin ViewState.
protected function createRequestMockWithoutViewState() { //$request = $this->getMockBuilder('\Symfony\Component\HttpFoundation\Request')->disableOriginalConstructor()->getMock(); $request = Request::create(''); $request->query = new ParameterBag(array( 'param2' => 'param2_value' )); return $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getViewState() {}", "function outputViewState()\n {\n $retval = \"\";\n foreach ($this->ViewState as $key => $value)\n {\n $retval .= \"<input type=\\\"hidden\\\" name=\\\"ViewState[\" .$key . \"]\\\" value=\\\"\" . $value . \"\\\">\";\n }\n return $retval;\n }", "private function serialize_viewstate(){\n return base64_encode(serialize($this->viewstate));\n }", "function getViewState(){\n\treturn $_POST[ SESSION_NAME_SPACE ][ 'viewSate' ];\t\n}", "public function getViewState()\n {\n if(is_null($this->_viewState) ){\n $this->_viewState = ViewState::createFromGlobals($this->getRequest(), $this->get('session'));\n }\n return $this->_viewState;\n }", "function setViewState( $ViewState ){\n\t\n\tif ( ! isset ( $_POST[ SESSION_NAME_SPACE ][ 'viewSate' ] ) ){\n\t\t$_POST[ SESSION_NAME_SPACE ][ 'viewSate' ] = $ViewState;\t\n\t}\n}", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n\t{\n\t}", "public function state(){\n return $this->state;\n }", "function getPreviousState();", "public function getReviewstate() {}", "public function state();", "public function replace() {\r\n//primary use is update the status when 'falling through' the state gate\r\n//instead of returning to the executive\r\n\t$clone = clone($this);\r\n\t$_SESSION[\"STATE\"][$this->thread][$this->position] = serialize($clone);\r\n}", "public function getBaseState() {}", "public function getPreviousState();", "public function getRState()\n {\n return $this->r_state;\n }", "function printState() {\n\t\t$state = $this->getState();\n\t\techo $state;\n\n\t\n\t}", "function OzState() {$this->reset();}", "public function getState(){\n\t\treturn $this->state;\n\t}", "public function getState()\n {\n if (!$this->state->getViewId()) {\n $this->state->loadByView($this->getId());\n }\n return $this->state;\n }", "public function setState()\n {\n if(isset($_SESSION['oauthState'])) return $this->state = $_SESSION['oauthState'];\n\n $this->state = md5(uniqid(mt_rand()));\n $_SESSION['oauthState'] = $this->state;\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 getState() {}", "public function getState() {}", "public function getState() {}", "public function state(): string {\n return $this->_state;\n }", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::fetch('app');\n $filter_order = $app->getUserStateFromRequest('Source.filter_order','filter_order','s.name');\n $filter_order_Dir = $app->getUserStateFromRequest('Source.filter_order_Dir','filter_order_Dir','asc');\n\n //set states\n $this->state->set('Source.filter_order',$filter_order);\n $this->state->set('Source.filter_order_Dir',$filter_order_Dir);\n }", "public function restore(string $state);", "public function get_state()\n {\n return $this->_state;\n }", "function getState()\n {\n\t\treturn $this->_state;\n }", "public function getState()\n {\n return $this->getParameter('state');\n }", "public function get_state() {\n\t\treturn $this->data['state'];\n\t}", "public function getStateMessage();", "public function state(Request $request)\n {\n $user = Auth::user();\n $submissions = StateMerge::where('id', $request->itemId)->get();\n $type = \"State\";\n $approved = true;\n return view('submission.submissionItem', compact('user','submissions','type', 'approved'));\n }", "protected function getState()\n {\n return Str::random(40);\n }", "protected function getState()\n {\n return Str::random(40);\n }", "public function __toString(): string\n {\n return __CLASS__.'::__toString'.\"\\n\".print_r($this->stateRaw, true);\n }", "public function postState($stateDetail)\n {\n \n }", "function loadState($new)\n {}", "public function getCurrentState();", "public function getUnbuiltState()\n {\n return $this->state;\n }", "public function GetState()\n\t{\n\t\treturn SPUtils::join_key_values_encode(\"=\", \"&\", array_intersect_key($this->__oauth, array_flip($this->include_in_state)));\n\t}", "public function state()\n {\n return $this->state;\n }", "function stateUpdate() {\n global $function_permission;\n if ($function_permission['is_edit']) {\n $str = '<input name=\"subupdate\" id=\"subupdate\" type=\"submit\" value=\"' . UPDATE . '\"/>';\n }\n $str .= '<input name=\"btnhuy\" id=\"btnhuy\" type=\"button\" onClick=\"javascript:huy();\" value=\"' . HUY . '\"/>';\n return $str;\n }", "public function getTranslatedStateAttribute()\n {\n return [\n 'state' => $this->state,\n 'class' => __('app.selects.project.concept_class.' . $this->state),\n ];\n }", "function getState()\r\n\t{\r\n\t\treturn $this->state;\r\n\t}", "abstract public function getState() ;", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::get('app');\n $view = $this->app->input->get('view');\n\n //TODO add these limits to the switch statement to support multiple pages and layouts\n // Get pagination request variables\n $limit = $app->getUserStateFromRequest($view.'_limit','limit',10);\n $limitstart = $app->getUserStateFromRequest($view.'_limitstart','limitstart',0);\n\n // In case limit has been changed, adjust it\n $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);\n\n $this->state->set($view.'_limit', $limit);\n $this->state->set($view.'_limitstart', $limitstart);\n\n //set default filter states for reports\n $filter_order = $app->getUserStateFromRequest('People.filter_order','filter_order','p.last_name');\n $filter_order_Dir = $app->getUserStateFromRequest('People.filter_order_Dir','filter_order_Dir','asc');\n $people_filter = $app->getUserStateFromRequest('People.'.$view.'_name','name',null);\n\n //set states for reports\n $this->state->set('People.filter_order',$filter_order);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.'.$view.'_name',$people_filter);\n\n }", "public function getState()\n {\n }", "function getState() {\n return $this->state;\n }", "protected function populateState() {\n\t\t\n\t $app\t = JFactory::getApplication();\n\t\t/** @var $app JSite **/\n\t \n\t\t$params\t = $app->getParams($this->option);\n\t\t$this->setState('params', $params);\n\t\t\n\t\t// Visitor\n\t\t$visitorId = (int)JFactory::getUser()->get(\"id\");\n\t\t$this->setState($this->option.'.visitor.id', $visitorId);\n\t\t\n\t\t$userId = $app->input->get->getInt(\"id\");\n\t\tif(!$userId) {\n\t\t $userId = (int)JFactory::getUser()->get(\"id\");\n\t\t}\n\t\t$this->setState($this->option.'.profile.user_id', $userId);\n\t\t\n\t $value = ($userId == $visitorId) ? true : false;\n\t $this->setState($this->option.'.visitor.is_owner', $value);\n\t}", "public function index()\n\t{\n /*Create Breadcumb*/\n $this->make_bread->add('State', '', 0);\n $arrData['breadcrumb'] = $this->make_bread->output();\n /*Create Breadcumb*/\n\n $arrData['statelist'] = $this->master->view_record();\n\t\treturn load_view(\"State/view\",$arrData);\n\t}", "function _setModelState()\r\n {\r\n $state = parent::_setModelState(); \r\n $app = JFactory::getApplication();\r\n $model = $this->getModel( $this->get('suffix') );\r\n $ns = $this->getNamespace();\r\n\r\n $state['filter_id_from'] = $app->getUserStateFromRequest($ns.'id_from', 'filter_id_from', '', '');\r\n $state['filter_id_to'] = $app->getUserStateFromRequest($ns.'id_to', 'filter_id_to', '', '');\r\n $state['filter_name'] = $app->getUserStateFromRequest($ns.'name', 'filter_name', '', '');\r\n $state['filter_enabled'] = $app->getUserStateFromRequest($ns.'enabled', 'filter_enabled', '', '');\r\n $state['filter_taxclass'] = $app->getUserStateFromRequest($ns.'taxclass', 'filter_taxclass', '', '');\r\n $state['filter_shippingtype'] = $app->getUserStateFromRequest($ns.'shippingtype', 'filter_shippingtype', '', '');\r\n \r\n foreach (@$state as $key=>$value)\r\n {\r\n $model->setState( $key, $value ); \r\n }\r\n return $state;\r\n }", "public function getState($state)\n {\n $projects = Project::where('state', $state)->get();\n return view('main')->with(['state'=> $state,'projects'=> $projects]);\n }", "protected function populateState() \n\t{\n\t\t\n\t\t$app = JFactory::getApplication('com_einsatzkomponente');\n\t\t// Load state from the request userState on edit or from the passed variable on default\n if (JFactory::getApplication()->input->get('layout') == 'edit') {\n $id = JFactory::getApplication()->getUserState('com_einsatzkomponente.edit.einsatzbericht.id');\n\n } else {\n $id = JFactory::getApplication()->input->get('id');\n JFactory::getApplication()->setUserState('com_einsatzkomponente.edit.einsatzbericht.id', $id);\n }\n\t\t$this->setState('einsatzbericht.id', $id);\n\t\t// Load the parameters.\n\t\t$params = $app->getParams();\n $params_array = $params->toArray();\n if(isset($params_array['item_id'])){\n $this->setState('einsatzbericht.id', $params_array['item_id']);\n }\n\t\t$this->setState('params', $params);\n\t}", "public function getNewState()\n {\n return $this->newState;\n }", "public function loginState()\n {\n $result = '<div class=\"loginState\">';\n\n $user = User::getCurrent();\n if ($user) {\n $result .= '<a href=\"' . $this->view->serverUrl() . $this->view->url(\n ['controller' => 'user', 'action' => 'view', 'id' => $user->id], 'singleid', true) . '\">' . $this->view->gravatar($user) . ' ' . $this->view->escape($user->nickname) . '</a> ';\n\n $result .= '<a href=\"' . $this->view->serverUrl() . $this->view->url(\n ['controller' => 'user', 'action' => 'logout'], 'default', true) . '\">' . $this->view->translate('Logout') . '</a> ';\n } else {\n $result .= ' <a href=\"' . $this->view->serverUrl() . $this->view->url(\n ['controller' => 'user', 'action' => 'new'], 'default', true) . '\">' . $this->view->translate('Subscribe') . '</a> ';\n\n $result .= '<a href=\"' . $this->view->serverUrl() . $this->view->url(\n ['controller' => 'user', 'action' => 'login'], 'default', true) . '\">' . $this->view->translate('Login') . '</a>';\n }\n\n return $result . '</div>';\n }", "private function restore_state() {\n\t\t\tglobal $ld_qs_api_vars;\n\n\t\t\tif ( is_array( $ld_qs_api_vars ) && count( $ld_qs_api_vars ) ) {\n\t\t\t\t$recent_state = array_pop( $ld_qs_api_vars );\n\n\t\t\t\tforeach ( $recent_state as $property => $val ) {\n\t\t\t\t\t$this->$property = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function getState(){\n return $this->_getData(self::STATE);\n }", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::get('app');\n\n //determine view so we set correct states\n $view = $app->input->get('view');\n\n // Get pagination request variables\n $limit = $app->getUserStateFromRequest($view.'_limit','limit',10);\n $limitstart = $app->getUserStateFromRequest($view.'_limitstart','limitstart',0);\n\n // In case limit has been changed, adjust it\n $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);\n\n $this->state->set($view.'_limit', $limit);\n $this->state->set($view.'_limitstart', $limitstart);\n\n //set default filter states for reports\n $filter_order = $app->getUserStateFromRequest('Company.filter_order','filter_order','c.name');\n $filter_order_Dir = $app->getUserStateFromRequest('Company.filter_order_Dir','filter_order_Dir','asc');\n $company_filter = $app->getUserStateFromRequest('Company.'.$view.'_name','company_name',null);\n\n //set states for reports\n $this->state->set('Company.filter_order', $filter_order);\n $this->state->set('Company.filter_order_Dir', $filter_order_Dir);\n $this->state->set('Company.'.$view.'_name', $company_filter);\n }", "public function getState(/* ... */)\n {\n return $this->_state;\n }", "public function initChangeStateContent()\n {\n }", "public function setState($state){\n\t\treturn Cundd_Vis_Model_Process_Adapter::write($state,$this->_processId);\n\t}", "public function getState() { return $this->data->get(\"state\"); }", "abstract public function setState() ;", "public function getUserState(){\n return($this->userState);\n }", "public function updateState($state);", "public function changeState()\n {\n // Check for request forgeries.\n JSession::checkToken(\"get\") or jexit(JText::_('JINVALID_TOKEN'));\n\n $userId = JFactory::getUser()->get(\"id\");\n if (!$userId) {\n $redirectOptions = array(\n \"force_direction\" => JRoute::_(\"index.php?option=com_users&view=login\", false)\n );\n $this->displayNotice(JText::_(\"COM_CROWDFUNDING_ERROR_NOT_LOG_IN\"), $redirectOptions);\n return;\n }\n\n $redirect = base64_decode($this->input->get(\"redirect\"));\n $redirectOptions = array(\n \"force_direction\" => JRoute::_($redirect, false)\n );\n\n $txnId = $this->input->get->getInt('txn_id');\n $state = $this->input->get->getInt('state');\n\n $state = (!$state) ? 0 : 1;\n\n if (!$txnId) {\n $this->displayWarning(JText::_(\"COM_CROWDFUNDING_ERROR_INVALID_TRANSACTION\"), $redirectOptions);\n return;\n }\n\n $keys = array(\n \"id\" => $txnId,\n \"receiver_id\" => $userId\n );\n\n /** @var $transaction Crowdfunding\\Transaction */\n $transaction = new Crowdfunding\\Transaction(JFactory::getDbo());\n $transaction->load($keys);\n\n if (!$transaction->getId()) {\n $this->displayWarning(JText::_(\"COM_CROWDFUNDING_ERROR_INVALID_TRANSACTION\"), $redirectOptions);\n return;\n }\n\n try {\n\n $transaction->updateRewardState($state);\n\n } catch (Exception $e) {\n JLog::add($e->getMessage());\n throw new Exception(JText::_('COM_CROWDFUNDING_ERROR_SYSTEM'));\n }\n\n if (!$state) {\n $msg = JText::_(\"COM_CROWDFUNDING_REWARD_HAS_BEEN_SET_AS_NOT_SENT\");\n } else {\n $msg = JText::_(\"COM_CROWDFUNDING_REWARD_HAS_BEEN_SET_AS_SENT\");\n }\n\n $this->displayMessage($msg, $redirectOptions);\n }", "public function getCurrentStateAction()\n {\n $controller = new ModuleStateController();\n\n $this->View()->assign(['response' => $controller->getCurrentState()->toArray()]);\n }", "public function getInvoiceState()\n {\n return $this->getParameter('invoiceState');\n }", "protected function establishCSRFTokenState()\n {\n if ($this->getState() === null) {\n $this->setState(md5(uniqid(mt_rand(), true)));\n $this->getStorage()->set('state', $this->getState());\n }\n }", "public function buildStateData($state = array()) {\n if (empty($state)) {\n return false;\n }\n\n $result = array();\n foreach (request()->session()->get('languages') as $lang => $language) {\n foreach($this->translatedAttributes as $field) {\n $this->translateOrNew($lang)->{$field} = $data[$lang . '_' .$field];\n }\n }\n\n }", "public function getState()\r\n {\r\n return $this->_state;\r\n }", "public function run()\n {\n return view('microboard::state', [\n 'config' => $this->config,\n 'title' => 'إعلانات قادمة',\n 'info' => 'لم يأتي وقت بداية ظهور هذه الإعلانات',\n 'icon' => 'fa fa-images',\n 'count' => Advertisement::whereDate('started_at', '>', now()->toDateString())->count(),\n ]);\n }", "public function getState()\r\n {\r\n return $this->state;\r\n }", "public function getState()\r\n {\r\n return $this->state;\r\n }", "private function prehledNavstev(){\n $this->tpl = \"historie-navstev\";\n \n \t$prehled = new HlavniPrehled($this->db);\n \n $this->render = array(\n\t\t\t'navstevy' => $prehled->vypis(@$_POST), \n\t\t);\t\n }", "protected function getState(): string\n {\n return Str::random(40);\n }", "protected function _getState()\n {\n return $this->state;\n }", "public static function __set_state($data);", "public function setState($state);", "public function setState($state) {}", "public function formCambiarEstado(){\n\t\t$this->load->view(\"formCambiarEstado\");\n\t}", "public function addViewState( $key, $value = null )\n {\n $this->page->$key = $value;\n $this->viewState[ $key ] = null;\n $this->viewState[ $key ] =& $this->page->$key;\n }", "protected function getState()\n {\n return $this->stateRaw[$this->name];\n }", "public function stateTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken('get');\n\n\t\t// Incoming\n\t\t$id = Request::getInt('id', 0);\n\t\t$state = strtolower(Request::getWord('state', 'up'));\n\n\t\tif ($state != 'up' && $state != 'down')\n\t\t{\n\t\t\tApp::redirect(\n\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t$row = new Middleware\\Location($id);\n\t\tif ($row->exists())\n\t\t{\n\t\t\t$row->set('state', $state);\n\t\t\tif (!$row->store())\n\t\t\t{\n\t\t\t\tApp::redirect(\n\t\t\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false),\n\t\t\t\t\tLang::txt('COM_TOOLS_ERROR_STATE_UPDATE_FAILED'),\n\t\t\t\t\t'error'\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false)\n\t\t);\n\t}", "private function renderView(){\n $switchView = strtolower($_POST['switch-tab']);\n\n if($switchView !== 'logout' && $_SESSION['login'])\n $switchView = 'search';\n elseif($switchView === 'register' && $_SESSION['registered']){\n $switchView = 'login';\n unset($_SESSION['registered']);\n }\n elseif(isset($switchView) && !empty($switchView)){\n $switchView = $switchView;\n unset($_POST['switch-tab']);\n }\n else\n $switchView = 'login';\n return $this->switchView($switchView);\n }", "final public function getState() {\n return $this->state;\n }" ]
[ "0.6684585", "0.645113", "0.6403894", "0.6284754", "0.6137009", "0.57681066", "0.5489903", "0.5489903", "0.54768133", "0.5424451", "0.5313368", "0.526869", "0.5256283", "0.52078784", "0.5174294", "0.51462746", "0.51422477", "0.51376057", "0.51041937", "0.5092075", "0.50828516", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.5070451", "0.50476724", "0.50472736", "0.5047078", "0.5043903", "0.5034065", "0.50237626", "0.5023175", "0.49902317", "0.4983099", "0.4970805", "0.49633858", "0.49602908", "0.49562523", "0.49562523", "0.494855", "0.4946379", "0.49453145", "0.49448", "0.49405408", "0.49382058", "0.4935175", "0.49264434", "0.4893473", "0.48901045", "0.48869923", "0.4865438", "0.48584163", "0.48566237", "0.4843984", "0.48430467", "0.48218235", "0.48080584", "0.48037198", "0.47978926", "0.47909456", "0.47754973", "0.4773365", "0.4770256", "0.4768246", "0.47678313", "0.47619414", "0.47587442", "0.47541076", "0.4751006", "0.47486547", "0.4743451", "0.4736683", "0.47294915", "0.47250497", "0.472094", "0.47179905", "0.4717888", "0.4715476", "0.4715476", "0.47110704", "0.47083956", "0.47053725", "0.46988866", "0.46938717", "0.46883538", "0.46823204", "0.46746284", "0.46661505", "0.4663594", "0.4658421", "0.46552286" ]
0.0
-1
Genera un requerimiento con un ViewState incorrecto. Se espera que al utilizar un ViewState con nodos que no respeten la estructura del Sitemap, directamente se descarte el ViewState.
protected function createRequestMockWithIncorrectViewState() { $request = Request::create(''); $request->query = new ParameterBag(array( 'param2' => 'param2_value', 'bc_url' => $this->encodeViewState(array(array('name' => 'node_1', 'params' => array('param1' => 'param1_value_modified')))) )); return $request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getViewState() {}", "function outputViewState()\n {\n $retval = \"\";\n foreach ($this->ViewState as $key => $value)\n {\n $retval .= \"<input type=\\\"hidden\\\" name=\\\"ViewState[\" .$key . \"]\\\" value=\\\"\" . $value . \"\\\">\";\n }\n return $retval;\n }", "private function serialize_viewstate(){\n return base64_encode(serialize($this->viewstate));\n }", "public function getReviewstate() {}", "public function getViewState()\n {\n if(is_null($this->_viewState) ){\n $this->_viewState = ViewState::createFromGlobals($this->getRequest(), $this->get('session'));\n }\n return $this->_viewState;\n }", "function getViewState(){\n\treturn $_POST[ SESSION_NAME_SPACE ][ 'viewSate' ];\t\n}", "public function getUnbuiltState()\n {\n return $this->state;\n }", "public function renderUnrepresentable()\r\n\t{\r\n\t\treturn $this->renderError(new XenForo_Phrase('requested_page_is_unrepresentable_in_html'));\r\n\t}", "public static function get_routed_state() {\n global $wp;\n\n $pagename = isset($wp->query_vars['pagename']) ? $wp->query_vars['pagename'] : null;\n $current_url = wp_ng_get_current_url(true);\n\n /* UI Routed page */\n $states = self::get_ng_router_states();\n\n foreach ( $states as $state ) {\n\n if (isset($state['post']) && is_singular($state['post']['type']) && !empty($state['url'])) {\n\n if (isset($state['abstract']) && $state['abstract']) {\n\n if ($pagename === explode('.', $state['name'])[0]) {\n return $state;\n }\n\n continue;\n }\n elseif ($current_url === trailingslashit($state['parentUrl'] . $state['url'])) {\n\n return $state;\n }\n }\n }\n\n return false;\n }", "private static function getView()\n\t{\n\t\tif(\\Config::get('laravel-sitemap::sitemap.sort')) static::sort();\n\t\treturn \\View::make('laravel-sitemap::sitemap')->with('links', static::$links);\n\t}", "public static function GenerateRoute () {\n // Failed or invalid attempts need to render a different view (and have the model be null);\n }", "public static function get_ng_router_abstract_states( $post ) {\n\n $states = array();\n\n $is_routed_post = intval(get_post_meta( $post->ID, '_is_ng_routed', true ));\n $state = self::get_ng_router_state( $post );\n $state_abstract = (array)$state;\n\n $state_abstract['abstract'] = true;\n\n if ( !$is_routed_post ) {\n $state_abstract['template'] = '<ui-view/>';\n }\n\n //Add Abstract state\n unset($state_abstract['controller']);\n unset($state_abstract['controllerAs']);\n\n //Add abstract\n $states[$state_abstract['name']] = $state_abstract;\n\n //Add base if is routed\n if ( $is_routed_post ) {\n\n $state->name .= '.base';\n $state->url = '';\n unset($state->resolve);\n unset($state->post);\n\n $states[$state->name] = (array)$state;\n }\n\n return $states;\n }", "function revertState(): void\n {\n if (!$this->stateStack) {\n throw new \\LogicException('The state stack is empty');\n }\n\n [$this->valid, $this->offset, $this->index, $this->current] = array_pop($this->stateStack);\n }", "function setViewState( $ViewState ){\n\t\n\tif ( ! isset ( $_POST[ SESSION_NAME_SPACE ][ 'viewSate' ] ) ){\n\t\t$_POST[ SESSION_NAME_SPACE ][ 'viewSate' ] = $ViewState;\t\n\t}\n}", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n\t{\n\t}", "protected function isUnchanged() {}", "function scorm_get_skip_view_array(){\n return array(0 => get_string('never'),\n 1 => get_string('firstaccess','scorm'),\n 2 => get_string('always'));\n}", "public function getNoViewFlag() {}", "public function testStateValidatesCorrectly()\n {\n $this->assertTrue($this->state->validate(uniqid()));\n\n // Test again with a different value.\n $this->assertTrue($this->state->validate(uniqid()));\n }", "private function validateView() {\n /*\n foreach ($this->sugarTemplateIndicators as $indicator) {\n if (strpos($this->viewContent, $indicator) !== false) {\n throw new ViewContentNotRenderedException(Sugar::childClass());\n }\n }\n */\n }", "function OzState() {$this->reset();}", "public function getLostPassword()\n\t{\n\t\t// not permit anyone accessing its device to reset the password\n\t\tif (Auth::check()) {\n\t\t\treturn $this->redirectWhenLogged(); }\n\t\t$attemptEmail = Session::get('club.login_fail_email');\n\t\treturn View::make(\n\t\t\tConfig::get('club::views.lost_password'),\n\t\t\tarray('defaults' => array('email' => $attemptEmail))\n\t\t);\n\t}", "public function archivetalinkcompleteAction() {\n\t\tPageTitle::setTitle($this->view, $this->_request);\n\t\t$session = new Zend_Session_Namespace('archivetalinkcomplete');\n\t\tif (!$session->ta_id) {\n\t\t\t$this->_redirect('/index');\n\t\t\treturn;\n\t\t}\n\t\t$this->view->lo_id = $session->lo_id;\n\t\t$this->view->ta_id = $session->ta_id;\n\t\tunset($session->lo_id);\n\t\tunset($session->ta_id);\n\t}", "public function testView() {\n\t\t$result = $this->CreditNote->view('creditnote-1');\n\t\t$this->assertTrue(isset($result['CreditNote']));\n\t\t$this->assertEqual($result['CreditNote']['id'], 'creditnote-1');\n\n\t\ttry {\n\t\t\t$result = $this->CreditNote->view('wrong_id');\n\t\t\t$this->fail('No exception on wrong id');\n\t\t} catch (OutOfBoundsException $e) {\n\t\t\t$this->pass('Correct exception thrown');\n\t\t}\n\t}", "public function index()\n\t{\n /*Create Breadcumb*/\n $this->make_bread->add('State', '', 0);\n $arrData['breadcrumb'] = $this->make_bread->output();\n /*Create Breadcumb*/\n\n $arrData['statelist'] = $this->master->view_record();\n\t\treturn load_view(\"State/view\",$arrData);\n\t}", "function getPreviousState();", "protected function renderHiddenReferrerFields() {}", "public function state(Request $request)\n {\n $user = Auth::user();\n $submissions = StateMerge::where('id', $request->itemId)->get();\n $type = \"State\";\n $approved = true;\n return view('submission.submissionItem', compact('user','submissions','type', 'approved'));\n }", "public function testInvalidView() {\n $renderer = $this->container->get('renderer');\n $render_element = [\n '#type' => 'view',\n '#name' => 'invalid_view_name',\n '#embed' => FALSE,\n ];\n $this->expectException(ViewRenderElementException::class);\n $this->expectExceptionMessage(\"Invalid View name ({$render_element['#name']}) given.\");\n $renderer->renderRoot($render_element);\n }", "public function password_lost()\n\t{\n\t\t$data['title'] = \"Mot de passe perdu ?\";\n\t\t$this->load->view('lib', $data);\n\t\t$this->load->view('password_lost_specifics');\n\t\t$this->load->view('header_'.$_SESSION['language']);\n\t\t$this->load->view('password_lost');\n\t\t$this->load->view('footer_'.$_SESSION['language']);\n\t}", "public function testViewWithBadTemplateOnRender()\n {\n (new BadTemplateView(new CalculatorModel(), 'badTemplate'))->render();\n }", "public function renderView()\n {\n //$_SESSION[\"info\"] zobrazuje vysledek operaci, paklize se nejake udaly\n if((isset($_SESSION[\"info\"])) && (!empty($_SESSION[\"info\"]))){\n $this->view_data[\"info\"] = $_SESSION[\"info\"];\n $_SESSION[\"info\"] = null;\n } \n\n //generuje csrf token pro formulare\n if (!isset($_SESSION[\"csrf_token\"])) {\n $_SESSION[\"csrf_token\"] = rand(1, 1e9);\n }\n \n if ($this->view)\n {\n $this->view_data[\"view\"] = $this->view;\n extract($this->view_data);\n $main_template = (dirname(__FILE__) .'/../view/@layout.phtml');\n \n if(file_exists($main_template))\n require_once($main_template); \n }\n }", "public function getPreviousState();", "protected function retrieveValidatedView(array $form, FormStateInterface $form_state, $unset = TRUE) {\n // @todo Figure out why all this hashing is done. Wouldn't it be easier to\n // store a single entry and that's it?\n $key = hash('sha256', serialize($form_state->getValues()));\n $view = ($this->validated_views[$key] ?? NULL);\n if ($unset) {\n unset($this->validated_views[$key]);\n }\n return $view;\n }", "public function reverseState()\n {\n $etat = $this->getIsActive();\n\n return !$etat;\n }", "public function reverseState()\n {\n $etat = $this->getIsActive();\n\n return !$etat;\n }", "protected function doTestOutdatedStatus() {\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n $langcode = 'fr';\n $languages = \\Drupal::languageManager()->getLanguages();\n\n // Mark translations as outdated.\n $edit = ['content_translation[retranslate]' => TRUE];\n $edit_path = $entity->toUrl('edit-form', ['language' => $languages[$langcode]]);\n $this->drupalGet($edit_path);\n $this->submitForm($edit, $this->getFormSubmitAction($entity, $langcode));\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n\n // Check that every translation has the correct \"outdated\" status, and that\n // the Translation fieldset is open if the translation is \"outdated\".\n foreach ($this->langcodes as $added_langcode) {\n $url = $entity->toUrl('edit-form', ['language' => ConfigurableLanguage::load($added_langcode)]);\n $this->drupalGet($url);\n if ($added_langcode == $langcode) {\n // Verify that the retranslate flag is not checked by default.\n $this->assertSession()->fieldValueEquals('content_translation[retranslate]', FALSE);\n $this->assertEmpty($this->xpath('//details[@id=\"edit-content-translation\" and @open=\"open\"]'), 'The translation tab should be collapsed by default.');\n }\n else {\n // Verify that the translate flag is checked by default.\n $this->assertSession()->fieldValueEquals('content_translation[outdated]', TRUE);\n $this->assertNotEmpty($this->xpath('//details[@id=\"edit-content-translation\" and @open=\"open\"]'), 'The translation tab is correctly expanded when the translation is outdated.');\n $edit = ['content_translation[outdated]' => FALSE];\n $this->drupalGet($url);\n $this->submitForm($edit, $this->getFormSubmitAction($entity, $added_langcode));\n $this->drupalGet($url);\n // Verify that retranslate flag is now shown.\n $this->assertSession()->fieldValueEquals('content_translation[retranslate]', FALSE);\n $storage = $this->container->get('entity_type.manager')\n ->getStorage($this->entityTypeId);\n $storage->resetCache([$this->entityId]);\n $entity = $storage->load($this->entityId);\n $this->assertFalse($this->manager->getTranslationMetadata($entity->getTranslation($added_langcode))->isOutdated(), 'The \"outdated\" status has been correctly stored.');\n }\n }\n }", "public function resetView()\n {\n $this->view = null;\n }", "private function render_invalid_step() {\n\t\t?>\n\t\t<p><?php\n\t\tprintf(\n\t\t\t/* translators: 1 - an opening link tag, 2 - a closing link tag. */\n\t\t\tesc_html__( 'You have reached an invaild step - %1$sreturn to the start of the wizard%2$s.', 'wp-security-audit-log' ),\n\t\t\t'<a href=\"' . esc_url( $this->get_welcome_step() ) . '\">',\n\t\t\t'</a>'\n\t\t);\n\t\t?></p>\n\t\t<?php\n\t}", "public function replace() {\r\n//primary use is update the status when 'falling through' the state gate\r\n//instead of returning to the executive\r\n\t$clone = clone($this);\r\n\t$_SESSION[\"STATE\"][$this->thread][$this->position] = serialize($clone);\r\n}", "public function getRewritten()\n {\n return $this->rewritten;\n }", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::get('app');\n $view = $this->app->input->get('view');\n\n //TODO add these limits to the switch statement to support multiple pages and layouts\n // Get pagination request variables\n $limit = $app->getUserStateFromRequest($view.'_limit','limit',10);\n $limitstart = $app->getUserStateFromRequest($view.'_limitstart','limitstart',0);\n\n // In case limit has been changed, adjust it\n $limitstart = ($limit != 0 ? (floor($limitstart / $limit) * $limit) : 0);\n\n $this->state->set($view.'_limit', $limit);\n $this->state->set($view.'_limitstart', $limitstart);\n\n //set default filter states for reports\n $filter_order = $app->getUserStateFromRequest('People.filter_order','filter_order','p.last_name');\n $filter_order_Dir = $app->getUserStateFromRequest('People.filter_order_Dir','filter_order_Dir','asc');\n $people_filter = $app->getUserStateFromRequest('People.'.$view.'_name','name',null);\n\n //set states for reports\n $this->state->set('People.filter_order',$filter_order);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.filter_order_Dir',$filter_order_Dir);\n $this->state->set('People.'.$view.'_name',$people_filter);\n\n }", "private function assertPageNotReloaded(): void {\n $this->assertSession()->pageTextContains($this->pageReloadMarker);\n }", "public function notFoundAction()\n {\n return $this->viewBuilder()->buildViewFromTemplate($this->detailsViewTemplate);\n }", "public function isVisitante(){ return false; }", "function search_api_post_update_views_query_type() {\n $config_factory = \\Drupal::configFactory();\n $changed_cache = [];\n\n foreach ($config_factory->listAll('views.view.') as $view_config_name) {\n $view = $config_factory->getEditable($view_config_name);\n if (substr($view->get('base_table'), 0, 17) == 'search_api_index_') {\n $displays = $view->get('display');\n\n $update_query = $update_cache = FALSE;\n foreach ($displays as $id => $display) {\n if (($display['display_options']['query']['type'] ?? '') === 'views_query') {\n $displays[$id]['display_options']['query']['type'] = 'search_api_query';\n $update_query = TRUE;\n }\n if (in_array($display['display_options']['cache']['type'] ?? '', ['tag', 'time'])) {\n $displays[$id]['display_options']['cache']['type'] = 'none';\n $update_cache = TRUE;\n }\n }\n\n if ($update_query || $update_cache) {\n $view->set('display', $displays);\n // Mark the resulting configuration as trusted data. This avoids issues\n // with future schema changes.\n $view->save(TRUE);\n if ($update_cache) {\n $changed_cache[] = $view->get('id');\n }\n }\n }\n }\n\n if ($changed_cache) {\n $vars = ['@ids' => implode(', ', array_unique($changed_cache))];\n return t('The following views have had caching switched off. The selected caching mechanism does not work with views on Search API indexes. Please either use one of the Search API-specific caching options or \"None\": @ids.', $vars);\n }\n\n return NULL;\n}", "function getHtmlStep2View()\r\n\t{\r\n\t\treturn '';\r\n\t}", "public function generateRevealedGameLayout()\r\n {\r\n $board = $this->board;\r\n $board->loopLayout(function($val, $row, $col) use (&$layout) {\r\n if (in_array($val, [self::POINT_SHIP, self::POINT_HIT], true)) {\r\n $layout[$row][$col] = self::POINT_HIT;\r\n } else if (in_array($val, [self::POINT_MISS, self::POINT_NO_SHOT], true)) {\r\n $layout[$row][$col] = '';\r\n }\r\n });\r\n\r\n return $this->makeGamingEdges($layout, $board->getRows(), $board->getColumns());\r\n }", "public function getLost(){\r\n\t\t//$this->drool;\r\n\t\t$pathway = array();\r\n\t\t// rss\t\t\r\n\t\t$pathway['first'] \t= array(WPI_BLOG_NAME.'&apos;s Feeds',array(\r\n\t\t\t'href' => get_feed_link(),\r\n\t\t\t'type' => 'application/rss+xml',\r\n\t\t\t'title'=> __(WPI_BLOG_NAME.' | Subscribe to this feed',WPI_META),\r\n\t\t\t'hreflang' => get_hreflang(),\r\n\t\t\t'rel' => self::RSS_REL,\r\n\t\t\t'class' => 'rtxt rss16',\r\n\t\t\t'rev' => 'feed:rss2'\r\n\t\t) );\t\r\n\t\t\r\n\t\t// home\r\n\t\t$pathway['home'] = $this->getFrontpage();\r\n\t\t\r\n\t\tglobal $wp_query;\r\n\t\t\r\n\t\t$pathway['last'] = array('404 Not Found',array(\r\n\t\t\t'href'=>'#content-top',\r\n\t\t\t'class'=> self::DN_ARROW\r\n\t\t));\r\n\t\t\r\n\t\treturn $pathway;\t\t\t\r\n\t}", "public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}", "public function getResearchHistory()\n {\n return view('research.research_history', [\n 'logs' => Auth::user()->getResearchLogs(0),\n 'trees' => Tree::orderBy('sort', 'DESC')->get(),\n ]);\n }", "public function getState()\n {\n if (!$this->state->getViewId()) {\n $this->state->loadByView($this->getId());\n }\n return $this->state;\n }", "abstract protected function resetCompleteView();", "function elgg_filepath_cache_reset() {\n\t$cache = elgg_get_filepath_cache();\n\t$view_types_result = $cache->delete('view_types');\n\t$views_result = $cache->delete('views');\n\treturn $view_types_result && $views_result;\n}", "protected function hasInvalidState()\n {\n $state = $this->request->session()->pull('state');\n\n return !(strlen($state) > 0 && $this->request->input('state') === $state);\n }", "public function getunmarkedAction ()\r\n {\r\n $this->_helper->viewRenderer->setNoRender(false);\r\n $this->_helper->layout()->enableLayout();\r\n }", "function SimulationBuildRoute(&$query)\n{\n\t$segments\t= array();\n\n\t// get a menu item based on Itemid or currently active\n\t$app\t\t= JFactory::getApplication();\n\t$menu\t\t= $app->getMenu();\n\t$params\t\t= JComponentHelper::getParams('com_workshop');\n\t$advanced\t= $params->get('sef_advanced_link', 0);\n\n\t// we need a menu item. Either the one specified in the query, or the current active one if none specified\n\tif (empty($query['Itemid'])) {\n\t\t$menuItem = $menu->getActive();\n\t\t$menuItemGiven = false;\n\t}\n\telse {\n\t\t$menuItem = $menu->getItem($query['Itemid']);\n\t\t$menuItemGiven = true;\n\t}\n\n\tif (isset($query['layout']) && isset($query['id'])) {\n\t\t$view = $query['layout'];\n\t\t$id = $query['id'];\n\t}\n\telse {\n\t\t// we need to have a view in the query or it is an invalid URL\n\t\treturn $segments;\n\t}\n\n\tif (!$view == '')\n\t{\n\t\t\t$segments[] = 'RealEstateProperties';\n\t\t\t$segments[] = $view;\n\t\t\t$segments[] = $id;\n\t\t\tunset($query['layout']);\n\t\t\tunset($query['id']);\n\t}\n\treturn $segments;\n}", "function qa_load_state()\n{\n\tglobal $qa_state;\n\n\t$qa_state = qa_get('state');\n\tunset($_GET['state']); // to prevent being passed through on forms\n}", "function taxonomy_post_update_clear_views_data_cache() {\n // An empty update will flush caches.\n}", "private function prehledNavstev(){\n $this->tpl = \"historie-navstev\";\n \n \t$prehled = new HlavniPrehled($this->db);\n \n $this->render = array(\n\t\t\t'navstevy' => $prehled->vypis(@$_POST), \n\t\t);\t\n }", "public function failedTransacton(){\n \n return view('responsepage');\n }", "public function testView() {\r\n\t\t$result = $this->ShopProductAttribute->view('shopproductattribute-1');\r\n\t\t$this->assertTrue(isset($result['ShopProductAttribute']));\r\n\t\t$this->assertEqual($result['ShopProductAttribute']['id'], 'shopproductattribute-1');\r\n\r\n\t\ttry {\r\n\t\t\t$result = $this->ShopProductAttribute->view('wrong_id');\r\n\t\t\t$this->fail('No exception on wrong id');\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->pass('Correct exception thrown');\r\n\t\t}\r\n\t}", "public function assertViewFailed(array $parameters) : void\n {\n $xPath = '//*[@data-id=\"'.$parameters[\"type\"].'\"]';\n //====================================================================//\n // Render Forced\n $forcedCrawler = $this->assertRouteWorks(\"splash_widgets_test_view_forced\", $parameters);\n //====================================================================//\n // Verify Right Widget is Here\n $this->assertEquals(1, $forcedCrawler->filterXpath($xPath)->count());\n //====================================================================//\n // Verify Error Alert is Here\n $this->assertEquals(1, $forcedCrawler->filterXpath('//*[@class=\"alert alert-danger no-margin\"]')->count());\n //====================================================================//\n // Render Forced\n $delayedCrawler = $this->assertRouteWorks(\"splash_widgets_test_view_delayed\", $parameters);\n //====================================================================//\n // Verify Right Widget is Here\n $this->assertEquals(1, $delayedCrawler->filterXpath($xPath)->count());\n //====================================================================//\n // Verify Error Alert is Here\n $this->assertEquals(1, $delayedCrawler->filterXpath('//*[@class=\"alert alert-danger no-margin\"]')->count());\n }", "private function tryState()\n\t{\n\t\t$key = array_rand($this->weights);\n\n\t\t$this->workingOnSolution[$key] = !$this->workingOnSolution[$key]; // neighbour\n\t\tlist($better, $price) = $this->check();\n\t\tif ($better) {\n\t\t\t$this->maxPrice = $price;\n\t\t\t$this->solution = $this->workingOnSolution;\n\t\t\treturn;\n\t\t}\n\n\t\t// delta magic\n\t\t$delta = ($price - $this->maxPrice);\n\t\t$x = mt_rand() / mt_getrandmax();\n\t\tif (!($x < exp($delta / $this->temp))) {\n\t\t\t$this->workingOnSolution[$key] = !$this->workingOnSolution[$key];\n\t\t\t// return new\n\t\t}\n\t\t// else return state\n\t}", "public function getRegenerate()\n\t{\n\t\t# Set Menu Permission\n\t\tself::addMenu(['charmaps.regenerate']);\n\n\t\treturn View::make('pages.charmaps.regenerate.index', [\n\t\t\t'pageinfo' => self::$pageinfo,\n\t\t\t'content' => 'This is Charmaps regenerate page.'\n\t\t]);\n\t}", "private function renderView(){\n $switchView = strtolower($_POST['switch-tab']);\n\n if($switchView !== 'logout' && $_SESSION['login'])\n $switchView = 'search';\n elseif($switchView === 'register' && $_SESSION['registered']){\n $switchView = 'login';\n unset($_SESSION['registered']);\n }\n elseif(isset($switchView) && !empty($switchView)){\n $switchView = $switchView;\n unset($_POST['switch-tab']);\n }\n else\n $switchView = 'login';\n return $this->switchView($switchView);\n }", "public function unverified()\n {\n $items = $this->postService::getByStatus('unverified');\n\n return view('admin.pages.posts')->with(compact('items'));\n }", "protected function is_view_page() {\n\t\treturn false;\n\t}", "function _memorizeCleanState() ;", "function lost_xwrd_view( $results ){\r\n\t\tglobal $interim_login;\r\n\t\t$line = $results[0];\r\n\t\t$nonce = $results[1];\r\n\t\t$action = $results[2];\r\n\t\t$err = $results[3];\r\n\t\t$user = $results[4];\r\n\t\t$stage = $results[5];\r\n\t\t$value = ( string ) '';\r\n\t\t$options = get_option( 'csds_userRegAide_Options' );\r\n\t\t$actions = array();\r\n\t\t$actions = apply_filters( 'lost_xwrd_actions_array', $actions );\r\n\t\t$login = wp_login_url();\r\n\t\t$theme = wp_get_theme();\r\n\t\tif( $action == null || array_key_exists( $action, $actions ) ){\r\n\t\t\t?>\r\n\t\t\t<form name=\"lostpassform\" id=\"lostpassform\" method=\"post\" >\r\n\t\t\t\t<?php echo $nonce; //wp_nonce_field( $nonce[0], $nonce[1] ); ?>\r\n\t\t\t\t<div class=\"my-header\">\r\n\t\t\t\t\t<h1 class=\"entry-title\"><?php _e( 'Update Lost Password Form:', 'user-registration-aide' ); ?></h1>\r\n\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t<?php\r\n\t\t\t\t\r\n\t\t\t\tif( empty( $action ) || $action == 'error' || $err >= 1 ){\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<div class=\"template-error\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\techo $line; \r\n\t\t\t\t\t?>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t}else{\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<div class=\"template-message\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\techo $line; \r\n\t\t\t\t\t?>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t<table class=\"pass-reset\">\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th class=\"pass-reset\"><?php _e( 'Field Name:', 'user-registration-aide' ); ?></th>\r\n\t\t\t\t\t\t<th class=\"pass-reset\"><?php _e( 'Field Value:', 'user-registration-aide' ); ?></th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"pass-reset\">\r\n\t\t\t\t\t\t\t<label for=\"lxwrd_user_login\"><?php _e( 'Username or Email:', 'user-registration-aide' ); ?></label>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\tif( !empty( $user ) ){\r\n\t\t\t\t\t\t\t$value = $user->user_email;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$value = '';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t<td class=\"pass-reset\">\r\n\t\t\t\t\t\t\t<input type=\"text\" name=\"lxwrd_user_login\" id=\"lxwrd_user_login\" class=\"reset-xwrd\" value=\"<?php echo $value; ?>\" size=\"20\" title=\"<?php _e( 'Login Name For Site', 'user-registration-aide' ); ?>\" />\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\tif( $options['add_security_question'] == 1 && $action == 'security_question' || $action == 'invalid_sq_answer' ){\r\n\t\t\t\t\t\tif( !empty( $user ) ){\r\n\t\t\t\t\t\t\tdo_action( 'sq_lp_view', $user );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"2\" class=\"pass-reset-submit\">\r\n\t\t\t\t\t\t\t<div class=\"template-submit\">\r\n\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button-primary\" name=\"lost_xwrd_get\" id=\"lost_xwrd_get\" value=\"<?php _e( 'Get New Password', 'user-registration-aide' ); ?>\" />\r\n\t\t\t\t\t\t\t\t<br/>\r\n\t\t\t\t\t\t\t\t<a href=\"<?php echo $login; ?>\" title=\"Login\">Login</a>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</form>\r\n\t\t\t<?php\r\n\t\t}else{\r\n\t\t\t//wp_die( $line );\r\n\t\t\t$redirect_to = get_site_url();\r\n\t\t\t?>\r\n\t\t\t<form method=\"post\" name=\"lost_password\" id=\"lost_password\">\r\n\t\t\t<?php echo $nonce; ?>\r\n\t\t\t\t<div class=\"my-header\">\r\n\t\t\t\t\t<h1 class=\"entry-title\"><?php _e( 'Update Lost Password Form:', 'user-registration-aide' ); ?></h1>\r\n\t\t\t\t</div>\r\n\t\t\t\t<?php\r\n\t\t\t\tif( $action == 'lost_xwrd' || $err >= 1 ){\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<div class=\"template-error\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\techo $line;\r\n\t\t\t\t\r\n\t\t\t\t}elseif( $action == 'lost_xwrd_set' ){\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<div class=\"template-message\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\techo $line;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\t?>\r\n\t\t\t\t\t<div class=\"template-message\">\r\n\t\t\t\t\t<?php\r\n\t\t\t\t\techo $line;\r\n\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"<?php echo $login; ?>\" title=\"Login\">Login</a>\r\n\t\t\t\t</div>\r\n\t\t\t</form>\r\n\t\t\t<?php\r\n\t\t\t\r\n\t\t}\r\n\t}", "public function pendingState(Request $request)\n {\n $user = Auth::user();\n $submissions = PendingStateMerge::where('id', $request->itemId)->withTrashed()->get();\n $type = \"State\";\n return view('submission.submissionItem', compact('user','submissions','type'));\n }", "private function restore_state() {\n\t\t\tglobal $ld_qs_api_vars;\n\n\t\t\tif ( is_array( $ld_qs_api_vars ) && count( $ld_qs_api_vars ) ) {\n\t\t\t\t$recent_state = array_pop( $ld_qs_api_vars );\n\n\t\t\t\tforeach ( $recent_state as $property => $val ) {\n\t\t\t\t\t$this->$property = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "protected function state_all() {\n return $this->_views->all_json();\n }", "public function cannotPerformReferencingErrorAction()\n {\n $this->renderTwigView('/iris-referencing/cannot-perform-referencing-error.html.twig');\n }", "public function actionRevert()\n {\n $eventId = Yii::$app->request->post('eventId');\n $event = Log::findOne($eventId);\n if (is_null($event)) {\n throw new NotFoundHttpException();\n }\n \n $count = $event->revertTo();\n \n return $this->render('reverted', [\n 'count' => $count,\n ]);\n }", "function checkState($state)\n {\n if (empty($state->sortBy)) {\n $state->sortBy = $this->sortBy;\n }\n if (empty($state->searchBy)) {\n $state->searchBy = $this->searchBy;\n }\n\n // Ensure that search objects are strings\n if (!is_string($state->sortBy)) {\n $state->sortBy = \"\";\n }\n if (!is_string($state->searchValue)) {\n $state->searchValue = \"\";\n }\n\n return $state;\n }", "public function history_item_kind_for_transition_to ($state)\n {\n if (($this->unpublished ()) && ($state == Visible))\n {\n return History_item_published;\n }\n \n if (($state & Unpublished) && $this->visible ())\n {\n return History_item_unpublished;\n }\n \n if ($state == Queued)\n {\n return History_item_queued;\n }\n \n if ($state == Abandoned)\n {\n return History_item_abandoned;\n }\n\n return parent::history_item_kind_for_transition_to ($state);\n }", "function getHtmlStep3View()\r\n\t{\r\n\t\treturn '';\r\n\t}", "public function renderView()\n {\n require_once 'Vistas/paginas/error.php';\n }", "function view() {\n\t\treturn '';\n\t}", "function testGetState2(){\n \t$existingAnswer = new Answer(2); //Answer of formdest_id = 2\n\t\t$this->assertEqual($existingAnswer->getState(), TRUE);\n }", "protected function getState()\n {\n return Str::random(40);\n }", "protected function getState()\n {\n return Str::random(40);\n }", "public function hasRebuilt() {\n return $this->rebuilt;\n }", "public function routerRebuilding() {\n $this->rebuilding = TRUE;\n }", "public function build(&$query)\n\t{\n\t\t$segments = array();\n\t\t$layout = isset($query['layout']) ? $query['layout'] : '';\n\n\t\tif ($layout)\n\t\t{\n\t\t\tunset($query['layout']);\n\t\t}\n\n\t\t// Check for view\n\t\tif (!isset($query['view']) && !isset($query['Itemid']))\n\t\t{\n\t\t\t// No view and no Itemid is gonna be hard ;)\n\t\t\treturn $segments;\n\t\t}\n\n\t\tif (!isset($query['view']))\n\t\t{\n\t\t\t// Get the view and layout from the Itemid.\n\t\t\t$link = Factory::getApplication()->getMenu()->getItem($query['Itemid'])->link;\n\t\t\t$uri = \\Joomla\\CMS\\Uri\\Uri::getInstance($link);\n\t\t\t$view = $uri->getVar('view');\n\t\t\t$layout = $uri->getVar('layout');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Easy mode\n\t\t\t$view = $query['view'];\n\t\t\tunset($query['view']);\n\t\t}\n\n\t\t// Get the ID of the item being displayed\n\t\t$id = 0;\n\n\t\tif (isset($query['id']))\n\t\t{\n\t\t\t$id = $query['id'];\n\t\t\tunset($query['id']);\n\t\t}\nif (isset($_GET['rd']))\n{\nprint_r($view);\n?><pre><?php\nprint_r($id);\nprint_r($query);\n?></pre><?php\n}\n\t\tswitch ($view)\n\t\t{\n\t\t\t// Singular views\n\t\t\tcase 'session':\n\t\t\t\tif (!isset($query['Itemid']))\n\t\t\t\t{\n\t\t\t\t\t$segments[] = 'session';\n\n\t\t\t\t\tif ($layout === 'edit')\n\t\t\t\t\t{\n\t\t\t\t\t\t$segments[] = 'edit';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// This handles the Joomla redirect from the task session.edit to the view=session&layout=edit\n\t\t\t\telseif (!isset($query['task']))\n\t\t\t\t{\n\t\t\t\t\t// Get the correct Itemid\n\t\t\t\t\t$query['Itemid'] = $this->getItemid('session');\n\n\t\t\t\t\tif ($layout)\n\t\t\t\t\t{\n\t\t\t\t\t\t$segments[] = 'session';\n\t\t\t\t\t\t$segments[] = $layout;\n\n\t\t\t\t\t\tif (array_key_exists('conference_session_id', $query))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$segments[] = $query['conference_session_id'];\n\t\t\t\t\t\t\tunset($query['conference_session_id']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (array_key_exists('conference_session_id', $query))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$db = Factory::getDbo();\n\t\t\t\t\t\t\t$speakerQuery = $db->getQuery(true)\n\t\t\t\t\t\t\t\t->select($db->quoteName('slug'))\n\t\t\t\t\t\t\t\t->from($db->quoteName('#__conference_sessions'))\n\t\t\t\t\t\t\t\t->where($db->quoteName('conference_session_id') . ' = ' . (int) $query['conference_session_id']);\n\t\t\t\t\t\t\t$db->setQuery($speakerQuery);\n\t\t\t\t\t\t\t$segments[] = $db->loadResult();\n\t\t\t\t\t\t\tunset($query['conference_session_id']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'speaker':\n\t\t\t\tif (!isset($query['Itemid']))\n\t\t\t\t{\n\t\t\t\t\t$segments[] = 'speaker';\n\n\t\t\t\t\tif ($layout === 'edit')\n\t\t\t\t\t{\n\t\t\t\t\t\t$segments[] = 'edit';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// This handles the Joomla redirect from the task speaker.edit to the view=speaker&layout=edit\n\t\t\t\telseif (!isset($query['task']))\n\t\t\t\t{\n\t\t\t\t\tif ($layout)\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($query['Itemid']);\n\t\t\t\t\t\t$segments[] = 'speaker';\n\t\t\t\t\t\t$segments[] = $layout;\n\n\t\t\t\t\t\tif (array_key_exists('conference_speaker_id', $query))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$segments[] = $query['conference_speaker_id'];\n\t\t\t\t\t\t\tunset($query['conference_speaker_id']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif (array_key_exists('conference_speaker_id', $query))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$db = Factory::getDbo();\n\t\t\t\t\t\t\t$speakerQuery = $db->getQuery(true)\n\t\t\t\t\t\t\t\t->select($db->quoteName('slug'))\n\t\t\t\t\t\t\t\t->from($db->quoteName('#__conference_speakers'))\n\t\t\t\t\t\t\t\t->where($db->quoteName('conference_speaker_id') . ' = ' . (int) $query['conference_speaker_id']);\n\t\t\t\t\t\t\t$db->setQuery($speakerQuery);\n\t\t\t\t\t\t\t$segments[] = $db->loadResult();\n\t\t\t\t\t\t\tunset($query['conference_speaker_id']);\n\n\t\t\t\t\t\t\t// Get the correct Itemid\n\t\t\t\t\t\t\t$query['Itemid'] = $this->getItemid('speakers');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'profile':\n\t\t\t\tif (isset($query['task']))\n\t\t\t\t{\n\t\t\t\t\tlist ($view, $task) = explode('.', $query['task']);\n\t\t\t\t\t$segments[] = $view;\n\t\t\t\t\t$segments[] = $task;\n\t\t\t\t\tunset($query['task']);\n\t\t\t\t\tunset($query['layout']);\n\n\t\t\t\t\tif (array_key_exists('conference_speaker_id', $query))\n\t\t\t\t\t{\n\t\t\t\t\t\t$segments[] = $query['conference_speaker_id'];\n\t\t\t\t\t\tunset($query['conference_speaker_id']);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (array_key_exists('conference_session_id', $query))\n\t\t\t\t\t{\n\t\t\t\t\t\t$segments[] = $query['conference_session_id'];\n\t\t\t\t\t\tunset($query['conference_session_id']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($layout)\n\t\t\t\t{\n\t\t\t\t\t$segments[] = $layout;\n\t\t\t\t}\n\n\t\t\t\t// This handles the cancel URL when the user clicks cancel on the edit profile page\n\t\t\t\tif (count($segments) === 0)\n\t\t\t\t{\n\t\t\t\t\t$query['Itemid'] = $this->getItemid($view);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'sessions':\n\t\t\t\t// Get the Itemid\n\t\t\t\t$query['Itemid'] = $this->getItemid('sessions');\n\n\t\t\t\tif ($id)\n\t\t\t\t{\n\t\t\t\t\t/** @var ConferenceModelSession $sessionModel */\n\t\t\t\t\t$sessionModel = ItemModel::getInstance('Session', 'ConferenceModel', array('ignore_request' => true));\n\t\t\t\t\t$sessionModel->setState('session.id', $id);\n\t\t\t\t\t$session = $sessionModel->getItem();\n\t\t\t\t\t$segments[] = $session->slug;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'speakers':\n\t\t\t\t// Get the Itemid\n\t\t\t\t$query['Itemid'] = $this->getItemid('speakers');\n\n\t\t\t\tif ($id)\n\t\t\t\t{\n\t\t\t\t\t/** @var ConferenceModelSpeaker $speakerModel */\n\t\t\t\t\t$speakerModel = ItemModel::getInstance('Speaker', 'ConferenceModel', array('ignore_request' => true));\n\t\t\t\t\t$speakerModel->setState('speaker.id', $id);\n\t\t\t\t\t$speaker = $speakerModel->getItem();\n\t\t\t\t\t$segments[] = $speaker->slug;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$query['Itemid'] = $this->getItemid($view);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $segments;\n\t}", "public function resetState() {}", "public function reverse()\n {\n $this->load->view('reverse');\n }", "function get_post_states($post)\n {\n }", "public function testRenderIndexWrongCode()\n {\n // Populate data\n $this->_populate();\n \n // Make Request\n $this->withSession($this->customSession)\n ->call('GET', '/dashboard');\n\n $this->assertRedirectedTo('/dashboard/login');\n }", "public function visited() {\n // Checking if there's no data in the database - if not, will insert the new view.\n if (!$this->psm->hasdata(\"SELECT id FROM artist_views WHERE artist_id = :ref AND ip = :ip\",[\n ':ref' => $this->data['id'],\n ':ip' => $_SERVER['REMOTE_ADDR']\n ])) {\n $view = true;\n }\n\n // But if not, we must check if it was more than 2 minutes ago or not - if so, we can add! Vice versa.\n else {\n $set = $this->psm->set(\"SELECT timeadded FROM artist_views WHERE artist_id = :ref AND ip = :ip ORDER BY id DESC LIMIT 1\",[\n ':ref' => $this->data['id'],\n ':ip' => $_SERVER['REMOTE_ADDR']\n ]);\n $view = ((time()-$set['timeadded'])/60 > 2)?true:false;\n }\n\n // Finally, if we have decided there's need for the view to be added, execute!\n if ($view) {\n $this->psm->insert('artist_views', [\n 'artist_id' => $this->data['id'],\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'timeadded' => time()\n ]);\n }\n }", "public function _memorizeCleanState() {}", "function exam_menu_rebuild() {\n \n menu_rebuild();\n \n return 'Menu rebuild completed.';\n}", "function value() {\n return str_replace($this->state(), '', $_SERVER['REQUEST_URI']);\n }", "public function patterns_check() {\n $patterns = $this->get_patterns_from_templates();\n $storedpatterns = $this->patterns;\n\n // View patterns.\n $viewupdates = array();\n if (!empty($patterns['view']) or !empty($storedpatterns['view'])) {\n // Stored.\n if (!$viewupdates and !empty($patterns['view']) and empty($storedpatterns['view'])) {\n foreach ($patterns['view'] as $pattern) {\n $viewupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'view',\n 'problem' => 'Not cached',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n }\n\n if (!$viewupdates and empty($patterns['view']) and !empty($storedpatterns['view'])) {\n foreach ($storedpatterns['view'] as $pattern) {\n $viewupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'view',\n 'problem' => 'Not used',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n }\n\n if (!$viewupdates and $notstored = array_diff($patterns['view'], $storedpatterns['view'])) {\n foreach ($notstored as $pattern) {\n $viewupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'view',\n 'problem' => 'Not cached',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n }\n }\n\n // Field patterns.\n $fieldupdates = array();\n if (!empty($patterns['field']) or !empty($storedpatterns['field'])) {\n if (!$fieldupdates and !empty($patterns['field']) and empty($storedpatterns['field'])) {\n foreach ($patterns['field'] as $fieldid => $fieldpatterns) {\n foreach ($fieldpatterns as $pattern) {\n $fieldupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'field',\n 'problem' => 'Not used',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n }\n }\n\n if (!$fieldupdates and empty($patterns['field']) and !empty($storedpatterns['field'])) {\n foreach ($storedpatterns['field'] as $fieldid => $fieldpatterns) {\n foreach ($fieldpatterns as $pattern) {\n $fieldupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'field',\n 'problem' => 'Not used',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n }\n }\n\n if (!$fieldupdates) {\n foreach ($patterns['field'] as $fieldid => $fieldpatterns) {\n if (empty($storedpatterns['field'][$fieldid])) {\n foreach ($fieldpatterns as $pattern) {\n $fieldupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'field',\n 'problem' => 'Not used',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n } else if ($notstored = array_diff($patterns['field'][$fieldid], $storedpatterns['field'][$fieldid])) {\n foreach ($notstored as $pattern) {\n $fieldupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'field',\n 'problem' => 'Not cached',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n }\n }\n }\n\n }\n\n // Anything else that looks like a pattern.\n $otherupdates = array();\n // Get the templates text.\n $text = $this->get_templates_text();\n // Remove found patterns from text.\n if (!empty($patterns['view'])) {\n $text = str_replace($patterns['view'], '', $text);\n }\n if (!empty($patterns['field'])) {\n foreach ($patterns['field'] as $fieldpatterns) {\n $text = str_replace($fieldpatterns, '', $text);\n }\n }\n // Find patterns of form ##...## and [[...]].\n preg_match_all(\"/##[^#]+##|\\[\\[[^\\]]+\\]\\]/\", $text, $matches);\n if (!empty($matches[0])) {\n foreach ($matches[0] as $pattern) {\n $otherupdates[] = array(\n 'pattern' => $pattern,\n 'type' => 'Unknown',\n 'problem' => '',\n 'dataform' => $this->df->name,\n 'view' => $this->name,\n );\n }\n }\n\n if ($updates = array_merge($viewupdates, $fieldupdates, $otherupdates)) {\n return $updates;\n }\n\n return null;\n }", "public function testStateIssuedCorrectly()\n {\n $this->assertNull($this->state->issue());\n }", "public function restoreGraphicState() {}", "public function restoreGraphicState() {}", "function invalidlogin()\r\n\t\t{\r\n\t\t\t$lang = new language;\r\n\t\t\t$this->pagelayout .= '<br /><br /><br />\r\n<center>\r\n<table width=\"200\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n<tr>\r\n<td width=\"100%\" align=\"center\">\r\n<font size=\"4\" point-size=\"16\"><b>'.$lang->word_access_denied.'</b></font>\r\n</td>\r\n</tr>\r\n</table>\r\n</center>\r\n';\r\n\t\t\tunset($lang);\r\n\t\t}" ]
[ "0.55274767", "0.52540195", "0.51508355", "0.49315196", "0.48864716", "0.48340198", "0.4799963", "0.4782844", "0.46871647", "0.46447343", "0.46210325", "0.46024892", "0.45765185", "0.4529426", "0.4516311", "0.4516311", "0.44890285", "0.44618127", "0.4453785", "0.4436306", "0.44185674", "0.43940556", "0.43852124", "0.43548444", "0.43517104", "0.43492505", "0.43367857", "0.43226805", "0.43198428", "0.43171945", "0.4303259", "0.43013164", "0.43012396", "0.4294213", "0.42839828", "0.4275767", "0.4275767", "0.42750943", "0.42716518", "0.42636636", "0.42624295", "0.42589", "0.42522603", "0.42438385", "0.42383504", "0.4229304", "0.42146268", "0.42105162", "0.4198053", "0.4183978", "0.41646996", "0.41635546", "0.41589862", "0.41561785", "0.4155466", "0.4155368", "0.4153497", "0.41505456", "0.41503358", "0.4146024", "0.4144164", "0.41388124", "0.41386643", "0.4125715", "0.4122633", "0.4118803", "0.41101032", "0.410746", "0.41063052", "0.41017064", "0.41009834", "0.40983173", "0.40979555", "0.40923226", "0.4089666", "0.40829757", "0.40794015", "0.4078282", "0.4077772", "0.40739632", "0.40713412", "0.40709883", "0.40694815", "0.40694815", "0.4063103", "0.40629366", "0.40623596", "0.4059676", "0.40589064", "0.40578645", "0.40564936", "0.4053019", "0.4051313", "0.40504092", "0.40501955", "0.40493327", "0.40480617", "0.40422016", "0.40422016", "0.4035346" ]
0.434535
26
displays the add page
public function getCreate(){ return View::make('admin.plan.add') ->with('insurances', Insurance::lists('name', 'id')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionAdd()\n\t{\n\t\t$this->render('add');\n\t}", "function display_add() {\n $this->_addform->display();\n }", "public function add()\n\t{\n\t\t$this->template('crud/add');\t\n\t}", "public function add()\n {\n //renderView('add');\n }", "public function renderAdd()\r\n\t{\r\n\t\t$this['itemForm']['save']->caption = 'Přidat';\r\n $this->template->titul = self::TITUL_ADD;\r\n\t\t$this->template->is_addon = TRUE;\r\n\r\n\t}", "function lb_show_add_record_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'add',\n\t\t)\n\t);\n}", "public function get_add()\n { \n // Render the page\n View::make($this->bundle . '::product.add')->render();\n }", "public function add(){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $this->assign('output',$outData);\n $this->display();\n }", "public function showAddPage(){\n return view('add');\n }", "public function add()\n\t{\n\t\treturn view('pages.add');\n\t}", "public function displayPageAddForm(){\n\n // Vérifie les données de champs dupliqués\n $this->handleDuplicateFields();\n\n // Vérifie les données post envoyées\n $this->handleAdd();\n\n // If there ia a modify var\n if(isset($_GET['modify']) && !empty($_GET['modify'])){\n\n $form = get_post($_GET['modify']);\n if($this->isForm($_GET['modify'])){\n\n $formMetas = get_post_meta($_GET['modify']);\n $formArgs = get_post_meta($_GET['modify'],'form-args');\n $formFields = get_post_meta($_GET['modify'],'form-fields');\n $submitArgs = get_post_meta($_GET['modify'],'form-submit-args');\n $formSendArgs = get_post_meta($_GET['modify'],'form-send-args');\n }else\n unset($form);\n\n }\n require_once __DIR__ . '/templates/add.php';\n\n }", "public function addAction()\n {\n $this->templatelang->load($this->_controller.'.'.$this->_action);\n\n // Rendering view page\n $this->_view();\n }", "public function add() {\n\t\t\n\t\t$this->template->content = View::instance(\"v_posts_add\");\n\t\t\n\t\t$client_files_body = Array(\n\t\t\t'/js/jquery.form.js',\n\t\t\t'/js/posts_add.js'\n\t\t);\n\t\t\n\t\t$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\techo $this->template;\n\t\t\n\t}", "public function actionAdd()\n {\n $this->adminOnly();\n\n $model = new AddPageForm(['class' => $this->getPageClassName()]);\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n return $this->redirect($this->contentContainer->createUrl('edit', ['type' => $model->type]));\n }\n\n return $this->render('@custom_pages/views/common/add', [\n 'model' => $model,\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()]);\n }", "public function add(){\n\t\t\t$formAction = \"index.php?area=backend&controller=news&action=do_add\";\n\t\t\t//xuat du lieu ra view qua ham renderHTML\n\t\t\t$this->renderHTML(\"views/backend/add_edit_news.php\",array(\"formAction\"=>$formAction));\n\t\t}", "function add() \n {\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n \n // Render the action with template\n $this->renderWithTemplate('users/add', 'AdminPageBaseTemplate');\n }", "public function add(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$admin = $this->_map_posted_data();\n\t\t\t\t$this->adminrepository->insert($admin);\n\t\t\t\theader(\"Location: \".BASE_URL.\"admin/admin\");\n\n\t\t\t}else{\n\t\t\t\t$view_page =\"adminsview/add\";\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t\t}\n\t\t}", "public function add() \r\n\t{\r\n\t\t$data['header']['title'] = 'Add a new country';\r\n\t\t$data['footer']['scripts']['homescript.js'] = 'home';\r\n\t\t$data['view_name'] = 'country/country_add_view';\r\n\t\t$data['view_data'] = '';\r\n\t\t$this->load->view('country/page_view', $data);\r\n\t}", "public function addForm() {\n $this->view->displayForm();\n }", "public function addView()\n {\n return $this->render('Add');\n }", "public function add(){\n\n\t $this->load->view('layouts/header');\n\t\t$this->load->view('layouts/aside');\n\t\t$this->load->view('admin/usuarios/add'); // se envia a la vista admin/laptops/add\n\t\t$this->load->view('layouts/footer');\n}", "public function add(){\n\t\t$this->load->view('top');\n\t\t$this->load->view(\"timHPS/timHps_add\",$data);\n\t\t$this->load->view('bottom');\n\t}", "public function renderAdd()\r\n\t{\r\n\t\t$this['tarifForm']['save']->caption = 'Přidat';\r\n\t}", "public function index() {\n $content = $this->lcopun->copun_add_form();\n $this->template->full_admin_html_view($content);\n }", "public function add_record()\n {\n $data['main_content'] = $this->type.'/'.$this->viewname.'/add';\n\t $this->load->view($this->type.'/assets/template',$data);\n }", "public function add() {\n\t\n\t\t# Make sure user is logged in if they want to use anything in this controller\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect(\"/index/unauthorized\");\n\t\t}\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_teachers_add');\n\n\t\t$this->template->title = \"Add Teacher\";\n\n\t\t$client_files_head = array(\"/css/teachers_add.css\");\n\t\t$this->template->client_files_head = Utils::load_client_files($client_files_head);\n\n\t\t#$client_files_body = array(\"/js/ElementValidation.js\", \"/js/shout_out_utils.js\");\n\t\t#$this->template->client_files_body = Utils::load_client_files($client_files_body);\n\n\t\t# Render template\n\t\techo $this->template;\n\t\t\n\t}", "public function display_add() {\n global $DB, $PAGE, $CFG;\n\n $table = $this->construct_unassigned_table();\n\n // Assemble bulk action panel.\n $bulktitle = get_string('ds_bulkassignment', 'local_elisprogram');\n $bulkactionpanel = new deepsight_bulkactionpanel_standard('bulkenrol', $bulktitle, $table, $table->get_actions());\n\n // HTML.\n echo $table->get_html();\n echo $bulkactionpanel->get_html();\n\n // JS.\n echo '<script src=\"'.$CFG->wwwroot.'/local/elisprogram/lib/deepsight/js/jquery-1.9.1.min.js\"></script>';\n $jsdeps = $table->get_js_dependencies();\n foreach ($jsdeps as $jsfile) {\n $PAGE->requires->js($jsfile);\n }\n\n echo '<script>(function($) {';\n echo '$(function() {';\n echo $table->get_init_js();\n echo $bulkactionpanel->get_init_js();\n echo '});';\n echo '})(jQuery); jQuery.noConflict();</script>';\n }", "public function showAdd()\n {\n return View::make('honeys.add');\n }", "public function showAddNewRecordPage() {\n\n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-add-show') {\n $access = TRUE;\n break;\n }\n }\n if ($access) {\n $this->data['message'] = $this->session->flashdata('message');\n $this->set_view('user/add_new_record_page',$this->data);\n } else {\n echo \"access denied\";\n }\n }", "function add()\n\t{\n\t\t// hien thi form them san pham\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/add');\n\t}", "public function actionAdd() {\n $this->setView('edit');\n }", "public function add() {\n if($this->user->access_level != 3) {\n # If not, redirect them to the films index\n\t \tRouter::redirect(\"/films\");\n }\n \n # Setup view\n $this->template->content = View::instance('v_films_add');\n $this->template->title = \"DER | Add New Film\";\n \n # Pass in template-specific CSS files\n\t $this->template->client_files_head = '<link rel=\"stylesheet\" href=\"/css/bootstrap.css\" type=\"text/css\">\n\t \t<link rel=\"stylesheet\" href=\"/css/signin.css\" type=\"text/css\">\n\t \t<script type=\"text/javascript\" src=\"/js/app.js\"></script>';\n\n # Render template\n echo $this->template;\n }", "public function add()\n {\n $data = [\n 'property' => [\n 'template' => 'extracurricular_add',\n 'title' => 'Tambah Ekstrakurikuler',\n 'menu' => $this->menu->read(),\n ],\n 'data' => [],\n ];\n\n $this->load->view('template', $data);\n }", "function add()\n\t{\n\t\tif (!$this->checkLogin()) {\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME . ' | Add Branch';\n\t\t$pageData['page_title'] = 'Branch Management';\n\t\t$pageData['parent_menu'] = 'branch_management';\n\t\t$pageData['child_menu'] = 'add_new_branch';\n\n\t\t$this->load->view('admin/branch_management/add', $pageData);\n\t}", "public function addAction()\n {\n $post_request = (array) $this->postZingRequest();\n\n /** Handle the request */\n $errors = $this->_handleRequest($post_request);\n\n return $this->renderAdmin('ZingComponentGoogleMapsBundle:Default:form.html.twig', array_merge(\n array(\n 'zing_form_action' => 'Create',\n 'zing_form_errors' => $errors\n ),\n $post_request\n ));\n\n }", "public function add(){\n\t\tif(is_null($this->session->userdata('user')))\n\t\t\tredirect('/login', 'refresh');\n\n\t\t$this->load->view('header');\n\t\t$this->load->view('lead/add');\n\t\t$this->load->view('footer');\n\n\t}", "public function view_adding_instruction(){\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_instructions';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Instructions',\n\t\t\t'courselist' => $this->setting_model->Get_All('course'),\n\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function xadd() {\n\t\t$args = $this->getAllArguments ();\n\t\tif ($args ['view'] == 'forms') {\n\t\t\t$this->_redirect ( '_newForm' );\n\t\t} elseif ($args ['view'] == 'fields') {\n\t\t\t$this->_redirect ( '_newField' );\n\t\t} elseif ($args ['view'] == 'actions') {\n\t\t\t$this->_redirect ( '_newAction' );\n\t\t} else {\n\t\t\tparent::xadd ();\n\t\t}\n\t}", "function add()\r\n\t{\r\n\t\t$data['main_content'] = 'policy_add';\r\n\t\t$opt_load = array(\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/dashboardui.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/css3-buttons.css\" />',\r\n\t\t\t'<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.datalabsecurity.com/webscan/resources/css/progress.css\" />',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery-1.6.4.min.js\"></script>',\r\n\t\t\t'<script src=\"http://www.datalabsecurity.com/webscan/resources/js/jquery.easytabs.min.js\" type=\"text/javascript\"></script>',\r\n\t\t\t'<script type=\"text/javascript\" src=\"http://www.datalabsecurity.com/webscan/resources/js/progress.js\"></script>',\r\n\t\t\t);\r\n\t\t$opt_head = array(\r\n\t\t\t\"title\" => \"Policies\",\r\n\t\t\t\"opt_load\" => $opt_load,\r\n\t\t\t);\r\n\t\t$data['opt_head'] = $opt_head;\r\n\t\t$this->load->view('includes/template-beta', $data);\t\r\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function add(){\n\n\t $data = array(\n\t \t 'laptops' =>$this->Laptop_model->getLaptops() ,\n\n\t \t );\n\n\t $this->load->view('layouts/header');\n\t\t$this->load->view('layouts/aside');\n\t\t$this->load->view('admin/prestamos/add',$data); // se envia a la vista admin/laptops/add\n\t\t$this->load->view('layouts/footer');\n}", "public function addAction()\n {\n// $m = $this->baseView('view',['lside','passportAdmin'],['lside'=>['list' => $this->names,'base' => ''],'cont' => ['fsd']]);\n// $p = $cr->render($m,[]);\n $p = $this->add($this->model);\n return $this->baseView('view',['admin/lside','passport/admin/add'],['lside'=>['list' => $this->names,'base' => ''],'cont' => $p]);\n }", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function add(){\n Auth::checkUserLogin();\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Add';\n\n $this->_view->error = array();\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n\t\t\t Url::redirect('users/index');\n\t\t }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else{\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('users/index');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout');\n\t}", "protected function add(){\n\t\tif(!isset($_SESSION['is_logged_in'])){\n\t\t\theader('Location: '.ROOT_URL. 'pages/1');\n\t\t}\n\t\t$viewmodel = new ShareModel();\n\n\t\t$this->returnView($viewmodel->add(), true);\n\t}", "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 get_add(){\n return View::make('stance.add')->with('title', 'Submit a Stance')->with('subtitle', 'Try to make your views official party Stances');;\n }", "function account_add()\r\n {\r\n $page_data['module_type'] = 'account';\r\n $page_data['page_name'] = 'account_add';\r\n $page_data['page_title'] = lang_key('create_new_account');\r\n $this->load->view('admin/index', $page_data);\r\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function add(): void\n {\n $exerciseforms = $this->exerciseformBLL->getAllExcerciseforms();\n\n $data = [\n 'exerciseforms' => $exerciseforms,\n 'name' => '',\n 'description' => '',\n 'repetitions' => '',\n 'sets' => ''\n ];\n\n $this->view('exercises/add', $data);\n }", "public function addNewAction()\n {\n // echo 'Hello from the addNew action in the Books controller!';\n View::renderTemplate('Books/addBook.html');\n }", "public function addAction() {\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t}", "public function add()\n {\n if (Auth::guest()){\n return redirect()->back();\n }\n\n return view('add');\n }", "public function add()\n {\n $this->view->state = $this->request->has('id') ? 'Edit Row' : 'Add Row';\n return $this->view('add');\n }", "public function admin_add(){\n $content = $this->load->view(\"users/users_form\",\"\",true);\n echo Modules::run(\"template/load_admin\", \"Add New User\", $content);\n }", "public function handleAdd()\n {\n $this->layout->content = View::make('grievance::grievance-add');\n }", "public function add() {\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$model->add();\r\n\t\t\r\n\t\t$this->view = $this->getView(\"languages\");\r\n\t\t$this->view->setModel($model, true);\r\n\t\t$this->view->display();\r\n\t}", "public function add()\n\t{\n\n\t\t$this->data['_pageview'] = $this->data[\"_directory\"] . \"edit\";\n\t\t$this->data['option'] \t\t= \"add\";\n\n\t\treturn view($this->constants[\"ADMINCMS_TEMPLATE_VIEW\"], $this->data);\n\t}", "public function addAction()\n {\n return $this->render('OCPlatformBundle:Default:index.html.twig', ['value' => 0]);\n }", "public function add(){\n\t\t// Set the Page Title ('pageName', 'pageSection', 'areaName')\n\t\t$this->_view->pageTitle = array('Add', 'Users');\n\t\t// Set Page Description\n\t\t$this->_view->pageDescription = '';\n\t\t// Set Page Section\n\t\t$this->_view->pageSection = 'Users';\n\t\t// Set Page Sub Section\n\t\t$this->_view->pageSubSection = 'Users';\n\n\t\t// Set default variables\n\t\t$this->_view->error = array();\n\n\t\t$userTypes = explode(',', USERS);\n $userTypesStore = array_pop($userTypes);\n\t\t$this->_view->userTypes = $userTypes;\n\n // If Form has been submitted process it\n\t\tif(!empty($_POST)){\n //if user selected cancel\n if(!empty($_POST['cancel'])){\n Url::redirect('backoffice/users/index');\n }\n $_POST['salt'] = null;\n\n if(!isset($_FILES) || empty($_FILES['image']['name'])){\n $_POST['image'] = null;\n }else{\n $this->uploadFile($_FILES);\n }\n\n // Create new user\n $createData = $this->_model->createData($_POST);\n if(isset($createData['error']) && $createData['error'] != null){\n foreach($createData['error'] as $key => $error){\n $this->_view->error[$key] = $error;\n }\n }else {\n $this->_view->flash[] = \"User added successfully.\";\n Session::set('backofficeFlash', array($this->_view->flash, 'success'));\n Url::redirect('backoffice/users/');\n }\n\t\t}\n\t\t// Render the view ($renderBody, $layout, $area)\n\t\t$this->_view->render('users/add', 'layout', 'backoffice');\n\t}", "public function index()\n {\n $this->add();\n }", "public function addAction() {\n\t\t$this->view->addLayoutVar(\"onglet\", 2);\n\t\t$uid = Annuaire_User::getCurrentUserId();\n\t\t$this->view->title = t_('Add');\n\t\t$db = Gears_Db::getDb();\n\t\t$clients = Array();\n\t\t$result = $db->fetchAll(\"SELECT * FROM ANNUAIRE_SOCIETE WHERE USER_ID = ?\", Array($uid));\n\t\tforeach ($result as $info) {\n\t\t\t$clients[$info['SOCIETE_ID']][0] = $info['SOCIETE_ID'];\n\t\t\t$clients[$info['SOCIETE_ID']][1] = $info['SOCIETE_NOM'];\n\t\t}\n\t\t$this->view->clients = ($clients);\n\t\t$this->view->addcontact = t_(\"Add a contact\");\n\t\t$this->view->name = t_(\"Name\");\n\t\t$this->view->firstname = t_(\"First Name\");\n\t\t$this->view->address = t_(\"Address\");\n\t\t$this->view->mail = t_(\"Mail\");\n\t\t$this->view->phone = t_(\"Phone Number\");\n\t\t$this->view->cell = t_(\"Cellphone number\");\n\t\t$this->view->fax = t_(\"Fax\");\n\t\t$this->view->site = t_(\"Website\");\n\t\t$this->view->comment = t_(\"Comment\");\n\t\t$this->view->society = t_(\"Companie\");\n\t\t$this->view->none = t_(\"none\");\n\t\t$this->view->send = t_(\"Send\");\n\t\t$this->view->addsociety = t_(\"Add a companie\");\n\t\t$this->view->activity = t_(\"Activity\");\n\t}", "public function addAction() {\n\t\t$this->_forward('edit', null, null, array('id' => 0, 'model' => $this->_getParam('model')));\n\t}", "public function add()\n\t{\t\n\t\t//Carrega o Model Categorias\t\t\t\n\t\t$this->load->model('CategoriasModel', 'Categorias');\n\t\n\t\t$data['categorias'] = $this->Categorias->getCategorias();\t\n\n\t\t// Editando texto do titulo do header\n\t\t$data['pagecfg']['Title'] = \"Adicionar Pessoa\";\t\t\n\n\t\t// Alterando o Estado da View Para Adicionar Pessoa\n\t\t$data['pagecfg']['viewState'] = \"Adicionar Pessoa\";\n\t\t$data['pagecfg']['btnState'] = \"Adicionar\";\n\t\t$data['pagecfg']['inputState'] = \"enable\";\n\t\t$data['pagecfg']['actionState'] = \"/ListarPessoas/salvar\";\n\t\t\n\t\t//Carrega a View\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('PessoaView', $data);\n\t\t$this->load->view('templates/footer', $data);\n\t}", "public function index() {\n $content = $this->llocation->location_add_form();\n $this->template->full_admin_html_view($content);\n }", "public function Add()\n\t{\n\t\t$this->load->view(\"admin/barang/tambah_barang\");\n\t}", "function admin_add()\n\t{\n\t $this->set('pagetitle',\"Add Page\");\t\n\t $this->loadModel('User');\n\t $userlists = array();\n\t $userlists = array_merge($userlists,array('0'=>'Admin'));\n\t $allClientLists = $this->User->find('list',array('conditions'=>array('User.user_type_id'=>1),'fields'=>array('id','fname')));\n $userlists = array_merge($userlists,$allClientLists);\n\t $this->set('userlists',$userlists);\n\t \n\t if(!empty($this->data))\n\t {\n\t\tif($this->Page->save($this->data))\n\t\t{\n\t\t $this->Session->setFlash('The Page has been created','message/green');\n\t\t $this->redirect(array('action' => 'index'));\n\t\t}\n\t\telse\n\t\t{\n\t\t $this->Session->setFlash('The Page could not be saved. Please, try again.','message/yellow');\n\t\t}\n\t }\n\t}", "public function add() {\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authenticate()) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend/login', '<strong>Error:</strong> Please login to continue.');\n\t\t\t}\n\t\t\t// Authorize w/ backend app.\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authorize('blog', 'add')) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend', '<strong>Error:</strong> Insufficient user access.');\n\t\t\t}\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n \t\t\t// Handle form submit.\n\t\t\t\treturn $this->models['blog']->add();\n\t\t\t} else {\n \t\t\t// Load view.\n \t\t\treturn $this->_loadView(dirname(__FILE__) .'/views/add.tpl');\n\t\t\t}\n\t\t}", "public function add_data()\n {\n $this->load->helper('url');\n $this->load->view('add_data_view');\n }", "public function admin_add() {\r\n if(isset($this->data[$this->modelClass])) {\r\n\t\t\t$this->_message($this->{$this->modelClass}->bsSave($this->data, 'add'));\r\n }\r\n\t\t$this->render('admin_edit');\r\n }", "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 patients_add(){\n\t\t$data['meta_description']='';\n\t\t$data['menu']= $this->menu;\n\n\t\t$data['user'] = $this->user;\n\t\t$data['group'] = $this->group->name;\n\t\t$data['superviser']=$this->superviser_name;;\n\n\t\t$data['page']='patients/patients-add'; //page view to load\n\t\t$data['pls'] = array(); //page level scripts\n\t\t$data['plugins'] = array(); //plugins\n\t\t$data['javascript'] = array(); //javascript\n\t\t$views= array('design/html_topbar','sidebar','design/page','design/html_footer');\n\t\t$this->layout->view($views, $data);\n\t}", "public function action_add()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n\t\t//return Response::forge(View::forge('event/add'));\n\t\t$data[\"category\"] = Model_Category::find_all();\n\t\t$this->template->title = \"イベント追加\";\n\t\t$this->template->content = View::forge('event/add',$data);\n\t}", "public static function add() {\n\t\tif (\n\t\t\t( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) ||\n\t\t\t'true' !== get_user_option( 'rich_editing' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\techo '<a href=\"#\" id=\"sgdg-tinymce-button\" class=\"button\"><img class=\"sgdg-tinymce-button-icon\" src=\"' .\n\t\t\tesc_attr( plugins_url( '/skaut-google-drive-gallery/admin/icon.png' ) ) .\n\t\t\t'\">' .\n\t\t\tesc_html__( 'Google Drive gallery', 'skaut-google-drive-gallery' ) .\n\t\t\t'</a>';\n\t\tadd_thickbox();\n\t}", "public function add() {\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authenticate()) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend/login', '<strong>Error:</strong> Please login to continue.');\n\t\t\t}\n\t\t\t// Authorize w/ backend app.\n\t\t\tif (!$GLOBALS['sizzle']->apps['backend']->models['backend']->authorize('sharers', 'add')) {\n \t\t\t$GLOBALS['sizzle']->utils->redirect('/backend', '<strong>Error:</strong> Insufficient user access.');\n\t\t\t}\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST') {\n \t\t\t// Handle form submit.\n\t\t\t\treturn $this->models['sharers']->add();\n\t\t\t} else {\n \t\t\t// Load view.\n \t\t\treturn $this->_loadView(dirname(__FILE__) .'/views/add.tpl');\n\t\t\t}\n\t\t}", "public function getAdd()\n {\n \treturn view(\"admin.user.add\");\n }", "public function add()\n\t{\n\t\tif (!parent::add())\n\t\t{\n\t\t\t// Redirect to the return page.\n\t\t\t$this->setRedirect($this->getReturnPage());\n\t\t}\n\t}", "public function add()\n\t{\n\t\tif (!parent::add())\n\t\t{\n\t\t\t// Redirect to the return page.\n\t\t\t$this->setRedirect($this->getReturnPage());\n\t\t}\n\t}", "public function getAdd()\n\t{\n\t $form = \\FormBuilder::create($this->form, [\n 'method' => 'POST',\n 'model' => $this->getModelInstance(),\n 'url' => ($this->url_prefix.'/add')\n ]);\n return view($this->tpl_prefix.'add',array('catalog'=>$this), compact('form'));\n\t}", "function invoice_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'invoice_add';\n $page_data['page_title'] = get_phrase('add_invoice');\n $this->load->view('backend/index', $page_data);\n }", "public function add()\n {\n $db = db_connect();\n $data['table'] = $db->listTables();\n $data['MenuModel'] = $this->MenuModel->where('hirarki', 1)->findAll();\n $param['menu'] = $this->menu;\n $param['activeMenu'] = $this->activeMenu;\n\n if ($param['activeMenu']['akses_tambah'] == '0')\n {\n return redirect()->to('denied');\n }\n $param['page'] = view($this->path_view . 'page-add',$data);\n return view($this->theme, $param);\n }", "function staff_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'staff_add';\n $page_data['page_title'] = get_phrase('add_staff');\n $this->load->view('backend/index', $page_data);\n }", "public function permit_type_add_form()\n {\n $this->load->view('common/header');\n $this->load->view('permit/permittype/create_form');\n $this->load->view('common/footer');\n }", "public function add() {\n // Load add template\n $add = new Views('templates/add.tpl.php');\n // Add header and footer template\n $add->set('header', $add->addHeader());\n $add->set('footer', $add->addFooter());\n $add->set('error', '');\n $add->set('success', '');\n\n //Check if user posted form\n if (isset($_POST['name'])) {\n $name = htmlspecialchars($_POST['name'], ENT_QUOTES);\n $file = new Files($_FILES['file']);\n //Manage uploaded file. If is something wrong with file return error\n if ($destination = $file->manageUploadedFile()) {\n $this->db->addProject($name, $destination);\n $add->set('success', ' <span class=\"button\">Your project has been created, go to project list page and start your scan!</span>');\n }\n else {\n $add->set('error', ' <span class=\"button error_button\">File error: Cannot extract file. Check archive or directory permissions.</span>');\n }\n }\n return $add->render();\n }", "public function addAction() {\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function index()\n\t{\n\t\t$content = $this->lcustomer->customer_add_form();\n\t\t$this->template->full_admin_html_view($content);\n\t}", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "public function add(){\n $this->edit();\n }", "function expense_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'expense_add';\n $page_data['page_title'] = get_phrase('add_expense');\n $this->load->view('backend/index', $page_data);\n }", "function transport_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'transport_add';\n $page_data['page_title'] = get_phrase('add_transport');\n $this->load->view('backend/index', $page_data);\n }", "function exam_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'exam_add';\n $page_data['page_title'] = get_phrase('add_exam');\n $this->load->view('backend/index', $page_data);\n }", "public function addAction()\n {\n \t$form = MediaForm::create($this->get('form.context'), 'media');\n\n \treturn $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => new Media()));\n }", "function showCompany_ADD() \n\t{\n\t\treturn view('company_add');\n \t\n\t}", "public function admin_add_new() {\n ?>\n <div class=\"wrap\">\n <h2><?php _e('Add New Form', 'swpm-form-builder'); ?></h2>\n <?php\n include_once( SWPM_FORM_BUILDER_PATH . 'includes/admin-new-form.php' );\n ?>\n </div>\n <?php\n }", "public function add(){\n return view('employee.displayForm');\n }", "public function index() {\n $data = array();\n \n //Create the scripts array\n $scripts = array();\n \n //Add script to the scripts array\n $scripts[] = base_url('js/add.js');\n \n //Add scripts array to the data array\n $data['scripts'] = $scripts;\n \n //Get modules\n $modules = $this->_getModules();\n $data['modules'] = $modules;\n \n //Get categories\n $users = $this->_getUsers();\n $data['users'] = $users;\n \n //Load the header\n $this->load->view('page/header',$data);\n \n //Load the page view\n $this->load->view('add',$data);\n \n //Load the footer\n $this->load->view('page/footer',$data);\n }", "public function displayPage()\n {\n\n // I check if there is a duplicate action\n $this->handleDuplicate();\n\n $formTable = new FormListTable();\n\n $formTable->prepare_items();\n require_once __DIR__ . '/templates/index.php';\n }", "function add_new()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio';\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['category'] = $this->portfolio_model->get_all_active_category();\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_portfolio';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function viewAddResources()\n {\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "function student_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'student_add';\n $page_data['page_title'] = get_phrase('add_student');\n $this->load->view('backend/index', $page_data);\n }", "protected function add(){\n // als er geen gebruiker is ingelogd, check session.. daarna maak session message\n if(!isset($_SESSION['isLoggedIn'])){\n $_SESSION['message'] = \"<div class=\\\"alert alert-dismissible alert-danger\\\">\n <button type=\\\"button\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\"></button>\n <strong>U moet ingelogd zijn om deze pagina te bezoeken! </strong>\";\n header('Location: '. ROOT_PATH . 'todos/all');\n }\n $viewmodel = new TodoModel();\n $this->returnView($viewmodel->add(),true);\n }" ]
[ "0.8209862", "0.81491435", "0.7927153", "0.7853182", "0.77977896", "0.7793934", "0.76992315", "0.76987165", "0.7637655", "0.7563919", "0.7551117", "0.75366586", "0.7527228", "0.75161433", "0.7469434", "0.7446072", "0.7410876", "0.7410459", "0.7409453", "0.7397481", "0.7397111", "0.73968196", "0.73413", "0.7325582", "0.7319907", "0.73031133", "0.73029613", "0.7288721", "0.728488", "0.7268979", "0.72448117", "0.7234778", "0.7206526", "0.72046125", "0.7189859", "0.7186653", "0.7178647", "0.7167508", "0.71613115", "0.71452385", "0.7129191", "0.7126097", "0.7121664", "0.7118598", "0.7113393", "0.7092422", "0.7071639", "0.70686716", "0.7063142", "0.7061633", "0.70614356", "0.70334", "0.7025484", "0.7017888", "0.701416", "0.69778943", "0.69745064", "0.69680864", "0.6965466", "0.69644785", "0.6961119", "0.6941559", "0.6940536", "0.6929707", "0.69169366", "0.69097024", "0.68999964", "0.6898929", "0.6891211", "0.68846786", "0.68812543", "0.68788594", "0.68675476", "0.6864614", "0.6852286", "0.6847446", "0.6843322", "0.6843322", "0.684252", "0.68385994", "0.6836927", "0.6833669", "0.6831553", "0.68315434", "0.6830623", "0.68257236", "0.68213624", "0.681848", "0.68125784", "0.68115765", "0.6807456", "0.679276", "0.6782624", "0.6768603", "0.67657393", "0.675627", "0.675523", "0.67464954", "0.6744777", "0.6731995", "0.67311203" ]
0.0
-1
displays the edit page
public function postEdit(){ $plan = Plan::find(Input::get('id')); if($plan){ return View::make('admin.plan.edit') ->with('insurances', Insurance::lists('name', 'id')) ->with('plan', $plan); } return Redirect::to('admin/insurancePlan') ->with('message', 'Something went wrong. Please try again.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $data['individual'] = $this->individual();\n $data['menus'] = $this->allmenus();\n $data['pages'] = $this->allpages();\n $this->load->view('Dashboard/header');\n $this->load->view('Menu/edit', $data);\n $this->load->view('Dashboard/footer');\n }", "abstract protected function renderEdit();", "public function edit()\r\n\t{\r\n\t\t$model = $this->getProfileView();\r\n\t\t$data = array('model'=> $model);\r\n\t\t\r\n\t\treturn $this->render($data);\r\n\r\n\t}", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function edit(){\n $factura = parent::find($_GET['id']);\n require_once 'views/employee/layouts/header.php';\n require_once 'views/employee/factura/edit.php';\n require_once 'views/employee/layouts/footer.php';\n\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function edit()\n {\n return view(\"web_admin.books.edit\");\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit()\n {\n return view('common::edit');\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n {\n return view('admincp::edit');\n }", "public function editAction() {}", "public function edit(){\n $publication = parent::find($_GET['id']);\n require_once 'views/layouts users/header.php';\n require_once 'views/admin/edit.php';\n require_once 'views/layouts users/footer.php';\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "function lb_show_edit_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'edit',\n\t\t\t'this_cafe' => lb_get_this_cafe_from_cafe( $_GET['edit-id'] ),\n\t\t)\n\t);\n}", "public function edit()\n {\n return view('home::edit');\n }", "public function edit()\n {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n\n $project = Project::find($_GET['id']);\n require_once('views/projects/edit.php');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n session_start();\n\n // Falls der Benutzer eingeloggt ist wird ihm die Edit View angezeigt, ansonsten ein Fehler\n if (isset($_SESSION['isLoggedIn']) && !empty($_SESSION['isLoggedIn'])) {\n $post = $this->postRepository->readById($_GET['id']);\n $view = new View('post/edit');\n $view->title = 'Post editieren';\n $view->post = $post;\n $view->display();\n } else {\n header('Location: /user/index/?error=Du bist nicht eingeloggt!');\n }\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function showEdit()\n {\n\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function editView() {\n $this->template()->addTplFile('edit.phtml');\n $this->setTinyMCE($this->formEdit->text, 'advanced');\n $this->setTinyMCE($this->formEdit->textPanel, 'advanced', array('height' => 300));\n if(isset($this->formEdit->textFooter)){\n $this->setTinyMCE($this->formEdit->textFooter, 'advanced', array('height' => 300));\n }\n Template_Module::setEdit(true);\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function profile_edit() {\n $this->template->content = View::instance('v_users_profile_edit');\n $this->template->title = \"Edit Profile\";\n\n // Render the view\n echo $this->template;\n\n }", "public function edit()\n\t{\n\t\t\n\t}", "function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('website::edit');\n }", "public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "function show_edit()\n\t{\n\t\treturn '';\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function editAction(): void {\n View::renderTemplate('Profile/edit.twig', [\n 'user' => $this->user\n ]);\n }", "public function editAction()\n {\n $tiles = [];\n // Reuse the parameters from $_REQUEST\n // If we are going to render a full page for edit form, we shall also render the _form_controls\n $tiles[] = Region::create($this->getEditRegionPath(), array_merge($_REQUEST, [\n '_form_controls' => true,\n ]));\n return $this->render($this->findTemplatePath('page.html') , array( 'tiles' => $tiles ));\n }", "public function edit()\n\t {\n\t return view('lecturer.edit');\n\t }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }", "public static function BackDisplayEdit()\n\t{\n\t\t$Object = Object::getById(\n\t\t\t$options = array(\n\t\t\t\t'object_id'\t => Util::getvalue('id'),\n\t\t\t\t'model' => 'ArticleModel',\n\t\t\t\t'table' => ArticleModel::$table,\n\t\t\t\t'state'\t\t => false, \n\t\t\t\t'relations'\t => true,\n\t\t\t\t'multimedas' => true,\n\t\t\t\t'categories' => true\n\t\t\t)\n\t\t);\n\n\t\tif(!$Object) Application::Route(array('modulename'=>'article'));\n\t\t\n\t\t$Locations = Location::getList($parent=0);\n\n\t\tparent::loadAdminInterface();\n\t\tself::$template->setcontent($Object, null, 'object');\n\t\tself::$template->setcontext($Locations, null, 'locations');\n\t\tself::$template->add(\"article.templates.xsl\");\n\t\tself::$template->add(\"article.edit.xsl\");\n\t\tself::$template->display();\n\t}", "public function edit()\n {\n \n \n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd(intval($id));\n\t\t$game_info = Resource_Service_Games::getResourceGames($info['link']);\n\t\t$this->assign('game_info', $game_info);\n\t\t$this->assign('ad_types', $this->ad_types);\n\t\t$this->assign('info', $info);\n\t}", "function edit()\n\t{\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Make sure you are logged in\n\t\tif (!$user->authorise('com_weblink.weblink.edit')) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\tJRequest::setVar('view', 'weblink');\n\t\tJRequest::setVar('layout', 'form');\n\n\t\t$model = &$this->getModel('weblink');\n\t\t$model->checkout();\n\n\t\tparent::display();\n\t}", "public function edit()\n {\n $id = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $post = $this->post->getPost($id); // je récupère le post\n\n // j'arrive en post car des données sont saisies dans le formulaire\n if($this->request->parameterExist('title') && $this->request->parameterExist('content')) {\n\n $this->post->updatePost(\n $this->request->getParameter('title'),\n $this->request->getParameter('content'),\n $id\n );\n\n $this->redirect(\"admin\", \"post/\" . $post['id']); // une fois le post créé, je redirige vers la vue Admin/post/iddupost\n }\n\n // j'arrive sur la vue en Get\n $this->buildView(array('post'=>$post));\n }", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function action_editar() {\r\n\t\tif(!Session::instance()->GetUsuario())\r\n \treturn $this->redirect(\"/\");\r\n $links = new Model_Link();\r\n $template = View::factory(\"base/menu\");\r\n $template->set(\"usuario\", Session::instance()->GetUsuario());\r\n $template->set(\"links\", $links->ObtenerLinks(Session::instance()->GetUsuario()));\r\n\t\t/***************************************/\r\n\t\t$template->body = View::factory(\"compromiso/editar\");\r\n\t\t\r\n\t\t$compromisoId = $this->request->param('id');\r\n\t\t$compromiso = new Model_Compromiso($compromisoId);\r\n\t\t$template->body->set(\"compromiso\", $compromiso);\r\n\t\t$template->set(\"scripts\", $this->scripts);\r\n\t \t$template->set(\"styles\", $this->styles);\r\n\t\t\r\n\t\t$this->response->body($template);\r\n\t}", "public function edit() {\n }", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "public function edit($id)\n {\n // include view file\n }", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function editAction(){\n\t\t$id = $this->getInput('id');\n\t\t$info = Ola_Service_Area::get(intval($id)); \n\t\t$this->assign('roots', $this->roots);\n\t\t$this->assign('parents', $this->parents);\n\t $this->assign('info', $info);\t\n\t}", "public function edit()\r\n {\r\n if (!isset($_SESSION['auth']) || empty($this->params['id'])) {\r\n header('Location: ' . BASE_URI);\r\n exit;\r\n }\r\n // get genre and publisher list\r\n $genreModel = new GenreModel();\r\n $genreList = $genreModel->read();\r\n $publisherModel = new PublisherModel();\r\n $publisherList = $publisherModel->read();\r\n\r\n // CASE user submit change\r\n if (isset($this->params['title'])) {\r\n $this->model->id = $this->params['id'];\r\n unset($this->model->params['id']);\r\n\r\n $this->model->params = $this->filterArrayEmpty($this->model->params);\r\n /**\r\n * Verif here\r\n */\r\n $this->model->save();\r\n header('Location: ' . BASE_URI . DIRECTORY_SEPARATOR . 'movie?id=' . $this->params['id']);\r\n exit;\r\n }\r\n\r\n // CASE edit movie page\r\n $this->model->id['col'] = 'id_movie';\r\n $this->model->id['val'] = $_GET['id'];\r\n // get genre and publisher real name\r\n $data = $this->model->read();\r\n\r\n $this->render('edit', [\r\n 'movie' => !empty($data) ? $data[0] : 'No data',\r\n 'genreList' => $genreList,\r\n 'publisherList' => $publisherList\r\n ]);\r\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function editAction()\r\n {\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit(){\n\n \treturn View::make('users.edit');\t\n }", "public function editAction()\n {\n echo 'Hello from the edit action in the Books controller!';\n echo '<p>Route parameters: <pre>' .\n htmlspecialchars(print_r($this->route_params, true)) . '</pre></p>';\n }", "public function editAction(): object\n {\n // Sets webpage title\n $title = \"Edit content\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n // Connects to db\n $this->app->db->connect();\n\n // Retrieve content id\n $contentId = getGet(\"id\");\n\n // SQL statement\n $sql = \"SELECT * FROM content WHERE id = ?;\";\n\n // Fetches data from db and stores in $resultset\n $content = $this->app->db->executeFetch($sql, [$contentId]);\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"contentId\" => $contentId,\n \"content\" => $content,\n // \"filters\" => $filters\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/edit\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function edit($id='')\n {\n \t$data['title'] = 'SEO - Raja housing';\n \t$data['result'] = $this->m_seo->edit($id);\n \t$this->load->view('seo/edit', $data);\n }", "public function edit()\n {\n if (Entry::canCreateOrEdit() === false) {\n return Redirect::route('entry.index')\n ->withMessage(\"Sorry, the competition has now started and entries cannot be changed.\");\n }\n\n $entry = $this->getEntry();\n\n if ($entry) {\n return View::make('entry.edit')\n ->with('entry', $entry);\n }\n\n return Redirect::route('entry.index');\n }", "public function edit()\n\t{\n\t\treturn view('account.edit');\n\t}", "public function edit($id)\n {\n //\n\t\techo 'edit';\n }", "public function edit($edit_id)\n\t{\n\n\t\t\n\t\t$this->data['_pageview'] = $this->data[\"_directory\"] . \"edit\";\n $this->data[\"edit_id\"] = $edit_id;\n\n\t\n $_USER_DETAILS \t= RolePermissions::where(\"pilot_role_id\", $edit_id);\n\t\t\n\t\t\n if ( $_USER_DETAILS -> count() <= 0 )\n {\n return GeneralHelper::show_error_page(\"404\");\n }\n\n\n \n \n\t\t$TMP_data\t\t\t\t\t\t\t\t\t\t= $_USER_DETAILS->get()->first()->toArray();\n $TMP_data['redirect_after_login']\t\t\t\t= \"\";\n\t\t\n\t\t\n\t\t$tmp_where\t\t\t\t\t\t\t\t\t\t= array('pilot_role_id'\t\t=> $edit_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 'project_id'\t\t\t=> $TMP_project_id,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'operation'\t\t\t\t=> 'redirect_after_login');\t\n\t\t$_redirect_to\t\t\t\t\t\t\t\t\t= RolePermissions::where( $tmp_where );\n\t\tif ( $_redirect_to -> count() > 0 )\n\t\t{\n\t\t\t$TMP_data['redirect_after_login']\t\t\t= $_redirect_to->get()->first()->directory;\n\t\t}\n\t\t\n\t\t\n \n \t$TMP_data[\"option\"]\t\t\t\t\t\t\t= \"edit\";\n\t\t$TMP_data[\"unique_formid\"]\t\t\t\t\t\t= \"\";\n\n\t\tGeneralHelper::form_fields_generator($this->data, true, $TMP_data, $this->input_fields, $this->fillable_inputs);\n $this->_create_child_for_form(true, $this->data, $_USER_DETAILS->get()->toArray() );\n\n\t\treturn view($this->constants[\"ADMINCMS_TEMPLATE_VIEW\"], $this->data);\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gc_Service_OrderShow::getOrderShow(intval($id));\n\t\n\t\t//状态\n\t\t$this->assign('ordershow_status', $this->ordershow_status);\n\t\t\n\t\t//渠道\n\t\tlist(,$ordershow_channel) = Gc_Service_OrderChannel::getAllOrderChannel();\n\t\t$ordershow_channel = Common::resetKey($ordershow_channel, 'id');\n\t\t$this->assign('ordershow_channel', $ordershow_channel);\n\t\t\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function edit(){\n\t\t# If user is blank, they're not logged in; redirect them to the login page\n\t\tif(!$this->user) {\n\t\t\tRouter::redirect('/users/login');\n\t\t}\n\n\t\t# If they weren't redirected away, continue:\n\t\t\n\t\t# Setup view\n\t\t$this->template->content = View::instance('v_posts_edit');\n\t\t$this->template->title = \"Posts of \".$this->user->first_name;\n\n\t\t#query to only show users posts\n\t\t$q = \"SELECT\n\t\t\t\tposts.content, \n\t\t\t\tposts.created, \n\t\t\t\tposts.post_id,\n\t\t\t\tusers.first_name, \n\t\t\t\tusers.last_name\n\t\t\tFROM posts\n\t\t\tINNER JOIN users\n\t\t\t\tON posts.user_id = users.user_id\n\t\t\tWHERE users.user_id =\".$this->user->user_id;\n\n\t\t# Execute the query to get all the posts. \n\t\t# Store the result array in the variable $posts\n\t\t# Run the query, store the results in the variable $posts\n\t\t$posts = DB::instance(DB_NAME)->select_rows($q);\n\n\t\t# Pass data (posts) to the view\n\t\t$this->template->content->posts = $posts;\n\n\t\t# Render template\n\t\techo $this->template;\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function getEdit(){\n return view(\"admin.product.edit\" );\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function Edit()\n\t{\n\t\t\n\t}", "function editting()\n\t{\n\t\tglobal $template, $mod_loader, $security, $errors, $lang_loader;\n\t\t\n\t\t// which is chosen\n\t\t$b = ( isset( $_GET[ 'pag' ] ) ) ? str_replace( '%20', ' ', strval( $_GET[ 'pag' ] ) ) : '';\n\t\t\n\t\t// create the list\n\t\t$list = '<select onchange=\"window.location.href = this.value\">';\n\t\t$list .= ( empty( $b ) ) ? '<option selected value=\"\"> </option>' : '<option value=\"\"> </option>';\n\t\tif ( is_array( $this->pages_array ) )\n\t\t{\n\t\t\tforeach ( $this->pages_array as $lang => $pags )\n\t\t\t{\n\t\t\t\tforeach ( $pags as $name => $pag )\n\t\t\t\t{\n\t\t\t\t\t$list .= ( $b == $lang . '-' . $name ) ? '<option selected ' : '<option ';\n\t\t\t\t\t$list .= 'value=\"' . $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_pages&s=edit&pag=' . $lang . '-' . $name ) . '\">' . $lang . ' :: ' . $name . '</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$list .= '</select>';\n\t\t\n\t\t// determine the content of the editee\n\t\tif ( !empty( $b ) )\n\t\t{\n\t\t\t// get the content\n\t\t\t$content = explode( '-', $b );\n\t\t\t$title = $content[ 1 ];\n\t\t\t$language = $content[ 0 ];\n\t\t\t$auth = $this->pages_array[ $content[ 0 ] ][ $content[ 1 ] ][ 'auth' ];\n\t\t\t$content = $this->pages_array[ $content[ 0 ] ][ $content[ 1 ] ][ 'content' ];\n\t\t}else\n\t\t{\n\t\t\t$content = '';\n\t\t\t$title = '';\n\t\t\t$language = '';\n\t\t\t$auth = '';\n\t\t}\n\t\t\n\t\t// get the editor\n\t\t$mods = $mod_loader->getmodule( 'editor', MOD_FETCH_NAME, NOT_ESSENTIAL );\n\t\t$mod_loader->port_vars( array( 'name' => 'editor1', 'quickpost' => FALSE, 'def_text' => stripslashes( $content ) ) );\n\t\t$mod_loader->execute_modules( 0, 'show_editor' );\n\t\t$page = $mod_loader->get_vars( array( 'editor_HTML', 'editor_WYSIWYG' ) );\n\t\t\n\t\tif ( !$page[ 'editor_WYSIWYG' ] )\n\t\t{ // make it so that newlines are actually newlines in the textarea\n\t\t\t$htm = $page[ 'editor_HTML' ];\n\t\t\t$htm = str_replace( '<textarea name=\"editor1\" id=\"editor1\" style=\"width: 100%; height: 78%\">' . htmlspecialchars( $content ) . '</textarea>', '<textarea name=\"editor1\" id=\"editor1\" style=\"width: 100%; height: 78%\">' . htmlspecialchars( str_replace( '<br />', \"\\r\\n\", $content ) ) . '</textarea>', $htm );\n\t\t\t$page[ 'editor_HTML' ] = $htm;\n\t\t}\n\t\t\n\t\t// construct the language selection list\n\t\t$langl = $lang_loader->get_langlist();\n\t\t$langs = '<select name=\"language\">';\n\t\tfor ( $i = 0; $i < count( $langl ); $i++ )\n\t\t{\n\t\t\t$langs .= ( $langl[ $i ] == $language ) ? '<option selected>' . $langl[ $i ] . '</option>' : '<option>' . $langl[ $i ] . '</option>';\n\t\t}\n\t\t$langs .= '</select>';\n\t\t\n\t\t// construct the auth selection list :)\n\t\t$auth2 = '<select name=\"auth\">';\n\t\t$s[ 0 ] = ( $auth == GUEST ) ? 'selected' : '';\n\t\t$s[ 1 ] = ( $auth == INACTIVE ) ? 'selected' : '';\n\t\t$s[ 2 ] = ( $auth == ADMIN ) ? 'selected' : '';\n\t\t$s[ 3 ] = ( $auth == SUPER_MOD ) ? 'selected' : '';\n\t\t$s[ 4 ] = ( $auth == MOD ) ? 'selected' : '';\n\t\t$s[ 5 ] = ( $auth == USER ) ? 'selected' : '';\n\t\t$auth2 .= '<option value=\"' . GUEST . '\" ' . $s[ 0 ] . '>' . $this->lang[ 'Guest' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . INACTIVE . '\" ' . $s[ 1 ] . '>' . $this->lang[ 'Inactive' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . ADMIN . '\" ' . $s[ 2 ] . '>' . $this->lang[ 'Admin' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . SUPER_MOD . '\" ' . $s[ 3 ] . '>' . $this->lang[ 'Super_mod' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . MOD . '\" ' . $s[ 4 ] . '>' . $this->lang[ 'Mod' ] . '</option>';\n\t\t$auth2 .= '<option value=\"' . USER . '\" ' . $s[ 5 ] . '>' . $this->lang[ 'User' ] . '</option>';\n\t\t$auth2 .= '</select>';\n\t\t\n\t\t// the template stuff eh\n\t\t$template->assign_block_vars( 'edit', '', array(\n\t\t\t'S_FORM_ACTION' => $security->append_sid( '?' . MODE_URL . '=ACP&' . SUBMODE_URL . '=ACP_pages&s=add_bar' ),\n\t\t\t'S_PAGE' => $page[ 'editor_HTML' ],\n\t\t\t'S_TITLE' => $title,\n\t\t\t'S_CONTENT' => htmlentities( $content ),\n\t\t\t'S_SELECT' => $list,\n\t\t\t'S_LANGS' => $langs,\n\t\t\t'S_MODE' => 'edit',\n\t\t\t'S_AUTH' => $auth,\n\t\t\t'S_AUTH2' => $auth2,\n\t\t\t\n\t\t\t'L_TITLE' => $this->lang[ 'Edit_title' ],\n\t\t\t'L_EXPLAIN' => $this->lang[ 'Edit_explain' ],\n\t\t\t'L_TITLE2' => $this->lang[ 'Edit_title2' ],\n\t\t\t'L_LANGUAGE' => $this->lang[ 'Edit_language' ],\n\t\t\t'L_SELECT' => $this->lang[ 'Edit_select' ],\n\t\t\t'L_AUTH' => $this->lang[ 'Edit_auth' ],\n\t\t\t'L_REMOVE' => $this->lang[ 'Edit_remove' ],\n\t\t) );\n\t\t\n\t\t// woot visible\n\t\t$template->assign_switch( 'edit', TRUE );\n\t}", "public function edit()\n {\n //return view('movie::edit');\n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n return $this->editor($isEditAction=true);\n }", "public function actionEdit(){\n\t\t$form = $_POST;\n\t\t$id = $form['id'];\n\t\tunset($form['id']);\n\t\tunset($form['submit_']);\n\t\tif($form['active'] == 'on'){\n\t\t\t$form['active'] = 1;\n\t\t}\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('UPDATE core_pages SET ? WHERE id = ?', $form, $id);\n\t\t$this->redirect('pages:');\n\t}", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function editAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$layoutName = $this->_request->getParam('layout'); \n\t\t$this->view->objLayout = $model->getLayout($layoutName);\n\t }", "public function edit() {\n if (!Auth::check()) return redirect()->to('login');\n $pageData = self::getData('edit');\n return view('profile-edit', $pageData);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function edit()\n {\n\n $data['id'] = Input::get('id');\n $page = $this->photoGallery->getDataById($data['id']);\n\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $rootParent = $this->photoGallery->rootParentList();\n $dash = \"\";\n $dropdown = [ ];\n $pageList = [ \"\" => 'Select Gallery' ] + $this->recur($rootParent, $dash, $dropdown);\n\n return view('cms.modules.multicms.photoGallery_edit', compact('page', 'pageList'), $data);\n }" ]
[ "0.83690137", "0.82135767", "0.80976015", "0.78737324", "0.78578633", "0.7803971", "0.7797339", "0.7769172", "0.776656", "0.77648556", "0.7751735", "0.77489144", "0.7740799", "0.7726954", "0.77191895", "0.77191275", "0.7717325", "0.7715426", "0.76877135", "0.7683288", "0.76726323", "0.7663843", "0.7659682", "0.7659682", "0.7658467", "0.76457393", "0.76457393", "0.76450074", "0.76441205", "0.76399946", "0.76218015", "0.76156294", "0.7611904", "0.7606684", "0.75930077", "0.759191", "0.75887275", "0.7582554", "0.75712806", "0.75594246", "0.7551414", "0.7532332", "0.75297725", "0.7504301", "0.7497133", "0.74917233", "0.7472181", "0.7455186", "0.744878", "0.74421537", "0.74362457", "0.7415359", "0.7415317", "0.7414445", "0.7401194", "0.7381152", "0.7374854", "0.7372148", "0.7370072", "0.7364723", "0.7351962", "0.7350263", "0.7350099", "0.7347595", "0.73436546", "0.7343605", "0.7335854", "0.7332243", "0.7332243", "0.7325395", "0.7325065", "0.7322318", "0.7321618", "0.7320227", "0.73169714", "0.7315735", "0.7313016", "0.7310526", "0.7308312", "0.73028785", "0.7293604", "0.7284218", "0.7278987", "0.72737324", "0.7266708", "0.72634244", "0.72627807", "0.7262483", "0.72617686", "0.72611153", "0.7257827", "0.7257827", "0.7256551", "0.72549915", "0.7250522", "0.7250522", "0.7250522", "0.7246935", "0.72468716", "0.7242906", "0.72378886" ]
0.0
-1
Add a property to be injected in the new object
public function withProperty(string $property, $value): self { return new self( $this->class, $this->properties->set($property, $value), $this->injectionStrategies, $this->instanciator ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addProperty($key, $value);", "public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }", "public function property(&$class, $property);", "public function addObjectProperty($field, ObjectProperty $property);", "function createProperty();", "function addProperty($name, $value) {\r\n\r\n\t\t$propertyName = 'set'.ucfirst($name);\r\n\t\t\r\n\t\t// XML boolean needs to be converted\r\n\t\tif( strtolower($value) == 'true') {\r\n\t\t\t$value = True;\r\n\t\t} elseif(strtolower($value) == 'false') {\r\n\t\t\t$value = False;\r\n\t\t}\r\n\r\n\r\n\t\t// Set methods on the PlugIn driver class ($this->className, $this->key)\r\n\t\t// Eg: <plug-in ... key=\"SMARTY_PLUGIN\" .../> maps to $this->setKey(\"SMARTY_PLUGIN\")\r\n\t\tif( method_exists( $this, $propertyName) ) {\r\n\t\t\t$this->$propertyName($value);\r\n\t\t} else {\r\n\t\t\t// Set properties in the PlugIn class.\r\n\t\t\t// Check for a set-property element, and try to set the class variable directly\r\n\t\t\t// Eg: <set-property property=\"force_compile\" value=\"true\"/>\r\n\t\t\t$plugInVars = get_class_vars( get_class($this->plugIn) );\t\t\r\n\r\n\t\t\tif( array_key_exists($name, $plugInVars) ) {\r\n\t\t\t\t$p =& $this->plugIn;\r\n\t\t\t\t$p->$name = $value;\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\t$driverName = ucfirst(get_class($this));\t\t\t\t\r\n\t\t\t\tprint 'Error: '.$driverName.'->addProperty(): Method: '.\r\n\t\t\t\t\t\t$propertyName.\" not found<br>\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public function addPropertyValue(string $property, $value) : DataContainerInterface;", "public function __set($property, $value) {}", "function set_property(){\n }", "public function push($value): IProperty;", "public function addProperty(string $name, mixed $value): void\n\t{\n\t\t$this->properties[$name] = $value;\n\t}", "public function inject($name, $value)\n {\n $this->$name = $value;\n }", "public function addProperty(Property $property)\n {\n $this->properties[(string)$property->getFqsen()] = $property;\n }", "protected function addProperty(\n SerializationVisitorInterface $visitor,\n ObjectEvent $event,\n string $objectClass,\n string $objectProperty,\n mixed $value,\n ?string $prop = null,\n bool $insertUnderscore = true): void\n {\n $metadata = $event->getContext()->getMetadataFactory()->getMetadataForClass($objectClass)->propertyMetadata[$objectProperty];\n if (!$metadata instanceof PropertyMetadata) {\n throw new RuntimeException('Invalid property metadata!');\n }\n\n if ($prop) {\n $metadata->serializedName = $this->propertyName($prop, $insertUnderscore);\n }\n\n $visitor->visitProperty($metadata, $value);\n }", "public function addRawProperty($field, RawProperty $property);", "protected function _add($property, $value): void {\n if (property_exists($this, $property)) {\n $this->{$property}[] = $value;\n } else {\n $this->_properties[$property][] = $value;\n }\n }", "public function registerProperty($name, callable $callable);", "public function embedProperty() {\n\n $this->addEmbed(\"Property\");\n return $this;\n }", "public function addProperty(PropertyInterface $property)\n\t{\n\t\t$this->properties[$property->key()] = $property;\n\n\t\treturn $this;\n\t}", "public function addProperty(ClassProperty $property)\n {\n if (isset($this->properties[$property->getName()])) {\n throw new CompilerException(\"Property '\" . $property->getName() . \"' was defined more than one time\", $property->getOriginal());\n }\n\n $this->properties[$property->getName()] = $property;\n }", "public function configureProperty(string $property, array $data) {\n $this->properties[$property] = $data;\n return $this;\n }", "public function injectObject() {\n\n // load the map\n $this->loadMap();\n $this->_injectMethods();\n $this->_injectProperties();\n\n }", "public function __set($propertyName, $propertyValue){\n \t$this->properties[$propertyName] = $propertyValue;\n }", "public function add_declaration($property, $value)\n {\n }", "private function addPropertyMetadata(PropertyMetadataInterface $metadata)\n {\n $property = $metadata->getPropertyName();\n\n $this->members[$property][] = $metadata;\n }", "public function appendAffectedObjectProperty(PropertyInterface $property)\n {\n $this->affectedObjectProperties[] = $property;\n }", "protected function inject($classOrObject, string $propertyNane, $propertyValue)\n {\n $property = new ReflectionProperty($classOrObject, $propertyNane);\n $property->setAccessible(true);\n $property->setValue($classOrObject, $propertyValue);\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function addAdditionalProperty($name, $value)\n {\n $this->additionalProperties[$name] = $value;\n }", "public function createProperty()\n {\n $prop = new LiquibaseProperty();\n $this->properties[] = $prop;\n\n return $prop;\n }", "public function addCommonObjectProperty($field, ObjectProperty $property);", "public function propertyObject($propertyIdent);", "public function __construct($val)\n {\n $this->property = $val;\n }", "function set($property, $value) {\n $this->{$property} = $value;\n }", "public function __set($property, $value) {\r\n $param = '_' . $property;\r\n $this->$param = $value;\r\n }", "public function __get($prop) {}", "public function set($property, $value);", "function addProperty($name, $value) {\r\n\r\n\t\tif($this->configured) {\r\n\t\t\treturn 'Configuration is frozen';\r\n\t\t}\r\n\r\n\t\t// XML boolean needs to be converted\r\n\t\tif( strtolower($value) == 'true') {\r\n\t\t\t$value = True;\r\n\t\t} elseif(strtolower($value) == 'false') {\r\n\t\t\t$value = False;\r\n\t\t}\r\n\r\n\t\t// Look for a setter method matching the \"name\" parameter\r\n\t\t$beanUtils = new PhpBeanUtils();\r\n\t\t$beanUtils->setProperty($this, $name, $value);\r\n\r\n\t}", "public function setp($property, $value){\n //not working static fn if(property_exists('Config_allsites', $property)){\n if(property_exists($this, $property)){\n $this->$property = $value;\n }\n return $this;\n }", "public function setProperty($property, $value = null);", "public function __set($property, $value){\n $this->$property = $value;\n }", "public function __set($property, $value) {\n if (isset($this->translation[$property])) {\n $property = $this->translation[$property];\n }\n $this->_magicProperties[$property] = $value;\n }", "public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}", "public function setProperty($property)\n\t{\n\t\t$this->property = $property;\n\t}", "public function setProperty($property)\n\t{\n\t\t$this->property = $property;\n\t}", "abstract public function property($propertyIdent);", "public function addProperty(Entities\\Devices\\Properties\\Property $property): void\n\t{\n\t\tif (!$this->properties->contains($property)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->properties->add($property);\n\t\t}\n\t}", "public function addColumn(Property $property);", "public function __set($property, $value)\n {\n $info = build_properties_hint(reflect_properties($this));\n warning('Property \"'.$property.'\" doesn\\'t exist in a '.get_class($this).' object', $info);\n $this->$property = $value; // Add the property to the object. (PHP's default behavior)\n }", "public function property($propertyIdent);", "public function __get($property) {}", "public function __set($prop, $value)\n {\n $this->assignee[$prop] = $value;\n }", "public function __set($property, $value) {\n\t\tif (strpos($property, 'source') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\t$this->bean->source = $value;\n\t\t\t} else {\n\t\t\t\t$sourceInstance = $this->getSourceInstance();\n\t\t\t\tif ($sourceInstance !== null) {\n\t\t\t\t\t$sourceInstance->$property = $value;\n\t\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif (strpos($property, 'remote') === 0) {\n\t\t\t$property = lcfirst(substr($property, 6));\n\t\t\tif ($property === '') {\n\t\t\t\t$this->bean->target = $value;\n\t\t\t} else {\n\t\t\t\t$targetInstance = $this->getTargetInstance();\n\t\t\t\tif ($targetInstance !== null) {\n\t\t\t\t\t$targetInstance->$property = $value;\n\t\t\t\t\t$this->bean->setMeta('tainted', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Temporary properties are kept in the object, and not written to the database.\n\t\t} elseif (strpos($property, 'temp') === 0) {\n\t\t\t$property = lcfirst(substr($property, 4));\n\t\t\t$this->tempProperties[$property] = $value;\n\t\t} elseif (isset($this->bean->$property)) {\n\t\t\t$this->bean->$property = $value;\n\t\t} elseif (!isset($this->properties[$property]) || $this->properties[$property] !== $value) {\n\t\t\t$this->properties[$property] = $value;\n\t\t\t$this->bean->setMeta('tainted', true);\n\t\t}\n\t}", "public function __set($property, $value) {\r\n\t\tswitch($property) {\r\n\t\t\tcase 'view':\r\n\t\t\t\t$this->view = $value;\r\n\t\t\t\t$this->install($this->view);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'script':\r\n\t\t\t\t$this->script .= $value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n PropertyHelper::Error($property);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function getInjectProperties() {}", "public function __set($property, $value) \n {\n \tif (property_exists($this, $property)) {\n \t\t$this->$property = $value;\n \t}\n }", "public function __set($property, $value)\n {\n $protected = array( 'repository' );\n if(!in_array($property, $protected))\n $this->$property = $value;\n }", "public function __set($prop, $val) {\n\t\t$this->props[$prop] = $val;\n }", "public function setProperty($key, $value);", "public function add($item)\n {\n $index = \"properties\";\n if (is_subclass_of($item->object, Model::class)) {\n $index = \"globals\";\n }\n $this->{$index}[$item->key] = $item;\n return $this;\n }", "public function __set($property, $value) {\n if (class_exists('\\Sleepy\\Hook')) {\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_' . $property, $value);\n $this->data[$property] = Hook::addFilter($this->clean_class() . '_set_property', $value);\n } else {\n $this->data[$property] = $value;\n }\n }", "public function create_property($name,$params){\n\t\t$endpoint = 'properties/'.$name;\n\n\t\ttry{\n\t\t\treturn json_decode($this->execute_put_request($this->get_request_url($endpoint,null),json_encode($params)));\n\t\t}\n\t\tcatch(HubSpot_Exception $e){\n\t\t\tprint_r('Unable to create property: '.$e);\n\t\t}\n\t}", "public function __set($property, $value) \n {\n $this->$property = $value;\n }", "public function __set($property, $value) \n {\n $this->$property = $value;\n }", "public function __set($property, $value) \n {\n $this->$property = $value;\n }", "public function __set($property, $value) \n {\n $this->$property = $value;\n }", "public function __set($property, $value) \n {\n $this->$property = $value;\n }", "public function __set($prop, $value)\r\n {\r\n $this->wrappedObj->$prop = $value;\r\n\r\n return $this;\r\n }", "public function __set( $property, $value ) {\n\t\t\tif ( property_exists( $this, $property ) ) {\n\n\t\t\t\t// Latitude hard-wired callback\n\t\t\t\t//\n\t\t\t\tif ( $property === 'latitude' ) {\n\t\t\t\t\t$this->set_LatLong( $value , null );\n\n\t\t\t\t// Longitude hard-wired callback\n\t\t\t\t//\n\t\t\t\t} elseif ( $property === 'longitude' ) {\n\t\t\t\t\t$this->set_LatLong( null , $value );\n\n\t\t\t\t// All other standard properties\n\t\t\t\t//\n\t\t\t\t} else {\n\t\t\t\t\t$this->$property = $value;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Extended Data, allow property as long as it does not conflict\n\t\t\t// with a built-in property.\n\t\t\t//\n\t\t\tif ( ! property_exists( $this, $property ) ) {\n\t\t\t\tif ( $this->slplus->database->is_Extended() &&\n\t\t\t\t\t$this->slplus->database->extension->has_field( $property )\n\t\t\t\t) {\n\t\t\t\t\t$this->exdata[ $property ] = $value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->temporary[ $property ] = $value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $this;\n\t\t}", "function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\n }\n }", "function __set($name, $value){\n //var_dump($value);\n\n $this->_properties[$name] = $value;\n }", "function setProperty($property,$value=null){\n\t\t/*\n\t\t * This function is useful to call right after adding the filed:\n\t\t *\n\t\t * $this->addField('line','login')->setProperty('not null');\n\t\t */\n\t\treturn $this->setFieldProperty($this->last_field,$property,$value);\n\t}", "public function __construct(Property $property)\n {\n $this->property = $property;\n }", "public static function createProperty($userId, $data) {\n\t\t$property = new Property ();\n\t\t$property->attributes = $data;\n\t\t$property->user_id = $userId;\n\t\t$property->save ();\n\t\treturn $property;\n\t}", "public function withProp($name, $value)\n {\n return $this->withProps([$name => $value]);\n }", "public function __construct($createProperty, $property)\n {\n $this->property = $property;\n\n $this->createProperty = $createProperty;\n }", "public function __set($property, $value)\n\t{\n\t\tif (property_exists($this, $property))\n\t\t{\n\t\t\t$this->$property = $value;\n\t\t}\n\t\telse echo \"error\";\n\t}", "public function addProperty($property) {\n $this->optionalProperties[] = $property;\n return $this->optionalProperties;\n }", "private function addProperties(&$objReceive)\n {\n $properties = [\n 'target_date', 'voucher_url', 'participant_first_name', 'participant_last_name',\n 'activity_title', 'activity_id', 'plan_title', 'plan_unit_items',\n 'plan_options', 'plan_transportation_item', 'booked_date', 'plan_start_time',\n 'display_amount_gross_final', 'activity_cancel_policies', 'checkin_date',\n 'checkin_time', 'checkin_location_title', 'checkin_location_description',\n 'pick_up_date', 'pick_up_time', 'pick_up_location_title', 'pick_up_location_description',\n 'hotel_name', 'hotel_address', 'hotel_tel', 'hotel_reservation_first_name',\n 'hotel_reservation_last_name', 'arrival_date', 'departure_date', 'flight_number',\n 'destination_tel',\n ];\n $defArray = ['plan_unit_items', 'plan_options', 'activity_cancel_policies'];\n \n // add properties dynamically\n foreach ($properties as $property) {\n $objReceive->{$property} = in_array($property, $defArray) ? [] : null;\n }\n }", "function _setProp($key, $value)\n {\n $this->_props[$key] = $value;\n }", "protected function injectProperties($properties, $object) {\n\t\tforeach ($properties as $propertyName => $property) {\n\t\t\t$propertyValue = $property->getValue();\n\t\t\tswitch ($property->getType()) {\n\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_OBJECT:\n\t\t\t\t\tif ($propertyValue instanceof \\F3\\FLOW3\\Object\\Configuration\\Configuration) {\n\t\t\t\t\t\t$preparedValue = $this->build($propertyValue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (strpos($propertyValue, '.') !== FALSE) {\n\t\t\t\t\t\t\t$settingPath = array_slice(explode('.', $propertyValue), 1);\n\t\t\t\t\t\t\t$propertyValue = \\F3\\FLOW3\\Utility\\Arrays::getValueByPath($this->settings['FLOW3'], $settingPath);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$preparedValue = $this->get($propertyValue);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_STRAIGHTVALUE:\n\t\t\t\t\t$preparedValue = $propertyValue;\n\t\t\t\tbreak;\n\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_SETTING:\n\t\t\t\t\tif (strpos($propertyValue, '.') !== FALSE) {\n\t\t\t\t\t\t$settingPath = array_slice(explode('.', $propertyValue), 1);\n\t\t\t\t\t\t$preparedValue = \\F3\\FLOW3\\Utility\\Arrays::getValueByPath($this->settings['FLOW3'], $settingPath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($propertyValue !== 'FLOW3') {\n\t\t\t\t\t\t\tthrow new \\F3\\FLOW3\\Object\\Exception\\CannotBuildObjectException('Invalid reference to setting \"' . $argumentValue . '\" in object configuration for Dynamic Object Container.', 1265200444);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$preparedValue = $this->settings['FLOW3'];\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$setterMethodName = 'inject' . ucfirst($propertyName);\n\t\t\tif (method_exists($object, $setterMethodName)) {\n\t\t\t\t$object->$setterMethodName($preparedValue);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setterMethodName = 'set' . ucfirst($propertyName);\n\t\t\tif (method_exists($object, $setterMethodName)) {\n\t\t\t\t$object->$setterMethodName($preparedValue);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (property_exists($object, $propertyName)) {\n\t\t\t\t$propertyReflection = new \\ReflectionProperty($object, $propertyName);\n\t\t\t\t$propertyReflection->setAccessible(TRUE);\n\t\t\t\t$propertyReflection->setValue($object, $preparedValue);\n\t\t\t}\n\t\t}\n\t}", "public function set($value): IProperty;", "public function setProperty(string $key, $value): self;", "public function __set($propertyName, $propertyValue){\n\t\t$this->properties[$propertyName]=$propertyValue;\n\t}", "abstract function setUserProfileProperty($user, $property_name, $property);", "function __set($property, $value) {\n global $USER, $DB;\n if(in_array($property, array('title', 'header'))) {\n return ($this->{'_'.$property} = $value);\n } elseif($property == 'content') {\n return ($this->$property = $value);\n } else {\n return parent::__set($property, $value);\n }\n }", "public function __set($property, $value) {\n if ( isset($this->$property)) {\n $this->$property = $value;\n }\n else\n {\n die(\"$value nao existe\");\n }\n }", "public function __set($property, $value) {\n // object then proxy it to the Uuser object\n if(strpos($property, '__user__') > -1) {\n $property = str_replace('__user__', '', $property);\n\n if($this->user == NULL)\n $this->user = new User();\n\n $this->user->{$property} = $value;\n }\n }" ]
[ "0.6443587", "0.6179483", "0.6062057", "0.6036264", "0.60047686", "0.5942698", "0.58942294", "0.5889729", "0.587319", "0.5843738", "0.57723624", "0.57685465", "0.57485485", "0.57049364", "0.56981665", "0.56690764", "0.5630436", "0.5625525", "0.5617281", "0.55919564", "0.5587839", "0.55510956", "0.55369246", "0.55320245", "0.5515766", "0.551411", "0.55029106", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5498315", "0.5495435", "0.54549056", "0.5446027", "0.5413334", "0.5411503", "0.54086083", "0.5398981", "0.5397908", "0.5394644", "0.53872305", "0.5385805", "0.5366957", "0.53563756", "0.5355704", "0.5353312", "0.5353312", "0.5344761", "0.53392637", "0.5338295", "0.5333167", "0.53220695", "0.53126776", "0.5297929", "0.52955717", "0.52900654", "0.52887475", "0.52827936", "0.52707285", "0.5266692", "0.52581286", "0.5244041", "0.52417386", "0.5239338", "0.52326155", "0.52326155", "0.52326155", "0.52326155", "0.52326155", "0.5228412", "0.5227122", "0.52185684", "0.5209159", "0.5208005", "0.5204123", "0.52012974", "0.5201191", "0.5191749", "0.5181936", "0.5179321", "0.5178794", "0.5166724", "0.5163767", "0.5156593", "0.51539266", "0.51525056", "0.514964", "0.51352626", "0.51321447", "0.5130371" ]
0.0
-1
Add a set of properties that need to be injected
public function withProperties(array $properties): self { return new self( $this->class, $this->properties->merge(new Collection($properties)), $this->injectionStrategies, $this->instanciator ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInjectProperties() {}", "public function setProperties($properties)\n {\n\n }", "protected function inject_custom_parameters()\n\t{\n\t\tforeach ($this->custom_parameters as $key => $value)\n\t\t{\n\t\t\t$this->container->setParameter($key, $value);\n\t\t}\n\t}", "function setMultiple($properties) {\n foreach ($properties as $property => $value) {\n $this->set($property, $value);\n }\n }", "private function addProperties( $properties, $options ){\n\n // loop over properties\n for( $i = 0; $i < count( $properties ); $i++ ){\n \n // property exists\n if( isset( $options[$properties[$i]] ) ){\n \n // add property id and value\n echo ' ' . $properties[$i] . '=\"' . $options[$properties[$i]] . '\" ';\n }\n // property exists\n }\n // loop over properties\n }", "protected function fillProperties()\n {\n foreach ($this as $key => $value) {\n if ($this->isPrivate($key)) {\n continue;\n }\n $this->currentProperties[\"{$key}\"] = $value;\n $this->newProperties[\"{$key}\"] = $value;\n }\n }", "private function addProperties(&$objReceive)\n {\n $properties = [\n 'target_date', 'voucher_url', 'participant_first_name', 'participant_last_name',\n 'activity_title', 'activity_id', 'plan_title', 'plan_unit_items',\n 'plan_options', 'plan_transportation_item', 'booked_date', 'plan_start_time',\n 'display_amount_gross_final', 'activity_cancel_policies', 'checkin_date',\n 'checkin_time', 'checkin_location_title', 'checkin_location_description',\n 'pick_up_date', 'pick_up_time', 'pick_up_location_title', 'pick_up_location_description',\n 'hotel_name', 'hotel_address', 'hotel_tel', 'hotel_reservation_first_name',\n 'hotel_reservation_last_name', 'arrival_date', 'departure_date', 'flight_number',\n 'destination_tel',\n ];\n $defArray = ['plan_unit_items', 'plan_options', 'activity_cancel_policies'];\n \n // add properties dynamically\n foreach ($properties as $property) {\n $objReceive->{$property} = in_array($property, $defArray) ? [] : null;\n }\n }", "public function setProperties() {\n\t\t$this->public_prop = 'public';\n\t\t$this->protected_prop = 100;\n\t\t$this->private_prop = true;\n\n\t\t// Set a non-predefined property.\n\t\t$this->dynamic = new self();\n\t}", "public function setAutowiringProperties($autowiringProperties) {\n $this->autowiringProperties = $autowiringProperties;\n }", "public function setProperties(array $properties);", "public function before()\n {\n if ($this->_config === null) {\n return;\n }\n foreach ($this->_config as $property => $value) {\n if (property_exists($this, $property)) {\n $this->{$property} = $value;\n }\n }\n }", "public function inject_fields() {\n return array(\n '__inject__'\n );\n }", "public function initMutateProperty()\n {\n foreach ( $this->initMutateProperties as $property ) {\n $this->mutateProperties[ $property ] = $this->{$property};\n }\n $this->view->addParams( [\n 'mutateProperties' => $this->mutateProperties\n ] );\n }", "public function setProperties($properties)\r\n {\r\n if (!empty($properties)) {\r\n foreach ($properties as $key => $val) {\r\n $this->$key = $val;\r\n }\r\n }\r\n }", "public function extend($properties)\n {\n $properties = $this->resolvePropertiesArgument($properties);\n $this->properties = array_merge($properties, $this->properties);\n return $this;\n }", "private function addProperties( $options ){\n\n // loop over properties\n for( $i = 0; $i < count( $this->elementProperties ); $i++ ){\n // property exists\n if( isset( $options[$this->elementProperties[$i]] ) ){\n \n // get property value\n $propertyValue = $options[$this->elementProperties[$i]];\n \n // is src\n if( $this->elementProperties[$i] == 'src' ){\n // add image url to source\n $propertyValue = $this->imageUrl . $propertyValue;\n }\n // is src\n \n // add property id and value\n echo ' ' .$this->elementProperties[$i] . '=\"' . $propertyValue . '\" ';\n }\n // property exists\n }\n // loop over properties\n }", "public function moveAllOtherUserdefinedPropertiesToAdditionalArguments() {}", "public function loadPropierties($values)\n {\n foreach ($values as $key => $value) {\n if (property_exists($this, $key)) {\n $this->$key = $value;\n }\n }\n }", "private function addPropertyMetadata(PropertyMetadataInterface $metadata)\n {\n $property = $metadata->getPropertyName();\n\n $this->members[$property][] = $metadata;\n }", "public function with(...$dependencies)\n {\n $this->registerInjectedDependencies($dependencies);\n }", "protected function injectProperties($properties, $object) {\n\t\tforeach ($properties as $propertyName => $property) {\n\t\t\t$propertyValue = $property->getValue();\n\t\t\tswitch ($property->getType()) {\n\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_OBJECT:\n\t\t\t\t\tif ($propertyValue instanceof \\F3\\FLOW3\\Object\\Configuration\\Configuration) {\n\t\t\t\t\t\t$preparedValue = $this->build($propertyValue);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (strpos($propertyValue, '.') !== FALSE) {\n\t\t\t\t\t\t\t$settingPath = array_slice(explode('.', $propertyValue), 1);\n\t\t\t\t\t\t\t$propertyValue = \\F3\\FLOW3\\Utility\\Arrays::getValueByPath($this->settings['FLOW3'], $settingPath);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$preparedValue = $this->get($propertyValue);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_STRAIGHTVALUE:\n\t\t\t\t\t$preparedValue = $propertyValue;\n\t\t\t\tbreak;\n\t\t\t\tcase \\F3\\FLOW3\\Object\\Configuration\\ConfigurationProperty::PROPERTY_TYPES_SETTING:\n\t\t\t\t\tif (strpos($propertyValue, '.') !== FALSE) {\n\t\t\t\t\t\t$settingPath = array_slice(explode('.', $propertyValue), 1);\n\t\t\t\t\t\t$preparedValue = \\F3\\FLOW3\\Utility\\Arrays::getValueByPath($this->settings['FLOW3'], $settingPath);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($propertyValue !== 'FLOW3') {\n\t\t\t\t\t\t\tthrow new \\F3\\FLOW3\\Object\\Exception\\CannotBuildObjectException('Invalid reference to setting \"' . $argumentValue . '\" in object configuration for Dynamic Object Container.', 1265200444);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$preparedValue = $this->settings['FLOW3'];\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$setterMethodName = 'inject' . ucfirst($propertyName);\n\t\t\tif (method_exists($object, $setterMethodName)) {\n\t\t\t\t$object->$setterMethodName($preparedValue);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setterMethodName = 'set' . ucfirst($propertyName);\n\t\t\tif (method_exists($object, $setterMethodName)) {\n\t\t\t\t$object->$setterMethodName($preparedValue);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (property_exists($object, $propertyName)) {\n\t\t\t\t$propertyReflection = new \\ReflectionProperty($object, $propertyName);\n\t\t\t\t$propertyReflection->setAccessible(TRUE);\n\t\t\t\t$propertyReflection->setValue($object, $preparedValue);\n\t\t\t}\n\t\t}\n\t}", "private function api_set_properties( $properties ) {\n\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// identify user first\n\t\t$this->set_named_identity( null );\n\n\t\t// remove blank properties\n\t\tif( isset( $properties[''] ) ) {\n\t\t\tunset( $properties[''] );\n\t\t}\n\n\t\t// record the properties\n\t\t$this->get_api()->set( $properties );\n\t}", "public function expose($properties)\n\t{\n\t\t! is_array($properties) and $properties = (array)$properties;\n\t\t \n\t\tif ($properties and ! Arr::is_assoc($properties))\n\t\t{\n\t\t\t$values = ($this->manager->attr(\"autoheader\") === true)\n\t\t\t\t? $properties\n\t\t\t\t: array_fill(0, count($properties), \"\");\n\t\t\t\t\n\t\t\t$properties = array_combine(array_values($properties), $values);\n\t\t}\n\t\t$this->properties = $properties;\n\t\treturn $this;\n\t}", "public function __construct($properties = [])\n {\n $this->configure($properties);\n $this->init();\n }", "public function __construct(array|string $props = [], array $inject = [])\n\t{\n\t\tif (is_string($props) === true) {\n\t\t\t$props = parse_url($props);\n\t\t\t$props['username'] = $props['user'] ?? null;\n\t\t\t$props['password'] = $props['pass'] ?? null;\n\n\t\t\t$props = array_merge($props, $inject);\n\t\t}\n\n\t\t// parse the path and extract params\n\t\tif (empty($props['path']) === false) {\n\t\t\t$props = static::parsePath($props);\n\t\t}\n\n\t\t$this->setProperties($this->props = $props);\n\t}", "protected function _addProperties($clonee) {\r\n\t\t/* Intentionally empty */\r\n\t}", "protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }", "private function set_properties($properties=array()){\n\n if ((!isset($properties)) || (!is_array($properties))){\n $properties=$this->$properties;\n return $properties;\n }\n else\n {\n $this->$properties=$properties; //set object properties\n }\n\n }", "public function setProperties($properties, $params)\n {\n foreach ($properties as $property) {\n if (array_key_exists($property, $params)) {\n $this->{$property} = $params[$property];\n }\n }\n }", "private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }", "public function injectObject() {\n\n // load the map\n $this->loadMap();\n $this->_injectMethods();\n $this->_injectProperties();\n\n }", "public function injectSettings(array $settings)\n {\n $this->settings = $settings;\n }", "public function __construct($config = array()) {\n if ($config && is_array($config)) {\n foreach ($config as $property => $value) {\n if (property_exists($this, $property)) {\n $this->{$property} = $value;\n }\n }\n }\n }", "public function addProperties(array $properties)\n\t{\n\t\tforeach ($properties as $property)\n\t\t{\n\t\t\t$this->addProperty($property);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function set_properties( $args ) {\n\n\t\t// Reset default property values\n\t\t$reset = array(\n\t\t\t'debug_mode' => false,\n\t\t\t'parant_plugin_slug' => '',\n\t\t\t'view' => plugin_dir_path( __FILE__ ) . 'wpaddons-io-sdk/view/wordpress-plugins.php',\n\t\t);\n\n\t\t// Define properties\n\t\tforeach ( $reset as $name => $default ) {\n\n\t\t\tif ( array_key_exists( $name, $args ) ) {\n\t\t\t\t// If set, use defined values\n\t\t\t\t$this->{$name} = $args[$name];\n\t\t\t} else {\n\t\t\t\t// If not set, use default values\n\t\t\t\t$this->{$name} = $default;\n\t\t\t}\n\n\t\t}\n\n\t}", "public function setProperties(array $properties) \n\t{\n\t\tforeach ($properties as $name => $value) {\n\t\t\t$this->set($name, $value);\n\t\t}\n\t}", "abstract protected function properties();", "private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }", "public function set_props($args)\n {\n }", "public static function setProperties(array $config)\r\n {\r\n foreach ($config as $k => $v) {\r\n $property = '_' . $k;\r\n self::$$property = $v;\r\n }\r\n }", "function properties()\n {\n }", "public function injectComponents()\n\t{\n\t\treturn [];\n\t\t//return ['burger\\ClassA' => 'test1'];\n\t}", "public function setProperties(array $properties)\n {\n $this->properties = $properties;\n }", "private function init_properties( array $properties ) {\n\t\t// recursively filter null values\n\t\t$this->properties = Arrays::filter_recursive( $properties );\n\t\t// collect all attributes properties for this element\n\t\t$this->collect_attributes();\n\t}", "public function __construct(array $options = array())\n {\n foreach($options as $key => $value) {\n $this->properties[$key] = $value;\n }\n }", "public function phpunit_add_definition($area, array $properties, $addmapping = true) {\n if (!array_key_exists('overrideclass', $properties)) {\n switch ($properties['mode']) {\n case cache_store::MODE_APPLICATION:\n $properties['overrideclass'] = 'cache_phpunit_application';\n break;\n case cache_store::MODE_SESSION:\n $properties['overrideclass'] = 'cache_phpunit_session';\n break;\n case cache_store::MODE_REQUEST:\n $properties['overrideclass'] = 'cache_phpunit_request';\n break;\n }\n }\n $this->configdefinitions[$area] = $properties;\n if ($addmapping) {\n switch ($properties['mode']) {\n case cache_store::MODE_APPLICATION:\n $this->phpunit_add_definition_mapping($area, 'default_application', 0);\n break;\n case cache_store::MODE_SESSION:\n $this->phpunit_add_definition_mapping($area, 'default_session', 0);\n break;\n case cache_store::MODE_REQUEST:\n $this->phpunit_add_definition_mapping($area, 'default_request', 0);\n break;\n }\n }\n }", "public function setProperties(array $properties): void\n {\n $this->properties = $properties;\n }", "public function __construct()\n {\n foreach (GeneralUtility::makeInstance(\\ReflectionClass::class, static::class)->getProperties() ?? [] as $reflection) {\n if (!$reflection->isProtected()) {\n $name = $reflection->getName();\n $value = $this->{$name};\n\n // Define parameter name of property\n $this->parameterMapping[$name] = GeneralUtility::camelCaseToLowerCaseUnderscored($name);\n\n // Map the type of properties\n $this->typeMapping[$name] = is_int($value) ? 'int' : (is_array($value) ? 'array' : (is_bool($value) ? 'bool' : (is_string($value) ? 'string' : null)));\n }\n }\n }", "public function addVars(array $args)\n {\n foreach ($args as $key => $value) {\n $this->$key = $value;\n }\n }", "protected function configure()\n {\n foreach ($this->getArguments() as $argument) {\n $this->addArgument($argument[0], $argument[1], $argument[2], $argument[3]);\n }\n\n foreach ($this->getOptions() as $option) {\n $this->addOption($option[0], $option[1], $option[2], $option[3], $option[4]);\n }\n }", "public function __construct($props)\n {\n $this->props = $props;\n }", "public function fill(array $properties)\n {\n foreach($properties as $arg => $value) {\n $this->setPublicProperty($arg, $value);\n }\n }", "protected function addWPConfigs()\n {\n\n $this[\"databaseAdapter\"] = function () {\n return $GLOBALS['wpdb'];\n };\n\n $this[\"query\"] = $this->factory(\n function () {\n return new \\WP_Query();\n }\n );\n\n }", "public function injectFields()\n\t{\n\t\t$GLOBALS['TL_DCA']['tl_module']['palettes']['personalData'] = str_replace('newsletters;', 'newsletters,newsalerts;', $GLOBALS['TL_DCA']['tl_module']['palettes']['personalData']);\n\t\t$GLOBALS['TL_DCA']['tl_module']['palettes']['registration'] = str_replace('newsletters;', 'newsletters,newsalerts;', $GLOBALS['TL_DCA']['tl_module']['palettes']['registration']);\n\t}", "public function __construct($productParams = array()){\n foreach ($productParams as $var=>$param){\n if (property_exists($this, $var)) {\n $this->$var = $param;\n }\n }\n }", "public function __construct(Array $properties = array())\n\t{\n\t\t$this->reset();\n\t\t\n\t\tforeach ($properties AS $property => $value)\n\t\t{\n\t\t\t$method_name = 'set_' .$property;\n\t\t\t\n\t\t\tif (method_exists($this, $method_name))\n\t\t\t{\n\t\t\t\t$this->$method_name($value);\n\t\t\t}\n\t\t}\n\t}", "public function setProperties(array $properties)\n\t{\n\t\t$this->sessions = $properties;\n\t}", "public function setAttributes(Collection $properties);", "public static function setParams(propertysInterface $params)\n {\n if(isset($params) && !empty($params)){\n if(!isset(self::$params)){\n self::$params = $params;\n return;\n }\n self::getParams()->add((array) $params);\n }\n }", "public function properties() { }", "protected function initProperties($reflector, $context)\n {\n $this->properties = [];\n }", "public function inject($inject = array())\n {\n $this->inject = $inject;\n\n return $this;\n }", "protected function addAdditionalIdentityPropertiesIfNeeded() {}", "public function testInstanceHasRequiredProperties()\n {\n $module = new CWBlockStores();\n foreach (self::REQUIRED_PROPERTIES as $prop) {\n $this->assertNotNull($module->$prop);\n }\n }", "private function _getSettings()\n {\n $properties = $this->_class->getProperties();\n foreach ($properties as $property) {\n $prop = new Property($property);\n $prop->fillSettings($this->_reflect);\n }\n if (empty($this->_reflect->listField)) {\n $keys = array_keys($this->_reflect->fields);\n $this->_reflect->listField = array_shift($keys);\n }\n $this->_reflect->fieldNames = array_keys($this->_reflect->fields);\n }", "protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }", "function getProperties($properties);", "private function js_set_properties( $properties = array() ) {\n\n\t\t// Verify tracking status\n\t\tif ( $this->disable_tracking() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// remove blank properties\n\t\tif( isset( $properties[''] ) ) {\n\t\t\tunset( $properties[''] );\n\t\t}\n\n\t\t$properties = json_encode( $properties );\n\n\t\techo '<script type=\"text/javascript\">' . \"_kmq.push(['set', {$properties}]);\" . \"</script>\";\n\t}", "function updateProperties($mutations);", "public function setUp()\n {\n $this->faker = Factory::create();\n\n $reader = new PhpDocReader();\n\n foreach (array_keys(get_object_vars($this)) as $propertyName) {\n if (self::MOCK_SUFFIX !== substr($propertyName, -strlen(self::MOCK_SUFFIX))) {\n continue;\n }\n\n $property = new \\ReflectionProperty(static::class, $propertyName);\n $propertyClass = $reader->getPropertyClass($property);\n\n $this->$propertyName = $this->prophesize($propertyClass);\n }\n }", "public function setProperties(array $data)\n {\n $this->properties = $data;\n }", "private function setServices(&$properties, $thisUrl, $collection) {\r\n \r\n if (!isset($properties['services'])) {\r\n $properties['services'] = array();\r\n }\r\n \r\n /*\r\n * Visualize\r\n */\r\n if (isset($properties['wms'])) {\r\n $this->setVisualizeService($properties, $collection);\r\n }\r\n \r\n /*\r\n * Download\r\n */\r\n if (isset($properties['resource'])) {\r\n $this->setDownloadService($properties, $thisUrl, $collection);\r\n }\r\n \r\n }", "public function set_properties( array $properties) {\n\t\t$this->init_properties( $properties );\n\t\treturn $this;\n\t}", "public function addProperty($key, $value);", "public function __construct( $setters = null ){\n $this->mergePropertiesFrom($setters);\n }", "public function it_returns_list_of_properties()\n {\n $this->properties->setBaseUrl($this->url);\n\n $this->properties->login();\n\n $this->assertJson($this->properties->get());\n }", "public function registerAll($props_and_vals = array()) {\n $this->_events->registerAll($props_and_vals);\n }", "public function allowProperties() {}", "protected function addRequiredParams(array $keys)\n {\n $this->requiredParams = array_merge($this->requiredParams, $keys);\n }", "public static function add_providers() {\n\t\t$args = func_get_args();\n\t\tif($args) {\n\t\t\tif(is_array($args[0])) {\n\t\t\t\tself::$providers += $args[0];\n\t\t\t} elseif(count($args) == 2) {\n\t\t\t\tself::$providers[$args[0]] = $args[1];\n\t\t\t} else {\n\t\t\t\tuser_error(__METHOD__ . ' expects either an array of providers or a URL scheme and JSON API endpoint');\n\t\t\t}\n\t\t} else {\n\t\t\tuser_error(__METHOD__ . ' expects either an array of providers or a URL scheme and JSON API endpoint');\n\t\t}\n\t}", "public function append(array $injectors)\n {\n $this->injectors = $injectors + $this->injectors;\n }", "function setProperty() {\n $instance = $this->CI->ciwy->current_instance[$this->component_name];\n $properties = func_get_arg(0);\n if (is_array($properties)) {\n foreach($properties as $key => $val) {\n if ( ! isset($this->component_property[$key])) {\n $message = '[' . $this->CI->ciwy->library_name . '] '. $key . ' is not a '.$this->component_name .' Property.';\n log_message('error', $message);\n show_error($message);\n } else {\n $this->CI->ciwy->component_config[$instance]['Config'][$key] = $val;\n }\n }\n }\n }", "abstract protected function setRequiredGetters();", "public function setProperties(array $props) {\n if (!$this->attributes()->contains('data-slick')) {\n $this->attributes()\n ->setInstance(new JsonAttribute('data-slick', $props))->forceVisibility('data-slick');\n } else {\n $this->attributes()->getAttribute('data-slick')->setValue($props);\n }\n return $this;\n }", "public function setExtendables()\n {\n $this->extend('foo', function() {\n return [$this->getUserAgent(), $this->getRemoteAddr()];\n });\n }", "abstract protected function getProperties();", "protected function mergeWhiteList() {\n\t\tif ( $this->customPropertiesWhitelist !== $this->addedCustomProperties['properties'] ) {\n\t\t\t// Fix property potentially passed as comma-delimited string.\n\t\t\t$customProperties = Sniff::merge_custom_array( $this->customPropertiesWhitelist, array(), false );\n\n\t\t\t$this->whitelisted_mixed_case_member_var_names = Sniff::merge_custom_array(\n\t\t\t\t$customProperties,\n\t\t\t\t$this->whitelisted_mixed_case_member_var_names\n\t\t\t);\n\n\t\t\t$this->addedCustomProperties['properties'] = $this->customPropertiesWhitelist;\n\t\t}\n\t}", "public function __construct($config) {\n foreach (['id', 'title', 'description', 'css'] as $propname) {\n $this->$propname = property_exists($config, $propname) ? $config->$propname : \"\";\n }\n }", "public function __construct($config) {\n foreach (['id', 'title', 'description', 'css'] as $propname) {\n $this->$propname = property_exists($config, $propname) ? $config->$propname : \"\";\n }\n }", "protected function initialize()\n {\n // load the driver\n static::getDriver();\n\n // add in the default ID property\n if (static::$ids == [self::DEFAULT_ID_PROPERTY] && !isset(static::$properties[self::DEFAULT_ID_PROPERTY])) {\n static::$properties[self::DEFAULT_ID_PROPERTY] = self::$defaultIDProperty;\n }\n\n // generates created_at and updated_at timestamps\n if (property_exists($this, 'autoTimestamps')) {\n $this->installAutoTimestamps();\n }\n\n // fill in each property by extending the property\n // definition base\n foreach (static::$properties as &$property) {\n $property = array_replace(self::$propertyDefinitionBase, $property);\n }\n\n // order the properties array by name for consistency\n // since it is constructed in a random order\n ksort(static::$properties);\n }", "public function __construct(array $properties) {\n foreach ($properties as $property => $value) {\n switch ($property) {\n // Strings.\n case 'numberOfFullTimeEmployees':\n case 'numberOfPartTimeEmployees':\n case 'annualRevenues':\n case 'occupiedPct':\n case 'occupiedArea':\n case 'openToPublicArea':\n case 'totalBuildingArea':\n case 'anyAreaLeasedToOthers':\n case 'occupancyDesc':\n $this->$property = $value;\n }\n }\n }", "public function _setProps() {\n $dataController = get_called_class();\n $dataController::_getMapper();\n $dataController::_getModel();\n }", "abstract protected function get_properties();", "abstract public function getProperties();", "public function __construct(array $properties) {\n parent::__construct($properties);\n foreach ($properties as $property => $value) {\n switch ($property) {\n // Strings.\n case 'description_of_accident':\n case 'vin_number':\n case 'driver_first_name':\n case 'driver_last_name':\n case 'driver_dl_number':\n case 'describe_damage':\n case 'other_vin_number':\n case 'other_driver_first_name':\n case 'other_driver_last_name':\n case 'other_driver_dl_number':\n case 'other_describe_damage':\n case 'estimate_amount':\n case 'where_vehicle_can_be_seen':\n case 'when_vehicle_can_be_seen':\n $this->$property = $value;\n break;\n\n // Booleans.\n case 'child_seat':\n case 'child_seat_installed':\n case 'child_seat_sustain':\n $this->$property = (bool) $value;\n break;\n }\n }\n }", "private function getProperties(){\n\n\n\t\t$props = get_post_meta(\n\t\t\t$this->post_id,\n\t\t\t'_column_props_'.$this->fullId,\n\t\t\ttrue\n\t\t);\n\n\n\n\t\t$defaults = $this->getDefaultColumnArgs();\n\t\t$props = wp_parse_args( $props, $defaults );\n\n\t\t$this->properties = $props;\n\n\t}", "public function getProperties(): PropertyCollection;", "private function initDependencies()\n {\n // == HTML ==========================================================\n $this->di->mapService('core.html.factory', '\\Core\\Html\\HtmlFactory');\n\n // == AJAX ==========================================================\n $this->di->mapService('core.ajax', '\\Core\\Ajax\\Ajax');\n }", "protected static function addOrEditPropertiesToDB($properties)\n {\n\n if (is_array($properties) && !empty($properties)) {\n foreach ($properties['properties'] as $property) {\n $checkExistence = DB::select(\n \"SELECT `property_id` FROM `apimo_properties` WHERE property_id = ?\",\n [$property['id']]\n );\n if (empty($checkExistence)) {\n DB::insert(\n 'INSERT INTO `apimo_properties` ( `property_id`, `agency`, `reference`, `status`, `user`, `step`, `parent`, `category`, `subcategory`, `name`, `type`, `subtype`, `agreement`, `block_name`, `address`, `address_more`, `publish_address`, `country`, `city`, `district`, `longitude`, `latitude`, `radius`, `area_unit`, `area_surface`, `rooms`, `bedrooms`, `sleeps`, `price`, `price_max`, `price_period`, `price_currency`, `residence`, `view`, `landscape`, `floor`, `heating`, `water`, `condition`, `standing`, `style`, `construction_year`, `renovation_year`, `available_at`, `delivered_at`, `activities`, `orientations`, `services`, `proximities`, `tags`, `tags_customized`, `pictures`, `areas`, `regulations`, `created_at`, `updated_at`)\n VALUES ( :property_id, :agency, :reference, :status, :user, :step, :parent, :category, :subcategory, :name, :type, :subtype, :agreement, :block_name, :address, :address_more, :publish_address, :country, :city, :district, :longitude, :latitude, :radius, :area_unit, :area_surface, :rooms, :bedrooms, :sleeps, :price, :price_max, :price_period, :price_currency, :residence, :view, :landscape, :floor, :heating, :water, :condition, :standing, :style, :construction_year, :renovation_year, :available_at, :delivered_at, :activities, :orientations, :services, :proximities, :tags, :tags_customized, :pictures, :areas, :regulations, :created_at, :updated_at)',\n [\n 'property_id' => $property['id'],\n 'agency' => $property['user']['agency'],\n 'reference' => $property['reference'],\n 'status' => $property['status'],\n 'user' => $property['user']['id'],\n 'step' => $property['step'],\n 'parent' => $property['parent'],\n 'category' => $property['category'],\n 'subcategory' => $property['subcategory'],\n 'name' => $property['name'],\n 'type' => $property['type'],\n 'subtype' => $property['subtype'],\n 'agreement' => $property['agreement']['type'],\n 'block_name' => $property['block_name'],\n 'address' => $property['address'],\n 'address_more' => $property['address_more'],\n 'publish_address' => $property['publish_address'],\n 'country' => $property['country'],\n 'city' => self::addOrUpdateCity($property['city']),\n 'district' => self::addOrUpdateDistrict($property['district']),\n 'longitude' => $property['longitude'],\n 'latitude' => $property['latitude'],\n 'radius' => $property['radius'],\n 'area_unit' => $property['area']['unit'],\n 'area_surface' => ((!empty($property['area']['value']) || !empty($property['area']['total'])) ? (($property['area']['value'] < $property['area']['total']) ? $property['area']['total'] : $property['area']['value']) : 0),\n 'rooms' => $property['rooms'],\n 'bedrooms' => $property['bedrooms'],\n 'sleeps' => $property['sleeps'],\n 'price' => ((isset($property['price']['value']) && !empty($property['price']['value'])) ? $property['price']['value'] : 0),\n 'price_max' => ((isset($property['price']['max']) && !empty($property['price']['max'])) ? $property['price']['max'] : 0),\n 'price_period' => ((isset($property['price']['period']) && !empty($property['price']['period'])) ? $property['price']['period'] : ''),\n 'price_currency' => ((isset($property['price']['currency'])) ? $property['price']['currency'] : ''),\n 'residence' => self::addOrUpdateResidence($property['residence']),\n 'view' => self::addOrUpdateView($property['view'], $property['id']),\n 'landscape' => (!empty($property['view']['landscape']) ? implode(',', $property['view']['landscape']) : ''),\n 'floor' => self::addOrUpdateFloor($property['floor'], $property['id']),\n 'heating' => self::addOrUpdateHeating($property['heating'], $property['id']),\n 'water' => self::addOrUpdateWater($property['water'], $property['id']),\n 'condition' => $property['condition'],\n 'standing' => $property['standing'],\n 'style' => $property['style']['name'],\n 'construction_year' => $property['construction_year'],\n 'renovation_year' => $property['renovation_year'],\n 'available_at' => $property['available_at'],\n 'delivered_at' => $property['delivered_at'],\n 'activities' => (!empty($property['activities']) ? implode(\n ',',\n $property['activities']\n ) : ''),\n 'orientations' => (!empty($property['orientations']) ? implode(\n ',',\n $property['orientations']\n ) : ''),\n 'services' => (!empty($property['services']) ? implode(',', $property['services']) : ''),\n 'proximities' => (!is_null($property['proximities']) ? implode(\n ',',\n $property['proximities']\n ) : ''),\n 'tags' => (!empty($property['tags']) ? implode(',', $property['tags']) : ''),\n 'tags_customized' => (!empty($property['tags_customized']) ? implode(\n ',',\n $property['tags_customized']\n ) : ''),\n 'pictures' => self::addOrUpdatePictures($property['pictures']),\n 'areas' => self::addOrUpdateAreas($property['areas'], $property['id']),\n 'regulations' => self::addOrUpdateRegulations($property['regulations'], $property['id']),\n 'created_at' => $property['created_at'],\n 'updated_at' => $property['updated_at'],\n ]\n );\n self::addOrUpdateUser($property['user']);\n self::addOrUpdateComments($property['comments'], $property['id']);\n self::setPropertyHash($property);\n } else {\n if (self::checkPropertyUpdateByHash($property)) {\n DB::update(\n 'UPDATE `apimo_properties` SET \n `agency`= :agency, \n `reference`= :reference, \n `status`= :status, \n `user` = :user, \n `step` = :step, \n `parent` = :parent, \n `category` = :category, \n `subcategory` = :subcategory, \n `name` = :name, \n `type` = :type, \n `subtype` = :subtype,\n `agreement` = :agreement, \n `block_name` = :block_name, \n `address` = :address, \n `address_more` = :address_more, \n `publish_address` = :publish_address, \n `country` = :country, \n `city` = :city, \n `district` = :district, \n `longitude` = :longitude, \n `latitude` = :latitude, \n `radius` = :radius, \n `area_unit` = :area_unit, \n `area_surface` = :area_surface, \n `rooms` = :rooms, \n `bedrooms` = :bedrooms, \n `sleeps` = :sleeps, \n `price` = :price, \n `price_max` = :price_max, \n `price_period` = :price_period, \n `price_currency` = :price_currency, \n `residence` = :residence, \n `view` = :view, \n `landscape = :landscape, \n `floor` = :floor, \n `heating` = :heating, \n `water` = :water, \n `condition` = :condition, \n `standing` = :standing, \n `style` = :style, \n `construction_year` = :construction_year, \n `renovation_year` = :renovation_year, \n `available_at` = :available_at, \n `delivered_at` = :delivered_at, \n `activities` = :activities, \n `orientations` = :orientations, \n `services` = :services, \n `proximities` = :proximities, \n `tags` = :tags, \n `tags_customized` = :tags_customized, \n `pictures` = :pictures, \n `areas` = :areas, \n `regulations` =:regulations,\n `created_at` = :created_at, \n `updated_at` = :updated_at \n WHERE property_id = :property_id',\n [\n 'property_id' => $property['id'],\n 'agency' => $property['user']['agency'],\n 'reference' => $property['reference'],\n 'status' => $property['status'],\n 'user' => $property['user']['id'],\n 'step' => $property['step'],\n 'parent' => $property['parent'],\n 'category' => $property['category'],\n 'subcategory' => $property['subcategory'],\n 'name' => $property['name'],\n 'type' => $property['type'],\n 'subtype' => $property['subtype'],\n 'agreement' => $property['agreement']['type'],\n 'block_name' => $property['block_name'],\n 'address' => $property['address'],\n 'address_more' => $property['address_more'],\n 'publish_address' => $property['publish_address'],\n 'country' => $property['country'],\n 'city' => self::addOrUpdateCity($property['city']),\n 'district' => self::addOrUpdateDistrict($property['district']),\n 'longitude' => $property['longitude'],\n 'latitude' => $property['latitude'],\n 'radius' => $property['radius'],\n 'area_unit' => $property['area']['unit'],\n 'area_surface' => ((!empty($property['area']['value']) || !empty($property['area']['total'])) ? (($property['area']['value'] < $property['area']['total']) ? $property['area']['total'] : $property['area']['value']) : 0),\n 'rooms' => $property['rooms'],\n 'bedrooms' => $property['bedrooms'],\n 'sleeps' => $property['sleeps'],\n 'price' => ((isset($property['price']['value']) && !empty($property['price']['value'])) ? $property['price']['value'] : 0),\n 'price_max' => ((isset($property['price']['max']) && !empty($property['price']['max'])) ? $property['price']['max'] : 0),\n 'price_period' => ((isset($property['price']['period']) && !empty($property['price']['period'])) ? $property['price']['period'] : ''),\n 'price_currency' => ((isset($property['price']['currency'])) ? $property['price']['currency'] : ''),\n 'residence' => self::addOrUpdateResidence($property['residence']),\n 'view' => self::addOrUpdateView($property['view'], $property['id']),\n 'landscape' => (!empty($property['view']['landscape']) ? implode(',', $property['view']['landscape']) : ''),\n 'floor' => self::addOrUpdateFloor($property['floor'], $property['id']),\n 'heating' => self::addOrUpdateHeating($property['heating'], $property['id']),\n 'water' => self::addOrUpdateWater($property['water'], $property['id']),\n 'condition' => $property['condition'],\n 'standing' => $property['standing'],\n 'style' => $property['style']['name'],\n 'construction_year' => $property['construction_year'],\n 'renovation_year' => $property['renovation_year'],\n 'available_at' => $property['available_at'],\n 'delivered_at' => $property['delivered_at'],\n 'activities' => (!empty($property['activities']) ? implode(\n ',',\n $property['activities']\n ) : ''),\n 'orientations' => (!empty($property['orientations']) ? implode(\n ',',\n $property['orientations']\n ) : ''),\n 'services' => (!empty($property['services']) ? implode(\n ',',\n $property['services']\n ) : ''),\n 'proximities' => (!is_null($property['proximities']) ? implode(\n ',',\n $property['proximities']\n ) : ''),\n 'tags' => (!empty($property['tags']) ? implode(\n ',',\n $property['tags']\n ) : ''),\n 'tags_customized' => (!empty($property['tags_customized']) ? implode(\n ',',\n $property['tags_customized']\n ) : ''),\n 'pictures' => self::addOrUpdatePictures($property['pictures']),\n 'areas' => self::addOrUpdateAreas($property['areas'], $property['id']),\n 'regulations' => self::addOrUpdateRegulations($property['regulations'], $property['id']),\n 'created_at' => $property['created_at'],\n 'updated_at' => $property['updated_at'],\n ]\n );\n self::addOrUpdateUser($property['user']);\n self::addOrUpdateComments($property['comments'], $property['id']);\n }\n }\n }\n }\n self::setSyncLastTime();\n }", "public function injectSettings(array $settings): void\n {\n $this->settings = $settings['package'] ?? [];\n }" ]
[ "0.6530963", "0.6064553", "0.5883595", "0.5529243", "0.55139554", "0.54733986", "0.5467623", "0.54580367", "0.54554534", "0.5437078", "0.5414128", "0.53604907", "0.5350503", "0.5336542", "0.5312733", "0.5301106", "0.5299364", "0.5279538", "0.52675337", "0.52595073", "0.52552015", "0.5232437", "0.5200297", "0.51911914", "0.51882803", "0.5186964", "0.51863277", "0.5169534", "0.5161675", "0.51587576", "0.5135432", "0.51251894", "0.51149184", "0.5109187", "0.50861", "0.50710183", "0.5066646", "0.5060818", "0.50496244", "0.5034276", "0.5029624", "0.5024403", "0.5015249", "0.5012535", "0.4990076", "0.49883184", "0.49843422", "0.49655566", "0.49525532", "0.49448252", "0.49434435", "0.49421778", "0.49315533", "0.49201623", "0.4911768", "0.49066848", "0.4906556", "0.48954543", "0.48819152", "0.48759675", "0.48748538", "0.4872169", "0.486791", "0.4860092", "0.48571995", "0.48547882", "0.48522893", "0.48521167", "0.48483956", "0.4846687", "0.48369178", "0.48351306", "0.4829383", "0.48290646", "0.4823407", "0.480976", "0.48016903", "0.47914216", "0.4786707", "0.47831073", "0.47682196", "0.47673145", "0.47575125", "0.47518542", "0.47437245", "0.47287205", "0.47231206", "0.47166547", "0.47166547", "0.47065762", "0.47050348", "0.47007355", "0.46995604", "0.4697833", "0.46976843", "0.46953344", "0.4690929", "0.46850988", "0.4681939", "0.46817768" ]
0.5058134
38
Return the collection of properties that will be injected in the object
public function getProperties(): CollectionInterface { return $this->properties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInjectProperties() {}", "public function getProperties(): PropertyCollection;", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function _getProperties() {}", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getExposedProperties(): array;", "public function getAllProperties(): array\n {\n return get_object_vars($this);\n }", "public function getProperties(): array;", "public function getProperties(): array;", "public function getProperties(): Collection\n {\n return collection($this->reflectionObject->getImmediateProperties())->map(function (ReflectionProperty $property) {\n return new PropertyEntity($property);\n });\n }", "public function getProperties(): array\n {\n return $this->properties;\n }", "function get_properties()\r\n {\r\n return $this->properties;\r\n }", "public static function getProperties() : array {\r\n return self::$properties;\r\n }", "public function properties() { }", "public function properties() {\n return array_keys($this->propertyDefs());\n }", "public function getProperties()\n {\n $class = get_called_class();\n $reflection = new \\ReflectionClass($class);\n $members = array_keys($reflection->getdefaultProperties());\n return $members;\n }", "public function inject_fields() {\n return array(\n '__inject__'\n );\n }", "public function properties()\n\t{\n\t\treturn $this->properties;\n\t}", "public function getProperties()\n {\n return $this->_propDict;\n }", "public function getProperties()\n {\n return $this->_propDict;\n }", "public function getProperties()\n {\n return get_object_vars($this);\n }", "public function get_properties()\r\n\t{\r\n\t\treturn get_object_vars($this);\r\n\t}", "public function getProperties() : array;", "public function getAutowiringProperties() {\n return $this->autowiringProperties;\n }", "public static function getProperties()\n {\n return static::$properties;\n }", "public function getProperties(): array\n {\n return $this->getParam('properties');\n }", "public function properties()\n {\n // Fetch all properties existing in the database\n $properties = Property::all();\n\n // return list of properties;\n return $properties;\n\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "public function getProperties()\n {\n return $this->properties;\n }", "protected function getReflectedProperties()\n {\n if (is_null($this->_ReflectedPropertiesCache)) {\n $this->_ReflectedPropertiesCache = array();\n\n $refectionClass = new ReflectionClass($this);\n $propertiesArray = $refectionClass->getProperties();\n if (is_array($propertiesArray) and count($propertiesArray) > 0) {\n while (list(, $property) = each($propertiesArray)) {\n $refectionProperty = new ReflectionProperty($property->class, $property->name);\n if ($refectionProperty->isPublic() || $refectionProperty->isProtected()) {\n $this->_ReflectedPropertiesCache[] = $property->name;\n }\n }\n }\n }\n\n return $this->_ReflectedPropertiesCache;\n }", "abstract public function getProperties();", "public function getProperties() {\n $modifiable_properties = [];\n $fields = $this->getFields();\n foreach (Framework::instance()->entityProperties($this->getEntity()) as $property => $info) {\n if (!in_array($property, array_keys($fields)) && $this->filter($property)) {\n $this->addModifier($modifiable_properties, 'property', $property);\n }\n }\n return $modifiable_properties;\n }", "public function getProperties(): array\n {\n return array_keys(get_object_vars($this));\n }", "protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }", "protected function properties()\n {\n // return get_object_vars($this);\n\n $properties = array();\n foreach (self::$db_table_fields as $db_field) {\n if (property_exists($this, $db_field)) {\n $properties[$db_field] = $this->$db_field;\n }\n }\n\n return $properties;\n }", "abstract protected function getProperties();", "public function properties() : array\n {\n return array_keys($this->_properties);\n }", "protected function property_map() { return array(); }", "protected function properties(){\n //return get_object_vars($this);\n $properties = array();\n //foreach(self::$db_table_fields as $db_field){\n foreach(static::$db_table_fields as $db_field){\n if(property_exists($this, $db_field)){\n \n $properties[$db_field] = $this->$db_field;\n }\n }\n return $properties;\n\n }", "public function properties()\r\n {\r\n $props = $this->class->getProperties();\r\n \r\n sort( $props );\r\n \r\n foreach ( $props as $key => $property )\r\n {\r\n // Only show public properties, because Reflection can't get the private ones\n if ( $property->isPublic() )\r\n {\r\n $props[$key] = new Docs_Property( $this->class->name, $property->name );\r\n }\r\n else\r\n {\r\n unset( $props[$key] );\r\n }\r\n }\r\n \r\n return $props;\r\n }", "public function getProperties() {\n if (is_array($this->_props)) {\n return $this->_props;\n } else {\n return array();\n }\n }", "protected function getPublicProperties() {\n\t\t$getPublicProperties = function($obj) { return get_object_vars($obj); };\n\t\treturn $getPublicProperties($this);\n\t}", "public function getProperties()\r\n\t{\r\n\t\treturn $this->_properties;\r\n\t}", "public function getProperties() {\n\t\treturn $this->_properties;\n\t}", "public function getRequiredProperties();", "public static function getProperties()\n\t\t{\n\t\t\treturn self::$properties;\n\t\t}", "public function getPropertiesList() : array;", "public function getProperties()\n {\n $vars = get_object_vars($this);\n\n foreach ($vars as $key => $value) {\n if (strcmp(\"db\", $key) == 0) {\n unset($vars[$key]);\n break;\n }\n }\n\n return $vars;\n }", "function getProperties($properties);", "public function getProperties(): array {\n\t\treturn array_keys($this->properties);\n\t}", "public function collection()\n\t{\n\t\t$properties = Property::PropertyReport($this->request)->get();\n\t\treturn $properties;\n\t}", "function _getProperties() ;", "public function getProperties() {\n return array_keys($this->_properties);\n }", "public function getProperties()\n\t{\n\t\treturn $this->_properties;\n\t}", "protected function properties(){\n\n // Here we are making an array, we are looping through the table to see if the fields in the table exist, if so. It is being stored into array \n $properties = array();\n foreach (static::$table_users_field as $users_field) {\n if(property_exists($this,$users_field)){\n $properties[$users_field] = $this->$users_field;\n }\n }\n\n return $properties;\n }", "public function get_properties(): array {\n\t\t$properties = array();\n\n\t\tforeach ( $this->properties as $key => $property ) {\n\t\t\tif ( self::REF__KEY === $key ) {\n\t\t\t\t$properties = array_merge( $properties, $property->get_properties() );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$properties[ $key ] = $property;\n\t\t}\n\n\t\treturn $properties;\n\t}", "protected function getPropertiesValidators()\n {\n return [];\n }", "public function expose() {\n return get_object_vars($this);\n }", "public function get_props() : array\n {\n return $this->additional['props'] ?? [];\n }", "public function getAllProperties() {\n\t\t$bean = $this->unbox();\n\n\t\t$properties = $this->properties;\n\n\t\t$sourceInstance = $this->getSourceInstance();\n\t\tif ($sourceInstance !== null) {\n\t\t\t$sourceServer = $this->getSourceServer();\n\t\t\tif ($sourceServer !== null) {\n\t\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($sourceServer->box()->getProperties(), 'source'));\n\t\t\t}\n\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($sourceInstance->box()->getProperties(), 'source'));\n\t\t}\n\n\t\t$targetInstance = $this->getTargetInstance();\n\t\tif ($targetInstance !== null) {\n\t\t\t$targetServer = $this->getTargetServer();\n\t\t\tif ($targetServer !== null) {\n\t\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($targetServer->box()->getProperties(), 'remote'));\n\t\t\t}\n\t\t\t$properties = array_merge($properties, $this->addPrefixProperties($targetInstance->box()->getProperties(), 'remote'));\n\t\t}\n\n\t\t// Finally some special \n\t\t$properties['deploymentId'] = $bean->id;\n\t\t$config = Zend_Registry::get('config');\n\t\t$properties['buildscriptDir'] = $config->directories->buildscript;\n\t\treturn $properties;\n\t}", "public function getProperties()\n {\n return $this->getProperty();\n }", "public function __sleep()\n {\n $properties = array_keys(get_object_vars($this));\n unset($properties['validators']);\n\n return $properties;\n }", "public function getPropertyNames();", "protected function properties(){\n\t\t$properties = array();\n\t\tforeach(static::$db_table_fields as $db_field){\n\t\t\tif(property_exists($this,$db_field)){\n\t\t\t$properties[$db_field]= $this->$db_field;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $properties;\t\n\t}", "abstract protected function get_properties();", "public function getCachedProperties() {\n return $this->cachedProperties ?? [];\n }", "public function getProperties()\n {\n return array_keys($this->toArray());\n }", "abstract public function getJsProperties();", "public function getProperties(): array\n {\n return $this->propertyRepository->findEnabledByChannel($this->channelContext->getChannel());\n }", "public function getPropertiesAnnotations()\n {\n if (is_object($this->_propertyAnnotations) === false) {\n if (isset($this->_reflectionData['properties']) === true) {\n $this->_propertyAnnotations = array();\n if (empty($this->_reflectionData['properties']) === false) {\n foreach ($this->_reflectionData['properties'] as $property => $reflectionProperty) {\n $collection = new Collection($reflectionProperty);\n $this->_propertyAnnotations[$property] = $collection;\n }\n\n return $this->_propertyAnnotations;\n }\n }\n\n $this->_propertyAnnotations = false;\n return false;\n }\n\n return $this->_propertyAnnotations;\n }", "protected function properties()\n {\n return [\n 'host' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::object_browser(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATG__NAGIOS_SERVICE_DEP__HOST',\n C__PROPERTY__INFO__DESCRIPTION => 'Host'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__host_dep_connection',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_nagios_refs_services_list',\n 'isys_catg_nagios_refs_services_list__id'\n ],\n C__PROPERTY__DATA__FIELD_ALIAS => 'hostdep_id',\n C__PROPERTY__DATA__TABLE_ALIAS => 'chostdep',\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__HOST'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__IMPORT => false,\n C__PROPERTY__PROVIDES__EXPORT => false\n ]\n ]\n ),\n 'service_dependency' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::object_browser(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATG__NAGIOS_SERVICE_DEP__SERVICE_DEPENDENCY',\n C__PROPERTY__INFO__DESCRIPTION => 'Assigned objects'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__service_dep_connection',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_connection',\n 'isys_connection__id'\n ],\n C__PROPERTY__DATA__FIELD_ALIAS => 'servicedep_id',\n C__PROPERTY__DATA__TABLE_ALIAS => 'cservicedep',\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__SERVICE_DEPENDENCY'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__IMPORT => false,\n C__PROPERTY__PROVIDES__EXPORT => false\n ],\n C__PROPERTY__CHECK => [\n C__PROPERTY__CHECK__MANDATORY => true\n ]\n ]\n ),\n 'host_dependency' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::object_browser(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CATG__NAGIOS_SERVICE_DEP__HOST_DEPENDENCY',\n C__PROPERTY__INFO__DESCRIPTION => 'Assigned objects'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__host_connection',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_nagios_refs_services_list',\n 'isys_catg_nagios_refs_services_list__id'\n ],\n C__PROPERTY__DATA__FIELD_ALIAS => 'host_id',\n C__PROPERTY__DATA__TABLE_ALIAS => 'chost',\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__HOST_DEPENDENCY'\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__IMPORT => false,\n C__PROPERTY__PROVIDES__EXPORT => false\n ]\n ]\n ),\n 'inherits_parent' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'inherits_parent',\n C__PROPERTY__INFO__DESCRIPTION => 'inherits_parent'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__inherits_parent'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__INHERITS_PARENT',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => serialize(get_smarty_arr_YES_NO())\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__IMPORT => true,\n C__PROPERTY__PROVIDES__EXPORT => true\n ]\n ]\n ),\n 'execution_fail_criteria' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog_list(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'execution_failure_criteria',\n C__PROPERTY__INFO__DESCRIPTION => 'execution_failure_criteria'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__exec_fail_criteria',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_nagios_service_dep_list',\n 'isys_catg_nagios_service_dep_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__EXEC_FAIL_CRITERIA',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_cmdb_dao_category_g_nagios_service_dep',\n 'callback_property_execution_fail_criteria'\n ]\n )\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__IMPORT => true,\n C__PROPERTY__PROVIDES__EXPORT => true\n ],\n C__PROPERTY__FORMAT => null\n ]\n ),\n 'notification_fail_criteria' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog_list(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'notification_failure_criteria',\n C__PROPERTY__INFO__DESCRIPTION => 'notification_failure_criteria'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__notif_fail_criteria',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_catg_nagios_service_dep_list',\n 'isys_catg_nagios_service_dep_list__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__NOTIF_FAIL_CRITERIA',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_cmdb_dao_category_g_nagios_service_dep',\n 'callback_property_notification_fail_criteria'\n ]\n )\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false,\n C__PROPERTY__PROVIDES__IMPORT => true,\n C__PROPERTY__PROVIDES__EXPORT => true\n ],\n C__PROPERTY__FORMAT => null\n ]\n ),\n 'dependency_period' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'dependency_period',\n C__PROPERTY__INFO__DESCRIPTION => 'Period dependency_period'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__dep_period',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_nagios_timeperiods',\n 'isys_nagios_timeperiods__id'\n ]\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__DEP_PERIOD',\n C__PROPERTY__UI__PARAMS => [\n 'p_arData' => new isys_callback(\n [\n 'isys_component_dao_nagios',\n 'getTimeperiodsAssoc'\n ]\n ),\n 'p_strClass' => 'input-dual-radio'\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false\n ],\n C__PROPERTY__FORMAT => [\n C__PROPERTY__FORMAT__CALLBACK => [\n 'isys_export_helper_nagios',\n 'notification_period'\n ]\n ]\n ]\n ),\n 'dependency_period_plus' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::dialog_plus(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'dependency_period+',\n C__PROPERTY__INFO__DESCRIPTION => 'dependency_period+'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__dep_period_plus',\n C__PROPERTY__DATA__REFERENCES => [\n 'isys_nagios_timeperiods_plus',\n 'isys_nagios_timeperiods_plus__id'\n ],\n C__PROPERTY__DATA__TABLE_ALIAS => 'timeperiod_plus_b'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CATG__NAGIOS_SERVICE_DEP__DEP_PERIOD_PLUS',\n C__PROPERTY__UI__PARAMS => [\n 'p_strTable' => 'isys_nagios_timeperiods_plus',\n 'p_strClass' => 'input-dual-radio mt5',\n 'p_bInfoIconSpacer' => 0\n ]\n ],\n C__PROPERTY__PROVIDES => [\n C__PROPERTY__PROVIDES__SEARCH => false,\n C__PROPERTY__PROVIDES__REPORT => false,\n C__PROPERTY__PROVIDES__LIST => false,\n C__PROPERTY__PROVIDES__MULTIEDIT => false\n ]\n ]\n ),\n 'description' => array_replace_recursive(\n isys_cmdb_dao_category_pattern::commentary(),\n [\n C__PROPERTY__INFO => [\n C__PROPERTY__INFO__TITLE => 'LC__CMDB__CATG__DESCRIPTION',\n C__PROPERTY__INFO__DESCRIPTION => 'Description'\n ],\n C__PROPERTY__DATA => [\n C__PROPERTY__DATA__FIELD => 'isys_catg_nagios_service_dep_list__description'\n ],\n C__PROPERTY__UI => [\n C__PROPERTY__UI__ID => 'C__CMDB__CAT__COMMENTARY_' . C__CMDB__CATEGORY__TYPE_GLOBAL . C__CATG__NAGIOS_SERVICE_DEP\n ]\n ]\n )\n ];\n }", "function properties()\n {\n }", "public function getSetters() {\n $fqsen = $this->fqsen;\n $setters = [];\n $propertiesPropertyFound = false;\n do {\n //var_dump($fqsen);\n $class = $this->fqsenToClass($fqsen);\n $methods = $class->getMethods();\n foreach ($methods as $method) {\n if (preg_match('/^set([A-Z0-9].*)$/', $method->getName(), $matches) && !array_key_exists($matches[1], $setters)) {\n $setters[lcfirst($matches[1])] = null;\n }\n }\n if (!$propertiesPropertyFound) {\n $properties = $this->classGetProperty($class, \"properties\");\n if ($properties) {\n $properties = $properties->getDefault();\n $properties = $this->arrayTokenScanner->scan($properties);\n foreach ($properties as $propertyKey => $propertyValue) {\n if (!array_key_exists($propertyKey, $setters)) {\n $setters[$propertyKey] = $propertyValue;\n }\n }\n $propertiesPropertyFound = true;\n }\n }\n $fqsen = strval($class->getParent());\n } while ($fqsen);\n return $setters;\n }", "public function __debugInfo()\n {\n $reflect = new \\ReflectionObject($this);\n $varArray = array();\n \n foreach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop) {\n $propName = $prop->getName();\n \n if ($propName !== 'DI') {\n // print '--> '.$propName.'<br />';\n $varArray[$propName] = $this->$propName;\n }\n }\n \n return $varArray;\n }", "private function extractProperties(): array\n {\n $tokens = $this->tokens->findFirstCurlyParenthesizedBlock();\n $tokens = $tokens->withoutBlocks();\n\n preg_match_all('/(?<docblock>T_DOC_COMMENT )?(?<qualifiers>(T_VAR |T_PUBLIC |T_PROTECTED |T_PRIVATE |T_STATIC ))+(?<type>T_STRING )?(?<name>T_VARIABLE )(= (?<value>(?:(?!; ).)+))?; /',\n $tokens->asString(),\n $matches,\n PREG_OFFSET_CAPTURE | PREG_SET_ORDER);\n\n $properties = [];\n foreach ($matches as $match)\n {\n $propertyTokens = TokenMatchHelper::codeBlock($match, $tokens, $this->tokens);\n $lines = $propertyTokens->lines();\n\n $properties[] = ['docblock' => TokenMatchHelper::docblockDetails($match, $tokens),\n 'type' => TokenMatchHelper::code('type', $match, $tokens),\n 'visibility' => TokenMatchHelper::visibility($match),\n 'is_static' => TokenMatchHelper::isStatic($match),\n 'name' => TokenMatchHelper::code('name', $match, $tokens),\n 'value' => TokenMatchHelper::code('value', $match, $tokens),\n 'start' => $lines['start'],\n 'end' => $lines['end'],\n 'tokens' => $propertyTokens];\n }\n\n return $properties;\n }", "public static function getProperties()\n {\n return [\n 'id' => [true, self::PROPERTY_TYPE_STRING, null, false, false],\n 'endDate' => [false, self::PROPERTY_TYPE_DATE, null, false, false],\n 'startDate' => [true, self::PROPERTY_TYPE_DATE, null, false, false],\n 'status' => [true, self::PROPERTY_TYPE_ENUM, null, false, false],\n 'price' => [true, self::PROPERTY_TYPE_OBJECT, '\\\\Price', false, false],\n 'product' => [true, self::PROPERTY_TYPE_OBJECT, '\\\\Product', false, false],\n ];\n }", "public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }", "public function it_returns_list_of_properties()\n {\n $this->properties->setBaseUrl($this->url);\n\n $this->properties->login();\n\n $this->assertJson($this->properties->get());\n }", "public function propToConfig()\n {\n $class = new ReflectionClass($this);\n $config = [];\n $propTags = $this->propTags();\n\n foreach ($class->getProperties(\\ReflectionProperty::IS_PUBLIC) as $property) {\n if (!$property->isStatic()) {\n $name = $property->getName();\n if(isset($propTags[$name])){\n $config[] = $propTags[$name];\n }else{\n $default = [];\n $default['prop'] = $name;\n $default['propName'] = $name;\n $default['type'] = 'text';\n $default['required'] = false;\n $default['value'] = '';\n $config[] = $default;\n }\n }\n }\n return $config;\n }", "public function __debugInfo()\n {\n $properties = $this->_properties;\n foreach ($this->_virtual as $field) {\n $properties[$field] = $this->$field;\n }\n\n return $properties;\n }", "public function getVars(){\n return $this->getClassVars()->getValues();\n }", "public function populatableProperties() : array;", "public function __debugInfo() {\n \n \t$reflect\t= new \\ReflectionObject($this);\n \t$varArray\t= array();\n \n \tforeach ($reflect->getProperties(\\ReflectionProperty::IS_PUBLIC) as $prop) {\n \t\t$propName = $prop->getName();\n \t\t \n \t\tif($propName !== 'DI') {\n \t\t\t//print '--> '.$propName.'<br />';\n \t\t\t$varArray[$propName] = $this->$propName;\n \t\t}\n \t}\n \n \treturn $varArray;\n }", "public function get_all(){\n return get_object_vars($this);\n }" ]
[ "0.81762755", "0.71661943", "0.70427763", "0.7042627", "0.7042627", "0.7042627", "0.696549", "0.6925482", "0.6925482", "0.6925482", "0.6925482", "0.69164115", "0.674856", "0.6737377", "0.6737377", "0.6713797", "0.6687474", "0.66805136", "0.667856", "0.66735077", "0.6647963", "0.66388005", "0.66301554", "0.66141653", "0.65973604", "0.65973604", "0.6587275", "0.65871775", "0.6573026", "0.6564396", "0.65598494", "0.65187943", "0.65079087", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6483631", "0.6480222", "0.6435807", "0.6432719", "0.64179003", "0.6408193", "0.6408193", "0.6396708", "0.6392543", "0.6368025", "0.6356637", "0.63225317", "0.6320719", "0.6308463", "0.6300481", "0.62878317", "0.62871367", "0.6278066", "0.6271893", "0.6271606", "0.6264795", "0.6251355", "0.62507385", "0.6227924", "0.6222782", "0.6218499", "0.6213395", "0.61962444", "0.61829394", "0.61378336", "0.6137671", "0.6133775", "0.6104757", "0.6093887", "0.60902214", "0.6087124", "0.60806334", "0.60532683", "0.605294", "0.6051551", "0.60305566", "0.6030182", "0.6004013", "0.59829175", "0.5977173", "0.5975317", "0.59751046", "0.5958312", "0.59444165", "0.5940161", "0.5923683", "0.5920991", "0.5897847", "0.589757", "0.5895961", "0.58896905" ]
0.6422799
48
Return the list of injection strategies used
public function getInjectionStrategies(): TypedCollectionInterface { return $this->injectionStrategies; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getAvailableStrategies() {\n\t\t$availableStrategies = array();\n\t\t$path = APP . 'Lib' . DS . 'Migrations' . DS;\n\t\tforeach (new \\DirectoryIterator($path) as $info) {\n \t\t\tif ($info->isDot()) {\n \t\t\t\tcontinue;\n \t\t\t}\n\n \t\t\tif (preg_match('/Strategy\\.php/', $info->getBasename())) {\n \t\t\t\t$type = str_replace('Strategy.php', '', $info->getBasename());\n \t\t\t\t$availableStrategies[] = strtolower($type);\n \t\t\t}\n\t\t}\n\n\t\treturn $availableStrategies;\n\t}", "protected function _loadStrategies(){\n\t\tif (isset($this->env['Strategy']) && is_array($this->env['Strategy']) && count($this->env['Strategy']) > 0){\n\t\t\tforeach ($this->env['Strategy'] as $key => $strategy){\n\t\t\t\tif (!is_array($strategy)){\n\t\t\t\t\t$key = $strategy;\n\t\t\t\t\t$strategy = array();\n\t\t\t\t}\n\n\t\t\t\t// Define a URL-friendly name\n\t\t\t\tif (empty($strategy['_opauth_url_name'])) $strategy['_opauth_url_name'] = strtolower($key);\n\t\t\t\t$this->strategyMap[$strategy['_opauth_url_name']] = $key;\n\t\t\t\t\n\t\t\t\t$this->env['Strategy'][$key] = $strategy;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\ttrigger_error('No Opauth strategies defined', E_USER_ERROR);\n\t\t}\n\t}", "public function authenticationStrategies()\n {\n $data = [];\n $settings = [];\n $settings['security']['authentication']['authenticationStrategy'] = 'allTokens';\n $data[] = [$settings, Context::AUTHENTICATE_ALL_TOKENS];\n $settings['security']['authentication']['authenticationStrategy'] = 'oneToken';\n $data[] = [$settings, Context::AUTHENTICATE_ONE_TOKEN];\n $settings['security']['authentication']['authenticationStrategy'] = 'atLeastOneToken';\n $data[] = [$settings, Context::AUTHENTICATE_AT_LEAST_ONE_TOKEN];\n $settings['security']['authentication']['authenticationStrategy'] = 'anyToken';\n $data[] = [$settings, Context::AUTHENTICATE_ANY_TOKEN];\n return $data;\n }", "function &getSupportedInjectionAdapters() {\n\t\t// Load meta-data adapters from the database.\n\t\tif ($this->getHasLoadableAdapters() && !$this->_injectionAdaptersLoaded) {\n\t\t\t$filterDao =& DAORegistry::getDAO('FilterDAO'); /* @var $filterDao FilterDAO */\n\t\t\t$loadedAdapters =& $filterDao->getObjectsByTypeDescription('metadata::%', 'class::%', $this, false);\n\t\t\tforeach($loadedAdapters as $loadedAdapter) {\n\t\t\t\t$this->addSupportedMetadataAdapter($loadedAdapter);\n\t\t\t}\n\t\t\t$this->_injectionAdaptersLoaded = true;\n\t\t}\n\n\t\treturn $this->_metadataInjectionAdapters;\n\t}", "private function getAvailableAggregationStrategies(): array\n {\n return [\n self::AGGREGATION_STRATEGY_FIRE_AND_FORGET,\n ];\n }", "public function getInjectMethods() {}", "private function strategiesAsString()\n {\n return implode(',', $this->ruleRepository->getStrategiesList());\n }", "protected function getProviderLookup()\n {\n // to skip loading those providers completely.\n return array_merge($this->providerLookup, [\n 'keycloak' => KeycloakProvider::class\n ]);\n }", "public function getDependencies() : array\n {\n return [\n 'aliases' => [\n // Choose a different adapter changing the alias value\n AccessTokenRepositoryInterface::class => Pdo\\AccessTokenRepository::class,\n AuthCodeRepositoryInterface::class => Pdo\\AuthCodeRepository::class,\n ClientRepositoryInterface::class => Pdo\\ClientRepository::class,\n RefreshTokenRepositoryInterface::class => Pdo\\RefreshTokenRepository::class,\n ScopeRepositoryInterface::class => Pdo\\ScopeRepository::class,\n UserRepositoryInterface::class => Pdo\\UserRepository::class,\n AuthenticationInterface::class => OAuth2Adapter::class\n ],\n 'factories' => [\n AuthorizationMiddleware::class => AuthorizationMiddlewareFactory::class,\n AuthorizationHandler::class => AuthorizationHandlerFactory::class,\n TokenEndpointHandler::class => TokenEndpointHandlerFactory::class,\n OAuth2Adapter::class => OAuth2AdapterFactory::class,\n AuthorizationServer::class => AuthorizationServerFactory::class,\n ResourceServer::class => ResourceServerFactory::class,\n // Pdo adapter\n Pdo\\PdoService::class => Pdo\\PdoServiceFactory::class,\n Pdo\\AccessTokenRepository::class => Pdo\\AccessTokenRepositoryFactory::class,\n Pdo\\AuthCodeRepository::class => Pdo\\AuthCodeRepositoryFactory::class,\n Pdo\\ClientRepository::class => Pdo\\ClientRepositoryFactory::class,\n Pdo\\RefreshTokenRepository::class => Pdo\\RefreshTokenRepositoryFactory::class,\n Pdo\\ScopeRepository::class => Pdo\\ScopeRepositoryFactory::class,\n Pdo\\UserRepository::class => Pdo\\UserRepositoryFactory::class,\n // Default Grants\n ClientCredentialsGrant::class => ClientCredentialsGrantFactory::class,\n PasswordGrant::class => PasswordGrantFactory::class,\n AuthCodeGrant::class => AuthCodeGrantFactory::class,\n ImplicitGrant::class => ImplicitGrantFactory::class,\n RefreshTokenGrant::class => RefreshTokenGrantFactory::class,\n ]\n ];\n }", "public function provides()\n\t{\n\t\treturn array('conferencer');\n\t}", "public function getDependencies()\n {\n return array(\n MongoServiceProvider::SERVICE_NAME\n );\n }", "private function registerViewStrategies()\n {\n if (! isset($this->config['strategies'])) {\n return;\n }\n\n $strategies = $this->config['strategies'];\n\n if (is_string($strategies)) {\n $strategies = [$strategies];\n }\n\n if (! is_array($strategies) && ! $strategies instanceof Traversable) {\n return;\n }\n\n $view = $this->getView();\n $events = $view->getEventManager();\n\n foreach ($strategies as $strategy) {\n if (! is_string($strategy)) {\n continue;\n }\n\n $listener = $this->services->get($strategy);\n if ($listener instanceof ListenerAggregateInterface) {\n $listener->attach($events, 100);\n }\n }\n }", "public function provides() {\n $providers = array();\n foreach ($this->providers as $key => $value) {\n $providers[] = $key;\n }\n return $providers;\n }", "public static function get_drivers() {\n return array(\n '' => get_string('choosedots'),\n 'native/mysqli' => \\moodle_database::get_driver_instance('mysqli', 'native')->get_name(),\n 'native/mariadb' => \\moodle_database::get_driver_instance('mariadb', 'native')->get_name(),\n 'native/pgsql' => \\moodle_database::get_driver_instance('pgsql', 'native')->get_name(),\n 'native/oci' => \\moodle_database::get_driver_instance('oci', 'native')->get_name(),\n 'native/sqlsrv' => \\moodle_database::get_driver_instance('sqlsrv', 'native')->get_name()\n );\n }", "public function provides()\n {\n return [\n 'auth',\n 'Permit\\CurrentUser\\ContainerInterface',\n 'Permit\\Access\\CheckerInterface',\n 'Permit\\CurrentUser\\LoginValidatorInterface'\n ];\n }", "protected function getAdapters(): array\n {\n return [\n \"grouped\" => \"Phalcon\\\\Config\\\\Adapter\\\\Grouped\",\n \"ini\" => \"Phalcon\\\\Config\\\\Adapter\\\\Ini\",\n \"json\" => \"Phalcon\\\\Config\\\\Adapter\\\\Json\",\n \"php\" => \"Phalcon\\\\Config\\\\Adapter\\\\Php\",\n \"yaml\" => \"Phalcon\\\\Config\\\\Adapter\\\\Yaml\",\n ];\n }", "public function provides()\n {\n return [\n SecretCompressor::class,\n SecretEncrypter::class,\n SecretManager::class\n ];\n }", "public function getDependencies()\n {\n return [\n 'invokables' => [\n// 'authentication.adapter' => Adapter\\DummySuccessAdapter::class,\n ],\n 'factories' => [\n Middleware\\AuthenticationMiddleware::class => Middleware\\AuthenticationMiddlewareFactory::class,\n Action\\LoginAction::class => Action\\LoginActionFactory::class,\n Action\\LogoutAction::class => Action\\LogoutActionFactory::class,\n \\Zend\\Authentication\\AuthenticationService::class => Service\\AuthenticationServiceFactory::class,\n ],\n ];\n }", "public function getDependencies(): array\n {\n return [\n 'invokables' => [\n ],\n 'factories' => [\n // third party\n Adapter::class => AdapterServiceFactory::class,\n CorsMiddleware::class => Middleware\\CorsMiddlewareFactory::class,\n // Handler\n Handler\\AuthorizationTokenHandler::class => Handler\\AuthorizationTokenFactory::class,\n Handler\\ObtainCalcResultHandler::class => Handler\\ObtainCalcResultFactory::class,\n Handler\\StoreCalcResultHandler::class => Handler\\StoreCalcResultFactory::class,\n // Service\n Service\\PreserveNumberOfResultsService::class => Service\\PreserveNumberOfResultsFactory::class,\n Service\\CalcResultExtractingService::class => Service\\CalcResultExtractingFactory::class,\n // Repository\n Repository\\CalcResultsRepository::class => Repository\\CalcResultsFactory::class,\n ],\n ];\n }", "public function provides()\n {\n return [\n 'sm.callback.factory',\n 'sm.event.dispatcher',\n 'sm.factory',\n Debug::class,\n ];\n }", "public function provides()\n {\n return [\n 'datamapper.presenter.scanner',\n 'command.presenter.register',\n 'command.presenter.clear'\n ];\n }", "protected static function getServiceProviders()\n {\n return [];\n }", "public function provides() {\n\t\treturn array();\n\t}", "public function provides()\n {\n return [\n 'digitalocean.adapterfactory',\n 'digitalocean.factory',\n 'digitalocean',\n 'digitalocean.connection',\n ];\n }", "public function provides()\n\t{\n\t\treturn [\n\t\t\t'lock',\n\t\t\t'lock.store',\n\t\t\t'command.lock.clear'\n\t\t];\n\t}", "public static function getAvailableDrivers()\n {\n return array_keys(self::$_driverMap);\n }", "public function provides(): array\n {\n if ($this->app->environment('production')) {\n return array_values($this->commands);\n } else {\n return array_merge(array_values($this->commands), array_values($this->devCommands));\n }\n }", "public function provides()\n {\n return array(\n //\n );\n }", "public function getEngines() {\n return $this->dependencyInjector->getAll('ride\\\\library\\\\template\\\\engine\\\\Engine');\n }", "public function provides()\n {\n return [\n 'dubbo_cli',\n 'dubbo_cli.factory',\n ];\n }", "public function provides()\n {\n return [\n ShippingAddressInterface::class,\n UserInterface::class,\n GoodsInterface::class,\n ShoppingCartInterface::class,\n FeedbackInterface::class,\n ];\n }", "public function getDependencies()\n {\n return [\n 'invokables' => [\n Action\\PingAction::class => Action\\PingAction::class,\n ],\n 'factories' => [\n Action\\HomePageAction::class => Action\\HomePageFactory::class,\n Action\\Likes\\ListLikesAction::class => Action\\Likes\\ListLikesFactory::class,\n Action\\Likes\\CreateLikeAction::class => Action\\Likes\\CreateLikeFactory::class,\n Action\\Posts\\CreatePostAction::class => Action\\Posts\\CreatePostFactory::class,\n Action\\Posts\\ListPostsAction::class => Action\\Posts\\ListPostsFactory::class,\n Action\\Comments\\ListCommentsAction::class => Action\\Comments\\ListCommentsFactory::class,\n Action\\Comments\\CreateCommentAction::class => Action\\Comments\\CreateCommentFactory::class,\n ],\n ];\n }", "public function provides()\n {\n return [\n HtmlBuilder::class,\n FormBuilder::class,\n AccessHandler::class,\n FieldBuilder::class,\n Alert::class,\n AlertMiddleware::class,\n Menu::class,\n 'html',\n 'form',\n 'field',\n 'alert',\n 'menu'\n ];\n }", "public function getCapabilities(): array\n {\n return [\n ResolverProvider::class => CoreResolverProvider::class,\n DownloaderProvider::class => CoreDownloaderProvider::class,\n PatcherProvider::class => CorePatcherProvider::class,\n CommandProviderCapability::class => CommandProvider::class,\n ];\n }", "public function provides()\n\t{\n\t\treturn array('dandb');\n\t}", "public function provides()\n {\n AchieveLogger::info(\"Deferred true and I am here in provides()\");\n return['App\\Services\\Utility\\AchieveLoggerService'];\n }", "public function getInterfaceInjectionInclusionPatterns()\n {\n return $this->interfaceInjectionInclusionPatterns;\n }", "public static function getDrivers(){\n //Method inherited from \\Illuminate\\Support\\Manager \n return \\Illuminate\\Auth\\AuthManager::getDrivers();\n }", "public function provides()\n {\n return [__CLASS__];\n }", "public function provides()\n {\n return [\n //\n ];\n }", "public function provides()\n {\n return [\n //\n ];\n }", "public function provides()\n {\n return [\n //\n ];\n }", "public function getCapabilities()\n {\n return [\n \\Composer\\Plugin\\Capability\\CommandProvider::class => CommandProvider::class,\n ];\n }", "public function provides() {\n return array();\n }", "public function getDependencies()\n {\n return [\n 'invokables' => [\n Action\\PingAction::class => Action\\PingAction::class,\n\n ],\n 'factories' => [\n\n SecurityHeadersMiddleware::class => Factory\\ReflectionFactory::class,\n\n // Default test\n Action\\HomePageAction::class => Action\\HomePageFactory::class,\n Action\\TestModelAction::class => Factory\\ReflectionFactory::class,\n\n // Model Rest\n Action\\ModelRestController::class => Factory\\ReflectionFactory::class,\n\n // Current User\n CurrentUserRepository::class => ReflectionFactory::class,\n\n // Oauth2\n\n // OAUTH2 servers\n AuthorizationServer::class => AuthorizationServerFactory::class,\n ResourceServer::class => ResourceServerFactory::class,\n\n // Middleware\n AuthorizeGemsAndOauthMiddleware::class => ReflectionFactory::class,\n ApiGateMiddleware::class => ReflectionFactory::class,\n AccessLogMiddleware::class => ReflectionFactory::class,\n ApiOrganizationGateMiddleware::class => ReflectionFactory::class,\n ApiPatientGateMiddleware::class => ReflectionFactory::class,\n LocaleMiddleware::class => ReflectionFactory::class,\n\n\n // Actions\n AuthorizeAction::class => ReflectionFactory::class,\n AccessTokenAction::class => ReflectionFactory::class,\n\n PingController::class => ReflectionFactory::class,\n ApiDefinitionAction::class => ReflectionFactory::class,\n AclGroupsController::class => ReflectionFactory::class,\n AclGlobalPermissionsController::class => ReflectionFactory::class,\n AclRolePermissionsController::class => ReflectionFactory::class,\n AclRolesController::class => ReflectionFactory::class,\n ApiRolesController::class => ReflectionFactory::class,\n RelatedTokensController::class => ReflectionFactory::class,\n\n DashboardConfigController::class => ReflectionFactory::class,\n\n GemsSessionTestController::class => ReflectionFactory::class,\n\n DevAction::class => ReflectionFactory::class,\n\n // Entity repositories\n AccessTokenRepository::class => ReflectionFactory::class,\n AuthCodeRepository::class => ReflectionFactory::class,\n ClientRepository::class => ReflectionFactory::class,\n RefreshTokenRepository::class => ReflectionFactory::class,\n ScopeRepository::class => ReflectionFactory::class,\n UserRepository::class => ReflectionFactory::class,\n\n // Main repositories\n AclRepository::class => ReflectionFactory::class,\n AccesslogRepository::class => ReflectionFactory::class,\n ApiDefinitionRepository::class => ReflectionFactory::class,\n SurveyQuestionsRepository::class => ReflectionFactory::class,\n\n RespondentRepository::class => ReflectionFactory::class,\n\n Acl::class => AclFactory::class,\n LoginAttemptsRepository::class => ReflectionFactory::class,\n\n //AccessTokenRepositoryInterface::class => ReflectionFactory::class,\n //AuthCodeRepositoryInterface::class => ReflectionFactory::class,\n //ClientRepositoryInterface::class => ReflectionFactory::class,\n //RefreshTokenRepositoryInterface::class => ReflectionFactory::class,\n //ScopeRepositoryInterface::class => ReflectionFactory::class,\n //UserRepositoryInterface::class => ReflectionFactory::class,\n\n // Grants\n AuthCodeGrant::class => AuthCodeGrantFactory::class,\n ClientCredentialsGrant::class => ReflectionFactory::class,\n ImplicitGrant::class => ImplicitGrantFactory::class,\n PasswordGrant::class => ReflectionFactory::class,\n RefreshTokenGrant::class => ReflectionFactory::class,\n ],\n 'aliases' => [\n AccessTokenRepositoryInterface::class => AccessTokenRepository::class,\n AuthCodeRepositoryInterface::class => AuthCodeRepository::class,\n ClientRepositoryInterface::class => ClientRepository::class,\n RefreshTokenRepositoryInterface::class => RefreshTokenRepository::class,\n ScopeRepositoryInterface::class => ScopeRepository::class,\n UserRepositoryInterface::class => UserRepository::class,\n ],\n ];\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n {\n return array();\n }", "public function provides()\n\t{\n\t\treturn array(\n\t\t\t'authentify.users-table', 'authentify.social_profiles-table', 'authentify.tokens-table', 'authentify.repository',\n\t\t\t'authentify.check', 'authentify.guest',\n\t\t\t'authentify.token.check', 'authentify.token.parse',\n\t\t\t'authentify.hybridauth'\n\t\t);\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\n\t{\n\t\treturn array();\n\t}", "public function provides()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function provides()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function provides()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function provides()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function provides()\r\n\t{\r\n\t\treturn array();\r\n\t}", "public function provides()\r\n\t{\r\n\t\treturn array();\r\n\t}" ]
[ "0.7098468", "0.62777054", "0.62403274", "0.6216394", "0.62068605", "0.61737406", "0.59344494", "0.5932356", "0.5887029", "0.5873927", "0.5868579", "0.58343774", "0.5786879", "0.574524", "0.57451737", "0.5710181", "0.5653659", "0.5627613", "0.5617549", "0.56082076", "0.5607703", "0.55620104", "0.5560033", "0.55439186", "0.55425245", "0.5534939", "0.551849", "0.5513713", "0.55024654", "0.54995984", "0.5494112", "0.54915017", "0.5486049", "0.5482109", "0.5481095", "0.548052", "0.54794675", "0.5476735", "0.5475882", "0.5471744", "0.5471744", "0.5471744", "0.5459868", "0.54572976", "0.54354304", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5431337", "0.5426533", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5424687", "0.5423445", "0.5423445", "0.5423445", "0.5423445", "0.5423445", "0.5423445" ]
0.7091983
1
Return the object instanciator
public function getInstanciator(): InstanciatorInterface { return $this->instanciator; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "public function getInstance(): object;", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public function getHydrator(): object\n {\n return new $this->hydratorClass();\n }", "abstract public function get_instance();", "public static function inst()\n {\n return static::get_one(__CLASS__);\n }", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function newInstance(): object;", "public function get_instance() {\r\n\t\treturn $this->obj;\r\n\t}", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public function instance();", "public static function factory()\r\n {\r\n return parent::factory(__CLASS__);\r\n }", "public function getInstance(): mixed;", "abstract public function instance();", "public static function init() \n {\n if (!isset(self::$o_instance)) \n\t\t{\n $c = __CLASS__;\n self::$o_instance = new $c;\n }\n\n return self::$o_instance;\n }", "public function getInstance(): object\n {\n }", "public abstract function getCreator();", "function get_instance($class)\n {\n }", "public function construct()\n {\n return $this->object;\n }", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "function get_instance()\r\n{\r\n\t\r\n}", "public static function get_instance ();", "public static function init() {\n\t\treturn Factory::get_instance( self::class );\n\t}", "public function newInstance();", "public function newInstance();", "public static function instance() {\n\t\tif (!Registry::exists($class=get_called_class())) {\n\t\t\t$ref=new \\Reflectionclass($class);\n\t\t\t$args=func_get_args();\n\t\t\tRegistry::set($class,\n\t\t\t\t$args?$ref->newinstanceargs($args):new $class);\n\t\t}\n\t\treturn Registry::get($class);\n\t}", "public function getObject()\n\t{\n\t\t// Create the OPF instance.\n\t\treturn new Opf_Class($this->_serviceLocator->get('template.Opt'));\n\t}", "public static function instance();", "public function getCreator();", "public function getCreator();", "public function getConstructor() {}", "public static function getInstance()\n {\n static $instance;\n if ( $instance )\n\n return $instance;\n $class = get_called_class();\n # echo \"new $class\\n\";\n\n return $instance = new $class;\n }", "public static function get_instance() {\n\t\tif (is_null(self::$instance)) {\n\t\t\t$className = __CLASS__;\n self::$instance = new $className;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static abstract function createInstance();", "public static function getObject(){\n\t\treturn self::$object_class;\n\t}", "public static function instance()\n {\n global $container;\n return $container->getByType(self::class);\n }", "public static function getInstance(): object\n {\n if (!isset(static::$instance[static::$class])) {\n static::$instance[static::$class] = new static::$class(...func_get_args());\n }\n\n return static::$instance[static::$class];\n }", "public static function me(): Instantiatable\n {\n return self::instantiate();\n }", "public static function getInstance()\n {\n $object = __CLASS__;\n self::$instance = new $object();\n return self::$instance;\n }", "public static function getInstance()\n {\n $object = __CLASS__;\n self::$instance = new $object();\n return self::$instance;\n }", "public function getCreator() {}", "public static function getInstance(): self;", "public static function inst()\n {\n return new static();\n }", "public function getInstance() {\n\t\tif ( $this->getClass() == null ) return;\n\t\treturn $this->app->getIocContainer()->getInstance($this->getClass());\n\t\t// $callable = array($this->getClass(), \"getInstance\");\n\t\t// if ( ($instance = call_user_func($callable)) === false ) {\n\t\t// \tthrow new Exception\\Plugin\\PluginClassLoaderException(\"Failed call to \\\"\". $this->getClass() .\"::getInstance()\\\"\");\n\t\t// }\n\t\t// return $instance;\n\t}", "public static function self() {\n\n\t\treturn self::factory( 'self' );\n\t}", "static function get_instance() {\n\t\tstatic $instance;\n\t\t$class = __CLASS__;\n\t\tif ( ! is_a( $instance, $class ) ) {\n\t\t\t$instance = new $class;\n\t\t}\n\t\treturn $instance;\n\t}", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__); \n\t}", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}", "public static function instance() {\n\t if ( !isset( self::$instance ) ) {\n\t $className = __CLASS__;\n\t self::$instance = new $className;\n\t }\n\t return self::$instance;\n\t }", "public static function getInstance(){\n\t\treturn parent::_getInstance(get_class());\n\t}", "static function getInstance(){\n if(MethodologiesManager::$obj == null){\n MethodologiesManager::$obj = new MethodologiesManager(new EloquentConnection());\n }\n return MethodologiesManager::$obj;\n }", "public static function create(){\r\n\t\tif(self::$instance === null){\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public function getObject() {}", "public function getObject() {}", "public function instance() {\n\t\t\n\t}", "protected function getInstantiator() {}", "public static function instance() {\n\t\treturn new self;\n\t}", "public function getReflector()\n {\n \n return new ReflectionObject($this->object);\n \n }", "public static function self() {\n\n\t\treturn self::factory( 'self' );\n\n\t}", "public function newInstance()\n {\n return new self();\n }", "public static function getInstance()\n\t{\n\t\tif(!isset(self::$instance)){\n\t\t\t$object = __CLASS__;\n\t\t\tself::$instance = new $object;\n\t\t}\n\t\treturn self::$instance;\n\t}", "static function create(): self;", "public static function factory()\n {\n return new self;\n }", "public function getInstance(/* ... */)\n {\n $reflection = new ReflectionClass($this->getClass());\n return $reflection->newInstanceArgs(func_get_args());\n }", "public static function getInstance()\n {\n return GeneralUtility::makeInstance(__CLASS__);\n }", "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 create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public static function get_instance() {\n \t\tstatic $instance = null;\n \t\tif (is_null($instance)) {\n \t\t\t$instance = new self();\n \t\t}\n \t\treturn $instance;\n \t}", "protected function getInstantiator()\n {\n if (is_null(self::$instantiator)) {\n self::$instantiator = new Instantiator();\n }\n\n return self::$instantiator;\n }", "public function getInstance($objectClass);", "public function get_instance()\n\t{\n\t\treturn $this;\n\t}", "public function get_instance()\n\t{\n\t\treturn $this;\n\t}", "public static function get_instance() {\n\n\t\treturn null === self::$instance ? new self() : self::$instance;\n\n\t}", "public static function instance()\n\t{\n\t\t$class = get_called_class();\n\t\tif (! isset(self::$_instances[$class]))\n\t\t{\n\t\t\tself::$_instances[$class] = new $class();\n\t\t}\n\t\treturn self::$_instances[$class];\n\t}", "public static function getInstance()\n{\n\t$class_name = get_called_class();\n\tif (empty(self::$instances[$class_name]))\n\t{\n\t\tself::$instances[$class_name] = new $class_name();\n\t}\n\treturn self::$instances[$class_name];\n}", "public static function getInstance()\n { \n if(!isset(self::$instance)) \n { \n $object= __CLASS__; \n self::$instance=new $object; \n } \n return self::$instance; \n }", "static function factory()\n {\n if (self::$_instance == NULL) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\n return new self();\n }", "public function instance() {\n\t\n\t\treturn $this;\n\t\n\t}", "public static function GetInstance(){\n if (!isset(self::$instance)) {\n $c = __CLASS__;\n self::$instance = new $c;\n }\n\n return self::$instance;\n }", "public function __construct()\n {\n if (!self::$instance) {\n self::$instance = $this;\n //echo \"Create new object\";\n return self::$instance;\n } else {\n //echo \"Return old object\";\n return self::$instance;\n }\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 getInstance()\n {\n return new self();\n }", "public static function getInstance () {\n\t\tif(!isset(self::$oInstance)){\n\t\t\t$sClass = __CLASS__;\n\t\t\tself::$oInstance = new $sClass();\n\t\t}\n\t\treturn self::$oInstance;\n\t}" ]
[ "0.7771085", "0.7411382", "0.738569", "0.7241553", "0.7230845", "0.71528286", "0.7082419", "0.7076155", "0.6984994", "0.6963802", "0.6958543", "0.6956891", "0.6924669", "0.6891582", "0.6885684", "0.6832614", "0.6802997", "0.67939067", "0.6790977", "0.677604", "0.67683876", "0.67683876", "0.67683876", "0.67683876", "0.67675513", "0.6767515", "0.67574424", "0.673524", "0.67128366", "0.66853136", "0.66853136", "0.66700196", "0.6661658", "0.6660283", "0.66571075", "0.66571075", "0.66567594", "0.6635085", "0.6617688", "0.66156405", "0.6613248", "0.6590752", "0.65748936", "0.6573501", "0.65731364", "0.65731364", "0.657059", "0.65607774", "0.6554265", "0.6538373", "0.6534519", "0.6527847", "0.6520467", "0.6488669", "0.64837456", "0.64759374", "0.6460546", "0.64587414", "0.645504", "0.645504", "0.645504", "0.64542305", "0.64542305", "0.64542305", "0.64542305", "0.6454045", "0.6454045", "0.6454045", "0.6453806", "0.6453806", "0.6445128", "0.6444132", "0.6436022", "0.6435402", "0.64345324", "0.6428648", "0.6418094", "0.64099836", "0.6398872", "0.6398578", "0.63982314", "0.6395185", "0.63917667", "0.6387981", "0.6384388", "0.63838893", "0.6382222", "0.6382222", "0.6378514", "0.6371489", "0.63697207", "0.6359452", "0.63494325", "0.63492477", "0.63396573", "0.6334769", "0.6325761", "0.6319768", "0.63189274", "0.6316007" ]
0.6784319
19
Return a new instance of the class
public function buildObject() { $object = $this->instanciator->build($this->class, $this->properties); $parameters = $this->instanciator->getParameters($this->class); //avoid injecting the properties already used in the constructor $properties = $this ->properties ->filter(function($value, $property) use ($parameters) { return !$parameters->contains($property); }); $refl = new ReflectionObject( $object, $properties, $this->injectionStrategies ); return $refl->buildObject(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public function newInstance();", "public function newInstance();", "public function create(){\r\n\treturn new $this->class();\r\n }", "public function newInstance(): object;", "public function newInstance()\n {\n return new self();\n }", "public function getNew()\n {\n $class = get_class($this);\n\n return new $class;\n }", "public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }", "public static function new(){\n self::$instance = new self();\n return self::$instance;\n }", "public function create()\n {\n return new $this->class;\n }", "public static function factory()\n {\n return new self;\n }", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public static function make() {\n return new self();\n }", "public function new()\n {\n //\n }", "public function new()\n {\n //\n }", "public static function instance() {\n\t\treturn new self;\n\t}", "public static function getNewInstance() {\n \treturn new static();\n\t }", "public function regularNew() {}", "public function new()\n\t{\n\t\t//\n\t}", "public function new()\n\t{\n\t\t//\n\t}", "public function &create()\n {\n $obj = null;\n\n if (class_exists($this->_class_name)) {\n // Assigning the return value of new by reference\n $obj = new $this->_class_name();\n }\n\n return $obj;\n }", "public static function newInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "function new_instance($class)\n {\n }", "public static function create() {\n\t\treturn new self();\n\t}", "public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }", "public static function create()\n\t{\n\t\treturn new self;\n\t}", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "public static function create()\n\t\t{\n\t\t\treturn new self();\n\t\t}", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function create()\n {\n return new self();\n }", "public static function createInstance()\n {\n return new self();\n }", "public static function create() {\n return new self();\n }", "public static function getNewInstance()\n {\n return self::$instance = new self();\n }", "static function create(): self;", "function get_new($class, $params=NULL)\r\n\t{\r\n\t\t$obj = $this->singularize(ucwords($class));\r\n\t\treturn new $obj($params);\r\n\t}", "public function makeNew()\n\t{\n\t\treturn new static($this->view);\n\t}", "public static function new()\n {\n return new static();\n }", "public static function make () {\n return new static;\n }", "function _new($classe)\n{\n return new $classe($bdd, $ObjetBDDParam);\n}", "public static abstract function createInstance();", "public static function make()\n {\n return new static();\n }", "public function getInstance(/* ... */)\n {\n $reflection = new ReflectionClass($this->getClass());\n return $reflection->newInstanceArgs(func_get_args());\n }", "private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }", "public static function make()\n {\n return new static;\n }", "public static function make()\n {\n return new static;\n }", "public static final function of($class) {\n return self::typeOf($class)->newInstance();\n }", "public static function factory()\r\n {\r\n return parent::factory(__CLASS__);\r\n }", "public static function create(){\r\n\t\tif(self::$instance === null){\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function __construct()\n {\n if (!self::$instance) {\n self::$instance = $this;\n //echo \"Create new object\";\n return self::$instance;\n } else {\n //echo \"Return old object\";\n return self::$instance;\n }\n }", "public static function i()\n\t{\n\t\treturn new self;\n\t}", "public function instance();", "static public function create()\n {\n return new static();\n }", "public static function inst()\n {\n return new static();\n }", "abstract public function instance();", "public static function make()\n\t{\n\t\treturn new static;\n\t}", "public static function init()\n {\n return new self();\n }", "public static function getInstance() {\n return new self();\n }", "public static function instance() {\n return new static();\n }", "public function make() {}", "public static function getInstance()\n {\n return new self();\n }", "public function Create()\n\t{\n\t\treturn new self;\n\t}", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "public static function create()\n {\n return new static;\n }", "static public function create()\n\t{\n\t\treturn new static;\n\t}", "public static function instance() {\n\t\tif (!Registry::exists($class=get_called_class())) {\n\t\t\t$ref=new \\Reflectionclass($class);\n\t\t\t$args=func_get_args();\n\t\t\tRegistry::set($class,\n\t\t\t\t$args?$ref->newinstanceargs($args):new $class);\n\t\t}\n\t\treturn Registry::get($class);\n\t}", "public static function instance()\n {\n return new static();\n }", "public static function instance()\n {\n return new static();\n }", "public static function instance()\n {\n return new static;\n }", "public static function instance()\n {\n return new static;\n }", "public function & create($class) {\n\t\t# Add namepsace to class\n\t\t$objectFactoryClass = $this->getFactoryClassName($this->getFactoryClass($class));\n\t\t# Creating Factory object\n\t\t$objectFactory = new $objectFactoryClass();\n\t\t# Creating orignal object\n\t\t$object = $objectFactory->getInstance($this);\n\t\t# Returning object\n\t\treturn $object;\n\t}", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }", "public static function create()\n {\n return new static();\n }" ]
[ "0.81785107", "0.81770515", "0.81770515", "0.8146544", "0.80270857", "0.7975619", "0.78320676", "0.7740365", "0.7697943", "0.76458305", "0.7587706", "0.7571617", "0.75617534", "0.754988", "0.7505806", "0.7505806", "0.7505772", "0.7499193", "0.74841374", "0.7471202", "0.7471202", "0.74642503", "0.7428922", "0.74241465", "0.7420291", "0.739067", "0.7386881", "0.73825824", "0.73825824", "0.73570544", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.73351187", "0.733377", "0.7300607", "0.7274508", "0.72704446", "0.7270331", "0.72313654", "0.7223512", "0.7194766", "0.7143543", "0.71279913", "0.7108802", "0.71018934", "0.70830834", "0.70763016", "0.70763016", "0.7075763", "0.7064591", "0.70582753", "0.7037167", "0.7037167", "0.7037167", "0.70367044", "0.7018828", "0.70181394", "0.70150197", "0.70132005", "0.70109123", "0.70026404", "0.6987617", "0.6984949", "0.6922247", "0.6918547", "0.6918336", "0.6910908", "0.6901786", "0.6901786", "0.6901786", "0.6901786", "0.68949145", "0.68893343", "0.6885196", "0.6885196", "0.68755627", "0.68755627", "0.68557256", "0.6853506", "0.6853506", "0.6853506", "0.6853506", "0.6853506" ]
0.0
-1
Get dress category sub categories
public static function getDressSubacategories($parent_cat_id) { Db_Actions::DbSelect("SELECT * FROM cscart_dress_type_subcategory WHERE dress_type_category_id=$parent_cat_id"); $result = Db_Actions::DbGetResults(); if (!isset($result->empty_result)) { ?><ul><?php foreach ($result as $subcat) { ?> <li><a href="#" data-typec="<?php echo $subcat->id ?>"><?php echo $subcat->label ?></a></li> <?php } ?></ul><?php } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_sub_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"type\"=>2))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function allSubCategory() {\n return $this->db->get_where('r_category',array('subCategory !='=>0))->result_array();\n }", "function get_subcategories_list() {\n $query = $this->db->get('subcategories');\n return $query->result_array();\n }", "function get_sub_categories($category_ID)\n {\n $get_sub_category_query=site_query(\"select * from Category where parentID=\".$category_ID.\" order by displayOrder\",\"get_sub_categories()\",$dev);\n return $get_sub_category_query;\n }", "public function subcategories()\n {\n \treturn $this->hasMany('App\\Category', 'parent_id')->where('status', 1);\n }", "public function subcategories()\n {\n return $this->hasMany(Category::class, 'parent_id')->where('status', 1);\n }", "public function fetch_subcategory() {\n $this->db->where('parent_id!=', '0');\n $r = $this->db->get('category');\n return $r->result_array();\n }", "public function getCategories();", "public function getCategories();", "function achieve_get_sub_category()\r\n{\r\n global $sql;\r\n\r\n $sub_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, ParentID, Name FROM achievement_category WHERE ParentID<>-1 ORDER BY `GroupID` ASC\");\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n while ($sub_cat[$temp[\"ParentID\"]][$temp[\"ID\"]] = $temp[\"Name\"])\r\n {\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n }\r\n return $sub_cat;\r\n}", "public function subcategories()\n {\n return $this->hasMany('App\\Models\\Subcategory', 'scat_cat_id', 'cat_id');\n }", "public function subcategory()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->pro->prifix.$this->pro->category);\n\t\t$this->db->order_by($this->pro->category.'_id','desc');\n\t\t$this->db->order_by($this->pro->category.'_parent','desc');\n\t\t$this->db->where($this->pro->category.'_status','1');\n\t\t$this->db->where($this->pro->category.'_parent>',0);\n\t\t$rs = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\treturn $rs->result_array();\n\t\t\n\t}", "public function subCategorylist()\n {\n $data = [];\n $sub_categories = Category::where('parent', '!=' ,'0')->get();\n if(count($sub_categories)){\n $data = ['status' => true, 'code' => 200, 'data'=>$sub_categories];\n }else{\n $data = ['status' => false, 'code' => 404, 'message' => \"data not found\"];\n }\n return $data;\n }", "function getCategories($parent=0)\n {\n $sql=\"select * from itf_category where parent ='\".$parent.\"' and status='1' order by catname\";\n $res = $this->dbcon->FetchAllResults($sql);\n\n if(count($res) > 0){\n foreach($res as &$r)\n {\n $re = $this->getCategories($r['id']);\n $r[\"subcat\"] = $re;\n\n }\n }\n return $res;\n\n }", "public function getSuperCategories()\n {\n $select = $this->select();\n $select->columns(\"supercategory\")\n ->group(\"supercategory\");\n\n return $this->fetchAll($select);\n }", "function get_sub_cat($cat_main, $catrow )\n{\n\tglobal $db;\n\n\tif ($cat_main > 0)\n\t{\n\t\t$sql= \"SELECT * FROM \".CATEGORIES_TABLE.\" WHERE cat_id <> $cat_main AND cat_main=$cat_main\";\n\t\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categorie sons '.$sql, '', __LINE__, __FILE__, $sql);\n\t\twhile ( $catw = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$i = count($catrow);\n\t\t\t$catrow[$i] = $catw;\n\t\t\tif ($catw['cat_id'] > 0)\n\t\t\t\t$catrow = get_sub_cat($catw['cat_id'],$catrow);\n\t\t}\n\t}\n\treturn $catrow;\n}", "public function showSubcategories(){\n return ArticleModel::showSubcategories();\n }", "public function getMenu(){\n $bigCategory = $this->getBigCategory();\n $medCategory = $this->getMediumCategory();\n foreach($bigCategory as $bigKey => $value){\n foreach($medCategory as $medKey => $val){\n if($val['parentId'] == $value['id']){\n $bigCategory[$bigKey]['subCategory'][] = $val;\n }\n }\n }\n return $bigCategory;\n }", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function getChildCategories()\n {\n if (!$this->hasData('category_tabs')) {\n $currentCategory = $this->getMainCategory();\n $results = [];\n if ($currentCategory) {\n $tabIds = $currentCategory->getData('sss_category_tab_ids');\n if (!is_array($tabIds)) {\n $tabIds = explode(',', $tabIds);\n }\n /**\n * Enable Catalog Category Flat ... \n * @var $tabCollection \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat\\Collection\n */\n if ($currentCategory->getUseFlatResource()) {\n $tabCollection = $currentCategory->getCollection();\n\n $tabCollection\n ->addIsActiveFilter()\n ->addAttributeToSelect('include_in_menu')\n ->addAttributeToSelect('sss_custom_tab_title')\n ->addAttributeToSelect('position')\n ->addAttributeToSelect('sss_tab_position')\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES)\n ->addFieldToFilter('parent_id', ['eq' => $currentCategory->getId()]);\n\n $tabCollection->getSelect()\n ->orWhere('main_table.entity_id in (?)', $tabIds, \\Magento\\Framework\\DB\\Select::TYPE_CONDITION);\n\n $results = $tabCollection->getItems();\n } else {\n $tabCollection = $currentCategory->getChildrenCategories();\n if ($tabCollection instanceof AbstractCollection) {\n $tabCollection->setLoadProductCount(false);\n $tabCollection->addAttributeToSelect('sss_custom_tab_title');\n $tabCollection->addLevelFilter(3);\n try {\n $tabCollection->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES);\n } catch (\\Exception $e) {\n }\n $results = $tabCollection->getItems();\n } else {\n foreach ($tabCollection as $childCategory) {\n if (3 == $childCategory->getLevel()) {\n $results[] = $childCategory;\n }\n }\n }\n }\n usort($results, function ($first, $second) {\n if ($first->getData('sss_tab_position') || $second->getData('sss_tab_position')) {\n return $first->getData('sss_tab_position') >= $second->getData('sss_tab_position');\n } else {\n return $first->getData('position') >= $second->getData('position');\n }\n });\n }\n $this->setData('category_tabs', $results);\n }\n return $this->getData('category_tabs');\n }", "public function get_categories()\n {\n return ['super-cat'];\n }", "function get_category_data( $adunit = false ) {\n\t$exposed_values = array();\n\t$parent_categories = array();\n\t$sub_categories = array();\n\t$exposed_values['parent_categories'] = 'no_value';\n\t$exposed_values['sub_categories'] = 'no_value';\n\tif ( is_single() ) {\n\t\tglobal $post;\n\t\t$category_tax = 'category';\n\t\t$categories = get_the_terms( $post->ID, $category_tax );\n\t\tif ( ! empty( $categories ) ) {\n\t\t\tforeach ( $categories as $term ) {\n\t\t\t\t$ancestors = get_ancestors( $term->term_id, $category_tax );\n\t\t\t\tif ( ! empty( $ancestors ) ) {\n\t\t\t\t\tforeach ( $ancestors as $ancestor ) {\n\t\t\t\t\t\t$remove[] = \"'\";\n\t\t\t\t\t\tif ( ! $adunit ) {\n\t\t\t\t\t\t\t$remove[] = '-';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$ancestor_term = get_term( $ancestor );\n\t\t\t\t\t\tarray_push( $parent_categories, str_replace( $remove, '', $ancestor_term->slug ) );\n\t\t\t\t\t\tarray_push( $sub_categories, str_replace( $remove, '', $term->slug ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$term_slug = $term->slug;\n\t\t\t\t\tarray_push( $parent_categories, $term_slug );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$filter_similar_parent_cats = array_unique( $parent_categories, SORT_STRING );\n\t\t\t$parent_categories = implode( ', ', $filter_similar_parent_cats );\n\t\t\t$filter_similar_sub_cats = array_unique( $sub_categories, SORT_STRING );\n\t\t\t$sub_categories = implode( ', ', $filter_similar_sub_cats );\n\t\t\tif ( ! empty( $parent_categories ) ) {\n\t\t\t\t$exposed_values['parent_categories'] = $parent_categories;\n\t\t\t}\n\t\t\tif ( ! empty( $sub_categories ) ) {\n\t\t\t\t$exposed_values['sub_categories'] = $sub_categories;\n\t\t\t}\n\t\t}\n\t} elseif ( is_category() || is_archive() ) {\n\t\t$q_object = get_queried_object();\n\t\t// WP_Post_Type archives don't have a \"slug\" property.\n\t\tif ( ! empty( $q_object->slug ) ) {\n\t\t\t$cat_slug = $q_object->slug;\n\t\t\t$exposed_values['parent_categories'] = $cat_slug;\n\t\t\t$exposed_values['sub_categories'] = $cat_slug;\n\t\t}\n\t\tif ( is_post_type_archive( 'joke' ) ) {\n\t\t\t$exposed_values['parent_categories'] = 'jokes';\n\t\t\t$exposed_values['sub_categories'] = 'jokes';\n\t\t}\n\t} elseif ( is_page() ) {\n\t\t$exposed_values['parent_categories'] = 'misc';\n\t\t$exposed_values['sub_categories'] = 'misc';\n\t} elseif ( is_home() && is_front_page() ) {\n\t\t$exposed_values['parent_categories'] = 'homepage';\n\t\t$exposed_values['sub_categories'] = 'homepage';\n\t}\n\treturn $exposed_values;\n}", "public static function catAndSubCategories($business_id, $enable_petro_module = 0)\r\n {\r\n $categories_query = Category::where('business_id', $business_id)\r\n ->where('parent_id', 0)\r\n ->orderBy('name', 'asc');\r\n if (!empty($enable_petro_module)) {\r\n $categories = $categories_query->get()->toArray();\r\n } else {\r\n $categories = $categories_query->notPetro()->get()->toArray();\r\n }\r\n\r\n if (empty($categories)) {\r\n return [];\r\n }\r\n\r\n $sub_categories = Category::where('business_id', $business_id)\r\n ->where('parent_id', '!=', 0)\r\n ->orderBy('name', 'asc')\r\n ->get()\r\n ->toArray();\r\n $sub_cat_by_parent = [];\r\n\r\n if (!empty($sub_categories)) {\r\n foreach ($sub_categories as $sub_category) {\r\n if (empty($sub_cat_by_parent[$sub_category['parent_id']])) {\r\n $sub_cat_by_parent[$sub_category['parent_id']] = [];\r\n }\r\n\r\n $sub_cat_by_parent[$sub_category['parent_id']][] = $sub_category;\r\n }\r\n }\r\n\r\n foreach ($categories as $key => $value) {\r\n if (!empty($sub_cat_by_parent[$value['id']])) {\r\n $categories[$key]['sub_categories'] = $sub_cat_by_parent[$value['id']];\r\n }\r\n }\r\n\r\n return $categories;\r\n }", "function emc_get_the_subcategory_list( $slug ) {\r\n\r\n\t// Determine parent category ID\r\n\t$parent = get_category_by_slug( $slug );\r\n\t$parent_id = $parent->term_id;\r\n\r\n\t// Check all post categories to see if any have the specified parent\r\n\t$cats = get_the_category( get_the_ID() );\r\n\r\n\t$html = '';\r\n\tforeach ($cats as $cat) {\r\n\t\tif ( $parent_id == $cat->category_parent ) {\r\n\t\t\t$html .= sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a> ',\r\n\t\t\t\tget_category_link( $cat->term_id ),\r\n\t\t\t\tsprintf( __( 'View all posts in %s', 'emc' ), esc_attr( $parent->name ) ),\r\n\t\t\t\tesc_attr( $cat->name )\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\treturn $html;\r\n\r\n}", "public function getCategories()\n {\n $categories = ClassInfo::subclassesFor('ConsultationCategory');\n return $this->Children()->filter('Classname', $categories);\n }", "public function getSub_category(){\n return $this->sub_category;\n }", "public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }", "public function get_categories() {\n return [ 'yx-super-cat' ];\n }", "public function findCategories();", "public function subcategories(){\n return $this->hasMany(Category::class,'parent_category_id')->where('hidden', 0);\n }", "function get_subcategories($categoryid) {\r\n global $DB;\r\n\r\n $subcategories = $DB->get_records('question_categories', array('parent' => $categoryid), 'id');\r\n\r\n foreach ($subcategories as $subcategory) {\r\n $subcategories = array_merge($subcategories, get_subcategories($subcategory->id));\r\n }\r\n\r\n return $subcategories;\r\n}", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "function getCategories($object) { \n\n $R1 = new Category(); // R1 --\n $R11 = new Category(); // | | - R11 --\n $R111 = new Category(); // | | - R111\n $R112 = new Category(); // | | - R112\n $R11->addSubcategory($R111); // |\n $R11->addSubcategory($R112); // |\n $R1->addSubcategory($R11); // |\n $R2 = new Category(); // R2 --\n $R21 = new Category(); // | - R21 --\n $R211 = new Category(); // | | - R211\n $R22 = new Category(); // |\n $R221 = new Category(); // | - R22 --\n $R21->addSubcategory($R211); // | - R221\n $R22->addSubcategory($R221);\n $R2->addSubcategory($R21);\n $R2->addSubcategory($R22);\n\n $object->addCollectionEntry($R1); \n $object->addCollectionEntry($R2); \n}", "public function categories()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'category';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }", "public function get_sub_category(){\r\n $this->datatables->select('s.cat_id,s.sub_cat_id,c.cat_name,s.sub_cat_name');\r\n $this->datatables->join( 'o-cakes_category c', 's.cat_id = c.cat_id', 'left' );\r\n $this->datatables->from('o-cakes_sub_cat s');\r\n $this->datatables->where('s.sub_cat_status',1);\r\n $result = $this->datatables->generate();\r\n echo $result;\r\n }", "public function topSubcategories_get()\n {\n $em = $this->doctrine->em;\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n\n $subcategories = $subcategoriesRepo->findBy(array(), array('visits' => 'DESC'), 10);\n\n if ($subcategories) {\n $response[\"desc\"] = \"Subcategorias mas visitadas \";\n $response[\"count\"] = count($subcategories);\n $response[\"data\"] = $subcategories;\n } else {\n $response[\"desc\"] = 'No existen subcategorias mas visitadas';\n $response[\"count\"] = 0;\n $response[\"data\"] = array();\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "function showSubCategory()\n\t {\n\t\t\n\t\t $prolist=new Actions();\n\t\t $res=$prolist->fetchAll(\"category\");\n\t\t\t\t\t\t\n\t\t $parentdata=mysql_query(\"select * from category where cat_par_id='0'\");\n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\techo '<option value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\t\t\n\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$parent_sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\tActions::$r++;\n\t\t\t\tActions::viewCategory($parent_sub_cat['cat_id']);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }", "public function getCategories() : array;", "function getSubcategories(rex_category $category, $level_number, $max_number_subcategories): void\n {\n ++$level_number;\n echo '<ul class=\"sub-categories-list\">';\n foreach ($category->getChildren(true) as $sub_category) {\n $subcategory_start_article = $sub_category->getStartArticle();\n if (false === rex_addon::get('ycom')->isAvailable() || rex_ycom_auth::articleIsPermitted($subcategory_start_article)) {\n echo '<li><a href=\"'. $sub_category->getUrl() .'\" title=\"'. $sub_category->getName() .'\">'. $sub_category->getName() .'</a>';\n if ($level_number < $max_number_subcategories && count($sub_category->getChildren(true)) > 0) {\n getSubcategories($sub_category, $level_number, $max_number_subcategories);\n }\n echo '</li>';\n }\n }\n echo '</ul>';\n }", "public function getSubCategoryList($category_id)\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_category');\r\n\t\t$this->db->where('category_status', '1');\r\n\t\t$this->db->where('category_parent_id', $category_id);\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getSubCategories($catId) {\n $subCatId = array ();\n $children = Mage::getModel ( 'catalog/category' )->getCategories ( $catId );\n foreach ( $children as $_children ) {\n $subCatId [] = $_children->getId ();\n \n }\n return $subCatId;\n }", "public function makeCategory() {\n $categories = NewsCategory::orderBy('sort', 'asc')->where('parent_id', 0)->get();\n $categories->map(function($d){\n $d['sub_category'] = $d->child;\n return $d;\n });\n return $categories;\n }", "public function getSubMenu(){\n\t\t$catalogue = $this->getMenu()->content;\n\t\tforeach($catalogue as $first){\n\t\t\t$noms_sub_menu = $this->GetHTTP(\n\t\t\t\t'https://api.zalando.com/categories', array(\n\t\t\t\t\t'key' => implode(\",\", $first->childKeys),\n\t\t\t\t\t'pageSize' => '20000')\n\t\t\t)->content;\n\t\t\tfor ($i = 0; $i < count($first->childKeys); $i++){\n\t\t\t\t$first->childKeys[$noms_sub_menu[$i]->key] = $first->childKeys[$i];\n\t\t\t\t$first->childKeys[$noms_sub_menu[$i]->key] = $noms_sub_menu[$i]->name;\n\t\t\t\tunset($first->childKeys[$i]);\n\t\t\t}\n\t\t}\n\t\treturn $catalogue;\n\t}", "public function subcategories()\r\n {\r\n return $this->hasMany('App\\Models\\SubCategory');\r\n }", "public function get_sub_category($category = \"\")\n\t{ \n\t\t$result = $this->db->from(\"category\")\n\t\t ->where(array(\"main_category_id\" => $category, \"category_status\" => 1,\"type\" => 2))\n\t ->orderby(\"category_name\")->get();\n\t\treturn $result;\n\t}", "static function categories()\n {\n $category = \\SOE\\DB\\Category::where('parent_id', '0')\n ->orderBy('category_order')\n ->get();\n $return = array();\n foreach($categories as $cat)\n {\n $return[$cat->id] = $cat->slug;\n }\n return $return;\n }", "function getCategories()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('alias') . ',' .\n\t\t\t$this->db->nameQuote('id') . ',' .\n\t\t\t$this->db->nameQuote('name') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') .\n\t\t\t' WHERE ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' AND ' . $this->db->nameQuote('id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('trash') . ' = ' . $this->db->quote('0') .\n\t\t\t' ORDER BY ' . $this->db->nameQuote('ordering') . ' ASC';\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObjectList();\n\t}", "function categories($prefix_subcategories = true)\n{\n $temp = [];\n $temp['01-00'] = 'Arts';\n $temp['01-01'] = 'Design';\n $temp['01-02'] = 'Fashion & Beauty';\n $temp['01-03'] = 'Food';\n $temp['01-04'] = 'Books';\n $temp['01-05'] = 'Performing Arts';\n $temp['01-06'] = 'Visual Arts';\n\n $temp['02-00'] = 'Business';\n $temp['02-02'] = 'Careers';\n $temp['02-03'] = 'Investing';\n $temp['02-04'] = 'Management';\n $temp['02-06'] = 'Entrepreneurship';\n $temp['02-07'] = 'Marketing';\n $temp['02-08'] = 'Non-Profit';\n\n $temp['03-00'] = 'Comedy';\n $temp['03-01'] = 'Comedy Interviews';\n $temp['03-02'] = 'Improv';\n $temp['03-03'] = 'Stand-Up';\n\n $temp['04-00'] = 'Education';\n $temp['04-04'] = 'Language Learning';\n $temp['04-05'] = 'Courses';\n $temp['04-06'] = 'How To';\n $temp['04-07'] = 'Self-Improvement';\n\n $temp['20-00'] = 'Fiction';\n $temp['20-01'] = 'Comedy Fiction';\n $temp['20-02'] = 'Drama';\n $temp['20-03'] = 'Science Fiction';\n\n $temp['06-00'] = 'Government';\n\n $temp['30-00'] = 'History';\n\n $temp['07-00'] = 'Health & Fitness';\n $temp['07-01'] = 'Alternative Health';\n $temp['07-02'] = 'Fitness';\n // $temp['07-03'] = 'Self-Help';\n $temp['07-04'] = 'Sexuality';\n $temp['07-05'] = 'Medicine';\n $temp['07-06'] = 'Mental Health';\n $temp['07-07'] = 'Nutrition';\n\n $temp['08-00'] = 'Kids & Family';\n $temp['08-01'] = 'Education for Kids';\n $temp['08-02'] = 'Parenting';\n $temp['08-03'] = 'Pets & Animals';\n $temp['08-04'] = 'Stories for Kids';\n\n $temp['40-00'] = 'Leisure';\n $temp['40-01'] = 'Animation & Manga';\n $temp['40-02'] = 'Automotive';\n $temp['40-03'] = 'Aviation';\n $temp['40-04'] = 'Crafts';\n $temp['40-05'] = 'Games';\n $temp['40-06'] = 'Hobbies';\n $temp['40-07'] = 'Home & Garden';\n $temp['40-08'] = 'Video Games';\n\n $temp['09-00'] = 'Music';\n $temp['09-01'] = 'Music Commentary';\n $temp['09-02'] = 'Music History';\n $temp['09-03'] = 'Music Interviews';\n\n $temp['10-00'] = 'News';\n $temp['10-01'] = 'Business News';\n $temp['10-02'] = 'Daily News';\n $temp['10-03'] = 'Entertainment News';\n $temp['10-04'] = 'News Commentary';\n $temp['10-05'] = 'Politics';\n $temp['10-06'] = 'Sports News';\n $temp['10-07'] = 'Tech News';\n\n $temp['11-00'] = 'Religion & Spirituality';\n $temp['11-01'] = 'Buddhism';\n $temp['11-02'] = 'Christianity';\n $temp['11-03'] = 'Hinduism';\n $temp['11-04'] = 'Islam';\n $temp['11-05'] = 'Judaism';\n $temp['11-06'] = 'Religion';\n $temp['11-07'] = 'Spirituality';\n\n $temp['12-00'] = 'Science';\n $temp['12-01'] = 'Medicine';\n $temp['12-02'] = 'Natural Sciences';\n $temp['12-03'] = 'Social Sciences';\n $temp['12-04'] = 'Astronomy';\n $temp['12-05'] = 'Chemistry';\n $temp['12-06'] = 'Earth Sciences';\n $temp['12-07'] = 'Life Sciences';\n $temp['12-08'] = 'Mathematics';\n $temp['12-09'] = 'Nature';\n $temp['12-10'] = 'Physics';\n\n $temp['13-00'] = 'Society & Culture';\n // $temp['13-01'] = 'History';\n $temp['13-02'] = 'Personal Journals';\n $temp['13-03'] = 'Philosophy';\n $temp['13-04'] = 'Places & Travel';\n $temp['13-05'] = 'Relationships';\n $temp['13-06'] = 'Documentary';\n\n $temp['14-00'] = 'Sports';\n $temp['14-05'] = 'Baseball';\n $temp['14-06'] = 'Basketball';\n $temp['14-07'] = 'Cricket';\n $temp['14-08'] = 'Fantasy Sports';\n $temp['14-09'] = 'Football';\n $temp['14-10'] = 'Golf';\n $temp['14-11'] = 'Hockey';\n $temp['14-12'] = 'Rugby';\n $temp['14-13'] = 'Running';\n $temp['14-14'] = 'Soccer';\n $temp['14-15'] = 'Swimming';\n $temp['14-16'] = 'Tennis';\n $temp['14-17'] = 'Volleyball';\n $temp['14-18'] = 'Wilderness';\n $temp['14-19'] = 'Wrestling';\n\n $temp['15-00'] = 'Technology';\n\n $temp['50-00'] = 'True Crime';\n\n $temp['16-00'] = 'TV & Film';\n $temp['16-01'] = 'After Shows';\n $temp['16-02'] = 'Film History';\n $temp['16-03'] = 'Film Interviews';\n $temp['16-04'] = 'Film Reviews';\n $temp['16-05'] = 'TV Reviews';\n\n if ($prefix_subcategories) {\n foreach ($temp as $key => $val) {\n $parts = explode('-', $key);\n $cat = $parts[0];\n $subcat = $parts[1];\n\n if ($subcat != '00') {\n $temp[$key] = $temp[$cat.'-00'].' > '.$val;\n }\n }\n }\n\n return $temp;\n}", "public function getCategoriesForSettings() {\n \n $qb = $this->_em->createQueryBuilder();\n $qb->select('c')\n ->from('ABOMainBundle:Category', 'c')\n ->join('c.parent', 'p')\n ->addSelect('p')\n ->where('c.level = :level')\n ->setParameter('level', 2);\n \n return $qb->getQuery()->getResult();\n }", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "public function getSubcategoriesOfCategory()\n {\n // recupere id de la sous categorie choisie\n $categoryId=$_GET['categoryID'];\n // var_dump($categoryId);\n // on recupere les données dans la table subcategories selon la categorie\n $resultGetSubcategoriesOfCategory=DB::table('sub_categories')\n ->join('categories', 'sub_categories.category_id', '=', 'categories.id')\n ->select('sub_categories.category_id', 'categories.name_category', 'sub_categories.id', 'sub_categories.name_subcategory')\n ->where('sub_categories.category_id', '=', $categoryId)\n ->get();\n\n return json_encode($resultGetSubcategoriesOfCategory);\n\n // select categories.category_id, categories.name_category, sub_categories.name_subcategory\n // from sub_categories\n // join categories\n // on sub_categories.category_id = categories.category_id\n // where sub_categories.category_id='1';\n\n }", "public function getAllCategories() {\n $allCategories= $this->getCategories(); \n foreach ($allCategories as $value){\n $value->setChildren($this->getSubCategories($value->getId()));\n }\n return $allCategories;\n \n }", "function get_cat_sub($cat_id,$level=0) {\nglobal $table_catcontent, $db;\n$list_info_cat=($level==0)?\"(-1\":\"\";\n$list_info_cat = $list_info_cat.\",\".$cat_id;\n$subcat_num = Check_sub_info($table_catcontent,$db,\" WHERE parent_id = '\".$cat_id.\"'\");\nif ($subcat_num>0) {\n\t$sql_query = \"SELECT * FROM `\" . $table_catcontent . \"` WHERE parent_id='\".$cat_id.\"' ORDER BY priority_order ASC\";\n\t$sql_query = mysql_query($sql_query);\n\twhile($sql_query_rows = mysql_fetch_array($sql_query)) {\n\t\t$list_info_cat = $list_info_cat.get_cat_sub($sql_query_rows['id'],1);\n\t\t}\n\t}\nreturn ($level==0)?$list_info_cat.\")\":$list_info_cat;\n}", "protected function getChildK2Categories()\n {\n $db = $this->db;\n $query = $db->getQuery(true);\n $query->select($db->quoteName(array('id', 'parent')));\n $query->from($db->quoteName('#__k2_categories'));\n $query->where($db->quoteName('published') . ' = 1');\n $query->where($db->quoteName('parent') . ' != 0');\n $db->setQuery($query);\n return $db->loadObjectList('id');\n }", "public function getSubcategory() {\n return $this->hasMany(Subcategory::className(), ['id' => 'subcategory_id'])\n ->viaTable('question_category', ['question_id' => 'id']);\n }", "public function getSubCategoryByCategoryId($id){\n //$this->db->select('id,sub_category');\n $query = $this->db->get_where('sub_category',array('category_id' => $id));\n return $query->result(); \n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "function show_cats_dropdowns($all_cats, $main_cats) {\r\n\t\t\t\t\t\t\t\t$auto_class_cats = get_option('auto_class_cats');\r\n\t\t\t\t\t\t\t\tforeach ($main_cats as $key => $cat) {\r\n\t\t\t\t\t\t\t\t\t$selected = ($cat->term_id == $category_id) ? \" selected\" : \"\";\r\n\t\t\t\t\t\t\t\t\techo '<div data-value=\"'.$cat->term_id.'\" class=\"option'.$selected.'\" data-cat-parent=\"'.$cat->category_parent.'\"><span class=\"icon icon-level-down\"></span> '.$cat->name.'</div>';\r\n\r\n\t\t\t\t\t\t\t\t\tforeach($all_cats as $key => $subcat) {\r\n\t\t\t\t\t\t\t\t\t\tif($subcat->category_parent == $cat->term_id && !in_array($subcat->category_parent, $auto_class_cats)) {\r\n\t\t\t\t\t\t\t\t\t\t\t$sub_cats[] = $subcat;\r\n\t\t\t\t\t\t\t\t\t\t\tunset($all_cats[$key]);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}//foreach $c as $cat\r\n\t\t\t\t\t\t\t\t\techo '<div class=\"sub-cat\" data-subcats-for-cat=\"'.$cat->term_id.'\">';\r\n\t\t\t\t\t\t\t\t\t\tif(count($sub_cats) > 0) {\r\n\t\t\t\t\t\t\t\t\t\t\tshow_cats_dropdowns($all_cats, $sub_cats);\r\n\t\t\t\t\t\t\t\t\t\t\tunset($sub_cats);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\techo '</div>';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}", "function get_categories_tree()\n\t\t{\n\t\t\t$where = '';\n\t\t\t$is_accessory = FSInput::get('is_accessory',0,'int');\n\t\t\tif($is_accessory){\n\t\t\t\t$where .= ' AND is_accessories = 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND is_accessories = 1 ';\n\t\t\t}\n\t\t\t\n\t\t\tglobal $db ;\n\t\t\t$sql = \" SELECT id, name, parent_id AS parentid \n\t\t\t\tFROM fs_products_categories \n\t\t\t\tWHERE 1 = 1\n\t\t\t\t\".$where;\n\t\t\t// $db->query($sql);\n\t\t\t$categories = $db->getObjectList($sql);\n\t\t\t\n\t\t\t$tree = FSFactory::getClass('tree','tree/');\n\t\t\t$rs = $tree -> indentRows($categories,1); \n\t\t\treturn $rs;\n\t\t}", "function get_categories($params=''){\n $sql = ('SELECT id, name, parentid, level FROM categories ORDER BY name');\n $cat_array = $this->db->query($sql)->result_array();\n \n //this will generate html output - probably faster, but html code is out of templates!!!\n //$output_html = $this->generate_list_html(\"-1\",$cat_array);\n \n //this is slower method, but no html code in php\n //for this option, smarty modifier(compiler) need to be installed(compiler.defun.php)\n $arr = array();\n if(!empty($params['catId']) && $params['catId'] > 0){\t\t\n //generate top category, because it is not back from recursion function \t\n $this->CreateNestedArray($cat_array, $arr, $params['catId'], 0, 20);\n $arr2[0] = $this->get_category($params['catId']);\n $arr2[0]['children'] = $arr;\n return $arr2;\n }else{\n //get all categories\n $this->CreateNestedArray($cat_array, $arr, \"-1\", 0, 20);\n return $arr;\n }\n \n return;\n }", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "public function getChildCat($parent = array(0), $type = false, $data = false)\n {\n global $rlDb;\n\n foreach ($parent as $parent_id) {\n $parent_id = (int) $parent_id;\n\n $sql = \"SELECT *, `Modified` \";\n $sql .= \"FROM `{db_prefix}categories` \";\n $sql .= \"WHERE `Type` = '{$type['Key']}' AND `Status` = 'active' AND `Parent_ID` = '{$parent_id}'\";\n if ($type['Cat_hide_empty']) {\n $sql .= \"AND `Count` > 0 \";\n }\n $sql .= \"ORDER BY `Position`\";\n\n if ($tmp_categories = $rlDb->getAll($sql)) {\n foreach ($tmp_categories as $cKey => $cValue) {\n $ids[] = $cValue['ID'];\n\n $categories[$cValue['ID']] = $cValue;\n $categories[$cValue['ID']]['pName'] = 'categories+name+' . $cValue['Key'];\n $categories[$cValue['ID']]['pTitle'] = 'categories+title+' . $cValue['Key'];\n\n /* get subcategories */\n if ($type['Cat_show_subcats']) {\n // TODO - add this condition in output if needs\n $rlDb->calcRows = true;\n $subCategories = $rlDb->fetch(array('ID', 'Count', 'Path`, CONCAT(\"categories+name+\", `Key`) AS `pName`, CONCAT(\"categories+title+\", `Key`) AS `pTitle', 'Key'), array('Status' => 'active', 'Parent_ID' => $cValue['ID']), \"ORDER BY `Position`\", null, 'categories');\n $rlDb->calcRows = false;\n\n if (!empty($subCategories)) {\n $categories[$cValue['ID']]['sub_categories'] = $subCategories;\n $categories[$cValue['ID']]['sub_categories_calc'] = $rlDb->foundRows;\n }\n\n unset($subCategories);\n }\n }\n unset($tmp_categories);\n\n $data[$parent_id] = $categories;\n\n unset($categories);\n } else {\n continue;\n }\n }\n\n if ($parent) {\n return $this->getChildCat($ids, $type, $data);\n } else {\n return $data;\n }\n }", "private function getCategories() {\r\n $data['categories'] = array();\r\n\r\n $this->load->model('catalog/category');\r\n\r\n $categories_1 = $this->model_catalog_category->getCategories(0);\r\n\r\n foreach ($categories_1 as $category_1) {\r\n $level_2_data = array();\r\n\r\n $categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);\r\n\r\n foreach ($categories_2 as $category_2) {\r\n $level_3_data = array();\r\n\r\n $categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);\r\n\r\n foreach ($categories_3 as $category_3) {\r\n $level_3_data[] = array(\r\n 'category_id' => $category_3['category_id'],\r\n 'name' => $category_3['name'],\r\n );\r\n }\r\n\r\n $level_2_data[] = array(\r\n 'category_id' => $category_2['category_id'],\r\n 'name' => $category_2['name'],\r\n 'children' => $level_3_data\r\n );\r\n }\r\n\r\n $data['categories'][] = array(\r\n 'category_id' => $category_1['category_id'],\r\n 'name' => $category_1['name'],\r\n 'children' => $level_2_data\r\n );\r\n }\r\n return $data['categories'];\r\n }", "public function categories()\n {\n /* $categories=Category::where('parent',0)->with('grandchildren')->get()\n ->toArray();*/\n\n //to get parent to child level heirarchy\n /*$categories=Category::with('grandchildren')->get()\n ->toArray();*/\n\n //to get children of specific category\n /*foreach($categories as $category){\n $parent=$category->children()->get();\n\n if(!is_null($parent)){\n print_r($parent);\n \n }\n }*/\n\n /*$categories=Category::orderBy('name', 'asc')\n ->orderBy('parent', 'asc')->get();*/\n\n $categories=Category::where('parent',0)->with('children','children.grandchildren')->orderBy('name', 'asc')->get()\n ->toArray();\n return response()->json(['categories'=>$categories]);\n }", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "protected function getCategoriesToRegenerate()\n {\n $sets = $this->getItemSets()['image-sets'];\n $childCategories = $this->getChildK2Categories();\n $categories = array();\n foreach ($sets as $set) {\n foreach ($set['k2categories'] as $catId) {\n if (! in_array($catId, $categories)) {\n $categories[] = $catId;\n }\n if ($set['k2selectsubcategories'] == '1') {\n foreach ($childCategories as $child) {\n if ((! in_array($child->id, $categories)) && ($child->parent == $catId)) {\n $categories[] = $child->id;\n }\n }\n }\n }\n }\n return $categories;\n }", "public function subCategories()\n {\n return $this->belongsToMany(Category::class, 'solution_categories', 'solution_id', 'category_id')->isChild();\n }", "public function getCategoriesList() {\n return $this->_get(16);\n }", "public function sub_categories()\n {\n return $this->hasMany('App\\SubCategory');\n }", "public function getAllCategories() {\n\n if (!isset(parent::all()[0])) {\n return [];\n }\n return parent::all()[0]->children;\n }", "function get_simple_categories($type='all', $parentid=false, $order=false){\n $parentid = intval($parentid);\n $where=$orderby='';\n if($type=='root') $where = 'WHERE parentid = -1';\n elseif ($type=='sub' && $parentid) $where = \"WHERE parentid = '$parentid'\";\n if($order) $orderby = ' order by name '.$order;\n $sql = \"SELECT id as catId, name as catName FROM categories \" . $where . $orderby; //, marketplaceCount\n $cats = $this->db->query($sql)->result_array();\n foreach($cats as $key=>$value){\n //$cats[$key]['marketplaceCount'] = number_format($value['marketplaceCount']);\n $haveSubCategories = $this->db_getone(\"SELECT id from categories where parentid='{$value['catId']}'\", 'id');\n if($haveSubCategories) $cats[$key]['haveSubCategories'] = 1;\n else $cats[$key]['haveSubCategories'] = 0;\n }\n return $cats;\n }", "public function getCurrentSubcategories()\n {\n return $this->_getHelper()->getCurrentSubcategories();\n }", "function dataSubCategory( $parentcategory, $gcntyn=false ){\n\n\tglobal $db, $sess;\n\n\t$arrfileurl = explode('/',$_SERVER['SCRIPT_FILENAME']);\n\tif(in_array(\"m\", $arrfileurl) || in_array(\"m2\", $arrfileurl)){\n\t\t$hidden = \"hidden_mobile=0\";\n\t} else {\n\t\t$hidden = \"hidden=0\";\n\t}\n\t# 카테고리 정보\n\tfor ($i=0;$i<2;$i++){\n\t\t$length = strlen($parentcategory) + 3;\n\t\t$query = \"\n\t\tselect\n\t\t\tcategory,catnm,sort,level,level_auth\n\t\tfrom\n\t\t\t\".GD_CATEGORY.\"\n\t\twhere\n\t\t\tcategory like '$parentcategory%'\n\t\t\tand length(category)=$length\n\t\t\";\n\t\tif ($GLOBALS[ici_admin] === false) $query .= \"and \".$hidden;\n\t\t$res = $db->query($query);\n\n\t\tif ($db->count_($res)) break;\n\t\telse if ($length>6) $parentcategory = substr($parentcategory,0,-3);\n\t}\n\n\t// 상품 개수 추출 및 상품분류 연결방식 전환 여부에 따른 처리\n\tif ( $gcntyn == true && _CATEGORY_NEW_METHOD_ === false ){\n\t\tif ($GLOBALS[ici_admin] === false) $where[] = \"a.\".$hidden;\n\t\t$where[] = \"a.category like '$parentcategory%'\";\n\t\t$where[] = \"open\";\n\t\tif ($GLOBALS['tpl']->var_['']['connInterpark']) $where[] = \"b.inpk_prdno!=''\";\n\n\t\t$query = \"\n\t\tselect\n\t\t\tleft(category,$length),count(distinct a.goodsno)\n\t\tfrom\n\t\t\t\".GD_GOODS_LINK.\" a,\n\t\t\t\".GD_GOODS.\" b\n\t\twhere\n\t\t\ta.goodsno = b.goodsno\n\t\t\tand \".implode(\" and \", $where).\"\n\t\tgroup by left(category,$length)\n\t\t\";\n\t\t$res2 = $db->query($query);\n\t\twhile ($data2=$db->fetch($res2)) $gcnt[$data2[0]] = $data2[1];\n\t}\n\n\t### 데이타 조작\n\t$i = 0;\n\twhile ($data=$db->fetch($res)){\n\t\t// 상품 개수 추출 및 상품분류 연결방식 전환 여부에 따른 처리\n\t\tif ($gcntyn == true && _CATEGORY_NEW_METHOD_ === true) {\n\t\t\t$where\t= array();\n\t\t\tif ($GLOBALS[ici_admin] === false) $where[] = \"gl.hidden=0\";\n\t\t\t$where[] = \"gl.category = '\".$data['category'].\"'\";\n\t\t\t$where[] = \"g.open = '1'\";\n\t\t\tif ($GLOBALS['tpl']->var_['']['connInterpark']) $where[] = \"g.inpk_prdno!=''\";\n\n\t\t\t$query = \"\n\t\t\tSELECT\n\t\t\t\tCOUNT(g.goodsno) as cnt\n\t\t\tFROM\n\t\t\t\t\".GD_GOODS.\" g\n\t\t\tINNER JOIN\n\t\t\t\t\".GD_GOODS_LINK.\" gl ON g.goodsno = gl.goodsno\n\t\t\tWHERE\n\t\t\t\t\".implode(\" AND \", $where).\"\n\t\t\t\";\n\n\t\t\t$res2 = $db->query($query);\n\t\t\twhile ($data2=$db->fetch($res2, 1)) $gcnt[$data['category']] = $data2['cnt'];\n\t\t}\n\n\t\t$member_auth = false;\n\t\tif($data['level']){//권한 설정되어 있는지 체크\n\t\t\tswitch($data['level_auth']){//권한체크\n\t\t\t\tcase '1': //모두숨김\n\t\t\t\t\tif( (!$sess['level'] ? 0 : $sess['level']) >= $data['level'] ) $member_auth = true;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: $member_auth = true; break;\n\t\t\t}\n\t\t}\n\t\telse $member_auth = true;\n\n\t\tif($member_auth){\n\t\t\t$data['gcnt'] = $gcnt[ $data['category'] ];\n\t\t\t$cate[$data[sort]][] = $data;\n\t\t}\n\t}\n\n\t### 배열 순서 재정의\n\tif ($cate) $cate = resort($cate);\n\n\treturn $cate;\n}", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "function tep_get_subCategory($tagValue){\n\tglobal $languages_id,$customer_group_id;\n\t//禁用的电池分类ID @nathan 2011-11-2\n\t//$disable_batteries = array(1,3,21,23,25,73,111,307,314,499);\n\t$disable_batteries = array(23,25,73,111,307,499);\n\t$disable_batteries_three = array(188,191,192,193,194,195,502,556,112,115,117,126,129,136,139,141,172,175,601,181,306,312,313,500,501,562,197,198,202,204,205,206,208,210,211,212,213,217,218,220,503,504,505,521,557,558,559,560,561,563,507,508,509,510,511,512,513,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,741);\n\t$jsonData = array();\n\tif (isset($tagValue) && !empty($tagValue)){\n\t\t# \n\t\t# URL\n\t\t# Ʒ\n\t\t# |_| |=|\n\t\t$topNavi_categories_sql = sprintf(\"SELECT DISTINCT C.categories_id,C.parent_id, CD.categories_name FROM %s AS CD INNER JOIN %s AS C ON CD.categories_id=C.categories_id WHERE CD.language_id=%u AND C.products_group_access like '%s' AND C.parent_id=%u ORDER BY C.sort_order ASC\",TABLE_CATEGORIES_DESCRIPTION,TABLE_CATEGORIES,(int)$languages_id,\"%\".$customer_group_id.\"%\",(int)$tagValue);\n\t\t$topNavi_categories_query = tep_db_query($topNavi_categories_sql);\n\t\tif (tep_db_num_rows($topNavi_categories_query) > 0){\n\t\t\t$i = 0;\n\t\t\twhile ($topNavi_categories = tep_db_fetch_array($topNavi_categories_query)) {\n\t\t\t\t//禁止显示的电池分类 @nathan 2011-11-2\n\t\t\t\tif($tagValue == 408 && in_array($topNavi_categories['categories_id'], $disable_batteries)) continue;\n\n\t\t\t\t$products_in_category = tep_count_products_in_category($topNavi_categories['categories_id']);\n\t\t\t\tif ($products_in_category > 0){\n\t\t\t\t\t$jsonData[$i]['name'] = $topNavi_categories['categories_name'];\n\t\t\t\t\t$jsonData[$i]['url'] = tep_href_link(FILENAME_DEFAULT,tep_get_abscPath($topNavi_categories['categories_id']),'NONSSL',false);\n\t\t\t\t\t$jsonData[$i]['parent'] = '0';\n\t\t\t\t\t$jsonData[$i]['num'] = tep_count_products_in_category($topNavi_categories['categories_id']);\n\t\t\t\t\t$i++;\n\t\t\t\t\t$sub_categories_sql = sprintf(\"SELECT DISTINCT C.categories_id,C.parent_id, CD.categories_name FROM %s AS CD INNER JOIN %s AS C ON CD.categories_id=C.categories_id WHERE CD.language_id=%u AND C.products_group_access like '%s' AND C.parent_id=%u ORDER BY C.sort_order ASC\",TABLE_CATEGORIES_DESCRIPTION,TABLE_CATEGORIES,(int)$languages_id,\"%\".$customer_group_id.\"%\",(int)$topNavi_categories['categories_id']);\n\t\t\t\t\t$sub_categories_query = tep_db_query($sub_categories_sql);\n\t\t\t\t\tif (tep_db_num_rows($sub_categories_query) > 0){\n\t\t\t\t\t\twhile ($sub_categories = tep_db_fetch_array($sub_categories_query)) {\n\t\t\t\t\t\t\tif(in_array($sub_categories['categories_id'], $disable_batteries_three)) continue;\n\t\t\t\t\t\t\t$products_in_subcategory = tep_count_products_in_category($sub_categories['categories_id']);\n\t\t\t\t\t\t\tif ($products_in_subcategory > 0){\n\t\t\t\t\t\t\t\t$jsonData[$i]['name'] = $sub_categories['categories_name'];\n\t\t\t\t\t\t\t\t$jsonData[$i]['url'] = tep_href_link(FILENAME_DEFAULT,tep_get_abscPath($sub_categories['categories_id']),'NONSSL',false);\n\t\t\t\t\t\t\t\t$jsonData[$i]['parent'] = $sub_categories['categories_id'];\n\t\t\t\t\t\t\t\t$jsonData[$i]['num'] = tep_count_products_in_category($sub_categories['categories_id']);\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}unset($products_in_subcategory);\n\t\t\t\t\t\t}unset($sub_categories);\n\t\t\t\t\t}unset($sub_categories_query,$sub_categories_sql);\n\t\t\t\t}unset($products_in_category);\n\t\t\t}unset($topNavi_categories);\n\t\t}unset($topNavi_categories_query,$topNavi_categories_sql);\n\t\t//echo json_encode($jsonData);\n\t\treturn $jsonData;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function generatePopularSubcategories()\n {\n\n $categoryId = $this->id;\n\n $subcategories = Subcategory::\n whereHas('categories', function ($query) use ($categoryId) {\n $query->where('categories.id', $categoryId);\n })\n ->whereHas('evercisegroups', function($query){})\n ->take(15)\n ->get()\n ->sortByDesc(function ($subcats) {\n return $subcats->evercisegroups->count();\n });\n\n $output = [];\n foreach ($subcategories as $subcat) {\n $output[] = [\n 'name' => $subcat->name,\n 'classes' => $subcat->evercisegroups->count(),\n ];\n }\n\n\n return $output;\n }", "public function get_sub_cat_list1($parentid,$subcatid){\n\t\t\n\t\t$parentid= trim($parentid);\n\t\t$subcatid= trim($subcatid);\n\t\t\n\t\treturn $this->db->query(\"select a.*,b.* from subcategory_name as a inner join subcategory as b on a.subcategory_name_id=b.subcategory_name_id where b.subcategory_name_id='$subcatid' and b.ParentCategory='$parentid'\")->result_array();\n\t\n\t\t\n\t}", "function bvt_sfa_feed_admin_get_categories() {\n\n $categories = get_categories(\n array(\n \"child_of\" => get_option(\"BVT_SFA_TOPICS_CATEGORY_ID\"),\n \"hide_empty\" => false\n )\n );\n\n return $categories;\n}", "function getSubCategory($category)\n\t\t{\n\t\t\t//get values of sub category of this category\n\t\t\t$subcatList = $this->manageContent->getValue_where('subcategory', '*', 'categoryId', $category);\n\t\t\tif(!empty($subcatList[0]))\n\t\t\t{\n\t\t\t\tforeach($subcatList as $subcat)\n\t\t\t\t{\n\t\t\t\t\techo '<option value=\"'.$subcat['subCategoryId'].'\">'.$subcat['name'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<option>No Subcategory</option>';\n\t\t\t}\n\t\t}", "public function get_all_info_cat_sub() {\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT categories.cat_id,subcategories.subc_id,subcategories.subc_name, categories.cat_name, company_info.info_logo, company_info.info_address, users.user_id,users.user_confirmed,users.admin_confirmed, users.user_name, users.user_email, users.user_comp_name, users.user_number, users.client_cat_id, client_cat.client_cat_id, users.user_time, client_cat.client_cat_name FROM client_cat LEFT JOIN users ON users.client_cat_id = client_cat.client_cat_id right join company_info on company_info.user_id=users.user_id right join categories on categories.cat_id=company_info.cat_id LEFT JOIN subcategories ON subcategories.subc_id=company_info.subc_id \n\");\n\t\t\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\t$result = $query->fetchAll();\n\t\t\treturn $result;\n\t\t}catch(PDOException $e){\n\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "function showChildCategories($category_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_sub_categories WHERE sub_cate_status = 1 AND \tparent_id = \".$category_id.\" order by sub_cate_title ASC\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "public function getParentCategories()\n {\n return [\n 1 => [\n 'ru' => 'Готовые наборы для аэрографии',\n 'uk' => 'Готові набори для аерографії',\n 'en' => 'Ready-made airbrush kits',\n ],\n 2 => [\n 'ru' => 'Дополнительное оборудование и аксессуары для аэрографии',\n 'uk' => 'Додаткове обладнання та аксесуари для аерографії',\n 'en' => 'Additional equipment and accessories for airbrushing'\n ],\n 3 => [\n 'ru' => 'Аэрографы и компрессоры Fengda',\n 'uk' => 'Аерографи і компресори Fengda',\n 'en' => 'Fengda Airbrushes and Compressors',\n ],\n 4 => [\n 'ru' => 'Товары для аэрографии на ногтях (nail art)',\n 'uk' => 'Товари для аерографії на нігтях (nail art)',\n 'en' => 'Goods for airbrushing on nails (nail art)',\n ],\n 6 => [\n 'ru' => 'Товары для аэрографии визажистов, гримеров и др.',\n 'uk' => 'Товари для аерографії візажистів, гримерів і ін.',\n 'en' => 'Goods for aerography of make-up artists, make-up artists, etc.',\n ],\n 5 => [\n 'ru' => 'Товары для аэрографии на кондитерских изделиях',\n 'uk' => 'Товари для аерографії на кондитерських виробах',\n 'en' => 'Goods for airbrushing confectionery products',\n ],\n 7 => [\n 'ru' => 'Краски для аэрографии Createx и Wicked Colors',\n 'uk' => 'Фарби для аерографії Createx і Wicked Colors',\n 'en' => 'Paints for airbrushing Createx and Wicked Colors',\n 'not_active' => true\n ],\n 8 => [\n 'ru' => 'Краски для аэрографии Auto Air Colors',\n 'uk' => 'Фарби для аерографії Auto Air Colors',\n 'en' => 'Paints for airbrushing Auto Air Colors',\n 'not_active' => true\n ],\n 9 => [\n 'ru' => 'Аэрографы и запчасти H&S/Hansa',\n 'uk' => 'Аерографи і запчастини H&S/Hansa',\n 'en' => 'Airbrushes and spare parts H&S/Hansa',\n ]\n ];\n }", "public function sub_categories()\n\t{ \n\n\t\tif ($this->input->is_ajax_request()) {\n\t\t\t$main_cat_id = $_POST['main_cat_id'];\n\n\t\t\t$sub_categories = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('main_cat_id'=> $main_cat_id)); \n\n\t\t\tif (isset($sub_categories) && count($sub_categories) != 0) {\n\t\t\t\t$id=\"sub_cat_id\".$main_cat_id;\n\t\t\t\t$div=\"div_\".$main_cat_id;\n\t\t\t\techo '<select id=\"'.$id.'\" onclick=\"get_sub_category('.$main_cat_id.');\">';\n\t\t\t\techo '<option disabled selected>Select Sub category</option>';\n\n\t\t\t\tforeach ($sub_categories as $cat) {\t\t\t\t\n\t\t\t\t\techo '<option value=\"'.$cat->id.'\">'.$cat->title.'</option>';\n\t\t\t\t}\n\t\t\t\techo '</select><div id=\"'.$div.'\"> </div><br>';\n\n\n\t\t\t}\n\n\n\t\t} \n\t}", "public function getChilds($category_id) {\n $categoryTableName = $this->info('name');\n\n $category = Engine_Api::_()->getItem('siteevent_category', $category_id);\n\n $select = $this->select()\n ->from($categoryTableName, array('category_id', 'category_name'))\n ->where(\"cat_dependency = ?\", $category_id);\n\n //IF SUBCATEGORY THEN FETCH 3RD LEVEL CATEGORY\n if ($category->cat_dependency != 0 && $category->subcat_dependency == 0) {\n $select->where(\"subcat_dependency = ?\", $category_id);\n }\n //IF CATEGORY THEN FETCH SUB-CATEGORY\n elseif ($category->cat_dependency == 0 && $category->subcat_dependency == 0) {\n $select->where(\"subcat_dependency = ?\", 0);\n }\n //IF 3RD LEVEL CATEGORY\n else {\n return array();\n }\n\n return $this->fetchAll($select);\n }", "function particularsubcatlist($id)\n\t{\n\t\t$getParsubproduct=\"SELECT * from product_sub_category where pr_sub_id = $id\";\n\t\t$subproduct_data=$this->get_results( $getParsubproduct );\n\t\treturn $subproduct_data;\n\t}", "public function listOfCategory()\n {\n //$sub_category = Categories::where('is_parent', 1)->orderBy('category_name')->get();\n return view('admin.category.categoryList');\n }", "function getProjectSubCategory($userData)\n\t\t{\n\t\t\t//get sub category from database\n\t\t\techo '<li class=\"pro_cat\"><a>'.$userData['category'].'</a></li>\n\t\t\t\t\t<ul class=\"profile_overview profile_1st_child_nav\">\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 1</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 2</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 3</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 4</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 5</a></li>\n\t\t\t\t\t</ul>';\n\t\t}", "function getCategoryTree($db) {\n // Make Category Tree\n $query = \"SELECT `COMPLAINT_TYPE`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $category['name'] = trim($row[\"COMPLAINT_TYPE\"], ' /');\n $category['COMPLAINT_TYPE'] = $row[\"COMPLAINT_TYPE\"];\n $category['slug'] = slugify($category['name']);\n $category['count'] = $row[\"COUNT(*)\"];\n if( $category['slug'] != 'n-a' && $category['slug'] != 'select-one' && $category['slug'] != 'other' ){\n $topCategories[$category['slug']]=$category;\n }\n }\n\n $query = \"SELECT `COMPLAINT_TYPE`, `DESCRIPTOR`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE`, `DESCRIPTOR` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $subCategory['name'] = trim($row[\"DESCRIPTOR\"], ' /');\n $subCategory['DESCRIPTOR'] = $row[\"DESCRIPTOR\"];\n $subCategory['slug'] = slugify($subCategory['name']);\n $subCategory['count'] = $row[\"COUNT(*)\"];\n if(\n trim($row['COMPLAINT_TYPE']) != ''\n && $subCategory['slug'] != 'n-a'\n && $subCategory['slug'] != 'select'\n ){\n $topCategories[slugify($row['COMPLAINT_TYPE'])]['subCategories'][$subCategory['slug']]=$subCategory;\n }\n }\n\n return $topCategories;\n}", "function get_category_array() {\n $args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n );\n return get_categories($args);\n}", "public static function getSubcatValues()\n\t{\n\t}", "public static function getListSubcategoria($subs){\n return CHtml::listData($subs,'id_subcategoria','nombre');\n }", "public function list_subCategory($category_id){\n $sqlQuery=\"select *,sidhus_category.cat_name from sidhus_subcategory inner join sidhus_category on sidhus_category.category_id=sidhus_subcategory.category_id where sidhus_subcategory.category_id = \". $category_id;\n //$sqlQuery= \"select * from make_an_offer INNER JOIN sell_product ON sell_product.sell_id=make_an_offer.product_id where sell_product.customer_id = \". $customer_id;\n $result=$this->con->query($sqlQuery);\n $this->con->close();\n return $result;\n }", "public function getSubByCategory($category_id){\n $subCategories = SubCategory::where('category_id', '=', $category_id)->select('*')->get()->toArray();\n return response()->json($subCategories);\n }", "public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function getCategories() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.parent_id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtpihps_categories', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t$query->order($db->quoteName('a.id'));\n\t\t\n\t\t$db->setQuery($query);\n\t\t$raw = $db->loadObjectList();\n\t\t$data = array();\n\t\tforeach ($raw as $item) {\n\t\t\t$data[$item->parent_id][$item->id] = $item->name;\n\t\t}\n\t\treturn $data;\n\t}", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'tree_id'])->viaTable('{{%news_tree}}', ['news_id' => 'id']);\n }", "public function subkategori()\n {\n //Query untuk mengambil semua data sub kategori yang di-join dengan tabel kategori berdasarkan id_kategori dan diurutkan berdasarkan nama_kategori\n $query = $this->db->query(\"SELECT * FROM sub_kategori A LEFT JOIN kategori B ON B.id_kategori = A.id_kategori ORDER BY B.nama_kategori\");\n return $query;\n }" ]
[ "0.7620408", "0.732699", "0.72744167", "0.72341084", "0.7215433", "0.7190907", "0.71455324", "0.70433193", "0.70433193", "0.7040855", "0.70328766", "0.69892126", "0.69842917", "0.6969913", "0.6961672", "0.6942846", "0.6923701", "0.68668985", "0.6835289", "0.68055856", "0.67725664", "0.6748842", "0.67453057", "0.67376107", "0.6723442", "0.67135197", "0.6686103", "0.6678527", "0.6674862", "0.6669125", "0.6658406", "0.6640892", "0.6630986", "0.66184914", "0.66173667", "0.6615058", "0.66116935", "0.6608031", "0.6604487", "0.6592305", "0.65764445", "0.6560681", "0.65546274", "0.6551017", "0.65352494", "0.6533278", "0.6531848", "0.65296036", "0.65248626", "0.65196973", "0.6506253", "0.65019435", "0.6483395", "0.64621544", "0.6459488", "0.64521354", "0.6440627", "0.6433604", "0.643288", "0.6432703", "0.64224875", "0.64201164", "0.6414344", "0.6413827", "0.6412152", "0.64120996", "0.6408644", "0.6407615", "0.6404164", "0.6400176", "0.6399373", "0.63860446", "0.6384252", "0.6378918", "0.63732713", "0.6366898", "0.63633984", "0.63628745", "0.63567525", "0.6356504", "0.6356124", "0.63533115", "0.6344162", "0.63407344", "0.63404447", "0.6339926", "0.63379955", "0.63340807", "0.63277745", "0.6320932", "0.63204813", "0.6318839", "0.63129026", "0.6310072", "0.62983304", "0.6294806", "0.6294806", "0.6293508", "0.6293008", "0.62885857" ]
0.6972718
13
/////////////////////////////////////////////////////////////////// Get data from url
public static function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data($url)\n\t\t{\n\t\t $ch = curl_init();\n\t\t $timeout = 5;\n\t\t curl_setopt($ch,CURLOPT_URL,$url);\n\t\t curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n\t\t curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\n\t\t $data = curl_exec($ch);\n\t\t curl_close($ch);\n\t\t return $data;\n\t\t}", "function get_data($url) {\n\t$ch = curl_init();\n\t$timeout = 5;\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\n\t$result = curl_exec($ch);\n\t$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\n\t$response = array(\n\t 'content' => $result, \n\t 'code' => $code);\n\t \n\treturn $response;\n }", "function get_data($url) {\n\t$ch = curl_init();\n\t$timeout = 5;\n\tcurl_setopt($ch,CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0');\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t$data = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $data;\n}", "private function get_data($url) { \n \n\t$ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n \n //curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n //curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);\n //curl_setopt($ch,CURLOPT_MAXREDIRS,50);\n \n $data = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $data;\n }", "function get_data($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "private function getData($url){\r\n\r\n $data= array();\r\n\r\n $myPage = curl_init($url);\r\n curl_setopt($myPage, CURLOPT_RETURNTRANSFER, TRUE);\r\n $info = curl_exec($myPage);\r\n if(curl_errno($myPage)){\r\n return null;\r\n exit;\r\n }\r\n curl_close($myPage);\r\n\r\n $data = json_decode($info);\r\n\r\n return $data;\r\n }", "public function GetData($url){\n\t\t$ch = curl_init();\n\t \n\t\tcurl_setopt($ch,CURLOPT_URL,$url);\n\t curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.15) Gecko/20080623 Firefox/2.0.0.15');\n\t \n\t curl_setopt($ch, CURLOPT_NOBODY, false);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$result= curl_exec ($ch);\n\t\tcurl_close($ch);\n\t return $result;\n\t}", "function get_data($url) {\r\n\t$ch = curl_init();\r\n\t$timeout = 5;\r\n\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\r\n\t$data = curl_exec($ch);\r\n\tcurl_close($ch);\r\n\treturn $data;\r\n}", "private function getDataByScrapeUrl()\n {\n return file_get_contents($this->url);\n }", "function fetchFileDataFromURL($url)\n{\n $url_parsed = parse_url($url);\n $in = '';\n\n $host = $url_parsed['host'];\n $port = isset($url_parsed['port']) ? intval($url_parsed['port']) : 80;\n if ($port == 0) {\n $port = 80;\n }\n $path = $url_parsed['path'];\n if (isset($url_parsed['query']) && $url_parsed['query'] != '') {\n $path .= '?' . $url_parsed['query'];\n }\n\n $fp = fsockopen($host, $port, $errno, $errstr, 3);\n if ($fp) {\n $out = \"GET $path HTTP/1.1\\r\\nHost: $host\\r\\n\";\n $out .= \"Connection: close\\r\\n\\r\\n\";\n fwrite($fp, $out);\n $body = false;\n while (!feof($fp)) {\n $s = fgets($fp, 1024);\n if ($body) {\n $in .= $s;\n }\n if ($s == \"\\r\\n\") {\n $body = true;\n }\n }\n\n fclose($fp);\n }\n\n return $in;\n}", "abstract public function get_url_read();", "function rest_get_data($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function get_url_content($url) {\n \t\t$ch = curl_init();\n \t\t$timeout = 5;\n \t\tcurl_setopt($ch, CURLOPT_URL, $url);\n \t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n \t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n \t\t$data = curl_exec($ch);\n \t\tcurl_close($ch);\n \t\treturn $data;\n\t}", "function get_data($url){\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0\");\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function get_data_with_curl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.\n curl_setopt($ch, CURLOPT_URL, $url);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n }", "public function getRemoteData($url = '')\n {\n return file_get_contents($url);\n }", "function getData($url) {\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "private function fetchDataFromUrl($url)\n {\n \ttry {\n \t\t$options = array(\n \t\t\t\t'http' => array(\n \t\t\t\t\t\t'method' => 'GET',\n \t\t\t\t\t\t'header' => implode(\"\\r\\n\", array(\n \t\t\t\t\t\t\t\t'accept: text/html,application/xhtml+xml,application/xml;',\n \t\t\t\t\t\t\t\t'cache-control:max-age=0',\n \t\t\t\t\t\t\t\t'Accept-language: en-US,en;q=0.8',\n \t\t\t\t\t\t\t\t'User-Agent: ' . $this->userAgents[rand(0, count($this->userAgents) - 1)]\n \t\t\t\t\t\t))\n \t\t\t\t)\n \t\t);\n \t\t$context = stream_context_create($options);\n \t\t$content = file_get_contents($url, false, $context);\n \t\t\n \t\t$targetHost = parse_url($url, PHP_URL_HOST);\n \t\t$doc = new \\App\\Libraries\\Parser\\Document($content, 'default', $targetHost);\n \t\t$res = $doc->parseContent(false, null);\n \t\tif ($res['okay']) {\n \t\t\t$images = $res['images'];\n \t\t\t$parsedUrl = parse_url($url);\n \t\t\tfor ($i = count($images) - 1; $i >= 0; $i--) {\n \t\t\t\tif (strpos($images[$i], 'http') !== 0) {\n \t\t\t\t\t/*\n \t\t\t\t\t $parsedImages = parse_url($images[$i]);\n \t\t\t\t\t $parsedImages['scheme'] = $parsedUrl['scheme'];\n \t\t\t\t\t $parsedImages['host'] = $parsedUrl['host'];\n \t\t\t\t\t $images[$i] = http_build_url($parsedImages);\n \t\t\t\t\t */\n \t\t\t\t\tarray_splice($images, $i, 1);\n \t\t\t\t}\n \t\t\t}\n \t\t\t$res['images'] = $images;\n \t\t\treturn $res;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} catch (\\Exception $e) {\n \t\tLog::error('Cannot fetch data from url: ' . $url . '; ' . $e);\n \t\treturn false;\n \t}\n }", "function getDataViaCurl($url){\n\n\t// TODO: check http response 200, 404, ...etc\n\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t// option for returning data\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HEADER, false);\n\t//retrieve data from curl_exec \n\t$data = curl_exec($curl);\n\t\n\tcurl_close($curl);\n\n\treturn $data;\n}", "function getCurlData($url)\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($curl, CURLOPT_TIMEOUT, 10);\ncurl_setopt($curl, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16\");\n$curlData = curl_exec($curl);\ncurl_close($curl);\nreturn $curlData;\n}", "protected function getData($url)\n {\n $cacheKey = md5($url);\n\n //check cache\n $data = $this->cache->get($cacheKey);\n\n if ($data === null) {\n\n //get raw\n $json = file_get_contents($url);\n $data = json_decode($json);\n\n //save to cache\n $this->cache->set($cacheKey, $data, 86400);\n }\n\n\n //return\n return $data;\n }", "function fetchUrl($url){\r\n\t\t$ch = curl_init($url);\r\n\t\t$useragent=\"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1\";\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 5);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt ($ch, CURLOPT_USERAGENT, $useragent);\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\treturn $data;\r\n\t}", "public function get($url);", "function getDATA($url) {\r\n // inisialisasi CURL\r\n $data = curl_init();\r\n $ip = $url;\r\n // $ip = $getRow['ipAddr'] . '' . $url;\r\n // setting CURL\r\n curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($data, CURLOPT_URL, $ip);\r\n\r\n // menjalankan CURL untuk membaca isi file\r\n $hasil = curl_exec($data);\r\n curl_close($data);\r\n return $hasil;\r\n}", "public function fetch($url);", "public function getInfo($url);", "public function getData($url) {\n\t\treturn simplexml_load_string($this->loadData($url));\n\t}", "function getData($url) {\n $xml = parseHTML($url);\n $storeIDs = getStoreIDs($xml);\n $addresses = getAddresses($xml);\n $phoneNumbers = getPhone($xml);\n $latitudes = getLatitudes($xml);\n $longitudes = getLongitudes($xml);\n $latLng = combineLatLng($latitudes, $longitudes);\n return organizeData($storeIDs, $addresses, $phoneNumbers, $latLng);\n}", "public function woo_slg_get_data_from_url( $url, $data = array(), $post = false ) {\n\t\t\t\n\t\t\t$result\t= wp_remote_retrieve_body( wp_remote_get( $url ) );\n\t\t\t\n\t\t\t$this->vk->_authJson\t= $result;\n\t\t\t\n\t\t\t// Decode the JSON request and remove the access token from it\n\t\t\t$data = json_decode( $result );\n\t\t\t\n\t\t\treturn $data;\n\t\t\t\n\t\t}", "function get_oembed_response_data_for_url($url, $args)\n {\n }", "function get_data($url) {\n $usrpwd = 'Contact CATA for access credentials';\n $ch = curl_init();\n $timeout = 15;\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERPWD,$usrpwd);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function curlData($url) {\n\t$ch = curl_init ();\n\n\t// setze die URL und andere Optionen\n\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\tcurl_setopt ( $ch, CURLOPT_HEADER, 0 );\n\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, TRUE );\n\n\t// führe die Aktion aus und speichere die Daten\n\t$result = curl_exec ( $ch );\n\t// schließe den cURL-Handle und gebe die Systemresourcen frei\n\tcurl_close ( $ch );\n\treturn (String) $result;\n}", "function get_data($url) {\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36\");\n curl_setopt($ch, CURLOPT_REFERER, \"https://www.youtube.com/\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function h_GET(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n if ($data) {\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n \n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($result, true);\n}", "public static function urlGetContent($URL){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $URL);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n }", "public function fetchUrl($url)\n {\n \n $response = array();\n $start = microtime(true);\n $response[\"request_uri\"] = $url;\n $headers = get_headers($url);\n $response[\"status_code\"] = substr($headers[0], 9,3);\n if ($response[\"status_code\"] == 200){\n $response[\"body\"] = @file_get_contents($url);\n } else {\n $response[\"body\"] = false;\n }\n\n // emulate content size header\n $response[\"headers\"][\"content-type\"] = finfo_buffer($this->finfo, $response[\"body\"], FILEINFO_MIME_TYPE);\n $response[\"headers\"][\"content-length\"] = strlen($response[\"body\"]);\n $end = $response[\"elapsed_time\"] = microtime(true);\n return $response;\n }", "function getDataFromUrl($url, $timeout = 7) {\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n\n return $data;\n }", "function url_get_contents($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL, $url);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "private function getData($url)\n {\n if(!is_writable(realpath(__DIR__))){\n die(\"[LiteBlogAPI] -> Please make my directory writable.\");\n }\n if(!file_exists(realpath(__DIR__) . \"/LiteBlogAPI/\")){\n mkdir(realpath(__DIR__) . \"/LiteBlogAPI/\");\n mkdir(realpath(__DIR__) . \"/LiteBlogAPI/cache/\");\n }\n $file = realpath(__DIR__) . \"/LiteBlogAPI/cache/\" . md5($url) . \".json\";\n if(file_exists($file) && time() - $this->cacheTime < filemtime($file)){\n return file_get_contents($file);\n }\n if(function_exists('curl_version')) {\n $data = $this->curl($url);\n file_put_contents($file, $data);\n return $data;\n } else {\n $data = file_get_contents($url);\n file_put_contents($file, $data);\n return $data;\n }\n }", "function ReadURL($URL)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $URL);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function get_data_from_oembed($_url) {\n\n $data0 = file_get_contents($_url);\n $data = json_decode($data0, true);\n\n return $data;\n}", "function getRequest($url) {\n // url to GET info for this table\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n if (curl_errno($ch)) { // Check if any error occurred\n echo 'Curl error: ' . curl_error($ch);\n }\n curl_close($ch); // close curl resource to free up system resources\n $res = json_decode($output, true); // json to array\n return $res;\n }", "function getJson($url)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_USERAGENT, 'www.paddez.com/lastfm/');\n curl_setopt($curl, CURLOPT_FAILONERROR, true);\n $response = curl_exec($curl);\n\n if($response == false || curl_errno($curl))\n {\n \t$info = curl_getinfo($curl);\n \tcurl_close($curl);\n\timagepng(errorImage(curl_error($curl)));\n\terror_log(\"Error: \".curl_error($curl));\n \tdie('Error: '.curl_error($curl));\n\n }\n\n curl_close($curl);\n return ($response);\n}", "public function loadData($url) {\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->baseUrl . $url);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->username . ':' . $this->password);\n\t\t@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\n\t\tif ($this->debug) {\n\t\t\techo \"Fetch: \" . $url;\n\t\t}\n\n\t\t$result = curl_exec($ch);\n\n\t\tcurl_close($ch);\n\n\t\tif ($this->debug) {\n\t\t\techo \"Fetch-Result: \" . $result;\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function http__request__get_content($url ){\n return static::http__request( $url, array(), 'get dont_split_to_array');\n }", "public function Get( $sUrl );", "function fetchUrl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n $retData = curl_exec($ch);\n curl_close($ch); \n \n return $retData;\n}", "function get_url_content($request)\n\t\t{\n\t\t$ch = curl_init($request);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\treturn curl_exec($ch);\n\t\t}", "public function collectData($url) {\n\t\t\t\n\t\t}", "private function getFromApi( $url ){\n\n\t\t$content = file_get_contents( $url );\n\t\tif( $content ){\n\t\t\treturn json_decode($content, true);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\n\t}", "abstract function getdata();", "function getContents($url) {\n // $url = \"http://jayasuryapinaki.me/actions/getAllProducts.php\";\n\n // Initialize a CURL session.\n $ch = curl_init();\n\n // Return Page contents.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //grab URL and pass it to the variable.\n curl_setopt($ch, CURLOPT_URL, $url);\n\n //$result = curl_exec($ch);\n\n $testing = file_get_contents($url);\n\n\n // var_dump(json_decode($testing, true));\n\n $response = json_decode($testing, true);\n\n return $response;\n }", "private function just_curl_get_data($url,$data)\n {\n \n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n\n }", "function fetch_url($url) {\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 120);\n\t$file_get_contents = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $file_get_contents;\n}", "function curl_get_contents($url)\n {\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n $data = curl_exec($curl);\n curl_close($curl);\n return $data;\n }", "function get_content($url) {\n preg_match('/^([^?]+)(\\?path.*?)?(&content.*)?$/', $url, $matches);\n if (isset($matches[3])) {\n\t\tparse_str(substr($matches[3], 1), $content);\n\t} else {\n\t\t$content = '';\n\t}\n return $content['content'];\n}", "function url_get_contents($Url) {\n if (!function_exists('curl_init')){ \n die('CURL is not installed!');\n }\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $Url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}", "function json_parse($url) {\n $fileContents = url_get_contents($url);\n $data = json_decode($fileContents,true);\n return $data;\n}", "private function getDataByGet($params){\n \tforeach($params as $key=>$val){\n \t\t$s .= \"&\".$key.\"=\".$val;\n \t}\n \t$val = file_get_contents($this->url.\"?\".substr($s,1));\n \treturn $val;\n }", "public function getWebContent($url) {\r\n\t\tsleep(rand(3,7));\r\n\t\tif(function_exists('curl_init')) {\r\n\t\t\t$ch = curl_init();\r\n\t\t\t$userAgent = \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)\";\r\n\t\t\tcurl_setopt($ch, CURLOPT_USERAGENT, $userAgent);\r\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 300);\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t\t$contents = curl_exec($ch);\r\n\t\t\tcurl_close($ch);\r\n\t\t} else {\r\n\t\t\t$contents = file_get_contents($url);\r\n\t\t}\r\n\t\t\r\n\t\treturn $contents;\r\n\t}", "function get_url_content($request)\n\t\t{\n\t\t\treturn file_get_contents($request);\n\t\t}", "public function get($url, $data = array()) {\n\t\treturn $this->request($url, $data, false);\n\t}", "function getDataFromLajifi($url) {\n $responseJSON = file_get_contents($url);\n if ($responseJSON === FALSE) {\n $errorMessage = \"Error fetching data from api.laji.fi\";\n// logger(\"lajifi.log\", \"error\", $errorMessage);\n exit($errorMessage);\n }\n return $responseJSON;\n}", "function urlResponse($url) {\n $headers = get_headers($url);\n return substr($headers[0],9, 3);\n }", "private static function get_external_content( $url )\n\t{\n\t\t$call = new RemoteRequest( $url );\n\t\t$call->set_timeout( 5 );\n\t\t$result = $call->execute( );\n\t\tif ( Error::is_error( $result ) ) {\n\t\t\tthrow Error::raise( _t( 'Unable to contact Flickr.', 'flickrfeed' ) );\n\t\t}\n\t\treturn $call->get_response_body( );\n\t}", "public function get($url, $params);", "function fetchPage($url)\r\n\t{\r\n\t\t$url_parsed = parse_url($url);\r\n\t\t$host = $url_parsed[\"host\"];\r\n\t\t$port = $url_parsed[\"port\"];\r\n\t\tif ($port==0)\r\n\t\t\t$port = 80;\r\n\t\t$path = $url_parsed[\"path\"];\r\n\r\n\t\tif (empty($path))\r\n\t\t$path=\"/\";\r\n\r\n\t\t//add on any query string\r\n\t\tif ($url_parsed[\"query\"] != \"\")\r\n\t\t\t$path .= \"?\".$url_parsed[\"query\"];\r\n\r\n\t\t//open the socket and send our HTTP request\r\n\t\t$fp = fsockopen($host, $port, $errno, $errstr, 30);\r\n\t\tif ($fp)\r\n\t\t{\r\n\t\t\t$out = \"GET $path HTTP/1.0\\r\\nHost: $host\\r\\n\\r\\n\";\r\n\t\t\tfwrite($fp, $out);\r\n\r\n\t\t\twhile (!feof($fp))\r\n\t\t\t{\r\n\t\t\t\t$output=fgets($fp, 255);\r\n\t\t\t\t$content.=$output;\r\n\r\n\t\t\t\t//determine whether we have reached the end of the header section\r\n\t\t\t\tif (!isset($header))\tif($output==\"\\n\" || $output == \"\\r\\n\" || $output == \"\\n\\l\")\r\n\t\t\t\t{\r\n\t\t\t \t$header = $content;\r\n\t\t\t\t\t$content = '';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfclose($fp);\r\n\r\n\t\t\treturn array(\"headers\" => $this->getHeaders($header), \"content\" => $content);\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn array(\"error\" => \"Unable to open a connection\");\r\n\t}", "private function getContent($url)\n {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n $data = curl_exec($ch);\n curl_close($ch);\n\n $header = substr($data, 0, strpos($data, '<') - 2);\n // get the status code of the http response\n $status = substr($header, 9, 3);\n\n if ('200' === $status) {\n return ['url' => $url,\n 'data' => substr($data, strlen($header) + 2)];\n } // moved -> call right url\n else if ('3' === substr($status, 0, 1)) {\n $start = strpos($header, 'Location: ') + 10;\n $url = substr($header, $start, strpos($header, chr(10), $start) - $start - 1);\n return $this->getContent($url);\n } // error\n else {\n return null;\n }\n }", "function curl_get_contents($url)\n\t{\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);\n\t\t$data = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $data;\n\t}", "public function getDetail($url, &$data)\n {\n// $rows = $this->curlGet($url);\n// if (isset($rows['paging'])) {\n// $p = $rows['paging'];\n// $is_end = $p['is_end'];\n// $next = $p['next'];\n//\n// if ($data) {\n// foreach ($data as $key => $val) {\n// array_push($rows['data'], $val);\n// }\n// }\n// $data = $rows['data'];\n//\n// if (!$is_end && $next) {\n// return $this->getDetail($next, $data);\n// }\n// }\n// return $data;\n }", "public function getContent($url) {\n $data = @file_get_contents($url);\n $data = json_decode($data, true);\n if ($data == null) {\n return 'Check api key, please!';\n }\n if (!$data['status']) {\n return $data['data'];\n } else {\n return $data['message'];\n }\n }", "function getUrl();", "public function get($url) {\n $request = $this->getRequest($url, HttpRequest::METH_GET);\n try {\n // this could be parametrized using optional options interface\n $options = array(\n 'useragent' => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; MS-RTC LM 8)\",\n 'connecttimeout' => 120, // timeout in seconds on connect \n 'timeout' => 120, // timeout in seconds on response \n 'redirect' => 5, // stop after 5 redirects\n 'compress' => true, // allow compression or not\n 'referer' => \"https://www.google.com/#output=search&sclient=psy-ab&q=jachty&fp=1\",\n );\n $request->setOptions($options);\n $request->send();\n } catch (Exception $e) {\n throw new Exception('Loading failed with exception', $request->getResponseCode(), $e);\n }\n $code = $request->getResponseCode();\n $body = $request->getResponseBody();\n\n // make sure we did not fail\n if ($code >= 500) {\n throw new Exception('Error response code recieved: ' . $body, $code);\n } elseif ($code >= 400) {\n throw new Exception('Permanent failure' . $body, $code);\n } elseif (trim($body) == '') {\n throw new Exception('Empty response', $code);\n }\n\n return $body;\n }", "function url_get_contents ($url) {\n if (!function_exists('curl_init')){ \n die('CURL is not installed!'); //Curl will return a false bool and die here if CURL is not enabled.\n }\n $ch = curl_init(); //Return curl handle\n curl_setopt($ch, CURLOPT_URL, $url); //The URL to fetch\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //Return curl contents as opposed to dumping\n\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate,sdch'); //set encoding\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); //follow redirects\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 0); //I don't know some shit\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0\");\n\n $output = curl_exec($ch);\n\t\n\tif (FALSE === $output)\n throw new Exception(curl_error($ch), curl_errno($ch));\n\t\n curl_close($ch); //Close handle\n return $output; //Return contents\n}", "function get_data($url) {\n\t\t//add URL to list\n\t\tfile_put_contents('urls-'.date(\"Y-m-d\").'-citeit.txt', $url.\"\\n\", FILE_APPEND);\n\t\t//end adding URL to list\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch,CURLOPT_CONNECTIONTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "function file_get_contents_curl($url) {\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\n $data = curl_exec($ch);\n curl_close($ch);\n\n return $data;\n }", "public static function get($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n $data = curl_exec($ch);\n curl_close($ch);\n\n return $data;\n }", "function getUrl($url) {\n\t$ch = curl_init();\n curl_setopt($ch,CURLOPT_MAXCONNECTS,100);\n curl_setopt($ch,CURLOPT_CLOSEPOLICY,CURLCLOSEPOLICY_LEAST_RECENTLY_USED);\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_MAXREDIRS,10);\n curl_setopt($ch,CURLOPT_HEADER,0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch,CURLOPT_TIMEOUT,30);\n curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);\n curl_setopt($ch,CURLOPT_HTTPGET,1);\n $data = curl_exec($ch);\n curl_close($ch);\n \n return $data;\n}", "public function getURLData()\r\n\t{\r\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\r\n\t\tself::$urlPath = $urldata;\r\n\t\tif( $urldata == '' )\r\n\t\t{\r\n\t\t\tself::$urlBits[] = 'home';\r\n\t\t\tself::$urlPath = 'home';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data = explode( '/', $urldata );\r\n\t\t\twhile ( !empty( $data ) && strlen( reset( $data ) ) === 0 ) \r\n\t\t\t{\r\n\t\t \tarray_shift( $data );\r\n\t\t }\r\n\t\t while ( !empty( $data ) && strlen( end( $data ) ) === 0) \r\n\t\t {\r\n\t\t array_pop($data);\r\n\t\t }\r\n\t\t\tself::$urlBits = $this->array_trim( $data );\r\n\t\t}\r\n\t}", "public static function read($url)\n\t{\n\t\treturn json_decode(file_get_contents($url), true);\n\t}", "public function fetchResult($url);", "public function obtenerURLData(){\n\t\t$urldata = (isset($_GET['page'])) ? $_GET['page'] : '' ;\n\t\tself::$urlPath = $urldata;\n\t\tif($urldata == ''){\n\t\t\tself::$urlBits[] = 'home';\n\t\t\tself::$urlPath = 'home';\n\t\t}else{\n\t\t\t$data = explode('/', $urldata);\n\t\t\twhile (!empty($data) && strlen(reset($data)) === 0){\n\t\t \tarray_shift( $data );\n\t\t }\n\t\t while (!empty($data) && strlen(end($data )) === 0){\n\t\t array_pop($data);\n\t\t }\n\t\t\tself::$urlBits = $this->array_trim( $data );\n\t\t}\n\t}", "private function _get($url) {\n\t\t$ch = curl_init ();\n\t\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)' );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_TIMEOUT, 5 );\n\t\t$data = curl_exec ( $ch );\n\t\t$httpcode = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close ( $ch );\n\t\treturn ($httpcode >= 200 && $httpcode < 300) ? $data : false;\n\t}", "function fetch($url){\n curl_setopt($this-> ch,CURLOPT_URL, $url);\n curl_setopt($this-> ch,CURLOPT_COOKIE, \"./cookie.txt\"); \n curl_setopt($this-> ch,CURLOPT_FOLLOWLOCATION, true);\n return $this-> html = curl_exec($this-> ch);\n }", "function make_get_call($mid_url) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_HEADER, false);\n \n $output = json_decode(curl_exec($curl));\n curl_close($curl);\n \n return $output;\n }", "public function getURL($url)\n {\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HEADER, 1);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 0);\n\n $response = curl_exec($curl);\n $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\n $ret = array(\n 'header' => mb_substr($response, 0, $header_size),\n 'content' => mb_substr($response, $header_size),\n );\n curl_close($curl);\n return $ret;\n }", "protected function getUrlData($url)\n {\n $websiteContent = Helper::curl($url);\n\n $parseUrl = parse_url($url);\n $websiteTitle = $parseUrl['host'];\n $searchQuery = !empty($parseUrl['query']) ? $parseUrl['query'] : '';\n $favicon = asset('assets/images/web.png');\n $image = null;\n\n if ($websiteContent['body']) {\n\n $htmlDom = new \\DOMDocument();\n @$htmlDom->loadHTML($websiteContent['body']);\n\n $websiteTitle = $htmlDom->getElementsByTagName('title')->item(0)->nodeValue;\n\n\n // Get the favicon\n $domLinks = $htmlDom->getElementsByTagName('link');\n\n // Loop through all the link tags\n foreach($domLinks as $link) {\n\n // Check for links that has these attributes\n if($link->getAttribute('rel') == 'icon' || $link->getAttribute('rel') == \"Shortcut Icon\" || $link->getAttribute('rel') == \"shortcut icon\") {\n\n $favicon = $link->getAttribute('href');\n\n // check if absolute url or relative path\n $faviconPath = parse_url($favicon);\n\n if( ! isset($faviconPath['host']) )\n $favicon = $parseUrl['scheme'] . '://' . $parseUrl['host'] . '/' . $favicon;\n\n }\n }\n\n foreach($htmlDom->getElementsByTagName('meta') as $meta) {\n\n if($meta->getAttribute('property')=='og:image'){\n\n $image = $meta->getAttribute('content');\n }\n }\n\n }\n\n $iframeCheck = ( isset($websiteContent['headers'][\"x-frame-options\"]) ? 1 : null);\n\n $result = array(\n 'iframe_blocked' => $iframeCheck,\n 'link_title' => $websiteTitle,\n 'favicon' => $favicon,\n 'image' => $image,\n 'searchQuery' => $searchQuery\n );\n\n return $result;\n }", "public function get($url, $data = array())\n {\n $client = $this->getClient($url);\n $request = $client->get($url, array(), array('query' => $data));\n return $this->send($request);\n }", "public static function Get($url)\r\n {\r\n return self::doRequest('GET', $url);\r\n }", "function getdata( $url, $authinfo, $javascript_loop = 0, $timeout = 0, $postdata = \"\" ) {\n\n\t\t$url = str_replace( \"&amp;\", \"&\", urldecode(trim($url)) );\n\n\t\t$ch = curl_init();\n\n\n\n\t\t$fields = '';\n\n\t\tif (!empty($postdata)) {\n\n\t\t\tforeach($postdata as $key => $value) { \n\n\t\t\t\t$fields .= ($fields==''?'?':'&').$key . '=' . $value; \n\n\t\t\t}\n\n\n\n\t\t\tcurl_setopt($ch,CURLOPT_POST, count($postdata));\n\n\t\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS, urlencode($fields));\n\n\t\t}\n\n\n\n\t\tcurl_setopt( $ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\" );\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $url);\n\n\t\t\t\n\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_ENCODING, \"\");\n\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls\n\n\t\tcurl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );\n\n\t\n\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, TRUE);\n\n\t\t\n\n\t\t$headers = array(\n\n\t\t \"Expect:\",\n\n\t\t \"X-ApiKey: 95074c8fb639b45aa0acc4c23bc7c4d2\",\n\n\t\t \"Authorization: Basic \".$authinfo\n\n\t\t);\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers); \n\n\t\t\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = curl_getinfo( $ch );\n\n\t\tcurl_close ( $ch );\n\n\t\n\n\t\tif ($response['http_code'] == 301 || $response['http_code'] == 302)\t\t{\n\n\t\t\tini_set(\"user_agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\");\n\n\t\n\n\t\t\tif ( $headers = get_headers($response['url']) ) {\n\n\t\t\t\tforeach( $headers as $value ) {\n\n\t\t\t\t\tif ( substr( strtolower($value), 0, 9 ) == \"location:\" )\n\n\t\t\t\t\t\treturn get_url( trim( substr( $value, 9, strlen($value) ) ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\n\n\t\tif ( ( preg_match(\"/>[[:space:]]+window\\.location\\.replace\\('(.*)'\\)/i\", $content, $value) || preg_match(\"/>[[:space:]]+window\\.location\\=\\\"(.*)\\\"/i\", $content, $value) ) &&\n\n\t\t\t\t$javascript_loop < 5 ) {\n\n\t\t\treturn getdata( $value[1], $authinfo, $javascript_loop+1 );\n\n\t\t} else {\n\n\t\t\treturn array( $content, $response );\n\n\t\t}\n\n\t}", "public function getData($url)\n {\n\n\n if( isset($_SESSION['accessToken']) && !empty($_SESSION['accessToken']) )\n {\n\n $accessToken = $_SESSION['accessToken'];\n\n try {\n\n\n // Returns a `Facebook\\FacebookResponse` object\n $response = $this->fb->get($url, $accessToken);\n\n\n } catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\n unset($_SESSION['accessToken']);\n return redirect('login');\n\n } catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\n unset($_SESSION['accessToken']);\n return redirect('login');\n\n }\n\n\n return $response;\n\n\n }\n\n\n }", "function getContentUrl($url){\n return $url[1];\n\t}", "protected function fetchUrl($url) {\n if ($this->config['retrMethod'] == 'curl') {\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $html = curl_exec($ch);\n curl_close($ch);\n\n if (function_exists('utf8_decode')) {\n $html = utf8_decode($html);\n }\n } else {\n $html = file_get_contents($url);\n }\n\n return $html;\n }", "protected function fetchContent($url)\n {\n return (string) $this->httpAdapter->get($url)->getBody();\n }", "public static function getUrl($url)\n\t\t{\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); //no ssl\n\t\t\t$output = curl_exec($ch);\n\t\t\tcurl_close($ch); \n\t\t\treturn $output;\n\t\t}", "function doCurl($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $data = json_decode(curl_exec($ch), true);\n curl_close($ch);\n return $data;\n }", "private function get_url_data($url, $internal_call_count=0){\r\n //$url = str_replace('access_token=','access_token2=',$url); // for force error testing\r\n log_message('info', basename(__FILE__).' : '.'get_url_data fetching: '.$url. ' no. of try: '.($internal_call_count+1));\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 600); // originally 5 secs\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER,array('Connection: close'));\r\n $tmp = curl_exec($ch);\r\n $http_ret_code=curl_getinfo($ch, CURLINFO_HTTP_CODE).'';\r\n curl_close($ch); \r\n\r\n $tmp_data=@json_decode($tmp); \r\n\r\n if(\r\n ($http_ret_code!='200') ||\r\n ($tmp=='') ||\r\n isset($tmp_data->error)\r\n )\r\n {\r\n log_message('debug', basename(__FILE__).' : '.'get_url_data fetching error: '.$tmp.' return status code: '.$http_ret_code.' for url: '.$url);\r\n\r\n $internal_call_count++;\r\n if($internal_call_count<3)\r\n {\r\n sleep(3);\r\n return $this->get_url_data($url,$internal_call_count);\r\n } \r\n }\r\n\r\n return $tmp; \r\n }", "function _http_get_json($url, array $data = null) {\n if ($data !== null)\n $url = _http_inject_url($url, $data);\n\n $response = _http_signed_request(COVER_APP, COVER_SECRET, $url);\n\n if (!$response)\n throw new Exception('No response');\n\n $data = json_decode($response);\n\n if ($data === null)\n throw new Exception('Response could not be parsed as JSON: <pre>' . htmlentities($response) . '</pre>');\n\n return $data;\n}", "private function request($url) {\n\t\t$ch = curl_init();\n\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n \t\t$response = curl_exec($ch);\n\t\t// TODO: Some processing here\n\t\t$response = json_decode($response);\n\t\treturn $response;\n\t}" ]
[ "0.76066136", "0.74832153", "0.74591416", "0.73890436", "0.7288517", "0.71284735", "0.71260417", "0.70423603", "0.701922", "0.69356066", "0.69270545", "0.6912051", "0.6908624", "0.6897053", "0.68633246", "0.6840602", "0.6799457", "0.67766845", "0.67423165", "0.6731993", "0.6731232", "0.67253995", "0.672114", "0.66796863", "0.66731566", "0.6649972", "0.6630145", "0.66033375", "0.6600694", "0.65502816", "0.65466875", "0.65388036", "0.6537353", "0.64977163", "0.64637566", "0.645499", "0.6449704", "0.6432431", "0.642037", "0.64129746", "0.64000934", "0.6371529", "0.6370002", "0.6368314", "0.6324042", "0.6319766", "0.6293228", "0.62763053", "0.6275058", "0.62642187", "0.6259524", "0.62474436", "0.6237859", "0.6232541", "0.62281483", "0.62208027", "0.62185425", "0.62133974", "0.62124586", "0.62097704", "0.62008727", "0.6200447", "0.6198012", "0.6195428", "0.619237", "0.61842173", "0.61733025", "0.61694574", "0.6165573", "0.6153013", "0.6152463", "0.6138085", "0.6135886", "0.61228794", "0.611908", "0.61123145", "0.6110154", "0.6096985", "0.60801816", "0.6079088", "0.60756457", "0.6062268", "0.6060933", "0.605216", "0.605058", "0.6048908", "0.60485625", "0.60478306", "0.6046257", "0.60396475", "0.60388917", "0.6029684", "0.6025086", "0.6010934", "0.60073316", "0.599551", "0.59932774", "0.59909886", "0.5985095", "0.59810936" ]
0.7059316
7
/////////////////////////////////////////////////////////////////// Get total product count
public static function getTotalProductCount() { Db_Actions::DbSelect("SELECT COUNT(id) FROM cscart_products"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductCount()\n {\n $count = 0;\n \tforeach ($this->getItems() as $item) {\n \t $count += $item['count'];\n \t}\n \treturn $count;\n }", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "public function getCountProduct()\n {\n return $this->product_model->countAll();\n }", "public function getProductCount()\n {\n return count($this->products);\n }", "public function count()\n {\n $count = 0;\n foreach($this->_data as &$product) {\n $count += $product['quantity'];\n }\n\n\t\treturn $count;\n\t}", "public function numberOfProducts(){\n if (!$this->cart_id){\n return 0;\n }\n return JeproshopCartModelCart::getNumberOfProducts($this->cart_id);\n }", "public function ProductCount()\n {\n return Products::count();\n }", "public function getNumProducts()\n {\n return $this->numProducts;\n }", "function getProductCount($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/count.json' , $params ),true);\n\t}", "public function getProductsCount()\n\t{\n\t\tif ($this->hasData('products_count')) {\n\t\t\treturn $this->getData('products_count');\n\t\t}\n\n\t\tif (null === $this->getData('products_count')) {\n\t\t\t$this->setData('products_count', self::DEFAULT_PRODUCTS_COUNT);\n\t\t}\n\n\t\treturn $this->getData('products_count');\n\t}", "public function countProduct(){\n return count(Product::all());\n }", "public function getProductTotalCount($productData) {\n if (isset ( $productData ['sku'] )) {\n return count ( $productData ['sku'] );\n }\n }", "public function NumOfProducts()\n {\n return Product::all()->count();\n }", "public function getProductsCount()\n {\n if (null === $this->_productsCount) {\n $this->_productsCount = self::DEFAULT_PRODUCTS_COUNT;\n }\n return $this->_productsCount;\n }", "public function getAllProductsCount()\n {\n\n return $this->all()->count();\n }", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public function totalCount();", "public function totalCount();", "public function getProNumRows()\n {\n return $this->db->count_all('products');\n }", "public function getTotalQuantity()\n {\n $quantity = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $quantity = $quantity + $basketProduct->getQuantity();\n }\n }\n \n return $quantity;\n }", "public static function getOrderedProductsQuantity(): string\n {\n $query = new Query();\n $total = $query->select([\n 'COUNT(*) as total'\n ])\n ->from(['sale_items'])\n ->where([\n 'customer_auth_id' => Yii::$app->user->identity->id,\n 'sale_id' => 0\n ])\n ->scalar();\n\n return $total;\n }", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}", "public function count() {\n\n // query to count all product records\n $query = \"SELECT count(*) FROM $this->table_name\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n // get row value\n $rows = $stmt->fetch(PDO::FETCH_NUM);\n\n // return count\n return $rows[0];\n }", "public function getTotalCount()\n {\n $this->loadItems();\n return $this->calculator->getCount($this->items);\n }", "public function getBasketProductsCount(): int\n\t{\n\t\tif ($this->basketProducts === null) {\n\t\t\t$this->getBasketProducts();\n\t\t}\n\n\t\treturn $this->basketProductsCount;\n\t}", "public function getCartVolume() {\n $product_total = 0;\n\n $products = $this->getProducts();\n\n foreach ($products as $product) {\n //$product_total += $product['quantity'];\n $product_total += $product['quantity'];\n }\n\n return $product_total;\n }", "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productstable = $oostable['products'];\n $products_to_categoriestable = $oostable['products_to_categories'];\n $products = $dbconn->Execute(\"SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '\" . intval($category_id) . \"'\");\n\n $products_count += $products->fields['total'];\n\n return $products_count;\n}", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function getProductItemCounts()\n {\n if (array_key_exists(\"productItemCounts\", $this->_propDict)) {\n if (is_a($this->_propDict[\"productItemCounts\"], \"\\Microsoft\\Graph\\Model\\KeyValuePair\") || is_null($this->_propDict[\"productItemCounts\"])) {\n return $this->_propDict[\"productItemCounts\"];\n } else {\n $this->_propDict[\"productItemCounts\"] = new KeyValuePair($this->_propDict[\"productItemCounts\"]);\n return $this->_propDict[\"productItemCounts\"];\n }\n }\n return null;\n }", "public function total(): int\n {\n return Arr::get($this->meta, 'total', $this->count());\n }", "public function getTotalCount()\n {\n return $this->totalCount;\n }", "public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }", "public function totalAmountOfShops()\n {\n return Shop::getTotalAmountOfShops();\n\n }", "function sizeCart(){\n\t\t//return array_sum($this->articulos);\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$cantidad = $book['cantidad'];\n\t\t\t$sum += $cantidad;\n\t\t}\n\t\t\n\t\treturn $sum;\n\t}", "public static function itemCount() {\n\t\t$items = self::current('products');\n\t\t\n\t\t// count(false) == 1? Seriously, PHP? -_-\n\t\tif($items !== false and empty($items)) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\treturn count(self::items());\n\t}", "public function getTotalCount()\n\t{\n\t\treturn $this->totalCount;\n\t}", "public function getBasketPrice(){\n $sum = 0;\n foreach ($this->products as $i => $product) {\n $sum += $product->price * $product->count;\n }\n return $sum;\n }", "public function get_total_items()\n {\n $num = 0;\n\n if (isset($_SESSION['cart'])) {\n foreach ($_SESSION['cart'] as $item) {\n $num = $num + $item;\n }\n }\n return $num;\n }", "public function getCountOfProduct(timpanyProductInterface $product)\n {\n return $this->_items[$product->getIdentifier()]['count'];\n }", "public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n $total += ($item->Quantity) ? $item->Quantity : 1;\n }\n\n return $total;\n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "protected function get_total_count() {\n\t\treturn affiliate_wp()->utils->data->get( \"{$this->batch_id}_total_count\", 0 );\n\t}", "public function get_total_items()\n\t{\n\t\t$num = 0;\n\t\t\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\tforeach($_SESSION['cart'] as $item)\n\t\t\t{\n\t\t\t\t$num = $num + $item;\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = array_reduce($items->all(), function ($a, ItemCollection $item) {\n return $a += $item->quantity;\n }, 0);\n\n return $count;\n }", "public function countProducts()\n {\n $count = 0;\n foreach($this->products as $product) {\n /** @var ProductAbstract $product */\n switch ($product->getRequiredData()->getType()) {\n case DataAbstract::TYPE_CONFIGURABLE:\n /** @var Configurable $product */\n if (method_exists($product, 'getSimpleProducts')) {\n foreach ($product->getSimpleProducts() as $simple) {\n /** @var Simple $simple */\n $count++;\n }\n }\n $count++;\n break;\n default:\n $count++;\n break;\n }\n }\n\n return $count;\n }", "public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_source_id))) {\n $qty += $inventory->qty;\n }\n }\n\n $orderedInventory = $this->product->ordered_inventories\n ->where('channel_id', $this->channel->id)->first();\n\n if ($orderedInventory) {\n $qty -= $orderedInventory->qty;\n }\n\n return $qty;\n }", "function get_total_prod_count($type, $modifiedAfter = null)\n\t{\n\t\t$collection = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('type_id', $type);\n\t\t\t\t\t\t\n\t\tif (!empty($modifiedAfter)) {\n\t\t\t$collection->addAttributeToFilter('updated_at', array('gteq' => $modifiedAfter));\n\t\t}\n\t\treturn $collection->getSize();\n\t}", "public static function count_product_ids() {\r\n\r\n\t\t\tif ( false === $count_product_ids = get_transient( 'cptpro_number_of_product_ids' ) ) {\r\n\r\n\t\t\t\t$count_product_ids = count( YIKES_Custom_Product_Tabs_Pro_Admin::fetch_all_product_ids() );\r\n\r\n\t\t\t\tset_transient( 'cptpro_number_of_product_ids', $count_product_ids, 10 * MINUTE_IN_SECONDS );\r\n\t\t\t}\r\n\r\n\t\t\treturn $count_product_ids;\r\n\t\t}", "public function getCountProducts(){\n global $connect;\n $query = $connect->PDO->prepare(\"SELECT count(id) FROM `pagTab`\");\n $query->execute();\n $row = $query->fetchAll();\n return $row;\n }", "function similarProductCount()\n {\n if($this->soap)\n return count($this->soap['SimilarProducts']);\n else\n return count($this->similarProducts);\n }", "static public function getTotalCount()\n\t{\n\t\treturn self::$count;\n\t}", "public function count() {\r\n\r\n return $this->total_size;\r\n\r\n }", "public function getPriceCount() {\n return $this->count(self::PRICE);\n }", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public static function totalNumber()\n {\n return (int)self::find()->count();\n }", "public function getShopCount()\n {\n return $this->count(self::_SHOP);\n }", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function getNumTotalItems()\n {\n return $this->numTotalItems;\n }", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "function getRowCount() {\n\t\t$saleData = $this->getProducts();\n\t\t$saleSize = sizeof($saleData);\n\t\treturn $saleSize -=1;\n\t}", "function count_products()\n\t{\t\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\t\t\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->total_number_of_search_results = 0;\n\t\t\t\n\t\t\treturn $this->total_number_of_search_results;\n\t\t}\n\t\t\t\n\t\t//Find the total number of search results\n\t\t$count_search_results_sql = '\n\t\t\t\tSELECT COUNT(*) ' .\n\t\t\t\t'FROM (SELECT DISTINCT product.id FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY product.id) AS product_count';\n\t\t\n\t\t$this->total_number_of_search_results = $this->_db->get_first_cell($count_search_results_sql);\n\t\n\t\treturn $this->total_number_of_search_results;\n\t}", "protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = $items->sum(function ($item) {\n return $item['quantity'];\n });\n\n return $count;\n }", "public function total(): int\n {\n return count($this->all());\n }", "function get_count() {\n\t\t$count=0;\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute(\"select count(pr_id) as num from \".$this->_db_table);\n\t\tif (!$rs) {\n\t\t\tprint $db->ErrorMsg();\n\t\t} else {\n\t\t\t$count = $rs->fields[\"num\"];\n\t\t}\n\t\treturn $count;\n\t}", "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($order1, true));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, false));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, true));\n }", "public function getTotalCount()\n {\n return $this->provider->totalCount;\n }", "public function modelTotalRecord(){\n\t\t\t$total = DB::rowCount(\"select id from products\");\n\t\t\treturn $total;\n\t\t}", "abstract public function countTotal();", "public function total_sold()\n\t{\n\t\t$sold = self::$_ci->cart_item_m->count_by(array('status' => 'pg-success'));\n\t\t\n\t\treturn (int) $sold;\n\t\t\n\t}", "public function TotalItems()\n {\n return $this->getTotalItems();\n }", "public function getProductQuantity()\n {\n }", "private function CountProductsAction($dom)\n {\n $nbProducts = 0;\n $rows = $dom->documentElement->getElementsByTagName('row');\n $nbProducts = $rows->length;\n// foreach($dom->documentElement->getElementsByTagName('row') as $zRow)\n// {\n// $nbProducts++;\n// }\n return $nbProducts;\n }", "public function list_items_total()\n\t{\n\t\t$cnt = $this->list_items(NULL, NULL, NULL, NULL, TRUE);\n\t\tif (is_array($cnt))\n\t\t{\n\t\t\treturn count($cnt);\n\t\t}\n\t\treturn $cnt;\n\t}", "public function count()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n }, 0);\n }", "public function getTotalQuantity()\n {\n $quantity = 0;\n foreach ($this->order_configurations as $config) {\n $quantity += $config->quantity;\n }\n return $quantity;\n }", "public function get_total()\n\t{\n\t\t$query = $this->query;\n\t\tif(isset($query['order']))\n\t\t\t$query['order'] = $this->model->table() . '.id';\n\t\treturn $this->model->count($query);\n\t}", "public function getTotalItems()\n\t{\n\t\treturn $this->totalItems;\n\t}", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "function fetchTotalObjectCount()\n {\n $db = eZDB::instance();\n $objectCount = array();\n $objectCount = $db->arrayQuery( \"SELECT COUNT(*) AS count FROM ezcontentobject\" );\n $totalObjectCount = $objectCount[0][\"count\"];\n return $totalObjectCount;\n }", "public function record_count() {\n $count = $this->db->count_all('product');\n return $count;\n }", "public function getTotalItemCount()\n {\n return $this->totalItemCount;\n }", "public function getNbProd()\n {\n return $this->CollProduit->taille();\n }", "public function getTotalCount()\n {\n return $this->readOneof(9);\n }", "public function count(): int\n {\n return $this->content()->sum('quantity');\n }" ]
[ "0.90284467", "0.8108571", "0.8093267", "0.8035205", "0.7779086", "0.77560496", "0.77557915", "0.76248777", "0.76099056", "0.7558842", "0.75444514", "0.753077", "0.75024605", "0.74686164", "0.74683267", "0.74584734", "0.735191", "0.735191", "0.7341474", "0.73247087", "0.7277171", "0.7277068", "0.7214189", "0.7203048", "0.7199394", "0.71927464", "0.7190162", "0.71771276", "0.7176101", "0.7172954", "0.7161696", "0.71532625", "0.7146661", "0.7141323", "0.7139671", "0.71377975", "0.71323186", "0.711078", "0.71027154", "0.710235", "0.7086518", "0.7086518", "0.7086518", "0.7085182", "0.7054591", "0.7046487", "0.70398605", "0.7036509", "0.70274", "0.7015042", "0.7014901", "0.70040727", "0.6993225", "0.6986484", "0.69661826", "0.69452965", "0.6944223", "0.69431525", "0.694137", "0.69253355", "0.69203764", "0.691687", "0.6911726", "0.68969506", "0.6896105", "0.68928057", "0.6887177", "0.6863574", "0.6852847", "0.684864", "0.6842624", "0.684111", "0.68405145", "0.68363994", "0.6822721", "0.681547", "0.68049884", "0.6804442", "0.6803462", "0.6797905", "0.6795672", "0.67919433", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.6791776", "0.67903674", "0.6780762", "0.677859", "0.67700386", "0.6754415", "0.67505074" ]
0.83563393
1
/////////////////////////////////////////////////////////////////// Get all top level categories
public static function getCategories() { $top_level_cats = array(); //Select all top level categories Db_Actions::DbSelect("SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0"); $result = Db_Actions::DbGetResults(); if (!isset($result->empty_result)) { foreach ($result as $cat) { $top_level_cats[] = array('id' => $cat->category_id, 'cat_name' => $cat->category, 'company_id' => $cat->company_id, 'status' => $cat->status, 'product_count' => $cat->product_count, 'is_op' => $cat->is_op, 'usergroup_ids' => $cat->usergroup_ids); } } if (!isset($result->empty_result)) { return $result; } else { return new stdClass(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}", "public function getCategories();", "public function getCategories();", "public function getAllCategories();", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function getAllCategories() {\n\n if (!isset(parent::all()[0])) {\n return [];\n }\n return parent::all()[0]->children;\n }", "function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}", "public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }", "function get_all_category(){\n $cat_args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n\n );\n $all_category = get_categories( $cat_args );\n\n return $all_category;\n }", "public static function getCategoryTopLevel() {\n\t\t\t$db = Db::getInstance();\n\t\t\t// Regex that grabs all top-level categories using location\n\t\t\t$regexForTopLevel = \"^[0-9]+$\";\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description \n\t\t\t\t\t\t\t\t\t\t\t FROM categories \n\t\t\t\t\t\t\t\t\t\t\tWHERE location REGEXP :regex\n\t\t\t\t\t\t\t\t\t\t ORDER BY location'\n\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t$categoryQuery->execute(array('regex' => $regexForTopLevel));\n\t\t\t$allTopCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allTopCategories;\n\t\t}", "public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }", "public static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public static function getRootCategories()\n {\n $app = App::getInstance();\n\n $sql = $app['safesql']->query(\n \"SELECT\n\t\t\t\t`id`\n\t\t\tFROM `category`\n\t\t\tWHERE hidden = 0\n\t\t\tAND id > 0\n\t\t\tAND parent IS NULL\n\t\t\tAND deleted = 0\n\t\t\tORDER BY `order` ASC\",\n array());\n $results = $app['db']->get_results($sql);\n $cats = array();\n\n if (!is_null($results)) {\n foreach ($results as $cat) {\n $cats[] = new Category($cat->id);\n }\n }\n return $cats;\n }", "public static function getTopCategories() {\n global $lC_Database, $lC_Language;\n \n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_link_target, c.categories_custom_url, c.categories_mode from :table_categories c, :table_categories_description cd where c.parent_id = 0 and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 and c.categories_visibility_nav = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n while ( $Qcategories->next() ) {\n $topCategories[] = array('id' => $Qcategories->value('categories_id'),\n 'name' => $Qcategories->value('categories_name'),\n 'link_target' => $Qcategories->value('categories_link_target'),\n 'custom_url' => $Qcategories->value('categories_custom_url'),\n 'mode' => $Qcategories->value('categories_mode'));\n }\n \n return $topCategories; \n }", "public function getallCategories(){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t \treturn $terms = NeCategory::model()->findAll($criteria);\n\t}", "public function get_categories () {\n\t\treturn Category::all();\n\t}", "public static function getAllCategories()\n\t{\n\t\t$categories= Category::all();\n\t\treturn $categories;\n\t}", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public function allCategories()\n {\n return Category::all();\n }", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "public function getCategories()\n\t{\n\t\treturn BlogCategory::all();\t\n\t}", "public function getCategories() : array;", "public function getAllCategories() {\n $allCategories= $this->getCategories(); \n foreach ($allCategories as $value){\n $value->setChildren($this->getSubCategories($value->getId()));\n }\n return $allCategories;\n \n }", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}", "public function get_categories() {\n\t\treturn $this->terms('category');\n\t}", "function getCategories()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('alias') . ',' .\n\t\t\t$this->db->nameQuote('id') . ',' .\n\t\t\t$this->db->nameQuote('name') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') .\n\t\t\t' WHERE ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' AND ' . $this->db->nameQuote('id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('trash') . ' = ' . $this->db->quote('0') .\n\t\t\t' ORDER BY ' . $this->db->nameQuote('ordering') . ' ASC';\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObjectList();\n\t}", "public function findCategories();", "static function categories()\n {\n $category = \\SOE\\DB\\Category::where('parent_id', '0')\n ->orderBy('category_order')\n ->get();\n $return = array();\n foreach($categories as $cat)\n {\n $return[$cat->id] = $cat->slug;\n }\n return $return;\n }", "public function getAllMainCategories(){\n\t\t$query = $this->db->query('\n\t\t\tselect c.id, c.name\n\t\t\tfrom food_category c\n\t\t\twhere\n\t\t\t\tmain = 1\n\t\t\torder by\n\t\t\t\tname asc');\n\t\treturn $query->result();\n\t}", "public function getCategories()\n {\n if ($this->_categories === null) {\n /** @var $tree Tree */\n $tree = $this->_categoryFactory->create()->getTreeModel();\n $tree->load(null, 2);\n // Load only to second level.\n $tree->addCollectionData(null, 'position');\n $this->_categories = $tree->getNodeById(Category::TREE_ROOT_ID)->getChildren();\n }\n return $this->_categories;\n }", "public function get_list_categories() {\n\t\t\t$categories = TableRegistry::get('Administrator.Categories');\n\t\t\t$all = $categories->find('treeList', ['conditions' => ['type' => 'Category', 'status' => $this->active], 'spacer' => '— '])->toArray();\n\t\t\treturn $all;\n\t}", "public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getCategoriesList() {\n return $this->_get(16);\n }", "public static function getCategories() {\n return Catalog::category()->orderBy('weight')->orderBy('name')->all();\n }", "private function getAllCategory() {\n $repository = $this->getDoctrine()\n ->getRepository('AppBundle:Category');\n\n return $repository->\n findBy(\n [],\n ['name' => 'ASC']\n );\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCategories()\n {\n return Category::all();\n }", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "public function getAllCategories()\n {\n return $this->AllChildren()->filter('ClassName', PortfolioCategory::class);\n }", "function bvt_sfa_feed_admin_get_categories() {\n\n $categories = get_categories(\n array(\n \"child_of\" => get_option(\"BVT_SFA_TOPICS_CATEGORY_ID\"),\n \"hide_empty\" => false\n )\n );\n\n return $categories;\n}", "public function get_categories() {\n\t\treturn array( 'general' );\n\t}", "public static function getCategories()\n {\n $app = App::getInstance();\n\n $manager = BaseManager::build('FelixOnline\\Core\\Category', 'category');\n\n try {\n $values = $manager->filter('hidden = 0')\n ->filter('deleted = 0')\n ->filter('id > 0')\n ->order('order', 'ASC')\n ->values();\n\n return $values;\n } catch (\\Exception $e) {\n return array();\n }\n }", "public function get_categories()\n\t{\n\t\treturn array('general');\n\t}", "function get_categories($params=''){\n $sql = ('SELECT id, name, parentid, level FROM categories ORDER BY name');\n $cat_array = $this->db->query($sql)->result_array();\n \n //this will generate html output - probably faster, but html code is out of templates!!!\n //$output_html = $this->generate_list_html(\"-1\",$cat_array);\n \n //this is slower method, but no html code in php\n //for this option, smarty modifier(compiler) need to be installed(compiler.defun.php)\n $arr = array();\n if(!empty($params['catId']) && $params['catId'] > 0){\t\t\n //generate top category, because it is not back from recursion function \t\n $this->CreateNestedArray($cat_array, $arr, $params['catId'], 0, 20);\n $arr2[0] = $this->get_category($params['catId']);\n $arr2[0]['children'] = $arr;\n return $arr2;\n }else{\n //get all categories\n $this->CreateNestedArray($cat_array, $arr, \"-1\", 0, 20);\n return $arr;\n }\n \n return;\n }", "public function get_categories()\n {\n return ['super-cat'];\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t\t\t\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))\n\t\t\t\t\t\t->orderby(\"category_name\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\treturn $result;\n\t}", "private static function _getSelectCategories()\n {\n $categories = Blog::category()->orderBy('name')->all();\n $sortedCategories = array();\n\n foreach($categories as $c)\n $sortedCategories[$c->id] = $c->name;\n\n return $sortedCategories;\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "function get_categories()\n\t\t{\n\t\t\t$categories = $this->manage_content->getValue('vertical_navbar','menu_name');\n\t\t\treturn $categories;\n\t\t}", "public function get_categories() {\n return [ 'yx-super-cat' ];\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function getCategoriesForSettings() {\n \n $qb = $this->_em->createQueryBuilder();\n $qb->select('c')\n ->from('ABOMainBundle:Category', 'c')\n ->join('c.parent', 'p')\n ->addSelect('p')\n ->where('c.level = :level')\n ->setParameter('level', 2);\n \n return $qb->getQuery()->getResult();\n }", "public function getCategories() {\n\t\t$db = $this->_db;\n\t\t\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtsms_categories', 'a'));\n\n\t\t$query->where($db->quoteName('a.published').' = 1');\n\n\t\t$query->group($db->quoteName('a.id'));\n\t\t$query->order($db->quoteName('a.name'));\n\n\t\t$db->setQuery($query);\n\n\t\t\n\t\t$categories = array();\n\t\t$categories[0]\t= JText::_('COM_GTSMS_UNCATEGORIZED');\n\n\t\tforeach ($db->loadObjectList('id') as $k => $item) {\n\t\t\t$categories[$k] = $item->name;\n\t\t}\n\n\t\treturn $categories;\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "function get_categories_tree() {\n\t\tglobal $db;\n\t\t$sql = \" SELECT id, name, parent_id AS parent_id \n\t\t\t\tFROM \" . $this->table_category;\n\t\t$db->query ( $sql );\n\t\t$categories = $db->getObjectList ();\n\t\t\n\t\t$tree = FSFactory::getClass ( 'tree', 'tree/' );\n\t\t$rs = $tree->indentRows ( $categories, 1 );\n\t\treturn $rs;\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'general' ];\n\t}", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories()\n {\n return $this->categories;\n }", "public function getCategories(){\n return Category::get();\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "public function all()\n {\n return new CategoryCollection(Category::whereUserId(Auth::id())->ordered()->get());\n }", "public static function getCategories(){\n $categories = Category::all()->toArray();\n\n return $categories;\n }", "public function getCategories() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.parent_id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtpihps_categories', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t$query->order($db->quoteName('a.id'));\n\t\t\n\t\t$db->setQuery($query);\n\t\t$raw = $db->loadObjectList();\n\t\t$data = array();\n\t\tforeach ($raw as $item) {\n\t\t\t$data[$item->parent_id][$item->id] = $item->name;\n\t\t}\n\t\treturn $data;\n\t}", "static function get_all_available_categories()\n {\n //moduli primari\n $modules_root = new Dir(DS.ModuleUtils::get_modules_path());\n\n $all_folders = $modules_root->listFolders();\n\n $result = array();\n\n foreach ($all_folders as $cat)\n {\n if ($cat->isDir())\n {\n $result[] = $cat->getName();\n }\n }\n\n //aggiungo la categoria framework se non è presente.\n if (!ArrayUtils::has_value($result, ModuleUtils::FRAMEWORK_CATEGORY_NAME))\n $result[] = ModuleUtils::FRAMEWORK_CATEGORY_NAME;\n //ok\n\n return $result;\n }", "public function get_categories()\n\t{\n\t\treturn $this->_categories;\n\t}", "public static function getAllCategories() {\n\t\t\t$db = Db::getInstance();\n\t\t\t$categoryQuery = $db->prepare('SELECT location, description\n\t\t\t\t\t\t\t\t\t\t\t FROM categories\n\t\t\t\t\t\t\t\t\t\t ORDER BY location\n\t\t\t\t\t\t\t\t\t\t');\n\t\t\t\t$categoryQuery->execute();\n\t\t\t$allCategories = $categoryQuery->fetchAll(PDO::FETCH_ASSOC);\n\t\t\treturn $allCategories;\n\t\t}", "public function get_categories()\n {\n return ['hsblog'];\n }", "public function get_categories() {\n return array ( 'general' );\n }", "function sportal_categories()\n{\n\tglobal $context, $scripturl, $txt;\n\n\tloadTemplate('PortalCategories');\n\n\t$context['categories'] = sportal_get_categories(0, true, true);\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=portal;sa=categories',\n\t\t'name' => $txt['sp-categories'],\n\t);\n\n\t$context['page_title'] = $txt['sp-categories'];\n\t$context['sub_template'] = 'view_categories';\n}", "function get_simple_categories($type='all', $parentid=false, $order=false){\n $parentid = intval($parentid);\n $where=$orderby='';\n if($type=='root') $where = 'WHERE parentid = -1';\n elseif ($type=='sub' && $parentid) $where = \"WHERE parentid = '$parentid'\";\n if($order) $orderby = ' order by name '.$order;\n $sql = \"SELECT id as catId, name as catName FROM categories \" . $where . $orderby; //, marketplaceCount\n $cats = $this->db->query($sql)->result_array();\n foreach($cats as $key=>$value){\n //$cats[$key]['marketplaceCount'] = number_format($value['marketplaceCount']);\n $haveSubCategories = $this->db_getone(\"SELECT id from categories where parentid='{$value['catId']}'\", 'id');\n if($haveSubCategories) $cats[$key]['haveSubCategories'] = 1;\n else $cats[$key]['haveSubCategories'] = 0;\n }\n return $cats;\n }", "public function getCategories(){\n\t\n\t\tglobal $wpdb;\n\t\t\n\t\t$allcategories = array();\n\t\t \n\t\t// geta all categories\t\t\n\t\t$categories = $wpdb->get_results('SELECT * FROM '.$this->categories_table.'');\n\t\t\n\t foreach($categories as $cat)\n\t\t{ \n\t\t $allcategories[$cat->term_id][] = $cat->name;\n\t\t\t$allcategories[$cat->term_id][] = $cat->name_de;\n\t\t\t$allcategories[$cat->term_id][] = $cat->name_it;\t\n\t\t}\n\t\t\n\t\treturn $allcategories;\n\t\t\t\n\t}", "public function getCategories()\n\t{\n\t\treturn $this->categories;\n\t}", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'tree_id'])->viaTable('{{%news_tree}}', ['news_id' => 'id']);\n }", "public function loadAllCategories() {\n\t\t$sql = \"SELECT * FROM categories_grumble ORDER BY category_name ASC\";\n\t\t$this->db->query($sql);\n\t\treturn $this->db->rows();\n\t}", "public static function getActiveCategories(){}", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function findAllCategories(): iterable;", "public function get_categories() {\n global $DB;\n $categories = array();\n $results = $DB->get_records('course_categories', array('parent' => '0', 'visible' => '1', 'depth' => '1'));\n if (!empty($results)) {\n foreach ($results as $value) {\n $categories[$value->id] = $value->name;\n }\n }\n return $categories;\n }", "public function get_all_categories()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('category');\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function get_categories() {\n\t\treturn [ 'basic' ];\n\t}", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "public function categories_all() {\n\t\t// Simple! Get the categories\n\t\t$this->data['categories'] = $this->mojo->blog_model->categories();\n\t\t\n\t\t// ...and display the view. We won't\n\t\t// be needing Pagination or anything like that\n\t\t$this->_view('categories');\n\t}", "public function getCategories()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('categories');\n }", "public function getCategories()\n {\n $categories = ClassInfo::subclassesFor('ConsultationCategory');\n return $this->Children()->filter('Classname', $categories);\n }" ]
[ "0.7896574", "0.7813748", "0.7813748", "0.77887344", "0.77032274", "0.7661748", "0.7658546", "0.76123273", "0.7598974", "0.75817806", "0.7560357", "0.754041", "0.7532735", "0.7523088", "0.7491185", "0.74835724", "0.7466275", "0.74441797", "0.7423476", "0.74049145", "0.73974645", "0.73942846", "0.73839414", "0.73606825", "0.7355281", "0.73354685", "0.7328348", "0.7325752", "0.7322762", "0.73103833", "0.73091877", "0.7275796", "0.7263301", "0.72630507", "0.7248445", "0.72270405", "0.7219682", "0.7215904", "0.7211247", "0.7209111", "0.7199361", "0.71866184", "0.7179377", "0.71590203", "0.71531415", "0.7150777", "0.71492255", "0.71487224", "0.7140845", "0.7137918", "0.7131193", "0.7125451", "0.7124527", "0.7122323", "0.7117616", "0.7116848", "0.7113272", "0.7113272", "0.7113243", "0.7102574", "0.7100826", "0.7100826", "0.7100826", "0.709048", "0.709048", "0.709048", "0.709048", "0.709048", "0.709048", "0.709048", "0.709048", "0.709048", "0.709048", "0.709006", "0.7085779", "0.70846784", "0.7080191", "0.70799387", "0.70779806", "0.70754266", "0.70694935", "0.706797", "0.7062752", "0.7055082", "0.70531225", "0.7043743", "0.70387155", "0.70358336", "0.7028669", "0.7027901", "0.7026344", "0.70126635", "0.7011746", "0.7011731", "0.70094645", "0.7006964", "0.70066977", "0.7005764", "0.7003834", "0.7003615" ]
0.83286905
0
/////////////////////////////////////////////////////////////////// Get subcategories from some category
public static function getSubCategories($parent_cat_id) { Db_Actions::DbSelect("SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=$parent_cat_id"); $result = Db_Actions::DbGetResults(); if (!isset($result->empty_result)) { return $result; } else { return new stdClass(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_sub_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"type\"=>2))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "function get_sub_categories($category_ID)\n {\n $get_sub_category_query=site_query(\"select * from Category where parentID=\".$category_ID.\" order by displayOrder\",\"get_sub_categories()\",$dev);\n return $get_sub_category_query;\n }", "function get_subcategories($categoryid) {\r\n global $DB;\r\n\r\n $subcategories = $DB->get_records('question_categories', array('parent' => $categoryid), 'id');\r\n\r\n foreach ($subcategories as $subcategory) {\r\n $subcategories = array_merge($subcategories, get_subcategories($subcategory->id));\r\n }\r\n\r\n return $subcategories;\r\n}", "function get_subcategories_list() {\n $query = $this->db->get('subcategories');\n return $query->result_array();\n }", "public function get_sub_category($category = \"\")\n\t{ \n\t\t$result = $this->db->from(\"category\")\n\t\t ->where(array(\"main_category_id\" => $category, \"category_status\" => 1,\"type\" => 2))\n\t ->orderby(\"category_name\")->get();\n\t\treturn $result;\n\t}", "public function allSubCategory() {\n return $this->db->get_where('r_category',array('subCategory !='=>0))->result_array();\n }", "function getCategories($object) { \n\n $R1 = new Category(); // R1 --\n $R11 = new Category(); // | | - R11 --\n $R111 = new Category(); // | | - R111\n $R112 = new Category(); // | | - R112\n $R11->addSubcategory($R111); // |\n $R11->addSubcategory($R112); // |\n $R1->addSubcategory($R11); // |\n $R2 = new Category(); // R2 --\n $R21 = new Category(); // | - R21 --\n $R211 = new Category(); // | | - R211\n $R22 = new Category(); // |\n $R221 = new Category(); // | - R22 --\n $R21->addSubcategory($R211); // | - R221\n $R22->addSubcategory($R221);\n $R2->addSubcategory($R21);\n $R2->addSubcategory($R22);\n\n $object->addCollectionEntry($R1); \n $object->addCollectionEntry($R2); \n}", "function achieve_get_sub_category()\r\n{\r\n global $sql;\r\n\r\n $sub_cat = array();\r\n $result = $sql[\"dbc\"]->query(\"SELECT ID, ParentID, Name FROM achievement_category WHERE ParentID<>-1 ORDER BY `GroupID` ASC\");\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n while ($sub_cat[$temp[\"ParentID\"]][$temp[\"ID\"]] = $temp[\"Name\"])\r\n {\r\n $temp = $sql[\"dbc\"]->fetch_assoc($result);\r\n }\r\n return $sub_cat;\r\n}", "function get_sub_cat($cat_main, $catrow )\n{\n\tglobal $db;\n\n\tif ($cat_main > 0)\n\t{\n\t\t$sql= \"SELECT * FROM \".CATEGORIES_TABLE.\" WHERE cat_id <> $cat_main AND cat_main=$cat_main\";\n\t\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categorie sons '.$sql, '', __LINE__, __FILE__, $sql);\n\t\twhile ( $catw = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$i = count($catrow);\n\t\t\t$catrow[$i] = $catw;\n\t\t\tif ($catw['cat_id'] > 0)\n\t\t\t\t$catrow = get_sub_cat($catw['cat_id'],$catrow);\n\t\t}\n\t}\n\treturn $catrow;\n}", "function getCategories($parent=0)\n {\n $sql=\"select * from itf_category where parent ='\".$parent.\"' and status='1' order by catname\";\n $res = $this->dbcon->FetchAllResults($sql);\n\n if(count($res) > 0){\n foreach($res as &$r)\n {\n $re = $this->getCategories($r['id']);\n $r[\"subcat\"] = $re;\n\n }\n }\n return $res;\n\n }", "public function subcategories()\n {\n \treturn $this->hasMany('App\\Category', 'parent_id')->where('status', 1);\n }", "public function getSubCategories($catId) {\n $subCatId = array ();\n $children = Mage::getModel ( 'catalog/category' )->getCategories ( $catId );\n foreach ( $children as $_children ) {\n $subCatId [] = $_children->getId ();\n \n }\n return $subCatId;\n }", "function getSubcategories(rex_category $category, $level_number, $max_number_subcategories): void\n {\n ++$level_number;\n echo '<ul class=\"sub-categories-list\">';\n foreach ($category->getChildren(true) as $sub_category) {\n $subcategory_start_article = $sub_category->getStartArticle();\n if (false === rex_addon::get('ycom')->isAvailable() || rex_ycom_auth::articleIsPermitted($subcategory_start_article)) {\n echo '<li><a href=\"'. $sub_category->getUrl() .'\" title=\"'. $sub_category->getName() .'\">'. $sub_category->getName() .'</a>';\n if ($level_number < $max_number_subcategories && count($sub_category->getChildren(true)) > 0) {\n getSubcategories($sub_category, $level_number, $max_number_subcategories);\n }\n echo '</li>';\n }\n }\n echo '</ul>';\n }", "public function subcategories_get($category_id)\n {\n $em = $this->doctrine->em;\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n $subcategories = $subcategoriesRepo->findBy(array('category' => $category_id));\n $category = $em->find('Entities\\Category', $category_id);\n if ($category) {\n $response[\"desc\"] = 'Subcategorias de la categoria: ' . $category->getTitle();\n $response[\"parent\"] = $category;\n $response[\"count\"] = count($subcategories);\n $response[\"data\"] = $subcategories;\n } else {\n $response[\"desc\"] = 'Categoria no encontrada';\n $response[\"parent\"] = null;\n $response[\"count\"] = 0;\n $response[\"data\"] = array();\n\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public function getFilteredSubCategoriesForListing(ProductCategory $product_category);", "public function getCategories();", "public function getCategories();", "public function subcategories()\n {\n return $this->hasMany(Category::class, 'parent_id')->where('status', 1);\n }", "public function findCategories();", "public function showSubcategories(){\n return ArticleModel::showSubcategories();\n }", "function getSubCategory($category)\n\t\t{\n\t\t\t//get values of sub category of this category\n\t\t\t$subcatList = $this->manageContent->getValue_where('subcategory', '*', 'categoryId', $category);\n\t\t\tif(!empty($subcatList[0]))\n\t\t\t{\n\t\t\t\tforeach($subcatList as $subcat)\n\t\t\t\t{\n\t\t\t\t\techo '<option value=\"'.$subcat['subCategoryId'].'\">'.$subcat['name'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<option>No Subcategory</option>';\n\t\t\t}\n\t\t}", "public function subCategorylist()\n {\n $data = [];\n $sub_categories = Category::where('parent', '!=' ,'0')->get();\n if(count($sub_categories)){\n $data = ['status' => true, 'code' => 200, 'data'=>$sub_categories];\n }else{\n $data = ['status' => false, 'code' => 404, 'message' => \"data not found\"];\n }\n return $data;\n }", "function showSubCategory()\n\t {\n\t\t\n\t\t $prolist=new Actions();\n\t\t $res=$prolist->fetchAll(\"category\");\n\t\t\t\t\t\t\n\t\t $parentdata=mysql_query(\"select * from category where cat_par_id='0'\");\n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\techo '<option value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\t\t\n\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$parent_sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\tActions::$r++;\n\t\t\t\tActions::viewCategory($parent_sub_cat['cat_id']);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }", "public function subcategories()\n {\n return $this->hasMany('App\\Models\\Subcategory', 'scat_cat_id', 'cat_id');\n }", "public function topSubcategories_get()\n {\n $em = $this->doctrine->em;\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n\n $subcategories = $subcategoriesRepo->findBy(array(), array('visits' => 'DESC'), 10);\n\n if ($subcategories) {\n $response[\"desc\"] = \"Subcategorias mas visitadas \";\n $response[\"count\"] = count($subcategories);\n $response[\"data\"] = $subcategories;\n } else {\n $response[\"desc\"] = 'No existen subcategorias mas visitadas';\n $response[\"count\"] = 0;\n $response[\"data\"] = array();\n }\n $this->set_response($response, REST_Controller::HTTP_OK);\n }", "public function getSubCategoryList($category_id)\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_category');\r\n\t\t$this->db->where('category_status', '1');\r\n\t\t$this->db->where('category_parent_id', $category_id);\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "function ProcessMultilevelSubCategories()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"ProcessMultilevelSubCategories();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\")) {\n $this->sub_categories_count = $this->listSettings->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n for ($i = 0; $i < $this->sub_categories_count; $i ++) {\n $sub_category = array();\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\")) {\n $sub_category[\"library\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"APPLY_LIBRARY\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LIBRARY\", array(\n $i), true);\n }\n if ($this->listSettings->HasItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\")) {\n $sub_category[\"link_field\"] = $this->listSettings->GetItem(\"SUB_CATEGORY_\" . $i, \"LINK_FIELD\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORY_LINK_FIELD\", array(\n $i), true);\n }\n $this->sub_categories[] = $sub_category;\n }\n\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_SUB_CATEGORIES_COUNT\", array(), true);\n }\n\n }", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "public function getSubMenu(){\n\t\t$catalogue = $this->getMenu()->content;\n\t\tforeach($catalogue as $first){\n\t\t\t$noms_sub_menu = $this->GetHTTP(\n\t\t\t\t'https://api.zalando.com/categories', array(\n\t\t\t\t\t'key' => implode(\",\", $first->childKeys),\n\t\t\t\t\t'pageSize' => '20000')\n\t\t\t)->content;\n\t\t\tfor ($i = 0; $i < count($first->childKeys); $i++){\n\t\t\t\t$first->childKeys[$noms_sub_menu[$i]->key] = $first->childKeys[$i];\n\t\t\t\t$first->childKeys[$noms_sub_menu[$i]->key] = $noms_sub_menu[$i]->name;\n\t\t\t\tunset($first->childKeys[$i]);\n\t\t\t}\n\t\t}\n\t\treturn $catalogue;\n\t}", "public function fetch_subcategory() {\n $this->db->where('parent_id!=', '0');\n $r = $this->db->get('category');\n return $r->result_array();\n }", "public function subcategory()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->pro->prifix.$this->pro->category);\n\t\t$this->db->order_by($this->pro->category.'_id','desc');\n\t\t$this->db->order_by($this->pro->category.'_parent','desc');\n\t\t$this->db->where($this->pro->category.'_status','1');\n\t\t$this->db->where($this->pro->category.'_parent>',0);\n\t\t$rs = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\treturn $rs->result_array();\n\t\t\n\t}", "public function getSubByCategory($category_id){\n $subCategories = SubCategory::where('category_id', '=', $category_id)->select('*')->get()->toArray();\n return response()->json($subCategories);\n }", "public function getChildCategories()\n {\n if (!$this->hasData('category_tabs')) {\n $currentCategory = $this->getMainCategory();\n $results = [];\n if ($currentCategory) {\n $tabIds = $currentCategory->getData('sss_category_tab_ids');\n if (!is_array($tabIds)) {\n $tabIds = explode(',', $tabIds);\n }\n /**\n * Enable Catalog Category Flat ... \n * @var $tabCollection \\Magento\\Catalog\\Model\\ResourceModel\\Category\\Flat\\Collection\n */\n if ($currentCategory->getUseFlatResource()) {\n $tabCollection = $currentCategory->getCollection();\n\n $tabCollection\n ->addIsActiveFilter()\n ->addAttributeToSelect('include_in_menu')\n ->addAttributeToSelect('sss_custom_tab_title')\n ->addAttributeToSelect('position')\n ->addAttributeToSelect('sss_tab_position')\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES)\n ->addFieldToFilter('parent_id', ['eq' => $currentCategory->getId()]);\n\n $tabCollection->getSelect()\n ->orWhere('main_table.entity_id in (?)', $tabIds, \\Magento\\Framework\\DB\\Select::TYPE_CONDITION);\n\n $results = $tabCollection->getItems();\n } else {\n $tabCollection = $currentCategory->getChildrenCategories();\n if ($tabCollection instanceof AbstractCollection) {\n $tabCollection->setLoadProductCount(false);\n $tabCollection->addAttributeToSelect('sss_custom_tab_title');\n $tabCollection->addLevelFilter(3);\n try {\n $tabCollection->addAttributeToFilter('sss_visible_in_tab', SourceBoolean::VALUE_YES);\n } catch (\\Exception $e) {\n }\n $results = $tabCollection->getItems();\n } else {\n foreach ($tabCollection as $childCategory) {\n if (3 == $childCategory->getLevel()) {\n $results[] = $childCategory;\n }\n }\n }\n }\n usort($results, function ($first, $second) {\n if ($first->getData('sss_tab_position') || $second->getData('sss_tab_position')) {\n return $first->getData('sss_tab_position') >= $second->getData('sss_tab_position');\n } else {\n return $first->getData('position') >= $second->getData('position');\n }\n });\n }\n $this->setData('category_tabs', $results);\n }\n return $this->getData('category_tabs');\n }", "public function getMenu(){\n $bigCategory = $this->getBigCategory();\n $medCategory = $this->getMediumCategory();\n foreach($bigCategory as $bigKey => $value){\n foreach($medCategory as $medKey => $val){\n if($val['parentId'] == $value['id']){\n $bigCategory[$bigKey]['subCategory'][] = $val;\n }\n }\n }\n return $bigCategory;\n }", "public function getChilds($category_id) {\n $categoryTableName = $this->info('name');\n\n $category = Engine_Api::_()->getItem('siteevent_category', $category_id);\n\n $select = $this->select()\n ->from($categoryTableName, array('category_id', 'category_name'))\n ->where(\"cat_dependency = ?\", $category_id);\n\n //IF SUBCATEGORY THEN FETCH 3RD LEVEL CATEGORY\n if ($category->cat_dependency != 0 && $category->subcat_dependency == 0) {\n $select->where(\"subcat_dependency = ?\", $category_id);\n }\n //IF CATEGORY THEN FETCH SUB-CATEGORY\n elseif ($category->cat_dependency == 0 && $category->subcat_dependency == 0) {\n $select->where(\"subcat_dependency = ?\", 0);\n }\n //IF 3RD LEVEL CATEGORY\n else {\n return array();\n }\n\n return $this->fetchAll($select);\n }", "public static function catAndSubCategories($business_id, $enable_petro_module = 0)\r\n {\r\n $categories_query = Category::where('business_id', $business_id)\r\n ->where('parent_id', 0)\r\n ->orderBy('name', 'asc');\r\n if (!empty($enable_petro_module)) {\r\n $categories = $categories_query->get()->toArray();\r\n } else {\r\n $categories = $categories_query->notPetro()->get()->toArray();\r\n }\r\n\r\n if (empty($categories)) {\r\n return [];\r\n }\r\n\r\n $sub_categories = Category::where('business_id', $business_id)\r\n ->where('parent_id', '!=', 0)\r\n ->orderBy('name', 'asc')\r\n ->get()\r\n ->toArray();\r\n $sub_cat_by_parent = [];\r\n\r\n if (!empty($sub_categories)) {\r\n foreach ($sub_categories as $sub_category) {\r\n if (empty($sub_cat_by_parent[$sub_category['parent_id']])) {\r\n $sub_cat_by_parent[$sub_category['parent_id']] = [];\r\n }\r\n\r\n $sub_cat_by_parent[$sub_category['parent_id']][] = $sub_category;\r\n }\r\n }\r\n\r\n foreach ($categories as $key => $value) {\r\n if (!empty($sub_cat_by_parent[$value['id']])) {\r\n $categories[$key]['sub_categories'] = $sub_cat_by_parent[$value['id']];\r\n }\r\n }\r\n\r\n return $categories;\r\n }", "function get_categories($params=''){\n $sql = ('SELECT id, name, parentid, level FROM categories ORDER BY name');\n $cat_array = $this->db->query($sql)->result_array();\n \n //this will generate html output - probably faster, but html code is out of templates!!!\n //$output_html = $this->generate_list_html(\"-1\",$cat_array);\n \n //this is slower method, but no html code in php\n //for this option, smarty modifier(compiler) need to be installed(compiler.defun.php)\n $arr = array();\n if(!empty($params['catId']) && $params['catId'] > 0){\t\t\n //generate top category, because it is not back from recursion function \t\n $this->CreateNestedArray($cat_array, $arr, $params['catId'], 0, 20);\n $arr2[0] = $this->get_category($params['catId']);\n $arr2[0]['children'] = $arr;\n return $arr2;\n }else{\n //get all categories\n $this->CreateNestedArray($cat_array, $arr, \"-1\", 0, 20);\n return $arr;\n }\n \n return;\n }", "function get_cat_sub($cat_id,$level=0) {\nglobal $table_catcontent, $db;\n$list_info_cat=($level==0)?\"(-1\":\"\";\n$list_info_cat = $list_info_cat.\",\".$cat_id;\n$subcat_num = Check_sub_info($table_catcontent,$db,\" WHERE parent_id = '\".$cat_id.\"'\");\nif ($subcat_num>0) {\n\t$sql_query = \"SELECT * FROM `\" . $table_catcontent . \"` WHERE parent_id='\".$cat_id.\"' ORDER BY priority_order ASC\";\n\t$sql_query = mysql_query($sql_query);\n\twhile($sql_query_rows = mysql_fetch_array($sql_query)) {\n\t\t$list_info_cat = $list_info_cat.get_cat_sub($sql_query_rows['id'],1);\n\t\t}\n\t}\nreturn ($level==0)?$list_info_cat.\")\":$list_info_cat;\n}", "public function list_subCategory($category_id){\n $sqlQuery=\"select *,sidhus_category.cat_name from sidhus_subcategory inner join sidhus_category on sidhus_category.category_id=sidhus_subcategory.category_id where sidhus_subcategory.category_id = \". $category_id;\n //$sqlQuery= \"select * from make_an_offer INNER JOIN sell_product ON sell_product.sell_id=make_an_offer.product_id where sell_product.customer_id = \". $customer_id;\n $result=$this->con->query($sqlQuery);\n $this->con->close();\n return $result;\n }", "public function Sub_category_list($category_id)\n\t{\n\t\t$sQuery = \"SELECT * FROM sub_category WHERE main_cat_id = '$category_id' AND status='Active'\";\n\t\t$cat_result = $this->db->query($sQuery);\n\n\t\t$category_result = $cat_result->result();\n\t\t$category_count = $cat_result->num_rows();\n\n\t\tif($cat_result->num_rows()>0)\n\t\t{\n\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"Sub Category list\", \"sub_category_count\" => $category_count, \"sub_category_list\"=>$category_result);\n\t\t} else {\n\t\t\t$response = array(\"status\" => \"error\", \"msg\" => \"Category Not Found\");\n\t\t}\n\n\t\treturn $response;\n\t}", "public function sub_categories()\n\t{ \n\n\t\tif ($this->input->is_ajax_request()) {\n\t\t\t$main_cat_id = $_POST['main_cat_id'];\n\n\t\t\t$sub_categories = $this->cat_model->GetWhere(\"categories\", \"title\", \"ASC\", array('main_cat_id'=> $main_cat_id)); \n\n\t\t\tif (isset($sub_categories) && count($sub_categories) != 0) {\n\t\t\t\t$id=\"sub_cat_id\".$main_cat_id;\n\t\t\t\t$div=\"div_\".$main_cat_id;\n\t\t\t\techo '<select id=\"'.$id.'\" onclick=\"get_sub_category('.$main_cat_id.');\">';\n\t\t\t\techo '<option disabled selected>Select Sub category</option>';\n\n\t\t\t\tforeach ($sub_categories as $cat) {\t\t\t\t\n\t\t\t\t\techo '<option value=\"'.$cat->id.'\">'.$cat->title.'</option>';\n\t\t\t\t}\n\t\t\t\techo '</select><div id=\"'.$div.'\"> </div><br>';\n\n\n\t\t\t}\n\n\n\t\t} \n\t}", "public static function getListSubcategoria($subs){\n return CHtml::listData($subs,'id_subcategoria','nombre');\n }", "public function getSub_category(){\n return $this->sub_category;\n }", "public function categoryBreadcrumbs($sub_cat_id,$catt=0)\n\t{\t\t\n\t\tif($catt==0)\n\t\t{\n\t\t$pa=$sub_cat_id;\n\t\t$count=0;\n\t\twhile($pa!=0)\n\t\t{\n\t\t\t$query44=\"select * from `categories` where category_id=$pa\";\n\t\t\t$res44=$this->query($query44);\n\t\t\t$row44=mysql_fetch_assoc($res44);\n\t\t\t$pa=$row44['parent_id'];\n\t\t\tif($sub_cat_id == $row44['category_id'])\n\t\t\t{\n\t\t\t\t$name_arr[$count]=$row44['category_name'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$name_arr[$count]=\"<a href='category.php?catId=\".base64_encode($row44['category_id']).\"' class='link'>\".$row44['category_name'].\"</a>\";\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$count+=1;\n\t\t}\n\t\t}\t\t\n\t\treturn (@array_reverse($name_arr));\n\t\t\t\n\t\t}", "public function getAllCategories() {\n $allCategories= $this->getCategories(); \n foreach ($allCategories as $value){\n $value->setChildren($this->getSubCategories($value->getId()));\n }\n return $allCategories;\n \n }", "function particularsubcatlist($id)\n\t{\n\t\t$getParsubproduct=\"SELECT * from product_sub_category where pr_sub_id = $id\";\n\t\t$subproduct_data=$this->get_results( $getParsubproduct );\n\t\treturn $subproduct_data;\n\t}", "protected function getCourseSubCategories(Request $request){\n \t$id = InputSanitise::inputInt($request->get('id'));\n \tif(isset($id)){\n \t\treturn CourseSubCategory::getCourseSubCategoriesByCategoryId($id);\n \t}\n }", "public function getCategories() : array;", "public function getSubCategoryByCategoryId($id){\n //$this->db->select('id,sub_category');\n $query = $this->db->get_where('sub_category',array('category_id' => $id));\n return $query->result(); \n }", "function emc_get_the_subcategory_list( $slug ) {\r\n\r\n\t// Determine parent category ID\r\n\t$parent = get_category_by_slug( $slug );\r\n\t$parent_id = $parent->term_id;\r\n\r\n\t// Check all post categories to see if any have the specified parent\r\n\t$cats = get_the_category( get_the_ID() );\r\n\r\n\t$html = '';\r\n\tforeach ($cats as $cat) {\r\n\t\tif ( $parent_id == $cat->category_parent ) {\r\n\t\t\t$html .= sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a> ',\r\n\t\t\t\tget_category_link( $cat->term_id ),\r\n\t\t\t\tsprintf( __( 'View all posts in %s', 'emc' ), esc_attr( $parent->name ) ),\r\n\t\t\t\tesc_attr( $cat->name )\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\treturn $html;\r\n\r\n}", "public function get_sub_categories($parent_id) {\n $parent_id = $this->real_escape_string($parent_id);\n return $this->query(\"SELECT * FROM sub_cat WHERE parent_id = '\"\n . $parent_id . \"' order by id \");\n }", "function get_cat($cat_id)\n{\n\tglobal $db;\n\t// phpBB 2.0.9\n\t$category_rows = array();\n\t//\n\tif ($cat_id <= 0)\n\t $cat_id = -1;\n\tif ($cat_id > 0)\n\t{\n\t\t$sql = \"SELECT * FROM \" . CATEGORIES_TABLE . \" WHERE cat_id=$cat_id\";\n\t\tif ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query this categories', '', __LINE__, __FILE__, $sql);\n\t\tif ( !($row = $db->sql_fetchrow($result)) ) $cat_id = -1;\n\t}\n\t//\n\t// no cat selected : get all\n\tif ($cat_id <= 0)\n\t{\n\t\t//-- v 1.0.5\n\t\t$sql = \"SELECT * FROM \" . CATEGORIES_TABLE . \" ORDER BY cat_order\";\n\t\t//-- \n\t\tif ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);\n\t\twhile ( $row = $db->sql_fetchrow($result) ) $category_rows[] = $row;\n\t}\n\t//\n\t// a cat selected : get it and its sub-cats\n\tif ($cat_id > 0)\n\t{\n\t\t// add the current one\n\t\t$catrow[] = $row;\n\t\t// get sub-cats\n\t\t$catrow = get_sub_cat($cat_id,$catrow);\n\t\t// get cats\n\t\t//-- v 1.0.5\n\t\t$sql = \"SELECT * FROM \" . CATEGORIES_TABLE . \" ORDER BY cat_order\";\n\t\t//--\n\t\tif( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql);\n\t\twhile ($row = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$found = false;\n\t\t\tfor ($i=0;( $i<count($catrow) && (!$found) );$i++) $found = ($row['cat_id'] == $catrow[$i]['cat_id']);\n\t\t\tif ($found) $category_rows[] = $row;\n\t\t}\n\t}\n\treturn $category_rows;\n}", "public function getSubcategoriesOfCategory()\n {\n // recupere id de la sous categorie choisie\n $categoryId=$_GET['categoryID'];\n // var_dump($categoryId);\n // on recupere les données dans la table subcategories selon la categorie\n $resultGetSubcategoriesOfCategory=DB::table('sub_categories')\n ->join('categories', 'sub_categories.category_id', '=', 'categories.id')\n ->select('sub_categories.category_id', 'categories.name_category', 'sub_categories.id', 'sub_categories.name_subcategory')\n ->where('sub_categories.category_id', '=', $categoryId)\n ->get();\n\n return json_encode($resultGetSubcategoriesOfCategory);\n\n // select categories.category_id, categories.name_category, sub_categories.name_subcategory\n // from sub_categories\n // join categories\n // on sub_categories.category_id = categories.category_id\n // where sub_categories.category_id='1';\n\n }", "public function get_sub_cat_list1($parentid,$subcatid){\n\t\t\n\t\t$parentid= trim($parentid);\n\t\t$subcatid= trim($subcatid);\n\t\t\n\t\treturn $this->db->query(\"select a.*,b.* from subcategory_name as a inner join subcategory as b on a.subcategory_name_id=b.subcategory_name_id where b.subcategory_name_id='$subcatid' and b.ParentCategory='$parentid'\")->result_array();\n\t\n\t\t\n\t}", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "function get_sub_category_list($category_id)\n\t{\n\t\techo '<div class=\"form-group\">\n\t\t\t\t<div class=\"col-md-12 col-sm-12\">\n\t\t\t\t<select onchange=\"get_product(\\'sub_category\\' , this.value)\" class=\"form-control selectpicker\"\n\t\t\t\t\tname=\"sub_category_id\" data-size=\"10\" data-live-search=\"true\" data-style=\"btn-default\">\n\t\t\t\t\t<option value=\"\">' . translate('select_sub_category') . '</option>';\n\n\t\t$sub_categories = $this->db->get_where('sub_category', array(\n\t\t\t'category_id' => $category_id\n\t\t))->result_array();\n\t\tforeach ($sub_categories as $row):\n\t\t\techo '<option value=\"' . $row['sub_category_id'] . '\">' . $row['name'] . '</option>';\n\t\tendforeach;\n\t\techo '</select></div></div>';\n\t}", "public function allsubcategories_get()\n {\n $em = $this->doctrine->em;\n $subcategoriesRepo = $em->getRepository('Entities\\Subcategory');\n $subcategories = $subcategoriesRepo->findAll();\n foreach ($subcategories as $subcategory) {\n $subcategory->servicesCount = $subcategory->getServices()->count();\n }\n $response[\"data\"] = $subcategories;\n $response[\"count\"] = count($subcategories);\n $this->set_response($response, REST_Controller::HTTP_OK);\n\n }", "public function getAllCategories();", "public function getCurrentSubcategories()\n {\n return $this->_getHelper()->getCurrentSubcategories();\n }", "function getCategories()\n\t{\n\t\t$query = ' SELECT ' .\n\t\t\t$this->db->nameQuote('alias') . ',' .\n\t\t\t$this->db->nameQuote('id') . ',' .\n\t\t\t$this->db->nameQuote('name') .\n\t\t\t' FROM ' . $this->db->nameQuote('#__k2_categories') .\n\t\t\t' WHERE ' . $this->db->nameQuote('parent') . ' = ' . $this->db->quote($this->params->get('primaryCategory')) .\n\t\t\t' AND ' . $this->db->nameQuote('id') . ' NOT IN (' . implode(',', $this->params->get('regionCategories')) . ')' .\n\t\t\t' AND ' . $this->db->nameQuote('published') . ' = ' . $this->db->quote('1') .\n\t\t\t' AND ' . $this->db->nameQuote('trash') . ' = ' . $this->db->quote('0') .\n\t\t\t' ORDER BY ' . $this->db->nameQuote('ordering') . ' ASC';\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObjectList();\n\t}", "function get_simple_categories($type='all', $parentid=false, $order=false){\n $parentid = intval($parentid);\n $where=$orderby='';\n if($type=='root') $where = 'WHERE parentid = -1';\n elseif ($type=='sub' && $parentid) $where = \"WHERE parentid = '$parentid'\";\n if($order) $orderby = ' order by name '.$order;\n $sql = \"SELECT id as catId, name as catName FROM categories \" . $where . $orderby; //, marketplaceCount\n $cats = $this->db->query($sql)->result_array();\n foreach($cats as $key=>$value){\n //$cats[$key]['marketplaceCount'] = number_format($value['marketplaceCount']);\n $haveSubCategories = $this->db_getone(\"SELECT id from categories where parentid='{$value['catId']}'\", 'id');\n if($haveSubCategories) $cats[$key]['haveSubCategories'] = 1;\n else $cats[$key]['haveSubCategories'] = 0;\n }\n return $cats;\n }", "public function getSuperCategories()\n {\n $select = $this->select();\n $select->columns(\"supercategory\")\n ->group(\"supercategory\");\n\n return $this->fetchAll($select);\n }", "public function subcategories()\r\n {\r\n return $this->hasMany('App\\Models\\SubCategory');\r\n }", "function bvt_sfa_feed_admin_get_categories() {\n\n $categories = get_categories(\n array(\n \"child_of\" => get_option(\"BVT_SFA_TOPICS_CATEGORY_ID\"),\n \"hide_empty\" => false\n )\n );\n\n return $categories;\n}", "function getCategoriesSQL($category){\n\t\t\n\t $result = $this->findByCategory($category);\n \t$parentId = $result['Category']['parent_id'];\n \t$id = $result['Category']['id'];\n \t\n\t\t\t//super-categories have 0 parentid\n\t\t\t//hence, find the list of sub-categories under the super-category\n \tif($parentId == 0){\n \t\n\t\t\t\t//get of list of subcategories that have this super-category as parent\n \t\t$listId = $this->find('all', array('conditions' => array('Category.parent_id'=> $id), 'fields' => 'id'));\n \t\t$categoryIdList = $this->convertListSQL($listId, 'Category', 'id');\n \t\treturn \"Story.category_id IN $categoryIdList\";\n\n \t}\n \telse{\n\t\n\t\t\t\t//sub-categories have a non-zero parentid as there are already the lowest level category\n \t\treturn \"Story.category_id = $id\";\n \t}\n\t\t\n\t}", "function getProjectSubCategory($userData)\n\t\t{\n\t\t\t//get sub category from database\n\t\t\techo '<li class=\"pro_cat\"><a>'.$userData['category'].'</a></li>\n\t\t\t\t\t<ul class=\"profile_overview profile_1st_child_nav\">\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 1</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 2</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 3</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 4</a></li>\n\t\t\t\t\t\t<li><i class=\"glyphicon glyphicon-chevron-right profile_ovr_icon\"></i><a>Sub Category 5</a></li>\n\t\t\t\t\t</ul>';\n\t\t}", "function helperGetRecursiveCat($allowedCat, $parentId=0,$level=0 ) {\n\t\t# $catArr = array();\n\t\t$level++;\n\n\t\t$where = 'hidden = 0 AND deleted=0 AND parent_uid='.$parentId;\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('pid,uid,title,parent_uid','tx_rggooglemap_cat',$where);\n\n\t\t// recursive query\n\t\t$catArr = '';\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\tif (in_array($row['uid'], explode(',', $allowedCat))) {\n\t\t\t\t$catArr .= '<option class=\"searchlvl'.$level.'\" value=\"'.$row['uid'].'\">'.$row['title'].'</option>';\n\t\t\t\t$recursiveCat = $this->helperGetRecursiveCat($allowedCat,$row['uid'],$level);\n\t\t\t\tif ($recursiveCat !== '') {\n\t\t\t\t\t$catArr .= $recursiveCat;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\treturn $catArr;\n\t}", "public function getCategories() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.parent_id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtpihps_categories', 'a'));\n\t\t\n\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t$query->order($db->quoteName('a.id'));\n\t\t\n\t\t$db->setQuery($query);\n\t\t$raw = $db->loadObjectList();\n\t\t$data = array();\n\t\tforeach ($raw as $item) {\n\t\t\t$data[$item->parent_id][$item->id] = $item->name;\n\t\t}\n\t\treturn $data;\n\t}", "public function getCategoriesAll()\n {\n return $this->where('cat_active', 1)->with('subcategories')->get();\n }", "public function getParentCategories() {\n $select = $this->select()\n ->from($this->info('name'), array(\"category_id\", \"category_name\"))\n ->where(\"cat_dependency = 0 AND subcat_dependency = 0\");\n\n return $this->fetchAll($select);\n }", "public function get_all_info_cat_sub() {\n\t\t\n\t\t$query = $this->db->prepare(\"SELECT categories.cat_id,subcategories.subc_id,subcategories.subc_name, categories.cat_name, company_info.info_logo, company_info.info_address, users.user_id,users.user_confirmed,users.admin_confirmed, users.user_name, users.user_email, users.user_comp_name, users.user_number, users.client_cat_id, client_cat.client_cat_id, users.user_time, client_cat.client_cat_name FROM client_cat LEFT JOIN users ON users.client_cat_id = client_cat.client_cat_id right join company_info on company_info.user_id=users.user_id right join categories on categories.cat_id=company_info.cat_id LEFT JOIN subcategories ON subcategories.subc_id=company_info.subc_id \n\");\n\t\t\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$query->execute();\n\t\t\t$result = $query->fetchAll();\n\t\t\treturn $result;\n\t\t}catch(PDOException $e){\n\n\t\t\tdie($e->getMessage());\n\t\t}\n\t}", "function showChildCategories($category_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_sub_categories WHERE sub_cate_status = 1 AND \tparent_id = \".$category_id.\" order by sub_cate_title ASC\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "public function getCategoriesForSettings() {\n \n $qb = $this->_em->createQueryBuilder();\n $qb->select('c')\n ->from('ABOMainBundle:Category', 'c')\n ->join('c.parent', 'p')\n ->addSelect('p')\n ->where('c.level = :level')\n ->setParameter('level', 2);\n \n return $qb->getQuery()->getResult();\n }", "function get_sub_category() {\r\n if(!isset($_POST['category_id'])){\r\n echo json_encode(array('status'=>false, 'message'=>\"category_id field is required!!\", 'data'=>blank_json()));\r\n die;\r\n }\r\n $category_id=$this->input->post('category_id');\r\n if(isset($_POST['last_count'])){\r\n $last_count = $_POST['last_count'];\r\n }else{\r\n $last_count = 0;\r\n }\r\n if($category_id==1 || $category_id==2 || $category_id==3 || $category_id==4){\r\n if($category_id==1){\r\n $table='fic_category';\r\n }\r\n if($category_id==2){\r\n $table='comm_category';\r\n }\r\n if($category_id==3){\r\n $table='competition_category';\r\n }\r\n if($category_id==4){\r\n $table='opendata_category';\r\n }\r\n $res = $this->CategoriesModel->get_subcategories($category_id,$table,$last_count);\r\n if (!empty($res)) {\r\n $i=0;\r\n foreach($res as $r){\r\n $res[$i]['root_id']=$category_id;\r\n $i++;\r\n }\r\n echo json_encode(array('status'=>true, 'message'=>\"Sub Categories list!\", 'data'=>$res));\r\n die;\r\n }\r\n echo json_encode(array('status'=>false, 'message'=>\"Sub Categories list not found!!\", 'data'=>array()));\r\n die;\r\n \r\n }else{\r\n echo json_encode(array('status'=>false, 'message'=>\"category_id is not valid!!\", 'data'=>blank_json()));\r\n }\r\n }", "private function getCategories() {\r\n $data['categories'] = array();\r\n\r\n $this->load->model('catalog/category');\r\n\r\n $categories_1 = $this->model_catalog_category->getCategories(0);\r\n\r\n foreach ($categories_1 as $category_1) {\r\n $level_2_data = array();\r\n\r\n $categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);\r\n\r\n foreach ($categories_2 as $category_2) {\r\n $level_3_data = array();\r\n\r\n $categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);\r\n\r\n foreach ($categories_3 as $category_3) {\r\n $level_3_data[] = array(\r\n 'category_id' => $category_3['category_id'],\r\n 'name' => $category_3['name'],\r\n );\r\n }\r\n\r\n $level_2_data[] = array(\r\n 'category_id' => $category_2['category_id'],\r\n 'name' => $category_2['name'],\r\n 'children' => $level_3_data\r\n );\r\n }\r\n\r\n $data['categories'][] = array(\r\n 'category_id' => $category_1['category_id'],\r\n 'name' => $category_1['name'],\r\n 'children' => $level_2_data\r\n );\r\n }\r\n return $data['categories'];\r\n }", "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "function getProductsBySubCategori($id) {\r\n \r\n $db = new SQL_Conect_PDO(); \r\n $sql = \"SELECT * FROM `products` WHERE `Id_sub_categories` = :Id \"\r\n . \"ORDER BY `Name` ASC \";\r\n \r\n $ArrPars['Id'] = $id; \r\n\r\n $db->SetQuery($sql, $ArrPars); \r\n $res = $db->GetQueryAll_Class(\"Product\");\r\n \r\n return $res;\r\n }", "public function getSubcategory() {\n return $this->hasMany(Subcategory::className(), ['id' => 'subcategory_id'])\n ->viaTable('question_category', ['question_id' => 'id']);\n }", "public function getSubCategory()\n {\n if (array_key_exists(\"subCategory\", $this->_propDict)) {\n if (is_a($this->_propDict[\"subCategory\"], \"\\Beta\\Microsoft\\Graph\\SecurityNamespace\\Model\\SubCategory\") || is_null($this->_propDict[\"subCategory\"])) {\n return $this->_propDict[\"subCategory\"];\n } else {\n $this->_propDict[\"subCategory\"] = new SubCategory($this->_propDict[\"subCategory\"]);\n return $this->_propDict[\"subCategory\"];\n }\n }\n return null;\n }", "function getListOfAllSubCategory_InACategory_Array_PDO($DBConnection, $CategoryId){\n\n\n\n\n $Query1 = \"SELECT * FROM `menu_meta_subcategory_table`\n WHERE `category_id` = :category_id ORDER BY `subcategory_sr_no` ASC\" ;\n try{\n $QueryResult1 = $DBConnection->prepare($Query1) ;\n $QueryResult1->execute(['category_id'=>$CategoryId]) ;\n $CategorySubCategoriesListArray = $QueryResult1->fetchAll() ;\n\n return $CategorySubCategoriesListArray ;\n }catch (Exception $e){\n throw new Exception(\"Unable to fetch the SubCategory list from the menu_meta_rel_category : \".$e->getMessage()) ;\n }\n\n}", "public function getAllCategories()\n\t{\n\t\treturn $this->_db->loadAssoc(\"SELECT * FROM @_#_categories ORDER BY title\", 'parent_id', true);\n\t}", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function getCategoryList()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$categoryId = $app->input->get('id', 'root', 'STRING');\n\n\t\t$model = JCategories::getInstance('Content', ['countItems' => 1]);\n\t\t$mainCategory = $model->get($categoryId);\n\n\t\t/*$model = new ContentModelCategories();*/\n\t\t/*$categories = $model->getItems();*/\n\n/*\t\t$categoryId = $app->input->get('id', 'root', 'STRING');\n\t\t$model = JCategories::getInstance('Content');\n\t\t$category = $model->get($categoryId, true);\n\t\t$categories = $category->getChildren();*/\n\n\t\t$params = json_decode($mainCategory->params);\n\n\t\t$result = [\n\t\t\t'id' => $mainCategory->id,\n\t\t\t'parent_id' => $mainCategory->parent_id,\n\t\t\t'count' => $mainCategory->numitems,\n\t\t\t'title' => $mainCategory->title,\n\t\t\t'alias' => $mainCategory->alias,\n\t\t\t'description' => $mainCategory->description,\n\t\t\t'image' => ['url' => $params->image, 'alt' => $params->image_alt],\n\t\t\t'children' => [],\n\t\t];\n\t\t$categories = $mainCategory->getChildren();\n\n\t\tforeach ($categories as $node) {\n\t\t\t$params = json_decode($node->params);\n\t\t\t$result['children'][] = [\n\t\t\t\t'id' => $node->id,\n\t\t\t\t'parent_id' => $node->parent_id,\n\t\t\t\t'count' => $node->numitems,\n\t\t\t\t'title' => $node->title,\n\t\t\t\t'alias' => $node->alias,\n\t\t\t\t'image' => ['url' => $params->image, 'alt' => $params->image_alt],\n\t\t\t];\n\t\t}\n\n\t\treturn $result;\n\t\t\n\t}", "public function get_sub_category(){\r\n $this->datatables->select('s.cat_id,s.sub_cat_id,c.cat_name,s.sub_cat_name');\r\n $this->datatables->join( 'o-cakes_category c', 's.cat_id = c.cat_id', 'left' );\r\n $this->datatables->from('o-cakes_sub_cat s');\r\n $this->datatables->where('s.sub_cat_status',1);\r\n $result = $this->datatables->generate();\r\n echo $result;\r\n }", "public function get_sec_category($category = \"\")\n\t{ \n\t\t$result = $this->db->from(\"category\")\n\t\t ->where(array(\"sub_category_id\" => $category, \"category_status\" => 1,\"type\" => 3))\n\t ->orderby(\"category_name\")->get();\n\t\treturn $result;\n\t}", "function oab_getSwappzaCategoryTree($dbcon) {\n $categories = array();\n $categoriesFinal = array();\n \n //Fetch Categories\n $stmt = $dbcon->prepare(\"SELECT categoryID,name\"\n . \" FROM SwappzaCategory WHERE ?\");\n \n if ($stmt) {\n $one = 1;\n $stmt->bind_param('d', $one);\n $stmt->execute();\n $stmt->bind_result($categoryID, $name);\n\n while ($stmt->fetch()) {\n array_push($categories, new SwappzaCategory($categoryID, $name, \"\", array()));\n }\n \n $stmt->close();\n \n //Fetch Subcategory for each category\n foreach($categories as $category) {\n $stmt = $dbcon->prepare(\"SELECT SwappzaSubCategory.subcategoryID, SwappzaSubCategory.name\"\n . \" FROM SwappzaSubCategoryOf\"\n . \" JOIN SwappzaSubCategory ON SwappzaSubCategoryOf.subcategoryID=SwappzaSubCategory.subcategoryID\"\n . \" WHERE SwappzaSubCategoryOf.categoryID=?\");\n \n if ($stmt) {\n $id = $category->getID();\n $stmt->bind_param('d', $id);\n $stmt->execute();\n $stmt->bind_result($subcategoryID, $subcategoryName);\n \n $subCategories = array();\n \n while($stmt->fetch()) {\n array_push($subCategories, new SwappzaSubCategory($subcategoryID, $subcategoryName, ''));\n }\n \n array_push($categoriesFinal,\n new SwappzaCategory(\n $category->getID(),\n $category->getName(),\n $category->getDescription(),\n $subCategories\n ));\n \n $stmt->close();\n } else {\n error_log(\"failed to prepare second statement from oab_getSwappzaCategoryTree in swappza.php\");\n }\n } \n \n } else {\n error_log(\"failed to prepare first statement from oab_getSwappzaCategoryTree in swappza.php\");\n }\n \n return $categoriesFinal; \n}", "public function getCategories()\n {\n $categories = new ArrayList;\n foreach(BlogCategory::get() as $category) {\n $data = array(\n 'Title' => $category->Title,\n 'Link' => $category->Parent()->Link('category/'.$category->URLSegment),\n 'ShowCount' => $this->ShowCount,\n 'Count' => $this->totalEntries($category->ID)\n );\n $categories->push(new ArrayData($data));\n }\n return $categories;\n }", "public function GetChildCategories()\n\t\t{\n\t\t\t$categoryId = $this->GetCatId();\n\t\t\t$childCatsCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('ChildCategories');\n\n\t\t\t// The cache has a cached version of the children for this category so just return it\n\t\t\tif(isset($childCatsCache[$categoryId])) {\n\t\t\t\treturn explode(',', $childCatsCache[$categoryId]);\n\t\t\t}\n\n\t\t\tif(!is_array($childCatsCache)) {\n\t\t\t\t$childCatsCache = array();\n\t\t\t}\n\n\t\t\t$childCats = array();\n\t\t\t$query = \"\n\t\t\t\tSELECT categoryid\n\t\t\t\tFROM [|PREFIX|]categories\n\t\t\t\tWHERE CONCAT(',', catparentlist, ',') LIKE '%,\".(int)$categoryId.\",%' AND categoryid!='\".(int)$categoryId.\"'\n\t\t\t\";\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile($child = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$childCats[] = $child['categoryid'];\n\t\t\t}\n\t\t\t$childCatsCache[$categoryId] = implode(',', $childCats);\n\t\t\t$GLOBALS['ISC_CLASS_DATA_STORE']->Save('ChildCategories', $childCatsCache);\n\t\t\treturn $childCats;\n\t\t}", "function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}", "public function subcategories(){\n return $this->hasMany(Category::class,'parent_category_id')->where('hidden', 0);\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function sub_categories()\n {\n return $this->hasMany('App\\SubCategory');\n }", "public function testGETSubresourcesPostCategoryRequest()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/post/1/categories',\n\t\t\t'type'\t\t=> 'GET',\n\t\t\t'data'\t\t=> null,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":true,\"message\":\"Record(s) Found\",\"data\":{\"totalCount\":\"2\",\"category\":[{\"id\":\"1\",\"name\":\"cat1\"},{\"id\":\"2\",\"name\":\"cat2\"}]}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}", "function getAllTestCategoriesInsideACategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesCategoriesID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n\n //get property\n $testCategoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n\n //First, we need the tree categories\n $tree = getItemsTree($itemTypeTestCasesCategoriesID, $clientID, $testCategoryParentPropertyID, $parentCategoryID);\n\n //Transform the items tree and store the ids in an unidimensional array\n $allCategories = array();\n\n //First, add the parentCategoryID\n $allCategories[] = $parentCategoryID;\n\n if ($tree) {\n foreach ($tree as $parid => $parent) {\n\n if (!in_array($parid, $allCategories)) {\n //Add the value\n $allCategories[] = $parid;\n }\n\n foreach ($parent as $child) {\n $id = $child['ID'];\n\n //Check if the values does not exist in the allCategories array.\n if (!in_array($id, $allCategories)) {\n //Add the value\n $allCategories[] = $id;\n }\n }\n }\n }\n\n //And return the testCategories\n return ($allCategories);\n}", "public function getAllCategories() {\n\n if (!isset(parent::all()[0])) {\n return [];\n }\n return parent::all()[0]->children;\n }", "public function get_sub_categories($id)\n\t{\n\t\t$data = $this->categories->get_sub_categories_of_parent_category($id);\n\t\techo json_encode($data);\n\t}", "function categories($prefix_subcategories = true)\n{\n $temp = [];\n $temp['01-00'] = 'Arts';\n $temp['01-01'] = 'Design';\n $temp['01-02'] = 'Fashion & Beauty';\n $temp['01-03'] = 'Food';\n $temp['01-04'] = 'Books';\n $temp['01-05'] = 'Performing Arts';\n $temp['01-06'] = 'Visual Arts';\n\n $temp['02-00'] = 'Business';\n $temp['02-02'] = 'Careers';\n $temp['02-03'] = 'Investing';\n $temp['02-04'] = 'Management';\n $temp['02-06'] = 'Entrepreneurship';\n $temp['02-07'] = 'Marketing';\n $temp['02-08'] = 'Non-Profit';\n\n $temp['03-00'] = 'Comedy';\n $temp['03-01'] = 'Comedy Interviews';\n $temp['03-02'] = 'Improv';\n $temp['03-03'] = 'Stand-Up';\n\n $temp['04-00'] = 'Education';\n $temp['04-04'] = 'Language Learning';\n $temp['04-05'] = 'Courses';\n $temp['04-06'] = 'How To';\n $temp['04-07'] = 'Self-Improvement';\n\n $temp['20-00'] = 'Fiction';\n $temp['20-01'] = 'Comedy Fiction';\n $temp['20-02'] = 'Drama';\n $temp['20-03'] = 'Science Fiction';\n\n $temp['06-00'] = 'Government';\n\n $temp['30-00'] = 'History';\n\n $temp['07-00'] = 'Health & Fitness';\n $temp['07-01'] = 'Alternative Health';\n $temp['07-02'] = 'Fitness';\n // $temp['07-03'] = 'Self-Help';\n $temp['07-04'] = 'Sexuality';\n $temp['07-05'] = 'Medicine';\n $temp['07-06'] = 'Mental Health';\n $temp['07-07'] = 'Nutrition';\n\n $temp['08-00'] = 'Kids & Family';\n $temp['08-01'] = 'Education for Kids';\n $temp['08-02'] = 'Parenting';\n $temp['08-03'] = 'Pets & Animals';\n $temp['08-04'] = 'Stories for Kids';\n\n $temp['40-00'] = 'Leisure';\n $temp['40-01'] = 'Animation & Manga';\n $temp['40-02'] = 'Automotive';\n $temp['40-03'] = 'Aviation';\n $temp['40-04'] = 'Crafts';\n $temp['40-05'] = 'Games';\n $temp['40-06'] = 'Hobbies';\n $temp['40-07'] = 'Home & Garden';\n $temp['40-08'] = 'Video Games';\n\n $temp['09-00'] = 'Music';\n $temp['09-01'] = 'Music Commentary';\n $temp['09-02'] = 'Music History';\n $temp['09-03'] = 'Music Interviews';\n\n $temp['10-00'] = 'News';\n $temp['10-01'] = 'Business News';\n $temp['10-02'] = 'Daily News';\n $temp['10-03'] = 'Entertainment News';\n $temp['10-04'] = 'News Commentary';\n $temp['10-05'] = 'Politics';\n $temp['10-06'] = 'Sports News';\n $temp['10-07'] = 'Tech News';\n\n $temp['11-00'] = 'Religion & Spirituality';\n $temp['11-01'] = 'Buddhism';\n $temp['11-02'] = 'Christianity';\n $temp['11-03'] = 'Hinduism';\n $temp['11-04'] = 'Islam';\n $temp['11-05'] = 'Judaism';\n $temp['11-06'] = 'Religion';\n $temp['11-07'] = 'Spirituality';\n\n $temp['12-00'] = 'Science';\n $temp['12-01'] = 'Medicine';\n $temp['12-02'] = 'Natural Sciences';\n $temp['12-03'] = 'Social Sciences';\n $temp['12-04'] = 'Astronomy';\n $temp['12-05'] = 'Chemistry';\n $temp['12-06'] = 'Earth Sciences';\n $temp['12-07'] = 'Life Sciences';\n $temp['12-08'] = 'Mathematics';\n $temp['12-09'] = 'Nature';\n $temp['12-10'] = 'Physics';\n\n $temp['13-00'] = 'Society & Culture';\n // $temp['13-01'] = 'History';\n $temp['13-02'] = 'Personal Journals';\n $temp['13-03'] = 'Philosophy';\n $temp['13-04'] = 'Places & Travel';\n $temp['13-05'] = 'Relationships';\n $temp['13-06'] = 'Documentary';\n\n $temp['14-00'] = 'Sports';\n $temp['14-05'] = 'Baseball';\n $temp['14-06'] = 'Basketball';\n $temp['14-07'] = 'Cricket';\n $temp['14-08'] = 'Fantasy Sports';\n $temp['14-09'] = 'Football';\n $temp['14-10'] = 'Golf';\n $temp['14-11'] = 'Hockey';\n $temp['14-12'] = 'Rugby';\n $temp['14-13'] = 'Running';\n $temp['14-14'] = 'Soccer';\n $temp['14-15'] = 'Swimming';\n $temp['14-16'] = 'Tennis';\n $temp['14-17'] = 'Volleyball';\n $temp['14-18'] = 'Wilderness';\n $temp['14-19'] = 'Wrestling';\n\n $temp['15-00'] = 'Technology';\n\n $temp['50-00'] = 'True Crime';\n\n $temp['16-00'] = 'TV & Film';\n $temp['16-01'] = 'After Shows';\n $temp['16-02'] = 'Film History';\n $temp['16-03'] = 'Film Interviews';\n $temp['16-04'] = 'Film Reviews';\n $temp['16-05'] = 'TV Reviews';\n\n if ($prefix_subcategories) {\n foreach ($temp as $key => $val) {\n $parts = explode('-', $key);\n $cat = $parts[0];\n $subcat = $parts[1];\n\n if ($subcat != '00') {\n $temp[$key] = $temp[$cat.'-00'].' > '.$val;\n }\n }\n }\n\n return $temp;\n}" ]
[ "0.77698004", "0.7572063", "0.73857844", "0.73384017", "0.73100144", "0.72855675", "0.721517", "0.7211912", "0.7191976", "0.71513855", "0.7107529", "0.7089275", "0.70819443", "0.70757496", "0.707214", "0.7061191", "0.7061191", "0.70204246", "0.70166427", "0.6984815", "0.6982", "0.6973248", "0.69721633", "0.6940891", "0.6909174", "0.6902674", "0.687908", "0.6844571", "0.68357366", "0.68261474", "0.6791848", "0.67903465", "0.6738349", "0.6725423", "0.6718814", "0.67173666", "0.6714537", "0.6714532", "0.6706457", "0.66649985", "0.6655448", "0.6621401", "0.66194296", "0.6611552", "0.6593649", "0.65816265", "0.65800506", "0.65783465", "0.6577819", "0.6573025", "0.6556481", "0.65553653", "0.65475786", "0.6542941", "0.6537922", "0.6529249", "0.65217716", "0.6511636", "0.6502943", "0.6499146", "0.6492941", "0.649173", "0.64860755", "0.64744383", "0.6470877", "0.6465297", "0.64639205", "0.64601225", "0.64580137", "0.64439553", "0.6436166", "0.64184326", "0.64157397", "0.6415615", "0.6410073", "0.6404171", "0.6398817", "0.638444", "0.6357248", "0.6356625", "0.6356298", "0.6352161", "0.6348864", "0.63448477", "0.6334556", "0.63296646", "0.6327331", "0.6325566", "0.63210446", "0.6318692", "0.631359", "0.6293927", "0.6291528", "0.6290359", "0.62868625", "0.62849766", "0.62772316", "0.62761784", "0.6272653", "0.6270144" ]
0.6423475
71
////////////////////////////////////////////////////////////////////// Get category data
public static function getCategoryData($category_id) { $data = fn_get_category_data($category_id); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "public function getCategoryData()\n {\n $_category = Mage::registry('current_category');\n $data = array();\n if ($_category) {\n $data['categoryId'] = $_category->getId();\n $data['categoryName'] = $_category->getName();\n }\n return $data;\n }", "public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}", "public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }", "public function getCategory() {}", "public function getCategory();", "public function getCategory();", "private function getCategory()\n {\n $catobj = (object)Array();\n $catobj->preview = $this->getFilePath('preview');\n $catobj->category = $this->category_number;\n $catobj->html = $this->getContent();\n $catobj->googleFonts = [];\n $catobj->contentCss = $this->getFilePath('relative_css');\n $catobj->contentClass = $this->getCSSClass($this->getFilePath('css'));\n return $catobj;\n }", "public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }", "function getCategory(){\n\t\t\t$data = array(); \n\t\t\t$query = \"select * from packages_category\";\n\t\t\t$result = mysql_query($query);\n\t\t \n\t\t\tif($result){\n\t\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\tarray_push($data,$row);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\tdie(\"error in mysql query \" . mysql_error());\n\t\t\t}\n\t\t}", "public function get_category() {\n $data['get_category'] = $this->Category_model->get_category();\n return $data['get_category'];\n }", "public function get_category()\n\t{\n\t\tglobal $module_name, $nv_Cache;\n\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id', $module_name );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "public function getCategory()\n {\n }", "public function get_category(){\n\t\treturn $this->category;\n\t}", "function get_cat() {\r\n \r\n $query = $this->db->get('categories');\r\n return $query->result_array();\r\n }", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}", "public function getcategory()\r\n{\r\n {\r\n $sql = \"select * from categories\";\r\n $result = $this->connect()->query($sql);\r\n if ($result->rowCount() > 0) {\r\n while ($row = $result->fetch()) {\r\n $data[] = $row;\r\n\r\n }\r\n return $data;\r\n }\r\n }\r\n}", "public function category() {\n\t\treturn $this->get_category();\n\t}", "function getCategory() {\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$sql = 'SELECT * FROM #__eb_categories WHERE id='.$categoryId;\n\t\t$this->_db->setQuery($sql) ;\n\t\treturn $this->_db->loadObject();\t\t\t\n\t}", "public function getCategoryData($catId) {\r\n /** load category based on category id */\r\n return Mage::getModel ( 'catalog/category' )->load ( $catId );\r\n }", "public function getCategory()\n {\n return $this->_category;\n }", "public function getCategory()\n\t\t{\n\t\t\t$sql = \"SELECT id_category,name_cate FROM tbl_category_products\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\t\t\t$pre->execute();\n\n\t\t\treturn $pre->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}", "function category()\n\t{\n\n\t\t//$CI =& get_instance();\n\t\t$this->load->model('shop/categories_m');\n\n\t\t$id = $this->attribute('id', '');\n\t\t$field = $this->attribute('field', '');\n\n\t\t$category = $this->categories_m->get( $id );\n\t\n\n\t\tif($category)\n\t\t{\n\t\t\tif($field != '')\n\t\t\t{\n\t\t\t\treturn array('result' => $category->$field );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (array) $category;\n\t\t\t}\n\t\t}\n\n\t\treturn array('result' => '');\n\n\t}", "function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }", "public function getCategory()\n {\n $get_property_category =Category::get();\n return $get_property_category->tojson();\n }", "public function getCat() {\n return DB::q_array(\"SELECT id, title, image FROM news_category WHERE published = 1\");\n }", "public static function getCategory()\n {\n return self::$category;\n }", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "public function getCategory()\n {\n return $this->category;\n }", "function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }", "function &getCategories()\r\n\t{\r\n\t\t$query = 'SELECT id AS value, catname AS text'\r\n\t\t\t\t. ' FROM #__eventlist_categories'\r\n\t\t\t\t. ' WHERE published = 1'\r\n\t\t\t\t. ' ORDER BY ordering'\r\n\t\t\t\t;\r\n\t\t$this->_db->setQuery( $query );\r\n\r\n\t\t$this->_categories = $this->_db->loadObjectList();\r\n\r\n\t\treturn $this->_categories;\r\n\t}", "public function getCategories();", "public function getCategories();", "function readCategories()\n{\n return readJsonFile(CATEGORIES_PATH);\n}", "public function getCategory(){\n return $this->category;\n }", "function getCategory($id_category){\n $db = db();\n $db->begin();\n $data = $db->exec('SELECT * FROM m_song WHERE fk_id_category = '.$id_category);\n\n return $data;\n }", "public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}", "function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}", "public function getCategory() {\n return $this->category;\n }", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "public function getCat()\n {\n return $this->cat = get_the_category($this->id);\n }", "public function getCategory() {\n\t\treturn $this->category;\n\t}", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function getCategory() {\r\n return \\models\\Database::validateData($this->_category, 'string|specialchars|strip_tags');\r\n }", "public function getCategory() {\n return $this->category;\n }", "public function getCategoryAccessData()\n\t{\n\t\treturn $this->categoryAccess;\n\t}", "function getAllCategories()\n {\n return $this->data->getAllCategories();\n }", "public function categoryArray() {\n\t\tif($this->data['mdid'] != \"\") {\n\t\t\treturn getCategoryArray($this->data['mdid'],'media');\n\t\t}\n\t\treturn ;\n\t}", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function getCategory()\n {\n return $this->category;\n }", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "public function getCategoryCloud()\n {\n $sql = \"\n SELECT\n PC.id as cat_id,\n PC.category,\n P2C.id,\n P2C.cat_id,\n COUNT(P2C.id) AS amount\n FROM Prod2Cat AS P2C\n LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n GROUP BY P2C.cat_id\n -- ORDER BY amount DESC\n \";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n return $res;\n }", "public function getCategory()\n {\n\n return $this->category;\n }", "public function get_category_permastruct()\n {\n }", "public function getCategory()\n {\n return $this->readOneof(2);\n }", "public function fetch_postcategory()\n\t\t{\n\t\t\t$query = $this->db->query('SELECT * FROM table_postcategory');\n\n foreach ($query->result() as $row)\n {\n $data[] = $row;\n }\n return $data;\n\t\t}", "public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }", "public function get_categories() {\n\t error_log(\"get_categories - category id: \" . $category_id,0);\n\n\t$query = \"SELECT * FROM category ORDER BY category_name ASC\";\n\n\t error_log(\"get_categories - query: \" . $query,0);\n\n \t $result = mysql_query($query);\n\n if ($result) {\n return $result;\n } else {\n\terror_log(\"did not get categories\",0);\n $error = mysql_errno();\n return -$error;\n }\n\n }", "public function getCategories() : array;", "public function getCategory()\n {\n \t$cat = Category::with('child')->get();\n return response()->json( [ 'cat' => $cat ] );\n }", "function getCategoryDataAction()\n {\n $siteId = $this->request->categoryId;\n $site = $this->category->findByPk($siteId);\n $this->set($site->toArray());\n $this->viewClass = \"JsonView\";\n }", "function getCategory()\n\t{\n\t\t//global $catarray;\n\t\t$getcat=array();\n\t\tinclude(\"config.php\");\n\t\tglobal $conn, $stmt;\n\t\t$stmt=$conn->prepare(\"SELECT name FROM category\");\n\t\t$stmt->bind_result($name);\n\t\t$stmt->execute();\n\t\twhile($stmt->fetch())\n\t\t{\n\t\t\tarray_push($getcat,array(\"name\"=>$name));\n\t\t}\n\t\treturn $getcat;\n\t}", "function get_category_data( $adunit = false ) {\n\t$exposed_values = array();\n\t$parent_categories = array();\n\t$sub_categories = array();\n\t$exposed_values['parent_categories'] = 'no_value';\n\t$exposed_values['sub_categories'] = 'no_value';\n\tif ( is_single() ) {\n\t\tglobal $post;\n\t\t$category_tax = 'category';\n\t\t$categories = get_the_terms( $post->ID, $category_tax );\n\t\tif ( ! empty( $categories ) ) {\n\t\t\tforeach ( $categories as $term ) {\n\t\t\t\t$ancestors = get_ancestors( $term->term_id, $category_tax );\n\t\t\t\tif ( ! empty( $ancestors ) ) {\n\t\t\t\t\tforeach ( $ancestors as $ancestor ) {\n\t\t\t\t\t\t$remove[] = \"'\";\n\t\t\t\t\t\tif ( ! $adunit ) {\n\t\t\t\t\t\t\t$remove[] = '-';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$ancestor_term = get_term( $ancestor );\n\t\t\t\t\t\tarray_push( $parent_categories, str_replace( $remove, '', $ancestor_term->slug ) );\n\t\t\t\t\t\tarray_push( $sub_categories, str_replace( $remove, '', $term->slug ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$term_slug = $term->slug;\n\t\t\t\t\tarray_push( $parent_categories, $term_slug );\n\t\t\t\t}\n\t\t\t}\n\t\t\t$filter_similar_parent_cats = array_unique( $parent_categories, SORT_STRING );\n\t\t\t$parent_categories = implode( ', ', $filter_similar_parent_cats );\n\t\t\t$filter_similar_sub_cats = array_unique( $sub_categories, SORT_STRING );\n\t\t\t$sub_categories = implode( ', ', $filter_similar_sub_cats );\n\t\t\tif ( ! empty( $parent_categories ) ) {\n\t\t\t\t$exposed_values['parent_categories'] = $parent_categories;\n\t\t\t}\n\t\t\tif ( ! empty( $sub_categories ) ) {\n\t\t\t\t$exposed_values['sub_categories'] = $sub_categories;\n\t\t\t}\n\t\t}\n\t} elseif ( is_category() || is_archive() ) {\n\t\t$q_object = get_queried_object();\n\t\t// WP_Post_Type archives don't have a \"slug\" property.\n\t\tif ( ! empty( $q_object->slug ) ) {\n\t\t\t$cat_slug = $q_object->slug;\n\t\t\t$exposed_values['parent_categories'] = $cat_slug;\n\t\t\t$exposed_values['sub_categories'] = $cat_slug;\n\t\t}\n\t\tif ( is_post_type_archive( 'joke' ) ) {\n\t\t\t$exposed_values['parent_categories'] = 'jokes';\n\t\t\t$exposed_values['sub_categories'] = 'jokes';\n\t\t}\n\t} elseif ( is_page() ) {\n\t\t$exposed_values['parent_categories'] = 'misc';\n\t\t$exposed_values['sub_categories'] = 'misc';\n\t} elseif ( is_home() && is_front_page() ) {\n\t\t$exposed_values['parent_categories'] = 'homepage';\n\t\t$exposed_values['sub_categories'] = 'homepage';\n\t}\n\treturn $exposed_values;\n}", "public static function getCategories()\n {\n //get cached categories\n $catCached = Yii::$app->cache->get('catCached');\n if ($catCached) {\n return $catCached;\n } else {\n return self::find()->indexBy('category_id')->asArray()->all();\n }\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "static function get_category_by_id($category){\n\t\treturn self::$db->where('id',$category)->get('categories')->results();\n\t}", "public static function categories() {\n $db = Db::getInstance();\n $req = $db->query('SELECT * FROM category');\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getCategoryList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$category = D('Category');\n\t\t\t$sql = \"SELECT * FROM lib_category;\";\n\t\t\t$return = $category->query($sql);\n\t\t\t$result = array();\n\t\t\tfor ($k = 0; $k < count($return); $k++) {\n\t\t\t\tarray_push($result, $return[$k]['category']);\n\t\t\t}\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return),\n\t\t\t\t\t'cat' => json_encode($result)\n\t\t\t\t));\n\t\t\t\techo $json;\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}\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 get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "private function __getCats() {\n\n\t\t$rootcatID = Mage::app()->getStore()->getRootCategoryId();\n\n\t\t$categories = Mage::getModel('catalog/category')\n\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t\t\t\t->addIsActiveFilter();\n $data = array();\n foreach ($categories as $attribute) {\n\t\t\t$data[] = array(\n\t\t\t\t'value' => $attribute->getId(),\n\t\t\t\t'label' => $attribute->getName()\n\t\t\t);\n }\n return $data;\n }", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}", "function getCategories(){\n\treturn dbSelect('categories');\n}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t\t\t\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))\n\t\t\t\t\t\t->orderby(\"category_name\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\treturn $result;\n\t}" ]
[ "0.8049214", "0.80097157", "0.7630015", "0.7294515", "0.72921723", "0.7259649", "0.7259649", "0.7233126", "0.7231281", "0.7209674", "0.71921027", "0.7139417", "0.70948845", "0.7092865", "0.7076273", "0.7047592", "0.70311606", "0.7020737", "0.70064306", "0.6998423", "0.69821537", "0.69511217", "0.69391006", "0.69257265", "0.6923657", "0.6920535", "0.6910732", "0.6897719", "0.68866974", "0.68833077", "0.6875072", "0.6872982", "0.6861521", "0.6861521", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.6840861", "0.68283695", "0.68179107", "0.68149126", "0.68149126", "0.6802872", "0.6801601", "0.67970514", "0.67938673", "0.67893237", "0.67868984", "0.677904", "0.6762972", "0.6758376", "0.67495036", "0.6747976", "0.6746737", "0.67265296", "0.6724142", "0.6719603", "0.67078257", "0.6707278", "0.6707238", "0.66842574", "0.6681988", "0.66797197", "0.6668846", "0.6655845", "0.6653312", "0.6650102", "0.6648664", "0.66418403", "0.66417605", "0.66349804", "0.66246223", "0.66228086", "0.6620203", "0.6617657", "0.6608858", "0.66019046", "0.6598198", "0.6597306", "0.6593316", "0.6585633", "0.6578128", "0.6578089", "0.65769047", "0.657606", "0.65723157", "0.6559642", "0.6547058", "0.6540391" ]
0.0
-1
/////////////////////////////////////////////////////////////////////// Get product data
public static function getProductData($product_id) { $auth = fn_fill_auth(); $data = fn_get_product_data($product_id, $auth); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductData()\n {\n // use\n //$this->request->getParams(); // all params\n $id= $this->request->getParam('param');\n $product = $this->_product->create()->load($id);\n return $product;\n\n }", "public function getProductData()\n {\n $p = Mage::registry('current_product');\n\n $data = array();\n if($p) {\n $data['name'] = $this->escapeSingleQuotes($p->getName());\n $data['productId'] = $this->escapeSingleQuotes($p->getSku());\n $data['price'] = Mage::helper('affirm/util')->formatCents(\n $this->getProductPrice($p)\n );\n $data['currency'] = $this->getCurrentCurrencyCode();\n }\n\n return $data;\n }", "public function getProductData()\n {\n return $this->_coreRegistry->registry('current_product');\n }", "public function getProduct();", "public function productRetrieveInfo(){\n\t\t$productId\t\t\t\t=\tself::getUserId();\n\t\t$productTable\t\t\t=\tself::getUserTable();\n\t\t$joinTable\t\t\t\t=\tself::getJoinTable();\n\t\t$productArray\t\t\t=\tself::getUserArray(); //single dimension array output\t\t\n\t\t$productCond\t\t\t=\tself::getUserCond();\t\t\n\t\t$retArray\t\t\t\t=\tself::retrieveEntry($productTable, $productArray, $joinTable, $productCond);\n\t\tforeach ($retArray as $retIndex => $retValue) {\n $$retIndex \t\t\t= \t$retValue;\n $mainArr \t\t\t=\texplode('|', $$retIndex);\n\t\t\t$returnValue \t\t= \tarray();\t\t\t \t \n\t\t\tforeach ($mainArr as $mainArrIndex => $mainArrValue) {\t\t\t\t\t\n\t\t\t\t$returnValue[] \t= \t$mainArrValue;\t\t\t\n\t\t\t}\t\t\t \n }\n\t\treturn $returnValue;\n\t}", "public function getUpdateProductData();", "function get_data_product() {\n $query = $this->db->query('select * from BI_emarsys_product_feeds');\n \n \tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\n\t\t}\n }", "public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}", "abstract protected function extractProductDetail();", "private function getProductInformation()\r\n {\r\n \r\n // if product is repairable get the repair agents details as well as products and suppliers\r\n if ($this->claimType == \"repair-warranty\" || $this->claimType == \"repair-no-warranty\" || \r\n $this->claimType == \"repair-no-transaction\")\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplierRepairAgent_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n // if the product is not repairable grab the product information and supplier information only\r\n else\r\n {\r\n $result = mysql_query( \"SELECT *\r\n FROM ProductSupplier_VIEW\r\n WHERE Keycode = $this->keycode\");\r\n \r\n $this->keycodeResult = mysql_fetch_array($result);\r\n }\r\n }", "public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }", "public function get_all_product_information () {\n $this->json_source_file = file_get_contents(\"products.json\");\n $this->json_source_array = json_decode($this->json_source_file,true);\n\n }", "public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }", "public function getProductSaveInfo($product, $data) {\n $product->setColor ( $data [11] );\n $product->setCost ( $data [12] );\n $product->setCountry ( $data [13] );\n $product->setCountryOfManufacture ( $data [14] );\n $product->setCreatedAt ( $data [15] );\n $product->setDescription ( $data [20] );\n $product->setEnableGooglecheckout ( $data [21] );\n $product->setGallery ( $data [22] );\n $product->setGiftMessageAvailable ( $data [23] );\n $product->setHasOptions ( $data [24] );\n $product->setHostemail ( $data [25] );\n $product->setHouserule ( $data [26] );\n $product->setImage ( $data [27] );\n $product->setImageLabel ( $data [28] );\n $product->setMediaGallery ( $data [30] );\n $product->setMinimalPrice ( $data [34] );\n $product->setMsrp ( $data [35] );\n $product->setMsrpDisplayActualPriceType ( $data [36] );\n $product->setMsrpEnabled ( $data [37] );\n $product->setName ( $data [38] );\n $product->setNewsFromDate ( strtotime ( $data [39] ) );\n $product->setNewsToDate ( '' );\n if (isset ( $data [41] )) {\n $product->setOptionsContainer ( $data [41] );\n }\n if (isset ( $data [43] )) {\n $product->setPrice ( $data [43] );\n }\n if (isset ( $data [44] )) {\n $product->setPrivacy ( $data [44] );\n }\n if (isset ( $data [45] )) {\n $product->setPropertyadd ( $data [45] );\n }\n if (isset ( $data [46] )) {\n $product->setPropertytype ( $data [46] );\n }\n if (isset ( $data [47] )) {\n $product->setPropertyWebsite ( $data [47] );\n }\n if (isset ( $data [48] )) {\n $product->setRequiredOptions ( $data [48] );\n }\n if (isset ( $data [49] )) {\n $product->setShortDescription ( $data [49] );\n }\n if (isset ( $data [50] )) {\n $product->setSmallImage ( $data [50] );\n }\n if (isset ( $data [51] )) {\n $product->setSmallImageLabel ( $data [51] );\n }\n if (isset ( $data [52] )) {\n $product->setSpecialFromDate ( $data [52] );\n }\n if (isset ( $data [53] )) {\n $product->setSpecialPrice ( $data [53] );\n }\n if (isset ( $data [54] )) {\n $product->setSpecialToDate ( $data [54] );\n }\n if (isset ( $data [55] )) {\n $product->setStatus ( $data [55] );\n }\n if (isset ( $data [56] )) {\n $product->setTaxClassId ( $data [56] );\n }\n if (isset ( $data [57] )) {\n $product->setThumbnail ( $data [57] );\n } \n return $product;\n }", "public function getProduct(): array\r\n {\r\n $pro = [];\r\n $result = $this->DataB->query('SELECT * FROM product');\r\n\r\n while ($row = $result->fetch_assoc()) {\r\n $pro[] = $row;\r\n }\r\n\r\n return $pro;\r\n }", "public function query_my_product_info(){\n\t\t$response = $this->execute($this->query_my_product_info_url);\n\t\tif(!$response){\n\t\t\tthrow new Exception(\"error in communication\");\n\t\t}\n\t\treturn json_decode($response,true);\n\t}", "protected function _getProductData() {\n\n\n $cat_id = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();\n $category = Mage::getModel('catalog/category')->load($cat_id);\n $data['event'] = 'product';\n\n $finalPrice = $this->getFinalPriceDiscount();\n if($finalPrice):\n $google_tag_params = array();\n $google_tag_params['ecomm_prodid'] = $this->getProduct()->getSku();\n $google_tag_params['name'] = $this->getProduct()->getName();\n $google_tag_params['brand'] = $this->getProduct()->getBrand();\n $google_tag_params['ecomm_pagetype'] = 'product';\n $google_tag_params['ecomm_category'] = $category->getName();\n $google_tag_params['ecomm_totalvalue'] = (float)$this->formatNumber($finalPrice);\n \n $customer = Mage::getSingleton('customer/session');\n if ($customer->getCustomerId()){\n $google_tag_params['user_id'] = (string) $customer->getCustomerId(); \n }\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n\n $data['google_tag_params'] = $google_tag_params;\n\n /* Facebook Conversion API Code */\n $custom_data = array(\n \"content_name\" => $this->getProduct()->getName(),\n \"content_ids\" => [$this->getProduct()->getSku()],\n \"content_category\" => $category->getName(),\n \"content_type\" => \"product\",\n \"value\" => (float)$this->formatNumber($finalPrice),\n \"currency\" => \"BRL\"\n );\n $this->createFacebookRequest(\"ViewContent\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n\n endif;\n\n return $data;\n }", "function getData($id)\n {\n return $this->objProductos->getInfoProducto($id);\n }", "function getProduct($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/id/'.(int)$params['id'].'.json'),true);\n\t}", "public function getProductData($productId) {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $productData = $objectManager->get('Apptha\\Airhotels\\Block\\Listings\\Home');\n return $productData->getProduct($productId);\n }", "public function product()\n {\n return $this->m_product;\n }", "public function neoProductInfo()\r\n {\r\n $result = array();\r\n\r\n $sysUtil = new SysUtility();\r\n $productInfoTblName = $sysUtil->getNeoProductInfoTblName();\r\n\r\n $neoModel = new NeoModel(SysDefinition::USER_DB_CONFIG);\r\n // Connect to Database\r\n $db_neo_conn = $neoModel->connect();\r\n\r\n if (! $db_neo_conn) {\r\n return (false); // Connect to DB failed return without further handling\r\n }\r\n\r\n // set the db table name\r\n $neoModel->setTableName($productInfoTblName);\r\n $queryResult = $neoModel->getNeoAllProductInfo();\r\n\r\n if (! is_bool($queryResult)) {\r\n $result = $queryResult;\r\n // Preset the default value\r\n $result[\"service_term\"] = 6;\r\n $result[\"store_quantity\"] = 1;\r\n\r\n $neoModel->close();\r\n return ($result);\r\n } else {\r\n $neoModel->close();\r\n return (false);\r\n }\r\n\r\n return ($result);\r\n }", "public function getQuoteProductsData()\n {\n $quote= Mage::getSingleton('checkout/session')->getQuote();\n $data = array();\n if ($quote) {\n foreach ($quote->getAllVisibleItems() as $item) {\n $productData = array();\n $productData['productId'] = $this->escapeSingleQuotes($item->getSku());\n $productData['name'] = $this->escapeSingleQuotes($item->getName());\n $productData['price'] = Mage::helper('affirm/util')->formatCents(\n $item->getPrice()\n );\n $productData['currency'] = $this->getCurrentCurrencyCode();\n $productData['quantity'] = $item->getQty();\n $data[] = $productData;\n }\n }\n return $data;\n\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "public function get_product()\n {\n return $this->_product;\n }", "public function getData($productId)\n {\n $output = [];\n $product = $this->getProduct($productId);\n\n if ($product) {\n // Prepare the base data\n $output = [\n 'id' => $product->getId(),\n 'sku' => $product->getSku(),\n 'name' => $product->getName(),\n 'price' => $this->renderProductPrice($productId),\n 'is_free' => $this->isFree($productId),\n 'form_key' => $this->toolsHelper->getFormKey(),\n 'has_parents' => $this->hasParents($product),\n 'in_stock' => $this->isInStock($productId),\n 'quantity_limits' => $this->getQuantityLimits($productId),\n 'has_attributes' => (bool) $this->hasAttributes($productId),\n 'has_options' => (bool) $this->hasOptions($productId),\n 'button_id' => $this->getButtonId($productId),\n 'button_container_selector' => '#nbn-' . $productId,\n 'button_selector' => '#' . $this->getButtonId($productId),\n 'page_url' => $product->getProductUrl(),\n 'attributes' => $this->getAttributes($productId),\n 'options' => $this->getOptions($productId)\n ];\n }\n\n return $output;\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return Mage::registry('product');\n }", "public function getProduct() {\n return Mage::registry('product');\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public static function get($product_id)\n {\n\n // Check Cache system\n if (self::$enable_cache) {\n $data = wp_cache_get($product_id, self::$cache_key);\n if ($data != false) {\n return $data;\n }\n }\n\n // Get Data\n $product = wc_get_product($product_id);\n\n // Data\n // Also We Can Use WC()->api->WC_API_Products->get_product( $product->get_id() );\n $product_data = self::get_product_data($product);\n\n // add variations to variable products\n if ($product->is_type('variable') && $product->has_child()) {\n $product_data['variations'] = self::get_variation_data($product);\n }\n\n // add the parent product data to an individual variation\n if ($product->is_type('variation') && $product->get_parent_id()) {\n $product_data['parent'] = self::get_product_data($product->get_parent_id());\n }\n\n // Add grouped products data\n if ($product->is_type('grouped') && $product->has_child()) {\n $product_data['grouped_products'] = self::get_grouped_products_data($product);\n }\n\n if ($product->is_type('simple')) {\n $parent_id = $product->get_parent_id();\n if (!empty($parent_id)) {\n $_product = wc_get_product($parent_id);\n $product_data['parent'] = self::get_product_data($_product);\n }\n }\n\n // Result\n if (self::$enable_cache) {\n wp_cache_set($product_id, $product_data, self::$cache_key);\n }\n\n // Return Data\n return $product_data;\n }", "public function getProducts()\n {\n $file = file_get_contents($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\") or die();\n return json_decode($file);\n\n }", "public function getProduct() {\r\n return $this->_product;\r\n }", "function LoadProduct($orderid) {\n\t$proids = array();\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"orderproduct\",array('id','orderid','proid','number','price','returnnow','modlcharge'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$idobj = $factory->getIdentityObject()->field('orderid')->eq($orderid);\n\t$order_pro = $finder->find($idobj);\n\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"product\",array('id','classid','length','width','think','unitlen','unitwid','unitthi','unit','sharp','note'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$pro = $order_pro->next();\n\t$i = 0;\n\t$data = array();\n\twhile($pro){\n\t\t$data[$i][0] = $i+1;\n\t\t$idobj = $factory->getIdentityObject()->field('id')->eq($pro->getProid());\n\t\t$collection = $finder->find($idobj);\n\t\t$product = $collection->current();\n\t\t$data[$i][1] = $product->getSize();\n\t\t$data[$i][2] = $pro->getNumber();\n\t\t$price = $pro->getPrice()-$pro->getReturnnow();\n\t\t$data[$i][3] = sprintf(\"%.2f\",$price);\n\t\t$data[$i][4] = sprintf(\"%.2f\",$price*$data[$i][2]);\n\t\t$i++;\n\t\t$pro = $order_pro->next();\n\t}\n\treturn $data;\n}", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function get_product_details($product) {\n // I will assume the connection is there and working and\n // the data is returned correctly.\n return json_encode($this->products[$product]);\n }", "public function actionWalmartproductinfo()\n {\n $sku = false;\n $productdata = \"add sku on url like ?sku=product_sku\";\n if (isset($_GET['sku'])) {\n $sku = $_GET['sku'];\n }\n $merchant_id = MERCHANT_ID;\n $config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi($config['consumer_id'], $config['secret_key']);\n if ($sku) {\n $productdata = $walmartHelper->getItem($sku);\n }\n print_r($productdata);\n die;\n }", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function getProductInfosList(){\n return $this->_get(1);\n }", "public function getProduct() {\r\n\t\t$id = $this->getRequest()->getParam('id');\r\n\t\t$products = Mage::getModel('catalog/product')->load($id);\r\n\t\treturn $products;\r\n\t}", "function get_store_data()\n\t{\n\t\t// fetch data from db\n\t\t$_data = index_array($this->db_fetch('client_data', array('where' => array('key' => 'product'))), 'type', TRUE);\n\t\t// split data\n\t\tforeach($_data as $type => $vals)\n\t\t{\n\t\t\t$pos = array();\n\t\t\tforeach($vals as $id => $val)\n\t\t\t{\n\t\t\t\tif( !isset($tags) || !in_array($val['tag'], $tags) )\n\t\t\t\t{\n\t\t\t\t\t// check for position taken\n\t\t\t\t\twhile(in_array($val['position'], $pos))\n\t\t\t\t\t{\n\t\t\t\t\t\t++$val['position'];\n\t\t\t\t\t}\n\t\t\t\t\t// save pos to array\n\t\t\t\t\t$pos[] = $val['position'];\n\t\t\t\t\t//\n\t\t\t\t\t$output[$type][$val['position']] = $val;\n\t\t\t\t\t//\n\t\t\t\t\t$tags[] = $val['tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort array\n\t\t\tksort($output[$type]);\n\t\t}\n\t\t// return output\n\t\treturn $output;\n\t}", "public function getproductinfoAction() {\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t$product = Doctrine::getTable ( 'Products' )->find ( $id )->toArray ();\n\t\tdie ( json_encode ( $product ) );\n\t}", "function product_get()\n {\n $product_id = $this->uri->segment(3);\n\n $product = $this->api_model->get_product($product_id);\n\n if(!empty($product))\n {\n $this->response(array('status' => 'success', 'message' => $product));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function get_product()\n\t{\n\t\t$product_id = $this->input->post('id');\n\t\t$data = $this->Common->get_details('products',array('product_id'=>$product_id))->row();\n $stock_check = $this->Common->get_details('product_stock',array('product_id'=>$product_id));\n if($stock_check->num_rows()>0)\n {\n $data->stock = $stock_check->row()->stock;\n }\n else\n {\n $data->stock = '0';\n }\n\t\tprint_r(json_encode($data));\n\t}", "private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }", "public function getProducts() {\n\n $dbData = new DBData();\n $array_products = [];\n foreach ($this->items as $item) {\n $array_products[] = $dbData->getProductDetails($item['id']);\n }\n return $array_products;\n }", "public function product1(){\r\n\t\t$sql =\"SELECT * FROM `products`,`manufactures`,`protypes` WHERE manufactures.manu_ID = products.manu_ID AND protypes.type_ID = products.type_ID\";\r\n\t\t$result = self::$conn->query($sql);\r\n\t\treturn $this->getData($result);\r\n\t}", "private function _generateProductsData(){\n \n $products = $this->context->cart->getProducts();\n $pagseguro_items = array();\n \n $cont = 1;\n \n foreach ($products as $product) {\n \n $pagSeguro_item = new PagSeguroItem();\n $pagSeguro_item->setId($cont++);\n $pagSeguro_item->setDescription(Tools::truncate($product['name'], 255));\n $pagSeguro_item->setQuantity($product['quantity']);\n $pagSeguro_item->setAmount($product['price_wt']);\n $pagSeguro_item->setWeight($product['weight'] * 1000); // defines weight in gramas\n \n if ($product['additional_shipping_cost'] > 0)\n $pagSeguro_item->setShippingCost($product['additional_shipping_cost']);\n \n array_push($pagseguro_items, $pagSeguro_item);\n }\n \n return $pagseguro_items;\n }", "function getProduct($product_id)\n{\n $var = getDataArray(\"select * from Product_with_catogory WHERE product_id =\" . $product_id);\n if (count($var) > 0)\n return $var[0];\n else\n return null;\n}", "public function getDataModel()\n {\n $mksoftproductData = $this->getData();\n \n $mksoftproductDataObject = $this->mksoftproductDataFactory->create();\n $this->dataObjectHelper->populateWithArray(\n $mksoftproductDataObject,\n $mksoftproductData,\n MksoftProductInterface::class\n );\n \n return $mksoftproductDataObject;\n }", "public function getDataModel()\n {\n return new Products();\n }", "public function retrieve_product_data_inv()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$product_id = $this->input->post('product_id');\n\t\t$product_info = $CI->Invoices->get_total_product_invoic($product_id);\n\t\techo json_encode($product_info);\n\t}", "public function getOrderProductData($sellerId,$orderId,$productId){\r\n \t/**\r\n \t * Load commission model\r\n \t */\r\n $productData = Mage::getModel('marketplace/commission')->getCollection()\r\n ->addFieldToFilter('seller_id',$sellerId)\r\n ->addFieldToFilter('order_id',$orderId) \r\n ->addFieldToFilter('product_id',$productId)->getFirstItem();\r\n /**\r\n * Return product data\r\n */\r\n return $productData; \r\n }", "public function getProductData($id = null)\n\t{\n\t\tif($id) {\n\t\t\t$sql = \"SELECT * FROM item_master where Item_ID = ? \";\n\t\t\t$query = $this->db->query($sql, array($id));\n\t\t\treturn $query->row_array();\n\t\t}\n\n\t\t$sql = \"SELECT * FROM item_master ORDER BY Item_ID\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->result_array();\n\t}", "protected function getProduct() {\n return $this->registry->registry('product');\n }", "protected function getProductData($product)\n {\n $trackingIdFieldName = Mage::helper('factfinder_tracking')->getIdFieldName();\n $masterIdFieldName = Mage::helper('factfinder/search')->getIdFieldName();\n\n $data = array(\n 'id' => $product->getData($trackingIdFieldName),\n 'masterId' => $product->getData($masterIdFieldName),\n );\n\n return $data;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "public function showProductStructuredData()\n\t{\n\n\t\tif ($currentProduct = $this->getProduct()) {\n\t\t\ttry {\n\t\t\t\t$productId = $currentProduct->getId() ? $currentProduct->getId() : $this->request->getParam('id');\n\n\t\t\t\t$product = $this->product->load($productId);\n\t\t\t\t$availability = $product->isAvailable() ? 'InStock' : 'OutOfStock';\n\n\t\t\t\t$priceValidUntil = $currentProduct->getSpecialToDate();\n\t\t\t\t$productStructuredData = array(\n\t\t\t\t\t'@context' => 'http://schema.org/',\n\t\t\t\t\t'@type' => 'Product',\n\t\t\t\t\t'name' => $currentProduct->getName(),\n\t\t\t\t\t'description' => trim(strip_tags($currentProduct->getDescription())),\n\t\t\t\t\t'sku' => $currentProduct->getSku(),\n\t\t\t\t\t'url' => $currentProduct->getProductUrl(),\n\t\t\t\t\t'image' => $this->getUrl('pub/media/catalog') . 'product' . $currentProduct->getImage(),\n\t\t\t\t\t'offers' => array(\n\t\t\t\t\t\t'@type' => 'Offer',\n\t\t\t\t\t\t'priceCurrency' => $this->_storeManager->getStore()->getCurrentCurrencyCode(),\n\t\t\t\t\t\t'price' => $currentProduct->getPriceInfo()->getPrice('final_price')->getValue(),\n\t\t\t\t\t\t'itemOffered' => $this->getProductStock($currentProduct->getId())->getQty(),\n\t\t\t\t\t\t'availability' => 'http://schema.org/' . $availability\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tif (!empty($priceValidUntil)) {\n\t\t\t\t\t$productStructuredData['offers']['priceValidUntil'] = $priceValidUntil;\n\t\t\t\t}\n\t\t\t\tif ($brand = $this->getProductBrand()) {\n\t\t\t\t\t$productStructuredData['brand']['@type'] = \"Thing\";\n\t\t\t\t\t$productStructuredData['brand']['name'] = $brand->getValue();\n\n\t\t\t\t}\n\t\t\t\tif ($this->getReviewCount()) {\n\t\t\t\t\t$productStructuredData['aggregateRating']['@type'] = 'AggregateRating';\n\t\t\t\t\t$productStructuredData['aggregateRating']['bestRating'] = 100;\n\t\t\t\t\t$productStructuredData['aggregateRating']['worstRating'] = 0;\n\t\t\t\t\t$productStructuredData['aggregateRating']['ratingValue'] = $this->getRatingSummary();\n\t\t\t\t\t$productStructuredData['aggregateRating']['reviewCount'] = $this->getReviewCount();\n\t\t\t\t}\n\n\t\t\t\treturn $this->helperData->createStructuredData($productStructuredData, '<!-- Product Structured Data by Mageplaza SEO-->');\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$this->messageManager->addError(__('Can not add structured data'));\n\t\t\t}\n\t\t}\n\t}", "function getProduct()\n\t\t{\n\t\t\tglobal $conn;\n\t\t\tif(isset($_POST[\"trademarkID\"]) || isset($_POST[\"limit\"]))\n\t\t\t{\n\t\t\t\t$trademark_id=$_POST[\"trademarkID\"];\n\t\t\t\t$limit=$_POST[\"limit\"];\n\t\t\t}\n\t\t\t$query=\"SELECT * FROM product P, trademark T WHERE T.Trademark_id =\".$trademark_id.\" AND T.Trademark_id=P.Trademark_id ORDER BY P.Count_buy DESC LIMIT \".$limit.\",20\";\n\t\t\t$kq=mysqli_query($conn,$query);\n\t\t\t$chuoijson=array();\n\t\t\techo \"{\";\n\t\t\techo \"\\\"PRODUCT\\\":\";\n\t\t\tif($kq)\n\t\t\t{\n\t\t\t\twhile($dong=mysqli_fetch_array($kq))\n\t\t\t\t{\n\t\t\t\t\tarray_push($chuoijson, array(\"Product_id\"=>$dong[\"Product_id\"]\n\t\t\t\t\t,'Product_name'=>$dong[\"Product_name\"]\n\t\t\t\t\t,'Price'=>$dong[\"Price\"]\n\t\t\t\t\t,'Image'=>\"http://\".$_SERVER['SERVER_NAME'].\":82\".\"/webpasokon\".$dong[\"Big_Image\"]));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\techo json_encode($chuoijson,JSON_UNESCAPED_UNICODE);\n\t\t\techo \"}\";\n\t\t}", "public function getProductInformation($id)\n {\n $prod = $this->getDefaultProduct();\n try {\n if (empty($id)) {\n return $prod;\n }\n\n $product = Mage::getModel('catalog/product')->load((int)$id);\n $category = null;\n // get top parent category of current product\n $categoryIds = $product->getCategoryIds();\n if (count($categoryIds) > 0) {\n $category = $this->catalogCategory->load((int)$categoryIds[0]);\n $catParent = $this->getTopParentCategory($category);\n $category = empty($catParent) ? $category->getName() : $catParent->getName();\n }\n\n $imgFullPath = $this->catalogMedia->getMediaUrl($product->getImage());\n $imgPartialPath = $this->catalogMedia->getMediaShortUrl($product->getImage());\n\n $finalPrice = $this->taxHelper->getPrice($product, $product->getFinalPrice(), true);\n $originalPrice = $this->taxHelper->getPrice($product, $product->getPrice(), true);\n $productSku = $product->getData('sku');\n $prod = array(\n 'productId' => !empty($productSku) ? $productSku : $id,\n 'description' => $product->getData('description'),\n 'descriptionShort' => $product->getData('short_description'),\n 'images' => array(\n 'fullImagePath' => $imgFullPath,\n 'partialImagePath' => $imgPartialPath,\n ),\n 'manufacturerName' => null,\n 'name' => $product->getName(),\n 'priceCurrent' => $this->coreHelper->currency($finalPrice, true, false),\n 'priceDiscount' => $this->coreHelper->currency(($originalPrice - $finalPrice), true, false),\n 'priceWithoutDiscount' => $this->coreHelper->currency($originalPrice, true, false),\n 'productLink' => $product->getProductUrl(true),\n 'category' => $category\n );\n } catch (Exception $exception) {\n $this->exceptionHandler->logException($exception);\n }\n\n return $prod;\n }", "public function getProduct()\n {\n return isset($this->product) ? $this->product : null;\n }", "public function getProductsData($productCollection)\n {\n /** @var Oggetto_YandexPrices_Model_Api_Market $api */\n $api = Mage::getModel('oggetto_yandexprices/api_market');\n /** @var Oggetto_YandexPrices_Helper_Data $helper */\n $helper = Mage::helper('oggetto_yandexprices');\n\n $data = [];\n /** @var Mage_Catalog_Model_Product $product */\n foreach ($productCollection as $product) {\n $price = $api->fetchPriceFromMarket($product->getName(), true);\n if (!is_null($price)) {\n $productPrice = $product->getFinalPrice();\n\n $priceFormatted = $helper->formatPrice($price, $this::YANDEX_MARKET_PRICE_CURRENCY);\n $priceAdduced = $helper->adducePrice($priceFormatted, $productPrice);\n\n $data[] = [\n 'product_id' => $product->getId(),\n 'price' => $priceAdduced\n ];\n } else {\n $data[] = [\n 'product_id' => $product->getId(),\n 'price' => $price\n ];\n }\n }\n\n return $data;\n }", "public function actionProductdetail()\n {\n $route = 'merchant.getProduct';\n $request = new getProductRequest();\n $request->setCustomerId($this->customer_id);\n $request->setAuthToken($this->auth_token);\n $request->setWholesalerId(33);\n $request->appendProductIds(4678);\n $result = Proxy::sendRequest($route, $request);\n $header = $result->getHeader();\n $body = getProductResponse::parseFromString($result->getPackageBody());\n return $this->render('index',[\n 'request' => $request->toArray(),\n 'route' => $route,\n 'header' => $header,\n 'body' => $body\n ]);\n }", "function getProducts() {\n\techo \"Getting Products </br>\";\n\t$response = getRequest('/api/product');\n\tprintInfo($response);\n}", "public function product()\n {\n return array_product($this->data());\n }", "public function get_product(){\r\n\t\t\r\n\t\t$data['results']=$this->Common_model->get_product();\r\n\t\techo json_encode($data);\r\n\t\t\r\n\t}", "public static function getProductFormData() {\n $result = lC_Products_Admin::getProductFormData($_GET['pid']);\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n\n echo json_encode($result);\n }", "public function get_data_produk()\n\t {\n\t\t$this->db->where('prod_hide_status','no');\n\t\t $query = $this->db->get('tbb_product');\n\t\t return $query->result_array();\n\t }", "function get_product($product_id){\n\t\t\n\t\treturn $this->_make_api_call($product_id,'products');\n\t}", "function fn_divido_gather_additional_product_data_post(&$product, $auth, $params)\n{\n if (empty(Tygh::$app['session']['auth']['user_id'])\n || empty(Tygh::$app['session']['cart']['user_data'])\n ) {\n return;\n }\n\n $user_data = Tygh::$app['session']['cart']['user_data'];\n\n if ($user_data['b_country'] !== DIVIDO_COUNTRY || empty($product['price'])) {\n return;\n }\n\n $processor_params = fn_divido_get_processor_params();\n\n if (empty($processor_params['show_product_page_calculator'])\n || empty($processor_params['api_key'])\n || empty($processor_params['currency'])\n || $processor_params['currency'] !== CART_SECONDARY_CURRENCY\n || $processor_params['show_product_page_calculator'] !== 'Y'\n ) {\n return;\n }\n\n $divido_data = array(\n 'price' => fn_format_price_by_currency(\n $product['price'],\n CART_PRIMARY_CURRENCY,\n $processor_params['currency']\n ),\n 'api_key' => fn_divido_slice_api_key($processor_params['api_key']),\n 'currency' => $processor_params['currency']\n );\n\n if (empty($processor_params['product_price_limit'])\n || $divido_data['price'] >= $processor_params['product_price_limit']\n ) {\n $product['divido_data'] = $divido_data;\n }\n}", "public function productRetrieveAll(){\n\t\t$productId\t\t\t=\tself::getUserId();\n\t\t$productTable\t\t=\tself::getUserTable();\n\t\t$joinTable\t\t\t=\tself::getJoinTable();\n\t\t$productArray\t\t=\tself::getUserArray(); //multi dimension array output\t\t\n\t\t$dbFieldArray\t\t=\tarray();\n\t\tforeach($productArray as $prodIndex => $prodVal){\n\t\t\t$dbFieldArray[]\t=\t$productArray[$prodIndex][0]; //Get db fields only from multi dimension array\n\t\t}\t\t\n\t\t$productCond\t\t=\tself::getUserCond();\t\t\n\t\t$retArray\t\t\t=\tself::retrieveEntry($productTable, $dbFieldArray, $joinTable,$productCond);\n\t\t$returnValue \t\t= \tarray();\t\t\t \t \n\t\tforeach ($retArray as $retIndex => $retValue) {\n $$retIndex \t\t= \t$retValue;\n $mainArr \t\t=\texplode('|', $$retIndex);\t\t\t\n\t\t\t$returnValue[] \t= \t$mainArr;\t\t\t\t\t\t \n }\n\t\treturn $returnValue;\n\t}", "public function getProductDataForDetailsPage(Product $product): array\n {\n $page_title = $product->name;\n $product_options = [];\n\n // Get options for product\n /** @var Item $item */\n if($product->non_default_items->isNotEmpty())\n {\n foreach($product->non_default_items as $item)\n {\n $details = $item->details;\n foreach($details as $detail)\n {\n $option_name = trim($detail['key']);\n\n if(!isset($product_options[$option_name]))\n {\n $product_options[$option_name] = [];\n }\n\n if(!in_array($detail['value'], $product_options[$option_name]))\n {\n $product_options[$option_name][] = $detail['value'];\n }\n }\n }\n }\n\n // Sort product options\n if(!empty($product_options))\n {\n $product_options = array_map(function($e) {\n sort($e);\n\n return $e;\n }, $product_options);\n }\n\n // Get stock status and quantity if it is a single sku product\n if(empty($product_options))\n {\n $stock_status = ($product->default_item->stock_status_override != 'none' && !empty($product->default_item->stock_status_override)) ?\n $product->default_item->stock_status_override : $product->default_item->calculated_stock_status;\n\n $orderable_quantity = $product->default_item->single_orderable_quantity;\n }\n\n // Get product data\n $default_sku = $product->default_item->sku;\n $product_data = [\n 'name' => $product->name,\n 'id' => $product->id,\n 'images' => $product->view_images,\n 'description' => $product->description,\n 'specs' => $product->specs,\n 'default_image_url' => $product->default_image_url,\n 'quantity' => $orderable_quantity ?? null,\n 'stock_status' => $stock_status ?? null\n ];\n\n // Create price displays\n $price_display = '$' . number_format($product->default_item->store_price, '2');\n $list_price_display = !empty($product->default_item->list_price) ? '$' . number_format($product->default_item->list_price, '2') : null;\n\n if($product->non_default_items->isNotEmpty())\n {\n // Get regular price display among items\n $item_prices = [];\n $item_list_prices = [];\n\n foreach($product->non_default_items as $non_default_item)\n {\n $price = floatval(trim($non_default_item->store_price));\n $price = number_format($price, 2);\n\n if(!empty($non_default_item->list_price))\n {\n $list_price = floatval(trim($non_default_item->list_price));\n $list_price = number_format($list_price, 2);\n\n if(!in_array($list_price, $item_list_prices))\n {\n $item_list_prices[] = $list_price;\n }\n }\n\n if(!in_array($price, $item_prices))\n {\n $item_prices[] = $price;\n }\n\n }\n\n sort($item_prices);\n\n if(!empty($item_list_prices))\n {\n sort($item_list_prices);\n $item_list_prices = new Collection($item_list_prices);\n if($item_list_prices->count() > 1)\n {\n $list_price_display = \"\\${$item_list_prices->last()}\";\n }\n else\n {\n $list_price_display = \"\\${$item_list_prices->first()}\";\n }\n }\n\n $item_prices = new Collection($item_prices);\n if($item_prices->count() > 1 && $item_prices->first() < $item_prices->last())\n {\n $price_display = \"\\${$item_prices->first()} - \\${$item_prices->last()}\";\n }\n else\n {\n $price_display = \"\\${$item_prices->first()}\";\n }\n }\n\n $brand_name = $product->vendor->name;\n\n return [\n 'brand_name' => $brand_name,\n 'price_display' => $price_display,\n 'default_sku' => $default_sku,\n 'list_price_display' => $list_price_display,\n 'product_options' => $product_options,\n 'product' => $product_data\n ];\n }", "function getProduct()\n {\n $sql = \"SELECT * FROM \" . DB_NAME . \".`products`\";\n //echo $sql;exit();\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n $products = [];\n\n while ($data = $result->fetch(PDO::FETCH_OBJ)) {\n $product = new ProductEntity();\n $product->setIdProduct($data->id);\n $product->setName($data->name);\n $product->setDomaine_realise($data->domaine_realise);\n $product->setTache_realisee($data->tache_realisee);\n $product->setImage($data->image);\n $product->setCreatedAt($data->createdat);\n\n $products[] = $product;\n }\n\n if ($products) {\n return $products;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "function getProducts() {\n\t\t$saleData = array();\n\t\tif($stmt = $this->connection->prepare(\"select * from products;\")) {\n\t\t\t$stmt -> execute();\n\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->bind_result($id, $itemName, $itemImage, $itemDesc, $salePrice, $regularPrice, $numberLeft);\n\n\t\t\tif($stmt ->num_rows >0){\n\t\t\t\twhile($stmt->fetch() ){\n\t\t\t\t\t$saleData[] = array(\n\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t'itemName' => $itemName,\n\t\t\t\t\t\t'itemImage' => $itemImage,\n\t\t\t\t\t\t'itemDesc' => $itemDesc,\n\t\t\t\t\t\t'salePrice' => $salePrice,\n\t\t\t\t\t\t'regularPrice' => $regularPrice,\n\t\t\t\t\t\t'numberLeft' => $numberLeft\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $saleData;\n\t}", "public function getProductById($product_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"products/$product_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $product_data=json_decode($string);\n \n return $product_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"Get product error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function get_data();", "function getProductBasics() {\n $db = acmeConnect();\n $sql = 'SELECT invName, invId FROM inventory ORDER BY invName ASC';\n $stmt = $db->prepare($sql);\n $stmt->execute();\n $products = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $products;\n }", "public function getProductPrice() {\n\t\t\t$data = request()->all();\n\t\t\t$dataArr = explode('-', $data['idSize']);\n\t\t\t$proAttr = ProductsAttribute::where(['product_id'=>$dataArr[0], 'size'=>$dataArr[1]])->first();\n\t\t\t$productData = [\n\t\t\t\t'sku' \t=> $proAttr->sku, \n\t\t\t\t'price' => $proAttr->price,\n\t\t\t\t'stock' => $proAttr->stock\n\t\t\t]; \n\t\t\treturn $productData;\n\t\t}", "public function getProduct_desc () {\n\t$preValue = $this->preGetValue(\"product_desc\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_desc\")->preGetData($this);\n\treturn $data;\n}", "public function getproductdetail($prod_id)\n {\n $product = $this->Dbmodel->getproductdata($prod_id); \n return $product;\n }", "public function getProduct() {\n return $this->_registry->registry ( 'current_product' );\n }", "function getProducts()\n {\n $ret = array();\n foreach ($this->getItems() as $item)\n if ($item->item_type == 'product')\n if ($pr = $item->tryLoadProduct())\n $ret[] = $pr;\n return $ret;\n }", "function getProductInfos($oid){\n if (!isset($this->products[$oid])){\n $r = array('pool'=>NULL, 'ticket'=>NULL, 'person'=>NULL, 'taarticleno'=>NULL);\n $selectedfields = array('tapool', 'taperson', 'taticket', 'prdconf');\n if ($this->xwtscatalog->fieldExists('taarticleno')){\n $selectedfields[] = 'taarticleno';\n }\n $dp = $this->xwtscatalog->display(array('oid'=>$oid,\n 'selectedfields'=>$selectedfields,\n 'options'=>array('tapool'=>array('target_fields'=>array('prjno', 'poolno')),\n 'taperson'=>array('target_fields'=>array('ptno')),\n 'prdconf'=>array('target_fields'=>array('calendar')),\n 'taticket'=>array('target_fields'=>array('tapool', 'ttno'))\n )\n )\n );\n $r['project'] = $dp['otapool']->link['oprjno']->raw;\n $r['pool'] = $dp['otapool']->link['opoolno']->raw;\n $r['ticket'] = $dp['otaticket']->link['ottno']->raw;\n $r['person'] = $dp['otaperson']->link['optno']->raw;\n $r['calendartype'] = $dp['oprdconf']->link['ocalendar']->link['otype']->raw;\n if (isset($dp['otaarticleno']))\n $r['taarticleno'] = $dp['otaarticleno']->raw;\n $this->products[$oid] = $r;\n }\n return $this->products[$oid];\n }", "protected function getProduct($pid) {\n $this->verboseOut('Getting product with pid: '.$pid);\n\t\t\n \t\n $product_info = $this->client->call ('catalog_product.info', array($pid, $this->store_id));\n \n $expectations = array();\n if(is_null($product_info)) \n {\n $expectations[] = 'No product info (NULL)';\n }\n else \n {\n if(!isset($product_info['status']) ) $expectations[] = 'No status';\n if($product_info['status'] != 1 ) $expectations[] = 'Status not 1';\n if(!isset($product_info[\"price\"]) || is_null($product_info[\"price\"]) ) \n {\n $type = 'none';\n if(!is_null($product_info[\"type_id\"]))\n {\n $type = $product_info[\"type_id\"];\n }\n if($type == 'bundle' || $type == 'grouped')\n {\n $product_info[\"price\"] = -1;\n }\n else \n {\n $expectations[] = 'No price for type: '.$type;\n }\n }\n if(!isset($product_info['visibility']) ) $expectations[] = 'No visibility';\n if($product_info['visibility'] < 3) $expectations[] = 'Visibility less than 3';\n }\n if(!empty($expectations))\n {\n $this->verboseOut('Product with pid: '.$pid.' failed due to the following: '.implode(', ', $expectations));\n return null;\n }\n \n \n if(settings::get('hide_products_out_of_stock',$this->wid))\n {\n \n $stock_info = $this->client->call ('cataloginventory_stock_item.list', $pid);\n if(is_null($stock_info) || !isset($stock_info[0]) || !isset($stock_info[0]['is_in_stock']) || $stock_info[0]['is_in_stock'] != 1 ){\n \n return null;\n }\n $product_info['is_in_stock'] = $stock_info[0]['is_in_stock'];\n }\n \n \n if(!self::is_in_discount_periode($product_info,Settings::get('mage_ignore_discount_expire_date', $this->wid)))\n {\n $product_info['special_price'] = null;\n }\n \n \n /*\n $images = $this->client->call('catalog_product_attribute_media.list', $pid);\n $xml = array();\n if(is_array($images))\n {\n foreach($images as $image ){\n @$xml['image_link'] = $image['url']; \n /// We set the url for each picture\n \n if(isset($image['types']) && in_array('thumbnail', $image['types'])){\n /// If this image is a thumbnail(There can only be one thumbnail), then we skip the rest\n break; \n }\n }\n }\n */\n \n $skippable_attributes = array('price', 'product_name');\n \n foreach($product_info as $key=>$val){\n \n if(!is_array($val) && $this->getAttributeSupported && !in_array(strtolower($key),$skippable_attributes))\n {\n try \n {\n $val = MagentoAttributeSet::get( $this->client,$product_info['type_id'], $product_info['set'])->getAttribute($key)->getOptionLabel($val);\n }\n catch(UnsupportedFeatureException $e)\n {\n $this->getAttributeSupported = false;\n }\n } \n $key = $this->translateXml($key);\n $xml[$key] = $val;\n }\n \n //$xml['buy_link'] = 'http://'.$this->getHostname().'/index.php/checkout/cart/add?qty=1&product='.$pid;\n \n return $xml;\n \n }", "public function getProduct()\n {\n return Mage::registry('current_product');\n }", "public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}", "public function getProductValueById()\n\t{\n\t\t$product_id = $this->input->post('product_id');\n\t\tif ($product_id) {\n\t\t\t$product_data = $this->model_products->getProductData($product_id);\n\t\t\techo json_encode($product_data);\n\t\t}\n\t}", "public function getProducts (){\n\t\t$cache = Zend_Registry::get('cache');\n\t\t// see if product - list is already in cache\n\t\tif(!$productArray = $cache->load('productsByManufacturerId'.$this->id)) {\n\t\t\t$productTable = Website_Model_CbFactory::factory('Website_Model_MysqlTable', 'product');\n\t\t\t$products = $productTable->fetchAll('manufacturer='.$this->id);\n\t\t\tforeach($products as $product){\n\t\t\t\t$productArray[] = Website_Model_CbFactory::factory('Website_Model_Product',$product->id);\n\t\t\t}\n\t\t\t$cache->save($productArray,'productsByManufacturerId'.$this->id,array('model'));\n\t\t}\n\t\treturn $productArray;\n\t}" ]
[ "0.80006254", "0.7810391", "0.77240026", "0.74755985", "0.73429984", "0.7321282", "0.7154672", "0.71318394", "0.7103133", "0.7056063", "0.7040395", "0.70209646", "0.6988272", "0.6964541", "0.69510925", "0.6950986", "0.69448185", "0.69270736", "0.6925699", "0.6917932", "0.6831335", "0.68159896", "0.67978287", "0.6779371", "0.67418486", "0.6741474", "0.67310566", "0.6728584", "0.6720905", "0.6720905", "0.6720905", "0.6715773", "0.6692644", "0.6692644", "0.6692644", "0.6692644", "0.6692644", "0.6692644", "0.6677664", "0.66545624", "0.6644022", "0.6642511", "0.663892", "0.6632935", "0.66288996", "0.6617845", "0.66162187", "0.66040003", "0.6594425", "0.65930927", "0.6576586", "0.65650654", "0.6564073", "0.65470994", "0.6543329", "0.6541746", "0.65382177", "0.65360135", "0.65359056", "0.6535252", "0.6524845", "0.6523164", "0.6520093", "0.65163994", "0.6510456", "0.65031743", "0.65031743", "0.64936566", "0.64840746", "0.6481095", "0.6473438", "0.6463868", "0.6456753", "0.64539313", "0.6452837", "0.64376646", "0.64340544", "0.643026", "0.64246947", "0.64218676", "0.64189225", "0.64011836", "0.6398465", "0.637606", "0.6374605", "0.6363149", "0.6359089", "0.6357029", "0.6355189", "0.63510776", "0.63500816", "0.634951", "0.6348005", "0.633284", "0.6330505", "0.6326446", "0.6307974", "0.6306896", "0.630526", "0.62949383" ]
0.67612404
24
////////////////////////////////////////////////////////////////////// Add product to cart
public static function addProductToCart($product_id) { $auth = fn_fill_auth(); $cart = & $_SESSION['cart']; $products_array = array( $product_id => array( 'product_id' => $product_id, 'amount' => 1 ) ); $data = fn_add_product_to_cart($products_array, $cart, $auth); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }", "public function addAction() {\r\n $cart = $this->_getCart();\r\n $params = $this->getRequest()->getParams();\r\n try {\r\n if (isset($params['qty'])) {\r\n $filter = new Zend_Filter_LocalizedToNormalized(\r\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\r\n );\r\n $params['qty'] = $filter->filter($params['qty']);\r\n }\r\n\r\n $product = $this->_initProduct();\r\n $related = $this->getRequest()->getParam('related_product');\r\n\r\n /**\r\n * Check product availability\r\n */\r\n if (!$product) {\r\n $this->_goBack();\r\n return;\r\n }\r\n\r\n $cart->addProduct($product, $params);\r\n if (!empty($related)) {\r\n $cart->addProductsByIds(explode(',', $related));\r\n }\r\n\r\n $cart->save();\r\n\r\n $this->_getSession()->setCartWasUpdated(true);\r\n\r\n /**\r\n * @todo remove wishlist observer processAddToCart\r\n */\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\r\n );\r\n\r\n if (!$this->_getSession()->getNoCartRedirect(true)) {\r\n if (!$cart->getQuote()->getHasError()) {\r\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\r\n $this->_getSession()->addSuccess($message);\r\n }\r\n $this->_goBack();\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n\r\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\r\n $json_messages = array();\r\n foreach ($messages as $message) {\r\n $json_messages[] = Mage::helper('core')->escapeHtml($message);\r\n }\r\n\r\n $_response->setMessages($json_messages);\r\n\r\n $url = $this->_getSession()->getRedirectUrl(true);\r\n\r\n $_response->send();\r\n } catch (Exception $e) {\r\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\r\n Mage::logException($e);\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot add the item to shopping cart.'));\r\n $_response->send();\r\n }\r\n }", "public static function add($product)\n {\n session()->push('cart', $product);\n }", "private function add($product){\n $cart = ['qty'=>0,'price' => 0, 'product' => $product];\n if($this->items){\n if(array_key_exists($product->prod_id, $this->items)){\n $cart = $this->items[$product->prod_id];\n }\n }\n $cart['qty']++;\n $cart['price'] += $product->price;\n $this->items[$product->prod_id] = $cart;\n $this->totalQty++;\n $this->totalPrice += $product->price;\n }", "public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "public function add_to_cart() {\n if ( ! is_single() ) {\n return;\n }\n\n global $product;\n\n WC_Gokeep_JS::get_instance()->add_to_cart( $product , '.single_add_to_cart_button' );\n }", "function add($product_id)\n\t{\n\t\t$product = $this->database->getProductbyId($product_id);\n\n\t\tif($product)\n\t\t{\n\t\t\t$this->_add_to_cart($product);\n\t\t}\n\t\t\n\t\t$this->_show_add_to_cart_comment($product['add_to_cart_comment']);\n\t\t\n\t\tredirect('cart');\n\t}", "public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }", "public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }", "function addToCart($proID){\n $product = $this->product->getRows($proID);\n \n // Add product to the cart\n $data = array(\n 'id' => $product['pro_id'],\n 'qty' => 1,\n 'price' => $product['price'],\n 'name' => $product[\"name\"],\n 'image' => $product['image']\n );\n $this->cart->insert($data);\n \n // Redirect to the cart page\n redirect(base_url().'index.php/CCart');\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function addProduct(Product $product, $quantity);", "public function addToCart($prod_id){\n\t\t$product = Product::find($prod_id);\n $this->cartConstruct();\n $this->add($product);\n Session::put('cart',$this);\n return redirect()->route('cart');\n\t}", "public function testAddProductToCart()\n {\n $this->browse(function (Browser $browser) {\n // Home Page\n $browser->visit(new HomePage);\n\n // Get Collection Name\n $collectionName = $browser->text('.thumbnail .caption a');\n\n // Products Page\n $browser->clickLink($collectionName)\n ->assertSee($collectionName);\n\n // Get Product Name\n $productName = $browser->text('.thumbnail .caption a');\n\n $browser->clickLink($productName)\n // Product Page\n ->assertSee($productName)\n ->press('Add To Cart')\n ->assertSee('Product has been added to your cart.')\n // Cart Page\n ->visit('/cart')\n ->assertSee($productName);\n });\n }", "public function add($product_id)\n {\n $product = Product::find($product_id);\n if(!$product)\n {\n abort(404);\n }\n Cart::associate('Product','App\\Models')->add($product_id, $product->name, 1, $product->price);\n return redirect()->route('cart.index');\n }", "function AddToCart($token, $product_name, $product_id, $purchased_amount)\n {\n $order_number = $this->GetOrderNumber();\n $id = $this->GetUserId($token);\n // die();\n $order_number = md5($order_number . $id);\n $this->AddOrdertoCart($id, $order_number);\n $product_data = $this->CheckProductAvailability($product_name, $product_id, $purchased_amount);\n $product_remain = $product_data[0];\n $product_id = $product_data[1];\n if ($product_remain > -1) {\n $this->AddProducttoCart($order_number, $product_id, $purchased_amount, $product_remain, $token);\n } else {\n echo \" Required product is not available!\";\n }\n }", "public function rapidAdd($id){\n $product=Products::find($id);\n $cart= Cart::add([\n'id'=>$product->id,\n'name'=>$product->pro_name,\n'qty'=>1,\n'price'=>$product->pro_price,\n ]);\n Cart::associate($cart->rowId, 'App\\Models\\Products');\nreturn redirect('/cart')->with('info', 'Product added in cart');\n }", "private function addProduct($product) \r\n\t{\r\n\t\t$this->newProducts[] = $product;\r\n\t}", "public function add()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$parent_accessory_productid = $post['product_id'];\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$producthelper = new producthelper;\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call add method of modal to store product in cart session\n\t\t$userfiled = JRequest::getVar('userfiled');\n\n\t\tJPluginHelper::importPlugin('redshop_product');\n\t\t$dispatcher = JDispatcher::getInstance();\n\t\t$dispatcher->trigger('onBeforeAddProductToCart', array(&$post));\n\n\t\t$result = $this->_carthelper->addProductToCart($post);\n\n\t\tif (is_bool($result) && $result)\n\t\t{\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errmsg = ($result) ? $result : JText::_(\"COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART\");\n\n\t\t\tif (AJAX_CART_BOX == 1)\n\t\t\t{\n\t\t\t\techo \"`0`\" . $errmsg;\n\t\t\t\tdie();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);\n\n\t\t\t\tif (count($ItemData) > 0)\n\t\t\t\t{\n\t\t\t\t\t$prdItemid = $ItemData->id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$prdItemid = $redhelper->getItemid($post['product_id']);\n\t\t\t\t}\n\n\t\t\t\t$link = JRoute::_(\"index.php?option=\" . $option . \"&view=product&pid=\" . $post[\"product_id\"] . \"&Itemid=\" . $prdItemid, false);\n\t\t\t\t$app->Redirect($link, $errmsg);\n\t\t\t}\n\t\t}\n\n\t\t$session = JFactory::getSession();\n\t\t$cart = $session->get('cart');\n\n\t\tif (isset($cart['AccessoryAsProduct']))\n\t\t{\n\t\t\t$attArr = $cart['AccessoryAsProduct'];\n\n\t\t\tif (ACCESSORY_AS_PRODUCT_IN_CART_ENABLE)\n\t\t\t{\n\t\t\t\t$data['accessory_data'] = $attArr[0];\n\t\t\t\t$data['acc_quantity_data'] = $attArr[1];\n\t\t\t\t$data['acc_attribute_data'] = $attArr[2];\n\t\t\t\t$data['acc_property_data'] = $attArr[3];\n\t\t\t\t$data['acc_subproperty_data'] = $attArr[4];\n\n\t\t\t\tif (isset($data['accessory_data']) && ($data['accessory_data'] != \"\" && $data['accessory_data'] != 0))\n\t\t\t\t{\n\t\t\t\t\t$accessory_data = explode(\"@@\", $data['accessory_data']);\n\t\t\t\t\t$acc_quantity_data = explode(\"@@\", $data['acc_quantity_data']);\n\t\t\t\t\t$acc_attribute_data = explode(\"@@\", $data['acc_attribute_data']);\n\t\t\t\t\t$acc_property_data = explode(\"@@\", $data['acc_property_data']);\n\t\t\t\t\t$acc_subproperty_data = explode(\"@@\", $data['acc_subproperty_data']);\n\n\t\t\t\t\tfor ($i = 0; $i < count($accessory_data); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$accessory = $producthelper->getProductAccessory($accessory_data[$i]);\n\t\t\t\t\t\t$post = array();\n\t\t\t\t\t\t$post['parent_accessory_product_id'] = $parent_accessory_productid;\n\t\t\t\t\t\t$post['product_id'] = $accessory[0]->child_product_id;\n\t\t\t\t\t\t$post['quantity'] = $acc_quantity_data[$i];\n\t\t\t\t\t\t$post['category_id'] = 0;\n\t\t\t\t\t\t$post['sel_wrapper_id'] = 0;\n\t\t\t\t\t\t$post['attribute_data'] = $acc_attribute_data[$i];\n\t\t\t\t\t\t$post['property_data'] = $acc_property_data[$i];\n\t\t\t\t\t\t$post['subproperty_data'] = $acc_subproperty_data[$i];\n\n\t\t\t\t\t\t$result = $this->_carthelper->addProductToCart($post);\n\n\t\t\t\t\t\t$cart = $session->get('cart');\n\n\t\t\t\t\t\tif (is_bool($result) && $result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errmsg = ($result) ? $result : JText::_(\"COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART\");\n\n\t\t\t\t\t\t\tif (JError::isError(JError::getError()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$error = JError::getError();\n\t\t\t\t\t\t\t\t$errmsg = $error->message;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (AJAX_CART_BOX == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo \"`0`\" . $errmsg;\n\t\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);\n\n\t\t\t\t\t\t\t\tif (count($ItemData) > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prdItemid = $ItemData->id;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prdItemid = $redhelper->getItemid($post['product_id']);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$link = JRoute::_(\"index.php?option=\" . $option . \"&view=product&pid=\" . $post[\"product_id\"] . \"&Itemid=\" . $prdItemid, false);\n\t\t\t\t\t\t\t\t$app->Redirect($link, $errmsg);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!DEFAULT_QUOTATION_MODE || (DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE))\n\t\t\t{\n\t\t\t\t$this->_carthelper->carttodb();\n\t\t\t}\n\n\t\t\t$this->_carthelper->cartFinalCalculation();\n\t\t\tunset($cart['AccessoryAsProduct']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!DEFAULT_QUOTATION_MODE || (DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE))\n\t\t\t{\n\t\t\t\t$this->_carthelper->carttodb();\n\t\t\t}\n\n\t\t\t$this->_carthelper->cartFinalCalculation();\n\t\t}\n\n\t\tif (!$userfiled)\n\t\t{\n\t\t\tif (AJAX_CART_BOX == 1 && isset($post['ajax_cart_box']))\n\t\t\t{\n\t\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&ajax_cart_box=' . $post['ajax_cart_box'] . '&tmpl=component&Itemid=' . $Itemid, false);\n\t\t\t\t$app->Redirect($link);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (ADDTOCART_BEHAVIOUR == 1)\n\t\t\t\t{\n\t\t\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t\t\t$app->Redirect($link);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$link = JRoute::_($_SERVER['HTTP_REFERER'], false);\n\n\t\t\t\t\tif ($cart['notice_message'] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg = $cart['notice_message'] . \"<br>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$msg .= JTEXT::_('COM_REDSHOP_PRODUCT_ADDED_TO_CART');\n\t\t\t\t\t$app->Redirect($link, $msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=product&pid=' . $post['p_id'] . '&Itemid=' . $Itemid, false);\n\t\t\t$app->Redirect($link);\n\t\t}\n\t}", "public function addToCart($product, $qty = 1){\n // Create Cart\n // if Product has in Cart, add + qty\n if(isset($_SESSION['cart'][$product->id])){\n $_SESSION['cart'][$product->id]['qty'] += $qty;\n } else { // if not in Cart, create\n $_SESSION['cart'][$product->id] = [\n 'qty' => $qty,\n 'name' => $product->name,\n 'price' => $product->price,\n 'img' => $product->img\n ];\n }\n // Total Qty\n // if isset Qty or if not\n $_SESSION['cart.qty'] = isset( $_SESSION['cart.qty'])\n ? $_SESSION['cart.qty'] + $qty\n : $qty;\n // Total Sum\n $_SESSION['cart.sum'] = isset($_SESSION['cart.sum'])\n ? $_SESSION['cart.sum'] + $qty * $product->price\n : $qty * $product->price;\n\n }", "function uc_order_edit_products_add($form, &$form_state) {\n $form_state['products_action'] = 'products_select';\n $form_state['refresh_products'] = TRUE;\n $form_state['rebuild'] = TRUE;\n $order = $form_state['build_info']['args'][0];\n\n $data = module_invoke_all('uc_add_to_cart_data', $form_state['values']['product_controls']);\n $product = uc_product_load_variant(intval($form_state['values']['product_controls']['nid']), $data);\n $product->qty = isset($form_state['values']['product_controls']['qty']) ? $form_state['values']['product_controls']['qty'] : $product->default_qty;\n\n drupal_alter('uc_order_product', $product, $order);\n uc_order_product_save($order->order_id, $product);\n $order->products[] = $product;\n\n uc_order_log_changes($order->order_id, array('add' => t('Added (@qty) @title to order.', array('@qty' => $product->qty, '@title' => $product->title))));\n\n // Decrement stock.\n if (module_exists('uc_stock')) {\n uc_stock_adjust_product_stock($product, 0, $order);\n }\n\n // Add this product to the form values for accurate tax calculations.\n $form_state['values']['products'][] = (array) $product;\n}", "public function addAction()\n {\n /** @var $session */\n $session = $this->get('session');\n\n $cart = $session->get('cart');\n\n $productID = $_POST['product_id'];\n $quantity = $_POST['quantity'];\n\n // First addition to the shopping cart\n if (empty($cart)) {\n $cart[] = array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n } else {\n $existingItem = false;\n\n foreach ($cart as &$cartItem) {\n // If product already exists in cart\n if ($cartItem['product_id'] == $productID) {\n $existingItem= true;\n\n // add to existing quantity\n $cartItem['quantity'] += $quantity;\n }\n }\n\n // if brand new item\n if ($existingItem == false) {\n $cart[]= array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n }\n }\n\n $session->set('cart', $cart);\n\n\n return new RedirectResponse('/cart');\n }", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }", "public function addProduct($product)\n {\n \n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if(is_null($cart))\n {\n $this->product()->save($product);\n }\n else\n {\n\n $quantity = $cart->pivot->quantity;\n\n $quantity++;\n\n $cart->pivot->update(compact('quantity'));\n }\n\n }", "public function addItemToCart( $item ){\n $this->cartItems[] = $item;\n Cart::updateTotalPrice();\n }", "public function addItem(Cart $cart, CartItem $item);", "public function addItem($id){\n \t$product = Product::findOrFail($id);\n \tCart::add($id, $product->product_name, 1, $product->product_price, 550, ['img'=>$product->image, \"stock\" => $product->stock]);\n \treturn back();\n }", "public function addToSession($product)\n {\n $session = $this->session;\n\n if ($session->has('cart')) {\n $products = (array)$session->get('cart');\n array_push($products, $product->getHash());\n $session->set('cart', $products);\n } else {\n $products = array($product->getHash());\n $session->set('cart', $products);\n }\n }", "public function add_product($project_id, $product_id, $quantity, $price)\n\t{\n\t\tif($this->projects_model->add_product($project_id, $product_id, $quantity, $price))\n\t\t{\n\t\t\tredirect('edit-project/'.$project_id);\n\t\t}\n\t}", "public function addProduct($prod) {\n\t\t\t$this->products[$this->pid] = $prod;\n\t\t\t$this->pid ++;\n\t\t}", "public function addProduct(Product $product): CurrentCart;", "function gc_template_loop_add_to_cart( $args = array() ) {\n\t\tglobal $product;\n\n\t\tif ( $product ) {\n\t\t\t$defaults = array(\n\t\t\t\t'quantity' => 1,\n\t\t\t\t'class' => implode( ' ', array_filter( array(\n\t\t\t\t\t\t'btn btn-outline-secondary gc-add-to-cart',\n\t\t\t\t\t\t'product_type_' . $product->get_type(),\n\t\t\t\t\t\t$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',\n\t\t\t\t\t\t$product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '',\n\t\t\t\t) ) ),\n\t\t\t);\n\n\t\t\t$args = apply_filters( 'woocommerce_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product );\n\n\t\t\twc_get_template( 'loop/add-to-cart.php', $args );\n\t\t}\n\t}", "public function addToCart() : void\n {\n $this->VIEW = false;\n $this->Cart->addToCart($_SESSION['Auth']->id, $_POST);\n }", "public function addProduct(Mage_Catalog_Model_Product $product)\n {\n $this->_products[$product->getId()] = $product;\n }", "public function add_to_cart(Request $request){\n $product = Product::find($request->input('product_id'));\n //On s'assure qu'il y'a bien un produit qui est retourne\n if($product){\n //On enregistre la session cart dans une variable\n $cart = $request->session()->get('cart');\n //On verifie si la cle du produit est deja dans les produits dans la session avant de l'ajouter\n if(!isset($cart['products'][$product->id])){\n //On prepare comment ajouter le produit dans les sessions. Chaque produit dans la sessoin set enregistre dans une cle cart. cette cle contient un\n $cart['products'][$product->id] = ['name' => $product->name, 'price' => $product->price, 'quantite' => 1, \"total\" => $product->price];\n //On ajoute la variable $cart dans les sessions\n $request->session()->put('cart',$cart);\n }\n }\n return response()->json(['success' => true,], 200);\n }", "public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}", "public function createCartProduct($request, $product_id)\n {\n $cart = Cart::create([\n 'user_id' => $request->input('user_id'),\n 'quantity' => $request->input('quantity'),\n ]);\n $cart_item = Cart::find($cart->id);\n $cart_item->state = 'direct-buy';\n $cart_item->save();\n DB::table('product_cart')->insert([\n 'product_id' => $product_id,\n 'cart_id' => $cart->id,\n ]);\n }", "public function actionAdd() {\n $id = Yii::$app->request->get('id');\n $qty = (int)Yii::$app->request->get('qty');\n $qty = !$qty ? 1 : $qty;\n\n $product = Product::findOne($id);\n if (empty($product)) return false;\n $session = $this->session;\n $cart = new Cart();\n $cart->addToCart($product, $qty);\n if (!Yii::$app->request->isAjax) { // works if js is off and ajax request did not occur\n return $this->redirect(Yii::$app->request->referrer);\n }\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }", "function addToCart()\n{\n\t// make sure the product id is in get, redirect otherwise.\n\tif (isset($_GET['p']) && (int)$_GET['p'] > 0) {\n\t\t$productID = (int)$_GET['p'];\n\t} else {\n\t\theader('Location: ./storeIndex.php');\n\t}\n\t\n\t// check if the product is in the database.\n\t$sql = \"SELECT ItemID, Quantity\n\t FROM Items\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) != 1) {\n\t\t// the product doesn't exist\n\t\theader('Location: ./cart.php');\n\t} else {\n\t\t//Check stock\n\t\t$row = mysql_fetch_assoc($result);\n\t\t$currentStock = $row['Quantity'];\n\n\t\tif ($currentStock == 0) {\n\t\t\t// Out of stock item, show error.\n\t\t\tsetError('The product you requested is no longer in stock');\n\t\t\theader('Location: ./cart.php');\n\t\t\texit;\n\t\t}\n\n\t}\t\t\n\t\n\t//Check if items is already in cart, and if so, update quantity.\n\t$sql = \"SELECT ItemID\n\t FROM Cart\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) == 0) {\n\t\t// put the product in the cart \n\t\t$sql = \"INSERT INTO Cart (ItemID, Quantity)\n\t\t\t\tVALUES ($productID, 1)\";\n\t\t$result = query($sql);\n\t} else {\n\t\t// update product quantity in the cart\n\t\t$sql = \"UPDATE Cart\n\t\t SET Quantity = Quantity + 1\n\t\t\t\tWHERE ItemID = $productID\";\t\t\n\t\t\t\t\n\t\t$result = query($sql);\t\t\n\t}\t\n\t\t\n\theader('Location: ' . $_SESSION['shop_return_url']);\t\t\t\t\n}", "public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}", "public function addItemToCart($account_id, $item_id, $quantity = false);", "private function addProduct($productId, $quantity = 1) {\n $this->_registry->checkVarInSession('productPage', 'products');\n if (!$this->_model->isChecked() == true) {\n $this->_model->checkBasket();\n }\n // calling addProduct method from basket model and make note of the response it returns\n $response = $this->_model->addProduct($productId, $quantity);\n if ($response == 'success') {\n $this->_session->flash('message', '<p class=\"stock success\">The product has been added to your basket.</p>');\n $this->_registry->redirectToProduct();\n } elseif ($response == 'stock') {\n $this->_session->flash('message', '<p class=\"stock\">Product is currently out of stock!</p>');\n $this->_registry->redirectToProduct();\n } elseif ($response == 'noproduct') {\n $this->_session->flash('message', '<p class=\"stock\">Product not found.</p>');\n $this->_registry->redirectTo();\n }\n }", "public function add_to_cart($params) {\n if ($params[0]) {\n $_REQUEST['id_item'] = $params[0];\n $_REQUEST['quantity'] = 1;\n }\n\n $hash = self::getHash();\n $cart = $this->NeoCartModel->getCart($hash);\n\n //hai sa bagam produsul in shopping cart\n $this->NeoCartModel->addToCart($_REQUEST, $cart);\n\n controller::set_alert_message(\"<br/>Produsul a fost adaugat in cos\");\n header(\"Location: \" . $this->getRefPage());\n exit();\n }", "public function addToCart($id)\n {\n $product = Product::find($id);\n if (!$product) {\n abort(404);\n }\n $cart = session()->get('cart');\n\n // if cart is empty then this the first product\n if (!$cart) {\n $cart = [\n $id => [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ]\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if cart not empty then check if this product exist then increment quantity\n if (isset($cart[$id])) {\n $cart[$id]['quantity']++;\n\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if item not exist in cart then add to cart with quantity = 1\n $cart[$id] = [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }", "public function add($product, $quantity = 1)\n\t{\n\t\t$item = [\n\t\t\t'id' => $product->id,\n\t\t\t'name' => $product->name,\n\t\t\t'price' => ($product->promotionprice != 0) ? $product->promotionprice : $product->unitprice,\n\t\t\t'image' => $product->image,\n\t\t\t'quantity' => $quantity,\n\t\t];\n\n\t\tif(isset($this->items[$product->id])){\n\t\t\t$this->items[$product->id]['quantity'] += $quantity;\n\t\t}else{\n\t\t\t$this->items[$product->id] = $item;\n\t\t}\n\t\t\n\t\tsession(['cart' => $this->items]);\n\t\t//dd($this->items);\n\t}", "public function addToCart($id){\n $produk=Product::findOrFail($id);\n Auth::loginUsingId(1);\n $user = Auth::user()->id;\n $addToCart = Cart::create(['product_id'=>$produk->id,\n 'user_id'=>$user]);\n return 'Berhasil Memasukan data ke cart list';\n }", "public function add(Product $product) {\n\t\t$this->products[] = $product;\n\t}", "public function add($product, $quantity)\n {\n $this->loadItems();\n if (isset($this->items[$product->{$this->params['productFieldId']}])) {\n $this->plus($product->{$this->params['productFieldId']}, $quantity);\n } else {\n $this->items[$product->{$this->params['productFieldId']}] = new CartItem($product, $quantity,\n $this->params);\n ksort($this->items, SORT_NUMERIC);\n $this->saveItems();\n }\n }", "public function addProduct($productInfo, $quantity, $request)\n { \n if (empty($this->cart[$productInfo->id])) {\n $product = ['product_id' => $productInfo->id, 'quantity' => $quantity, 'product_name' => $productInfo->product_name, 'product_desc' => $productInfo->product_description, 'product_price' => $productInfo->product_price];\n $this->cart[$productInfo->id] = $product;\n } else {\n $this->addProductCount($productInfo->id, $quantity);\n }\n\n $this->saveCart($request);\n }", "function addToCart(){\n\t\tif(!isset($_POST['id'])) header(sprintf(\"Location: %s\", $this->Files['Cart']));\n\t\t// ---------- These are our posted variables --------------\t\t\n\t\t$TmpCart=array();\n\t\t$TmpCart['type'] \t= 1;\n\t\t$TmpCart['name'] \t= clean_variable($_POST['name'],true);\n\t\t$TmpCart['id']\t \t= clean_variable($_POST['id'],true);\n\t\t$TmpCart['qty'] \t= (is_int($_POST['qty']) && isset($_POST['qty']))?clean_variable($_POST['qty'],true):'1';\n\t\t$TmpCart['price'] = clean_variable($_POST['price'],true);\n\t\t\n\t\t// Process Products Specs and Attributes\n\t\t$SPC = \t\t\t(isset($_POST['spec'])) ? \n\t\t\t\t\t\t\t\t\t((!is_array($_POST['spec'])) ? array( $_POST['spec'] ) : $_POST['spec']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SPC)) foreach($SPC as &$v) clean_variable($v,true);\n\t\t\n\t\t$TmpStrg = '';\n\t\tif(count($SPC) > 0){ /* // Check the Specs of the product and get the price for that spec. If differant use that price\n\t\t\tforeach($SPC as $k => $v){ \n\t\t\t\t$getSpecs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getSpecs->mysql(\"SELECT `att_price`, `att_sale`, `att_sale_exp` FROM `prod_link_prod_att` WHERE `att_id` = '$v' AND `prod_id` = '\".$TmpCart['id'].\"';\");\n\t\t\t\t$getSpecs->mssql(\"SELECT att_price, att_sale, att_sale_exp FROM prod_link_prod_att WHERE att_id = '$v' AND prod_id = '\".$TmpCart['id'].\"';\");\n\t\t\t\t$getSpecs = $getSpecs->Rows();\n\t\t\t\tif($getSpecs[0]['att_price'] > 0){\n\t\t\t\t\t$attSaleExp = ereg('[^A-Za-z0-9]', $getSpecs[0]['att_sale_exp']);\n\t\t\t\t\tif($attSaleExp == \"00000000000000\") $attprices += $getSpecs[0]['att_price'];\n\t\t\t\t\telse if ($attSaleExp > date(\"YmdHis\")) $attprices += $getSpecs[0]['att_sale'];\n\t\t\t\t\telse $attprices += $getSpecs[0]['att_price'];\n\t\t\t\t} else { $attprices = 0; }\n\t\t\t\t$TmpStrg .= ($TmpStrg == \"\") ? ($v.\".\".$attprices) : (\":\".$v.\".\".$attprices);\n\t\t\t} */\n\t\t}\n\t\t$TmpCart['spec'] = $TmpStrg;\n\t\t\n\t\t// Process Products Special Options\n\t\t$SPCL = \t\t(isset($_POST['special'])) ?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['special'])) ? array( $_POST['special'] ) : $_POST['special']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SPCL)) foreach($SPCL as &$v) clean_variable($v,true);\n\t\t$TmpCart['special'] = (is_array($SPCL) && count($SPCL) > 0) ? implode(\":\",$SPCL) : $SPCL;\n\t\t\n\t\t\n\t\t$SLCT = \t\t(isset($_POST['selections'])) ?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['selections'])) ? array( $_POST['selections'] ) : $_POST['selections']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SLCT)) foreach($SLCT as &$v) clean_variable($v,true);\n\t\t$TmpCart['selections'] = (is_array($SLCT) && count($SLCT) > 0) ? implode(\":\",$SLCT) : $SLCT;\n\t\t\n\t\t// Process Products Messages and Comments, mainly used for gift cards\n\t\t$MSG = \t\t\t(isset($_POST['message'])) \t\t\t? clean_variable($_POST['message'],true):'';\n\t\t$MSGTo = \t\t(isset($_POST['message_to'])) \t? clean_variable($_POST['message_to'],true):'';\n\t\t$MSGFrm = \t(isset($_POST['message_from'])) ? clean_variable($_POST['message_from'],true):'';\n\t\t\n\t\t$MSGEng = \t(isset($_POST['message']))?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['engraving']))? array( $_POST['engraving'] ) : $_POST['engraving'] ):\n\t\t\t\t\t\t\t\t'';\n\t\tif(is_array($MSGEng)) foreach($MSGEng as &$v) clean_variable($v,true);\n\t\t/*\n\t\t$getMsgs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t$getMsgs->mysql(\"SELECT `prod_msg_type` FROM `prod_products` WHERE `prod_id` = '\".$TmpCart['id'].\"';\");\n\t\t$getMsgs->mssql(\"SELECT prod_msg_type FROM prod_products WHERE prod_id = '\".$TmpCart['id'].\"';\");\n\t\t$getMsgs = $getMsgs->Rows();\n\t\t$Msgs = $getMsgs[0]['prod_msg_type'];\n\t\t*/\n\t\t$Msgs='';\n\t\tif(strlen(trim($Msgs)) > 0) $Msgs = unserialize(urldecode($Msgs));\n\t\telse $Msgs = array(); $Tarray = array();\n\t\tif(count($Msgs) > 0){\n\t\t\tforeach($Msgs as $k => $v){\n\t\t\t\tswitch($k){\n\t\t\t\t\tcase \"Cmnts\": if(strlen(trim($MSG)) > 0) $Tarray['Cmnts'][0] = $MSG; break; // Straight Comment for the Product\n\t\t\t\t\tcase \"ToFrm\":\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\t\t\t\t\t// To From comments for Gift Cards Ect.\n\t\t\t\t\t\tif(strlen(trim($MSGTo)) > 0){\n\t\t\t\t\t\t\t$Tarray['ToFrm'][0] = $MSGTo;\n\t\t\t\t\t\t\t$Tarray['ToFrm'][1] = $MSGFrm;\n\t\t\t\t\t\t} break;\n\t\t\t\t\tcase \"Engv\":\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\t\t\t\t\t// Engravings for the product allows for multiple lines\n\t\t\t\t\t\tif(intval($v)>1){ if(strlen(trim($MSGEng)) > 0) $Tarray['Engv'][0] = $MSGEng;\n\t\t\t\t\t\t} else { $n=0; foreach($MSGEng as $v){\n\t\t\t\t\t\t\t\tif(strlen(trim($v)) > 0) $Tarray['Engv'][$n] = $v; $n++;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t} break;\n\t\t\t\t}\n\t\t\t} $TmpCart['msgs'] = $Tarray;\n\t\t} else { $TmpCart['msgs'] = 0; }\n\t\t\n\t\t$TmpCart['attnd']\t= \t(isset($_POST['attendee']))? array(clean_variable($_POST['attendee'],true)) : array(0);\n\t\t\n\t\t$this->updateCart($TmpCart); // Update our cart with our new information\n\t\t\n\t\theader(sprintf(\"Location: %s\", $this->Files['Cart'] )); // Go to page to dispaly Cart -- Do this to prevent double insertion of product via refresh button\n\t}", "public static function addItem($id_product, $id_item, $qty)\n {\n }", "public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }", "function add_to_cart($id,$qty){\r\n\r\n $row = $this->Web_model->get_by_id($id);\r\n $kategori = $this->Web_model->get_by_idkat($row->id_kategori);\r\n if ($row) {\r\n $datas= array(\r\n 'id' => $row->id_menu,\r\n 'name' => $row->nama_menu,\r\n 'price' => $row->harga,\r\n 'qty' => $qty, \r\n 'id_kategori' => $row->id_kategori,\r\n 'gambar' => $row->foto_menu,\r\n 'nama_kategori' => $kategori->nama_kategori,\r\n );\r\n $this->cart->product_name_rules = '[:print:]';\r\n $this->cart->insert($datas);\r\n echo(count($this->cart->contents()));\r\n }\r\n }", "public function addProduct(Product $product)\n {\n $this->products[] = $product;\n $this->price += $product->getPrice();\n if($this->hasPromotion()){\n $this->applyPromotion();\n }\n }", "public function actionAddToCart($product_id, $user_id, $variation_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['variation_id'] = $variation_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('shopping_cart', $saveArr)->execute();\n exit;\n }", "function old_pushCart($product_id,$quantity,$transport) \n {\n $conn=connect();\n $query= \"INSERT INTO shopping_cart(user_id,delivery,product_id,quantity) VALUES (\".$this->user_id.\",\".$transport.\",\".$product_id.\",\".$quantity.\")\"; //obtain information about a product\n if($results = mysqli_query($conn, $query)) //to add to the cart\n {\n $last_id =mysqli_insert_id($conn);\n $this->cart->addProduct($last_id, $product_id,$transport,$quantity);\n }\n mysqli_close($conn);\n \n \n }", "public function add($productId, $idProductAttribute, $quantity = 1) {\n /* Product addition to the cart */\n if (!isset($this->cart->id) OR !$this->cart->id) {\n $this->cart->add();\n if ($this->cart->id)\n $this->cookie->id_cart = (int) ($this->cart->id);\n }\n return $this->cart->updateQty($quantity, $productId, $idProductAttribute);\n }", "function add_product_to_order($id_order,$id_product,$sauce){\r\n $bdd = Database3Splus::getinstance();//connexion();\r\n $amount = 1;\r\n $req = \"INSERT INTO order_details VALUES (:id_order, :id_product, :amount, :sauce)\";\r\n $result = $bdd->prepare($req);\r\n $result->bindParam(':id_order', $id_order);\r\n $result->bindParam(':id_product', $id_product);\r\n $result->bindParam(':amount', $amount);\r\n $result->bindParam(':sauce', $sauce);\r\n $result->execute();\r\n $count = $result->rowCount();\r\n\t\tif($count != 0){return TRUE;}\r\n\t\telse{return FALSE;}\r\n\t}", "public function add_to_cart($cartid=0, $prodid=0, $qty=0) {\n\t\t// otherwise create a new entry in cart for this prodid.\n\t\t\n\t\t$query = \"SELECT * FROM pivot_order-products WHERE order_id = ? AND product_id = ?\";\t\t\t\n\t\t$values = array($cartid,$prodid);\n\t\t$results = $this->db->query($query,$values);\n\n\t\tif($results) {\n\t\t\t$total = $results('quantity') + $qty;\n\t\t\t$query = \"UPDATE pivot_order-products SET quantity = ?, SET modified_on = NOW() WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($total, $cartid, $prodid);\n\n\t\t} else {\n\t\t\t$query = \"INSERT INTO pivot_order-products (order_id,product_id,quantity,created_on,modified_on) VALUES \";\n\t\t\t$query = \"(?,?,?,NOW(),NOW())\";\n\t\t\t$values = array($cartid, $prodid, $qty);\n\n\t\t}\n\t\treturn $this->db->query($query, $values);\n\t}", "public function add()\n {\n if (Request::isMethod('post')) {\n\n $product_id = Request::get('id');\n $product = Product::find($product_id);\n Cart::add(\n [\n 'id' => $product_id,\n 'name' => $product->name,\n 'image' => $product->image,\n 'qty' => 1,\n 'price' => $product->price\n ]\n );\n }\n return redirect('/products');\n }", "public function addItemToCart($id)\n {\n $session=Yii::app()->session;\n $arr_session=array();\n $model=Item::model()->findbyPk($id);\n $my_product=$model->attributes;\n if(isset($session['cart']))\n {\n $arr_session=$session['cart'];\n if(array_key_exists($id,$session['cart']))\n {\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']++;\n $session['cart']=$arr_session;\n \n }else{\n $arr_session=$session['cart'];\n $arr_session[$id]=$my_product;\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }else{\n $session['cart']=array($id=>$my_product,);\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }", "public function addToCart()\n {\n $id = intval($_GET[\"id\"]);\n if ($id > 0) {\n if ($_SESSION['cart'] != \"\") {\n $cart = json_decode($_SESSION['cart'], true);\n $found = false;\n for ($i = 0; $i < count($cart); $i++)\n {\n if ($cart[$i][\"product\"] == $id)\n {\n $cart[$i][\"quantity\"] = $cart[$i][\"quantity\"] + 1;\n $found = true;\n break;\n }\n }\n if (!$found)\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n }\n $_SESSION['cart'] = json_encode($cart);\n }\n else\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n $_SESSION['cart'] = json_encode($cart);\n }\n }\n }", "public function addItemToCart($id)\n {\n\n //$this->db->query(\"insert into koszyk (id_produktu, id_klienta, ilosc)\");\n\n return $this->getProductById($id);\n }", "public function add(Product $product)\n\t{\t\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t//\tSi el producto ya esta en el carro se le suma 1 a la cantidad.\n \tif (array_key_exists($product->id, $cart)){\n \t\t$ops = $cart[$product->id]->cantidad;\n \t\t$product->cantidad = $ops+1;\n \t}\n \t//\tSi el producto no estaba su cantidad es 1.\n \telse{\n \t $product->cantidad = 1;\t\n \t}\n \t$cart[$product->id] = $product;\n \t//\tAgregando el producto.\n\t\t\\Session::put('cart',$cart);\n\n\t\treturn redirect()->route('cart-show');\n\n\t}", "public function store(Product $product)\n { \n Cart::add($product->id, $product->name , 1, $product->price)\n ->associate('App\\Product');\n return redirect()->route('cart.index')->with('success_message', 'Item was added to your cart!');\n \n }", "public function addItem(string $sku, int $qty): Cart;", "public function addSimpleProduct(\\Club\\ShopBundle\\Entity\\CartProduct $product)\n {\n $prod = new \\Club\\ShopBundle\\Entity\\OrderProduct();\n\n $prod->setOrder($this->order);\n $prod->setPrice($product->getPrice());\n $prod->setQuantity($product->getQuantity());\n $prod->setProductName($product->getProductName());\n $prod->setType($product->getType());\n\n $this->order->addOrderProduct($prod);\n $this->em->persist($prod);\n }", "function add_to_cart(){\n\t\t$data = array(\n\t\t\t'id' => $this->input->post('produk_id'), \n\t\t\t'name' => $this->input->post('produk_nama'), \n\t\t\t'price' => $this->input->post('produk_harga'), \n\t\t\t'qty' => $this->input->post('quantity'), \n\t\t);\n\t\t$this->cart->insert($data);\n echo $this->show_cart(); //tampilkan cart setelah added\n }", "public function add() {\n\t\t$this->load->language('checkout/cart');\n\n\t\t$json = array();\n\n\t\tif (isset($this->request->post['product_id'])) {\n\t\t\t$product_id = (int)$this->request->post['product_id'];\n\t\t} else {\n\t\t\t$product_id = 0;\n\t\t}\n\n\t\t$this->load->model('catalog/product');\n\n\t\t$product_info = $this->model_catalog_product->getProduct($product_id);\n\n\t\tif ($product_info) {\n\t\t\tif (isset($this->request->post['quantity']) && ((int)$this->request->post['quantity'] >= $product_info['minimum'])) {\n\t\t\t\t$quantity = (int)$this->request->post['quantity'];\n\t\t\t} else {\n\t\t\t\t$quantity = $product_info['minimum'] ? $product_info['minimum'] : 1;\n\t\t\t}\n\t\t\tif (isset($this->request->post['option'])) {\n\t\t\t\t$option = array_filter($this->request->post['option']);\n\t\t\t} else {\n\t\t\t\t$option = array();\n\t\t\t}\n\n\t\t\t$product_options = $this->model_catalog_product->getProductOptions($this->request->post['product_id']);\n\n\t\t\tforeach ($product_options as $product_option) {\n\t\t\t\tif ($product_option['required'] && empty($option[$product_option['product_option_id']])) {\n\t\t\t\t\t$json['error']['option'][$product_option['product_option_id']] = sprintf($this->language->get('error_required'), $product_option['name']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($this->request->post['recurring_id'])) {\n\t\t\t\t$recurring_id = $this->request->post['recurring_id'];\n\t\t\t} else {\n\t\t\t\t$recurring_id = 0;\n\t\t\t}\n\n\t\t\t$recurrings = $this->model_catalog_product->getProfiles($product_info['product_id']);\n\n\t\t\tif ($recurrings) {\n\t\t\t\t$recurring_ids = array();\n\n\t\t\t\tforeach ($recurrings as $recurring) {\n\t\t\t\t\t$recurring_ids[] = $recurring['recurring_id'];\n\t\t\t\t}\n\n\t\t\t\tif (!in_array($recurring_id, $recurring_ids)) {\n\t\t\t\t\t$json['error']['recurring'] = $this->language->get('error_recurring_required');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$json) {\n\t\t\t\tif(isset($this->session->data['cart'])) {\n$oldCart = $this->session->data['cart']; \n}\n$this->cart->add($this->request->post['product_id'], $quantity, $option, $recurring_id);\n\t\t\t\t/*\n\t\t\t\t // BOF - Betaout Opencart mod\n $this->load->model('tool/betaout');\n //$this->model_tool_betaout->track();\n $this->model_tool_betaout->trackEcommerceCartUpdate();\n // EOF - Betaout Opencart mod\n\t\t\t\t*/\n\n\t\t\t\t$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('checkout/cart'));\n\n$this->load->model('setting/setting');\n$giftTeaser = $this->model_setting_setting->getSetting('giftteaser', $this->config->get('config_store_id'));\nif (empty($giftTeaser['giftteaser']['Enabled']) || $giftTeaser['giftteaser']['Enabled'] == 'no') { } else {\n$this->load->language('extension/module/giftteaser');\n$addition = '';\nforeach ($this->cart->getProducts() as $key => $val) {\nif (!empty($val['gift_teaser']) && $val['gift_teaser']==true ) {\nif (!isset($this->session->data['success_addition'])) {\n$addition = $this->language->get('gift_added_to_cart');\n}\n}\n}\t\n$json['success'] .= $addition;\t\n}\n\n$this->register_abandonedCarts();\n\t\t\t\t// Unset all shipping and payment methods\n\t\t\t\tunset($this->session->data['shipping_method']);\n\t\t\t\tunset($this->session->data['shipping_methods']);\n\t\t\t\tunset($this->session->data['payment_method']);\n\t\t\t\tunset($this->session->data['payment_methods']);\n\n\t\t\t\t// Totals\n\t\t\t\t$this->load->model('extension/extension');\n\n\t\t\t\t$totals = array();\n\t\t\t\t$taxes = $this->cart->getTaxes();\n\t\t\t\t$total = 0;\n\t\t\n\t\t\t\t// Because __call can not keep var references so we put them into an array. \t\t\t\n\t\t\t\t$total_data = array(\n\t\t\t\t\t'totals' => &$totals,\n\t\t\t\t\t'taxes' => &$taxes,\n\t\t\t\t\t'total' => &$total\n\t\t\t\t);\n\n\t\t\t\t// Display prices\n\t\t\t\tif ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {\n\t\t\t\t\t$sort_order = array();\n\n\t\t\t\t\t$results = $this->model_extension_extension->getExtensions('total');\n\n\t\t\t\t\tforeach ($results as $key => $value) {\n\t\t\t\t\t\t$sort_order[$key] = $this->config->get($value['code'] . '_sort_order');\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_multisort($sort_order, SORT_ASC, $results);\n\n\t\t\t\t\tforeach ($results as $result) {\n\t\t\t\t\t\tif ($this->config->get($result['code'] . '_status')) {\n\t\t\t\t\t\t\t$this->load->model('extension/total/' . $result['code']);\n\n\t\t\t\t\t\t\t// We have to put the totals in an array so that they pass by reference.\n\t\t\t\t\t\t\t$this->{'model_extension_total_' . $result['code']}->getTotal($total_data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$sort_order = array();\n\n\t\t\t\t\tforeach ($totals as $key => $value) {\n\t\t\t\t\t\t$sort_order[$key] = $value['sort_order'];\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_multisort($sort_order, SORT_ASC, $totals);\n\t\t\t\t}\n\n\t\t\t\t$json['total'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total, $this->session->data['currency']));\n\t\t\t} else {\n\t\t\t\t$json['redirect'] = str_replace('&amp;', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']));\n\t\t\t}\n\t\t}\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}", "public function add($id)\n {\n \tif(empty($this->items))\n \t{\n \t\t$item = new ShoppingItem($id,1);\n\t\t\t$this->session->push(self::SHOPPINGCART, $item);\n\t\t\t$this->items[] = $item;\n \t}else\n \t{\n \n \t\tif($this->getItem($id))\n \t\t{\n \t\t\t$item = $this->getItem($id);\n \t\t\t$item->quantity += 1;\n \t\t}\n else\n {\n \t\t$item = new ShoppingItem($id,1);\n \t\t$this->session->push(self::SHOPPINGCART,$item);\n \t\t$this->items[] = $item;\n }\n \t} \n \t\n }", "public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&amp;tab=buy&amp;area=cart\" );\n\t}", "public function addProduct(array $params = []): void\n {\n if (!empty($params))\n {\n $id = intval($params['id']) ?? null;\n $title = $params['title'] ?? null;\n $price = floatval($params['price']) ?? null;\n $quantity = intval($params['quantity']) ?? null;\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($id && $title && $price && $quantity)\n {\n if (!$userData->getCart())\n {\n $userData->cart = new ShoppingCart();\n }\n\n $userData->getCart()->addProduct(compact('id', 'title', 'price', 'quantity'));\n }\n\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }", "public function actionAdd()\n {\n $product_id = $this->getRequest('post','product_id');\n $image_id = $this->getRequest('post','image_id');\n $product = \\common\\models\\Products::find()->where(['id' => $product_id])->one();\n $total = $product->price;\n $count = $this->getRequest('post','count');\n $cover_id = $this->getRequest('post','cover_id');\n $color_id = $this->getRequest('post','color_id');\n\n $cart = new OrderCart();\n $cart->product_id = $product_id;\n $cart->image_id = $image_id;\n $cart->total = $total;\n $cart->count = $count;\n $cart->cover_id = $cover_id;\n $cart->user_id =$this->getUserId();\n $cart->user_hash = $this->getFromSession('id');\n $cart->color_id = $color_id;\n $cart->save();\n $allCart = (new CartsUtil())->getSelfCart();\n foreach($allCart as $k=> $v) {\n if($v['id'] == $cart->id) {\n $discont = (new SalesUtil())->detectSale($v);\n $cart->total = $cart->total - (($discont && isset($discont['sale_val']))\n ? $discont['sale_val']\n : 0 );\n break;\n }\n }\n return ($cart->save()) ? 200 : 400;\n }", "public function store(Request $request)\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n\n if(empty($cart)) {\n $order = new Order;\n $order->user_id = $user->id;\n $order->status_id = 1;\n $order->save();\n\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $order->id;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n } else {\n // if you already have this product in your cart just add the next quantity to the same line item\n if (OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->exists() ){\n $repeatOrderProduct = OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->first();\n $orderProduct = OrderProduct::find($repeatOrderProduct->id);\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity + $orderProduct->quantity;\n $orderProduct->save();\n }\n // else make a new line item for this new item\n else {\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $cart;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n }\n }\n\n Activity::log('Saved an item to their cart.', $user->id);\n\n $request->session()->flash('status', 'Product was saved to cart.');\n\n return Redirect::action('CartController@index');\n\n }", "public function add(\\Webshop\\Products\\Product $product)\n {\n $this->redis->zAdd('prd', $product->getId(), serialize($product));\n }", "public function addToCart($product, $qtt){\n $this->lines[] = [\"product\" => $product, \"qtt\" => $qtt];\n }", "function add_to_cart(item $item) {\n \\Cart::session(auth()->id())->add(array(\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'quantity' => 1,\n 'attributes' => array(),\n 'associatedModel' => $item\n ));\n return redirect('/cart');\n }", "public function added_to_cart( $cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data ) {\n\n\t\t// don't track add to cart from AJAX POST here\n\t\tif ( isset( $_POST['action'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$product = get_product( $product_id );\n\n\t\t$properties = array(\n\t\t\t$this->property_name['product_name'] => htmlentities( $product->get_title(), ENT_QUOTES, 'UTF-8' ),\n\t\t\t$this->property_name['quantity'] => $quantity,\n\t\t\t$this->property_name['category'] => strip_tags( $product->get_categories() )\n\t\t);\n\n\t\tif ( ! empty( $variation ) ) {\n\t\t\t// Added a variable product to cart, set attributes as properties\n\t\t\t// Remove 'pa_' from keys to keep property names consistent\n\t\t\t// note: `pa_` was replaced with `attribute_` in 2.1, so `pa_` can be removed once 2.1+ is required\n\t\t\t$variation = array_flip( str_replace( array( 'pa_', 'attribute_' ), '', array_flip( $variation ) ) );\n\n\t\t\t$properties = array_merge( $properties, $variation );\n\t\t}\n\n\t\t$this->api_record_event( $this->event_name['added_to_cart'], $properties );\n\t}", "public function add(ProductInterface $product, $quantity = 1);", "function addToCart() {\n\t\t$wine_name = $_SESSION['wine']['name'];\n\t\t//check if there is a registered user logged in\n\t\t// --> LET US NOT THINK ABOUT USERNAMES FOR NOW <--\n\t\t//if (!isset($_SESSION['user'])) {\n\t\t\t//generate a random username (string) for\n\t\t\t//unlogged user\n\t\t\t//$username = uniqid('',true);\n\t\t\t//$_SESSION['user']['username'] = $username;\n\t\t//}\n\n\t\t//get the cart\n\t\t$cart = $_SESSION['cart'];\n\t\t//get wine count\n\t\t$wine_qty = $_POST['wine_quantity'];\n\t\t// detect if the same item already exist in the cart\n\t\tif (isset($_SESSION['cart'][$wine_name])) {\n\t\t\t//just add the post quantity to the quantity in the cart\n\t\t\t$_SESSION['cart'][$wine_name] += $wine_qty;\n\t\t}\n\t\telse {\n\t\t\t//create an array of the selected item to be\n\t\t\t//added to the cart\n\t\t\t$_SESSION['cart'][$wine_name] = intval($wine_qty);\n\t\t\t//current date will also be used at view cart\n\t\t\t//\"purchase_date\" => date(\"Y-m-d h:i:sa\")\n\t\t}\n\t\t//redirect to homepage\n\t\theader('Location: index.php');\n\t}", "public function addProductToCart(Request $request): JsonResponse\n {\n\n // Check if request includes the product\n $product_id = $request->get('product');\n if (!$product_id) {\n return $this->errorResponse('You need to provide a product!', Response::HTTP_BAD_REQUEST);\n }\n\n // Check if product exists in the db\n $product = Product::find($product_id);\n if (!$product) {\n return $this->errorResponse('Couldnt find product', Response::HTTP_NOT_FOUND);\n }\n\n $this->orderHandler->updateCartProductSession($product_id);\n return $this->successResponse([], Response::HTTP_OK);\n }", "public function actionAddToCart()\n {\n (LoginController::class)::checkLogin();\n $id = App::call()->request->getParams()['id'];\n $cart = (new Sessions())->get('cart');\n if ($id) {\n if (!$cart || !in_array($id, $cart)) {\n (new Sessions())->add('cart', $id);\n $message = 'Item is added!';\n } else {\n $message = 'Item is already in cart!';\n }\n }\n echo $message;\n }", "public function addToCart(Request $request, $id)\n {\n $product = Product::find($id);\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new Cart($oldCart);\n $cart->add($product, $product->id);\n\n $request->session()->put('cart', $cart);\n return redirect('shopping');\n }", "function add() {\n\t\tif (True) {\n\n\t\t\t// create an empty product.\n\t\t\t$o =& new ufo_product(0);\n\t\t\t$this->addedObject =& $o;\n\t\t\n\t\t\t// create an entry in the db.\n\t\t\t$o->initialize();\n\t\t\t$o->create();\n\t\t\t$o->edit();\n\n\t\t\t// add it to the product array.\n\t\t\t$this->product[] = $o;\n\t\t}\n\t}", "public function addItem( $variant_id,\\Shop\\Models\\Products $product, array $post )\r\n {\r\n \r\n $wishlistitem = \\Shop\\Models\\Carts::createItem($variant_id, $product, $post);\r\n \r\n // Is the item already in the wishlist?\r\n // if so, inc quantity\r\n // otherwise add the wishlistitem\r\n $exists = false;\r\n foreach ( $this->items as $key => $item )\r\n {\r\n if ($item['hash'] == $wishlistitem->hash)\r\n {\r\n $exists = true;\r\n $wishlistitem->id = $item['id'];\r\n $wishlistitem->quantity = $wishlistitem->quantity + $item['quantity'];\r\n $this->items[$key] = $wishlistitem->cast();\r\n \r\n break;\r\n }\r\n }\r\n \r\n if (! $exists)\r\n {\r\n $this->items[] = $wishlistitem->cast();\r\n }\r\n \r\n return $this->save();\r\n }", "public function addItemToCart(Request $request,$id){\n \n //get product\n $product=Product::with('get_images')->findOrFail($id);\n\n\n //check if the quantity entered is null or 0\n\n if($request->quantity==null || $request->quantity==0){\n return back()->withInput($request->input())->withErrors('Min unit needs to be 1');\n }\n //to check if the product exists in cart \n\n $cart_product=Cart::content()->groupBy('id')->get($id);\n\n //if not present check the quantity requested with the entered one. If present then compare with quantity requested and entered.\n\n if($cart_product==null){\n if($request->quantity>$product->quantity){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n }\n else if(($request->quantity+($cart_product->first()->qty))>$product->quantity ){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n if($product->special_price_from && $product->special_price_to){\n $date=date('Y-m-d');\n if($date<=$product->special_price_to && $date>=$product->special_price_from){\n \n $product->price=$product->special_price;\n\n }\n }\n Cart::add(['id'=>$product->id,'name'=>$product->name,'qty'=>$request->quantity,'price'=>$product->price,'options'=>['image'=>$product->get_images->first()->image_name]]);\n session(['cart_total'=>round((float)str_replace(',', '', Cart::total()),2)]);\n\n Session::flash('success','Item added to cart!');\n return back();\n\n }", "public function addToCart(Request $request){\n if($request->session()->has('user'))\n {\n //add item info inside cart table\n $cart = new Cart;\n $cart->user_id = auth()->user()->id;\n $cart->product_id = $request->product_id;\n $cart->save();\n return redirect('/products');\n }else{\n return redirect('/login');\n }\n }", "public function addprodus_session($product)\n {\n $getsess = $this->getsession();\n if(!$getsess) $cart = array();//Cart doesn't exista\n elseif($getsess) $cart = $getsess;//Cart exist, use it's Array\n\n $cart[$product[\"id\"]] = $product;//pass product to Cart\n\n $this->session->set_userdata('cart', $cart);\n if($this->checkCartItem($product[\"id\"])) return true;\n\n return false;\n }", "public static function addProduct($id){\n \n $id = intval($id);\n \n $productsInCart = array();\n \n if(isset($_SESSION['products'])){\n $productsInCart = $_SESSION['products'];\n }\n \n if(array_key_exists($id, $productsInCart)){\n $productsInCart[$id]++;\n }else{\n $productsInCart[$id] = 1; \n }\n \n $_SESSION['products'] = $productsInCart;\n \n return self::countItems();\n }", "public function addToCart($id, Request $request)\n {\n $product = DB::table('products')\n ->join('images', 'products.id', '=', 'images.product_id')\n ->select('products.*', 'images.name as imageName')\n ->where('products.id', '=', $id)\n ->groupby('products.id')\n ->get();\n $name = $product[0]->name;\n $price = $product[0]->price * ((100-$product[0]->sale)/100);\n $image = $product[0]->imageName;\n Cart::add(array('id' => $id, 'name' => $name, 'qty' => 1, 'price' => $price, 'options' => array('size' => 'L', 'image' => $image)));\n return redirect('user/cart');\n }", "public function addCart($cart){\n $this->cart_id = $cart; \n }", "public function actionAddtocart($id,$price,$name, $quantity)\n {\n $session = Yii::$app->session;\n //$session->remove('cart');\n if($session->has('cart')) //if the session is there, we need to add to it\n {\n //t\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n\n\n }\n else //if the session is not there, we need to create it\n {\n\n $session['cart'] = array();\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n }\n //go to the users' cart page\n $this->redirect(['cart/index']);\n }", "public function add_item($data)\n {\n $required = array(\n 'id' => 'Product id not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n $cart = $this->getService()->getSessionCart();\n\n $product = $this->di['db']->getExistingModelById('Product', $data['id'], 'Product not found');\n\n //reset cart by default\n if (!isset($data['multiple']) || !$data['multiple']) {\n $this->reset();\n }\n\n return $this->getService()->addItem($cart, $product, $data);\n }", "function addItem($itemKey){\n\t\t\t//if the item already exsists in the cart, add one.\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] + 1; \n\t\t\t}\n\t\t\t\n\t\t\t//if the item is not already set in the cart.\n\t\t\t//Find the correct price off the item from the server side $products\n\t\t\t//note - I am looking up the prices server-side to protect from customers entering in their own prices in the html\n\t\t\telse{\n\t\t\t\t//find the corresponding product based on the product name (keys would be preferable)\n\t\t\t\tforeach($GLOBALS['products'] as $product){\t\t\n\t\t\t\t\tif($itemKey == $product['name']){\n\t\t\t\t\t\t//set the item price server-side\n\t\t\t\t\t\t$itemPrice = $product['price'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//if there is a valid product with that name (key) and therefore has a corresponding price.\n\t\t\t\t//add it to the cart otherwise ignore it\n\t\t\t\t//note - This protects the server from having items in the shopping cart that don't exsist server side. \n\t\t\t\tif(isset($itemPrice)){\n\t\t\t\t\t$this->items[$itemKey] = array( \"name\" => $itemKey, \"price\" => $itemPrice , \"quantity\" => 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\treturn;\n\t\t}", "public function add($id){\n $product = Product::findOrFail($id);\n\n //goi phuong thức add() từ thư viện Cart\n Cart::add([\n 'id' => $id,\n 'name' => $product->name,\n 'qty' => 1,\n 'price' => $product->discount ?? $product->price,\n 'weight' => $product->weight ?? 0,\n 'options' => [\n 'images' => $product->productImages,\n ],\n ]);\n\n//dung phuong thuc content() de xem DL trong cart\n// dd(Cart::content());\n\n return back();\n }", "public function addItem($product_id, $product_name, $category_id, $category_name, $qty, $cost, $sku = null)\n {\n $item = array(\n 'product_id' => $product_id,\n 'product_name' => $product_name,\n 'category_id' => $category_id,\n 'category_name' => $category_name,\n 'qty' => $qty,\n 'cost' => $cost\n );\n \n if($sku) {\n $item['sku'] = $sku;\n }\n \n $this->items[] = $item;\n }", "public function addCart($post_id)\n {\n global $woocommerce;\n if (!is_int($post_id)) return;\n $post = get_post($post_id);\n if ($post->post_type == \"product\") :\n $cart_item_key = $woocommerce->cart->add_to_cart($post_id, 1);\n endif;\n }", "public function AddProduct () {\n $piece1 = '(';\n \t$piece2 = '';\n\t\t\n\t\tif(isset($SKU)) {\n\t\t\t$piece1 .= 'ProductSKU,';\n\t\t\t$piece2 .= \"'\" . $this->SKU . \"'\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: SKU Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$productTable = 'Products';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $productResults = OrderData::InsertData($productTable, $productPiece);\n\t\t\n\t\tif($productResults === false)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tif(isset($Qty)) {\n\t\t\t$piece1 .= 'TotalAMT,';\n\t\t\t$piece2 .= \"\" . $this->initialquantityStock . \"\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: Quantity Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$piece1 .= 'CommittedAMT,';\n\t\t$piece2 .= $this->committedStock . ',';\n\n \t\t$piece1 .= 'AvailableAMT';\n $piece2 .= $this->availableStock . ')';\n\t\t\n\t\t$piece1 .= ') VALUES (';\n\n $inventoryPiece = $piece1 . $piece2;\n\t\t\n\t\t$inventoryTable = 'Inventory';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $inventoryResults = OrderData::InsertData($inventoryTable, $inventoryPiece);\n\t\t\n\t\tif($inventoryResults === false)\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}" ]
[ "0.86509967", "0.80622", "0.8015628", "0.7981821", "0.7945607", "0.7817365", "0.78100586", "0.7773152", "0.7747582", "0.770635", "0.76901203", "0.76901203", "0.7657472", "0.7626505", "0.7600053", "0.7554239", "0.7440893", "0.743813", "0.7432114", "0.74168867", "0.7410251", "0.74087995", "0.74063694", "0.7392194", "0.7379576", "0.7361264", "0.7355601", "0.73245025", "0.73163354", "0.7297822", "0.72821903", "0.72670543", "0.7264099", "0.7263399", "0.7244715", "0.723761", "0.7230947", "0.7206885", "0.72054976", "0.7193315", "0.71908534", "0.7170119", "0.7166587", "0.7141841", "0.71370226", "0.71348345", "0.7129411", "0.71239316", "0.7120377", "0.7119871", "0.71122", "0.7107063", "0.7082771", "0.7081636", "0.7081611", "0.70785934", "0.7068645", "0.7051432", "0.7049894", "0.70410043", "0.7025763", "0.7010487", "0.7000472", "0.6996817", "0.6985679", "0.69763577", "0.6975172", "0.69623315", "0.6929183", "0.69145846", "0.69141483", "0.69124025", "0.69099236", "0.6905525", "0.69042546", "0.69022346", "0.68989325", "0.6893889", "0.6887273", "0.68864954", "0.68828046", "0.6873469", "0.68718195", "0.68597883", "0.68478316", "0.6846373", "0.68379474", "0.6826303", "0.68151087", "0.6803465", "0.67988056", "0.6798771", "0.67919886", "0.67818534", "0.67732996", "0.6769518", "0.6769381", "0.6764328", "0.6762129", "0.67612183" ]
0.74723375
16
////////////////////////////////////////////////////////////////////// Delete product from cart
public static function deleteProductFromCart($product_id) { $auth = fn_fill_auth(); $cart = $_SESSION['cart']; fn_delete_cart_product($cart, $cart_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeProduct(Product $product){\n \t$this->myCart->remove($product);\n }", "public function delete() {\n if (!$this->customer->isLogged()) {\n die();\n }\n $product_id = $this->request->post['product_id'];\n $this->load->model('catalog/product');\n\n $this->model_catalog_product->deleteProduct($product_id);\n\n echo \"ok\";\n exit();\n\n }", "public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}", "function delete_product_item($id){\n $this->delete($id);\n }", "public function deleteCartProduct($id = null)\n {\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n DB::table('cart')->where(['id'=>$id])->delete();\n return redirect('/cart')->with('update_message','Product has been deleted from cart');\n }", "public function deleteProduct(Product $product);", "public static function cart_remove_product()\n {\n if (!isset($_REQUEST['cart-item-key'])) {\n WordPress_Rewrite_API_Request::missing_params();\n }\n\n //@TODO Check item_key exist in Cart or Use $_REQUEST['product_id'] as item_key\n\n // Remove\n WooCommerce_Cart::remove_item_cart(sanitize_text_field($_REQUEST['cart-item-key']));\n\n // Result\n wp_send_json_success(self::_return_cart_list(), 200);\n }", "private function deleteProduct()\n {\n echo PHP_EOL;\n \n try\n {\n $productToDelete = $this->productDao->getByEan(self::PRODUCT_TURKEY_EAN);\n $resultOfDelete = $this->productDao->delete($productToDelete); \n\n echo 'Product with id: ' . $productToDelete->id . ' was deleted ' .\n (($resultOfDelete) ? '' : 'un') .\n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n }", "public function product_delete()\n\t\t\t\t{\n\t\t\t\t}", "public static function delete_product($id)\n {\n echo $id;\n $cart = session()->get('cart');\n if(isset($cart[$id])) {\n unset($cart[$id]);\n session()->put('cart', $cart);\n }\n session()->flash('success', 'Product removed successfully');\n\n return redirect()->back();\n\n }", "public function destroy(Cart $cart,Product $product)\n {\n\n //TO DO GET CART_PRODUCTS DATA HERE AND DELETE IT\n\n\n //TO DO DELETE CART DATA HERE\n\n return back();\n }", "public function deleteProduct($id, $request)\n {\n unset($this->cart[$id]);\n $this->saveCart($request);\n }", "public function deleting(Cart $cart)\n {\n //\n }", "function delete($product)\n {\n if (array_key_exists($product->id, $this->items)) {\n $storeProductDelete = $this->items[$product->id];\n //giam tien\n $this->totalPrice -= $storeProductDelete['price'];\n //giam so luong\n $this->totalQuantity -= $storeProductDelete['quantity'];\n // xoa phan tu o vi tri $product->id\n unset($this->items[$product->id]);\n }\n }", "public function delete()\n\t{\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$cartElement = $post['cart_index'];\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t$model->delete($cartElement);\n\t\t$this->_carthelper->cartFinalCalculation();\n\t\t$this->_carthelper->carttodb();\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t$this->setRedirect($link);\n\t}", "public function removeproductAction() {\n $id = $this->getRequest()->getParam('id');\n $poProductId = $this->getRequest()->getParam('poproductid');\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo_product')->load($poProductId);\n $product = Mage::getResourceModel('catalog/product_collection')\n ->addFieldToFilter('entity_id', $model->getProductId())\n ->setPageSize(1)->setCurPage(1)\n ->getFirstItem();\n try {\n $model->delete();\n Mage::getSingleton('vendors/session')->addSuccess(\n $this->helper()->__('Product %s has been removed.', '<i>' . $product->getSku() . '</i>')\n );\n $this->_redirect('*/*/view', array('id' => $id));\n } catch (Exception $e) {\n Mage::getSingleton('vendors/session')->addError($this->helper()->__('There is error while removing product.'));\n Mage::getSingleton('vendors/session')->addError($e->getMessage());\n $this->_redirect('*/*/view', array('id' => $id));\n }\n }", "public function removeProduct($product)\n {\n\n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if (! is_null($cart))\n\n $cart->pivot->delete();\n }", "public function destroy(Product $product)\n {\n return Cart::deleteFromSession($product);\n }", "public function deleteFromCart($prod_id){\n $this->cartConstruct();\n $this->removeItem($prod_id);\n if(count($this->items)>0)\n {\n Session::put('cart',$this);\n }\n else\n {\n Session::forget('cart',$this);\n }\n return redirect()->back();\n\t}", "function deleteFromCart()\n{\n\t$productID = (int)$_GET['p']; //Get product id to be removed.\n\t\t\n\t$sql = \"DELETE FROM Cart WHERE ItemID = $productID\";\n\n\t$result = query($sql);\n\t\n\theader('Location: ./cart.php');\t\n}", "public function deleteCart(){\n $cartItemModel = \\Ccc::objectManager('\\Model\\Item',false);\n\n foreach($this->getCartItems() as $item){\n $ids[] = $item->itemId;\n }\n \n if($cartItemModel->deleteData($ids)){\n return true;\n }\n\n return false;\n }", "public function delete(Product $product)\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t//\tEliminando el producto del carro.\n\t\tunset($cart[$product->id]);\n\t\t\\Session::put('cart', $cart);\n\n\t\treturn redirect()->route('cart-show');\n\t}", "function deleteCart() {\n\t\t$queryString = \"DELETE FROM cart;\";\n\n\t\tif ($stmt = $this->connection->prepare($queryString)) {\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\theader(\"Location: http://serenity.ist.rit.edu/~qsb2538/341/project1/cart.php\");\n\t\t}\n\t}", "private function deleteIdFromProductsCart($cart, $productId)\n {\n unset($cart['products'][array_search($productId, $cart['products'])]);\n return $cart;\n }", "public function delete_product() {\n\t\t$values=array(\"rstatus\"=>\"C\");\n\t\t$rowIndex = $_POST['row_index'];\n\t\t$where =array(\"id\"=>$_POST['product_id']);\n\t\tif($this->update(\"products\",$values,$where)) {\t\t\t\n\t\t\techo '{\"masterItemsList\":{\"updateFlag\":\"void\",\"rowIndex\":'.$rowIndex.'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while deleting';\n\t}", "public function destroy($id)\n {\n\n $cart = Cart::where('user_id', Auth()->id())\n ->first();\n\n $deleteProduct = CartProduct::findOrFail($id);\n $deleteProduct->delete();\n\n $CartProducts = CartProduct::where('user_id', Auth()->id())\n ->where('cart_id', $cart->id)\n ->get();\n\n if ($CartProducts->count() >= 1) {\n $this->updateTotal($cart);\n return redirect()->route('my-cart.index');\n } else {\n $cart->delete();\n return redirect()->route('my-cart.index');\n }\n // End of delete\n }", "public function actionDeleteProduct()\n {\n $order = Order::model()->findByPk(Yii::app()->request->getPost('order_id'));\n\n if (!$order)\n $this->error404(Yii::t('CartModule.admin', 'ORDER_NOT_FOUND'));\n\n if ($order->is_deleted)\n throw new CHttpException(404, Yii::t('CartModule.admin', 'ORDER_ISDELETED'));\n\n $order->deleteProduct(Yii::app()->request->getPost('id'));\n }", "public function actionDeleteProduct()\n\t{\n\t\t$model = OrderProduct::model()->findByPk($_POST['product_id']);\n\t\tif($model)\n\t\t\t$model->delete();\n\t}", "public function delete()\n {\n // get request\n $request = $this->getRequest()->request;\n // get product ID from request\n $product_id = $request['a'];\n // get product ids from session\n $compareProducts = $this->View()->getSession('compare', $compareProducts)?$this->View()->getSession('compare', $compareProducts):array();\n\n if (in_array($product_id, $compareProducts)) {\n // unseting product from compare session\n $key = array_search($product_id, $compareProducts);\n unset($compareProducts[$key]);\n }\n\n $this->View()->setSession('compare', $compareProducts);\n\n if ($request['XHR']) {\n die(json_encode([\n 'success' => true,\n 'message' => $this->View()->translating('compare_item_deleted'),\n 'count' => count($compareProducts),\n ]));\n }\n\n Router::redirect('compare');\n }", "public function delete_product_purchase()\n\t{\n\t\tif(empty($this->request->data['id_cliente']) || empty($this->request->data['produto_id']))\n\t\t{\n\t\t\t$this->Return = false;\n\t\t\t$this->Message = 'Informar produto e codigo do cliente';\n\t\t\t$this->EncodeReturn();\t\n\t\t}\n\n\t\t$CartSession = json_decode(base64_decode($this->request->data['carrinho']), 1);\n\n\t\t$i = 0;\t\t\t\t\n\t\tforeach ($CartSession['item'] as $item) \n\t\t{\n\t\t\tif($item['Produto']['id'] == $this->request->data['produto_id'] && $i == $this->request->data['indice'])\n\t\t\t{\n\t\t\t\tunset($CartSession['item'][$i]);\t\t\t\t\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\t\t\n\n\t\tsort($CartSession['item']);\t\n\n\t\t##realiza soma de valores\n\t\t$this->CountPurchase($CartSession);\t\n\t\t$this->EncodeReturn();\t\n\t}", "public function removeProduct(Product $product): CurrentCart;", "function remove_from_cart ($external_cart_id, $product_id) {\n $db = getDb();\n $cart_id = fetch_cart_id($external_cart_id);\n\n $statement = $db->prepare(\"\n DELETE FROM\n cart_content\n WHERE (\n cart_id = :cart_id AND\n product_id = :product_id\n )\n \");\n $executed = $statement->execute([\n \"cart_id\" => $cart_id,\n \"product_id\" => $product_id,\n ]);\n if (!$executed) {\n throw new Exception(\"An unexpected error occurred; could not remove from cart\");\n }\n}", "public function remove($cartId);", "function deleteProduct()\r\n{\r\n\tif (isset($_GET['productId']) && (int)$_GET['productId'] > 0) {\r\n\t\t$productId = (int)$_GET['productId'];\r\n\t} else {\r\n\t\theader('Location: index.php');\r\n\t}\r\n\t\r\n\t// remove any references to this product from\r\n\t// tbl_order_item and tbl_cart\r\n\t/*\r\n\t$sql = \"DELETE FROM tbl_order_item\r\n\t WHERE pd_id = $productId\";\r\n\t\r\n\tdbQuery($sql);\r\n\t\t\t\r\n\t$sql = \"DELETE FROM tbl_cart\r\n\t WHERE pd_id = $productId\";\t\r\n\t\r\n\tdbQuery($sql);\r\n\t*/\r\n\t\r\n\t// get the image name and thumbnail\r\n\t$sql = \"SELECT pd_image, pd_thumbnail\r\n\t FROM tbl_product\r\n\t\t\tWHERE pd_id = $productId\";\r\n\t\t\t\r\n\t$result = dbQuery($sql);\r\n\t$row = dbFetchAssoc($result);\r\n\t\r\n\t// remove the product image and thumbnail\r\n\tif ($row['pd_image']) {\r\n\t\tunlink(SRV_ROOT . 'images/product/' . $row['pd_image']);\r\n\t\tunlink(SRV_ROOT . 'images/product/' . $row['pd_thumbnail']);\r\n\t}\r\n\t\r\n\t// remove the product from database;\r\n\t$sql = \"DELETE FROM tbl_product \r\n\t WHERE pd_id = $productId\";\r\n\tdbQuery($sql);\r\n\t\r\n\theader('Location: index.php?catId=' . $_GET['catId']);\r\n}", "public function destroy(Product $cart)\n {\n $cartContent = session( 'cart', collect());\n $cartContent = $cartContent->where('id', '!=', $cart->id);\n\n session(['cart' => $cartContent]);\n\n return redirect()->back();\n }", "public function removeFromCart() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'] = array_splice($_SESSION['cart'], $count, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function delete_from_cart(Request $data) {\n \t$product_info = array(\n \t\t\"product_id\" => $data->product_id,\n \t\t\"num_items\" => $data->num_items,\n \t\t\"selectors\" => $data->selectors\n \t);\n\n \t// Create cart helper class and delete\n \t$cart_helper = new CartHelper();\n \t$cart_helper->delete_from_cart($product_info);\n\n \t// Return to cart\n \treturn redirect()->back();\n }", "public function destroy()\n {\n $this->_session->offsetUnset('products');\n $this->getEventManager()->trigger(CartEvent::EVENT_DELETE_CART_POST, $this, ['cart_id'=>$this->_session->cartId]);\n }", "public function delete(Cart $cartObj)\n {\n $query = $this->pdo->prepare(\"DELETE FROM orders_products WHERE order_id=:order_id;\");\n $query->execute(array('order_id'=>$cartObj->getOrderId()));\n }", "public function delete()\n {\n $this->isAuthenticated();\n $this->authToken->isRequestLimitExceeded();\n $this->authToken->logRequest(1);\n\n //get the id from the user\n $data = $_POST;\n //set the id\n $this->product->id = array_values($data)[0];\n\n if ($this->product->delete()) {\n // set response code - 200 ok\n http_response_code(200);\n echo json_encode(array(\"message\" => \"Product was deleted.\"));\n }\n\n // if unable to update the product\n else {\n\n // set response code - 503 service unavailable\n http_response_code(503);\n echo json_encode(array(\"message\" => \"Unable to delete.\"));\n }\n }", "public function del_product($del_id){\n\n\t\t$sql = \"DELETE FROM `my_cart`.`products` WHERE `products`.`id` = $del_id\";\n\t\n\t\t\t$this->query($sql);\n\t}", "public function removeProduct(Product $product, $quantity);", "function deleteCart() {\n\t\tunset($_SESSION['cart']);\t\t\n\t}", "public function remove_from_cart($qty=0, $oid=0, $proid=0) {\n\t\tif($qty) {\n\t\t\t$query = \"UPDATE pivot_order-products SET quantity = ? WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($qty,$oid,$prodid);\n\t\t\n\t\t} else {\n\t\t\t$query = \"DELETE FROM pivot_order-products WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($oid,$prodid);\n\n\t\t}\n\t\treturn $this->db->query($query,$values);\n\t}", "public function deleted($product)\n {\n Storage::deleteDirectory('product/' . $product->id);\n }", "public function remove_from_cart() {\n WC_Gokeep_JS::get_instance()->remove_from_cart();\n }", "public function delete_product($prod_id){\n\t\t$query = $this->db->delete('product', array('id' => $prod_id));\n\t\treturn $query;\n\t}", "public function removeFromShoppingCart($id){\r\n $stmt = $this->DB->prepare(\"DELETE FROM shopping_cart WHERE Cart_ID = $id;\");\r\n $stmt->execute();\r\n }", "function delete_product($product_id)\r\n\t{\r\n\t\t$this->db->delete('tbl_product', array('product_id' => $product_id));\t\t\r\n\t\treturn 1;\t\t\r\n\t}", "public function deleteCart($id)\n {\n $cart = session()->get('cart');\n $quantita_bloccata = $cart[$id]['quantita'];\n $idProduct = $cart[$id]['id'];\n $products = Product::with('sector')->find($idProduct);\n \n $products->sector->quantita_bloccata = $products->sector->quantita_bloccata - $quantita_bloccata;\n $quantitaTemp = $products->sector->quantita_bloccata;\n if ( $quantitaTemp >=0 ) {\n $products->push();\n \n }\n\n unset($cart[$id]);\n session()->put('cart', $cart);\n if (count($cart)==0) {\n session()->forget('cart');\n\n }\n\n return redirect()->back();\n \n }", "public function removeProduct($id){\r\n $stmt = $this->DB->prepare ( \"DELETE FROM products WHERE Product_ID = '$id';\");\r\n $stmt->execute ();\r\n }", "public function deleteProduct($id_product, $id_product_attribute = null, $id_customization = null, $id_address_delivery = 0)\n {\n $result = Hook::exec('ppbsDeleteCartProduct', array(\n 'id_product' => $id_product,\n 'id_product_attribute' => $id_product_attribute,\n 'id_customization' => $id_customization,\n 'id_address_delivery' => $id_address_delivery,\n ),\n null, false);\n if ($result == false) {\n parent::deleteProduct($id_product, $id_product_attribute = null, $id_customization = null, $id_address_delivery = 0);\n }\n }", "public function destroy($id)\n {\n\n $item = OrderProduct::find($id);\n Activity::log('Deleted an item from their cart.');\n $item->delete();\n return Redirect::action('CartController@index')->with('status', 'Item was successfully removed.');;\n }", "public function delete_product(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$product_id = $this->uri->segment(4,0);\r\n\t\t\t$condition = array('id' => $product_id);\r\n\t\t\t$old_product_details = $this->product_model->get_all_details(PRODUCT,array('id'=>$product_id));\r\n\t\t\t$this->update_old_list_values($product_id,array(),$old_product_details);\r\n\t\t\t$this->update_user_product_count($old_product_details);\r\n\t\t\t$this->product_model->commonDelete(PRODUCT,$condition);\r\n\t\t\t$this->setErrorMessage('success','Product deleted successfully');\r\n\t\t\tredirect('admin/product/display_product_list');\r\n\t\t}\r\n\t}", "public function destroy(cart $cart)\n {\n //\n }", "public function destroy(cart $cart)\n {\n //\n }", "public function delete() {\n\t\t$sql = 'delete from cart_orders_products_attributes where orders_products_attributes_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t}", "public function delete($id)\n{\n //faut recupere la qty de l id\n $cart=$this->session->get('cart',[]);\n unset($cart[$id]);\n return $this->session->set('cart', $cart);\n}", "public function deleteCart($id)\n {\n $data['cart'] = DB::table('carts')\n ->where('id', $id)\n ->delete(); //delete data from db table.cart based on item id\n\n return back()->with('success', 'Removed Item From Cart!');\n }", "public function delete_cart($where) {\n \treturn $this->db->delete($this->cart, $where);\n }", "public function destroyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.destroy', $this->instance);\n }", "public function productDelete(Varien_Event_Observer $observer)\n {\n try \n {\n $helper = Mage::helper('increasingly_analytics');\n\n if ($helper->isEnabled()){\n $productId = $observer->getEvent()->getProduct()->getId();\n\n $productData = array('product_id' => $productId);\n $helper->deleteBundleOnProductDeleteFromCart($productId);\n $helper->increasinglyApi($productData,'product_delete','track',$helper->getApiToken(),$helper->getApiSecret());\n }\n\n }\n catch(Exception $e)\n {\n Mage::log(\"Product delete tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n }", "public function deletePurchaseOrderProd($id){\n\t \t$query = $this->db->delete('purchase_order_products',array('id'=>$id));\n\t\treturn 1;\n\t }", "function deletesinglecart($cart_id){\n $cart= Cart::findOrfail($cart_id);\n $cart->delete();\n return back();\n }", "public function destroy($id)\n {\n if (Auth::check()) {\n $cart = Cart::where('user_id', Auth::id())->where('product_id',$id)->first();\n $cart->delete();\n\n return response()->json(['message'=>'Product removed from cart']);\n }\n }", "public function delete_item_list($product_id){\n\t\t\tunset($_SESSION['terminal_list'][$product_id]);\n\t\t\treturn 'sucess';\n\t}", "public function destroy(Cart $cart)\n {\n //\n }", "public function destroy(Cart $cart)\n {\n //\n }", "public function destroy(Cart $cart)\n {\n //\n }", "public function removeCart($id){\n\n CartItem::destroy($id);\n return redirect('/product_carts')->withSuccessRemoveCartMessage('Product cart has been removed!');\n //->withSuccessRemoveCartMessage('Product cart has been removed!');\n }", "function delete($d) {\r\n\t\t\r\n\t\t$db = new DB;\r\n\t\t$cart = $_SESSION[\"cart\"];\r\n\t\t\r\n\t\t$temp \t\t= array();\r\n\t\t$product_id = $d[\"product_id\"];\r\n\t\tif (!$product_id) {\r\n\t\t\treturn False;\r\n\t\t}\r\n\t\t$j = 0;\r\n\t\tfor ($i=0;$i<sizeof($cart);$i++) {\r\n\t\t\tif ($cart[$i][\"product_id\"] != $product_id) {\r\n\t\t\t\t$temp[$j++] = $cart[$i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$cart = $temp;\r\n\t\t$_SESSION[\"cart\"] = $cart;\r\n\t\treturn True;\r\n\t}", "function delItem($product_id)\r\n\t{\r\n\t\t$product_id = (int)$product_id;\r\n\t\tunset($_SESSION['Product'][$product_id]);\r\n\t\tunset($_SESSION['ProductVar'][$product_id]);\r\n\t\tunset($_SESSION['BasketSumm']);\r\n\t\tunset($_SESSION['ShipperId']);\r\n\t\tunset($_SESSION['GewichtSumm']);\r\n\t\tunset($_SESSION['PaymentId']);\r\n\t\theader(\"Location:\" . $_SERVER['HTTP_REFERER']);\r\n\t\texit;\r\n\t}", "public function removeCart(Request $request)\n {\n $cart = new Cart($request);\n $item = Product::find($request->get('product_id'));\n if(!empty($item)) {\n $data = $cart->deleteItem($item,1,$request);\n return response()->json([\"message\" => __(\"Product remove from cart\"),\"data\" => $data]);\n }\n return response()->setStatusCode(404)->json([\"message\" => \"Product not found\"]);\n\n }", "public function delete_product()\n {\n\t $product_id = (int)$this->uri->segment(4);\n\t //dump($product_id);\n\t \n\t $query = $this->Product_model->delete_product($product_id);\n\t if($query){\n\t\t \n\t\t redirect('admin/Dashboard/product');\n\t\t \n\t } else {\n\t\t\t \n\t\t echo 'error';\n\t\t\t \n\t }\t \n\t \n }", "public function destroy(product $product)\n {\n //\n }", "public function destroy(product $product)\n {\n //\n }", "function deleteProduct()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\t\n\t\t$sql='delete from products_table where product_id ='.$id;\n\t\t\n\t\t$obj=new Bin_Query();\n\t\t\n\t\tif($obj->updateQuery($sql))\n\t\t{\t\n\t\t\treturn '<div class=\"success_msgbox\">Product Deleted Successfully</div>';\t\n\t\t}\t\n\t}", "public function deleteProduct($id)\n {\n $this->isAdmin();\n\n $pattern = 'adminProduct';\n $this->isReferer($pattern);\n\n $messageModel = new ProductModel();\n\n if ($messageModel->deleteEntityById($id)) {\n\n $commentModel = new CommentModel();\n\n $commentModel->deleteComments($id);\n\n FileCache::deleteCache(CACHE_DIRECTORY);\n\n if (file_exists(SITE_DIR . \"/webroot/uploads/{$id}.jpg\")) {\n\n unlink(SITE_DIR . \"/webroot/uploads/{$id}.jpg\");\n\n }\n\n Session::set('admin-success', 'Товар удален');\n\n header(\"Location: $pattern\");\n die();\n\n } else {\n\n Session::set('admin-warning', 'Произошла ошибка');\n\n header(\"Location: $pattern\");\n die();\n }\n }", "public function deleteCart($id) {\n // Find the product id and delete it from DB.\n $cart = Cart::findOrFail($id);\n\n if (Auth::user()->id == 2) {\n // If user is a test user (id = 2),display message saying you cant delete if your a test user\n //ipansuryadiflash()->error('Error', 'Cannot delete cart because you are signed in as a test user.');\n } else {\n $cart->delete();\n }\n\n // Then redirect back.\n return redirect()->back();\n }", "public function deleteCart() {\n if (Request::ajax()) {\n //return \"ajax\";\n $product_id = Input::get('id');\n Cart::remove($product_id);\n return true;\n } else {\n \n }\n }", "public function deleteOne(Cart $cartObj)\n {\n $query = $this->pdo->prepare(\"\n DELETE FROM orders_products\n WHERE product_id=:product_id AND order_id=:order_id;\");\n $query->execute(array('product_id'=>$cartObj->getProductId(),'order_id'=>$cartObj->getOrderId()));\n unset($query);\n }", "public function testShoppingCartCanBeDeleted()\n {\n $id1 = new UUID();\n $cart1 = new ShoppingCart($id1);\n $this->gateway->insert($id1, $cart1);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n $this->assertEquals(1, count($result));\n\n // Delete Cart from Cart Database\n $this->gateway->delete($id1);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n $this->assertEquals(0, count($result));\n }", "public static function delete(Product $product)\n {\n\t$sth = self::getPdo()->prepare(\"DELETE FROM product WHERE id = :id\");\n\n\t$sth->execute(\n\t array(\n\t\t':id' => $product->id,\n\t )\n\t);\n\n\treturn true;\n }", "public function remove(Request $request): void\n {\n \\Cart::remove($request->get('product_id'));\n }", "public function deletecartproduct($productid,$userid) { \n \n\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t$connection = $resource->getConnection();\n\t\t \n\t\t\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1\";\n\t\t$result_result = $connection->fetchAll($quote_sql);\n\t\t//print_r($result_result); \n\t\tif(!empty($result_result))\n\t\t{\n\t\t \n\t\t\t// $quote->save();\n\t\t\t$quoteId=$result_result[0]['entity_id'];\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t $quote_sql2 = \"Select * FROM quote_item where quote_id=$quoteId and product_id=$productid\";\n\t\t $result_result2 = $connection->fetchAll($quote_sql2);\n\t\t\t\n\t\t\tif(!empty($result_result2))\n\t\t\t\n\t\t\t{\n\t\t\t\t$checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId);\n\t\t\t \n\t\t\t\t$quote_item_id=$result_result2[0]['item_id'];\n\t\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();//instance of object manager\n\t\t\t\t$itemModel = $objectManager->create('Magento\\Quote\\Model\\Quote\\Item');//Quote item mode\n\t\t\t\t$quoteItem=$itemModel->load($quote_item_id);//load particular item which you want to delete by his item id\n\t\t\t\t$quoteItem->delete();//deletes the item\n\t\t\t\t$this->cart->removeItem($quote_item_id);\n\t\t $this->cart->save();\n\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\")); \n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t}\n \n\t\t return $result; \n\t }", "public function actionCartDelete($id) {\n $model=$this->loadModelCart($id);\n\t\t$this->loadModelCart($id)->delete();\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('event/view', 'id'=>$model->event_id));\n\t\t//$(\"#cartContent\").load(' echo Yii::app()->getRequest()->getUrl(); #cartContent')\n\t\t \n }", "function delete_cart_item($row_id = FALSE) \n\t\t{\n\t\t\t$this->flexi_cart->delete_items($row_id);\n\t\t\t\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\n\t\t\tredirect('cart');\t\t\n\t\t}", "public function delete_cart_post(){\n $rowid = $this->input->post('row_id');\n $r = $this->cart->remove($rowid);\n $result = array();\n if ($r) {\n\n $result['result'] = '1';\n $result['data'] = $this->cart->contents();\n $result['totals_rows'] = $this->cart->total_items();\n $result['pagination'] = false;\n }\n else\n {\n $result['result'] = '2';\n $result['message'] = 'Error al agregar al carrito';\n }\n\n $this->response($result,201);\n }", "public function delete($id)\n {\n \n \n \n $result = $this->database->product_delete($id);\n\n return $result;\n }", "public function removeCart($id) {\n Cart::destroy($id);\n return redirect('cart');\n }", "public function destroy(Request $request)\n {\n $cartDetail = CartDetail::find($request->cart_detail_id);\n if ($cartDetail->cart_id == auth()->user()->cart->id) \n $cartDetail->delete();\n\n\n /* if ($cartDetail) {\n\n $op = $cartDetail->product->quantity + $cartDetail->quantity;\n\n \n\n \n\n $cartDetail->where('quantity','>','0')\n ->update(['quantity'=>$op]);\n }*/\n \n $notification = 'El producto se ha eliminado del carrito de compras correctamente.';\n return back()->with(compact('notification'));\n \n \n }", "public function deleteProduct( $id ) {\n\t\treturn $this->requester->request('DELETE', $this->url . '/' . $id);\n\t}", "public function destroy($id)\n {\n Cart::Remove($id);\n toastr()->success('Product has been Deleted From cart !');\n session()->flash('msg','product deleted now');\n return redirect()->back();\n }", "function delete_prodInv($prodID)\n {\n $sql = \"delete from product where ProdID=\" . $prodID;\n $query = $this->db->query($sql);\n }", "public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function delete_product($id)\n\t{\n\t\t\n\t\t$delete=$this->db->query(\"UPDATE `products` SET `pr_deleted`='1' WHERE `pr_id`='\".$id.\"'\");\n\t\tif($delete)\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}", "public function del($product_id){\n\t\tunset($_SESSION['panier'][$product_id]);\n\t}", "function deleteProduct(ProductEntity $product)\n {\n $sql = \"DELETE FROM \" . DB_NAME . \".`products` WHERE id=\" . $product->getIdProduct();\n\n try {\n $result = $this->connexion->prepare($sql);\n $var = $result->execute();\n //var_dump($sql); exit();\n if ($var) {\n return TRUE;\n } else {\n return FALSE;\n }\n } catch (PDOException $th) {\n return NULL;\n }\n }", "function deleteCartItem()\n {\n $item_id = $_POST['movie_id'];\n\n // User is not logged in\n if (!LoggedIn::user()) {\n\n $storeItem = 1;\n $movieItem = 0;\n $sessionType = \"\";\n\n $category_id = $_POST['category_id'];\n\n // if cart or store\n\n if ($category_id == $movieItem) {\n\n $sessionType = 'cart';\n\n } else if ($category_id == $storeItem) {\n\n $sessionType = 'store_items';\n }\n\n\n // CART\n foreach ($_SESSION[$sessionType] as $key => $value) {\n foreach ($value as $movie => $id) {\n if ($id == $item_id) {\n // Is match then remove element at position $key eg 0, 1, 2 ,3 in the array\n unset($_SESSION[$sessionType][$key]);\n }\n }\n }\n\n\n // STORE\n\n\n } else {\n\n // IF USER IS LOGGED IN USE THIS (TODO::LATER)\n Cart_item::where('movie_id', '=', $item_id)->delete();\n }\n }", "public function removeItemFromOrder($productId) {\n $product = Doctrine_Query::create()\n ->delete('Orderdetail od')\n ->where('od.Product = ?', $productId)\n ->andWhere('od.Order = ?', $this->getOrderId())\n ->execute();\n }" ]
[ "0.7960117", "0.772794", "0.771067", "0.7682363", "0.7673694", "0.7645469", "0.75880367", "0.7546866", "0.7544915", "0.7503153", "0.74693835", "0.74689454", "0.746671", "0.74597186", "0.74350214", "0.7421636", "0.7408494", "0.73823726", "0.7378197", "0.7328592", "0.7292169", "0.72911525", "0.7258322", "0.7231787", "0.7211656", "0.71672106", "0.7135013", "0.71284336", "0.7118745", "0.7074712", "0.7068089", "0.7041407", "0.70334405", "0.7032461", "0.70321584", "0.7016378", "0.7012837", "0.7004196", "0.697967", "0.6957786", "0.69514394", "0.6943919", "0.69176877", "0.6914534", "0.69111526", "0.6904886", "0.6904532", "0.6864238", "0.6858588", "0.6858133", "0.68472886", "0.68472785", "0.6844842", "0.68413234", "0.68296635", "0.68296635", "0.68175626", "0.6817077", "0.6800925", "0.6800576", "0.6795667", "0.6783427", "0.67829996", "0.6782999", "0.677603", "0.6752832", "0.6747229", "0.6747229", "0.6747229", "0.672126", "0.67195123", "0.6712146", "0.670843", "0.67027676", "0.66978014", "0.66978014", "0.6695202", "0.66931546", "0.66927284", "0.66839546", "0.66823006", "0.6679118", "0.66739374", "0.6672709", "0.66592324", "0.66571313", "0.66454417", "0.6637018", "0.66287315", "0.66252315", "0.6619884", "0.66168565", "0.66124517", "0.66057366", "0.6605023", "0.6603861", "0.65986156", "0.65984625", "0.6596767", "0.65872896" ]
0.77758974
1
////////////////////////////////////////////////////////////////////// Get product name
public static function getProductName($product_id) { $name = fn_get_product_name($product_id, $lang_code = CART_LANGUAGE, $as_array = false); return $name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductName()\n {\n return $this->product_name;\n }", "public function getProductName()\n {\n return $this->product_name;\n }", "public function getProduct_name () {\n\t$preValue = $this->preGetValue(\"product_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_name;\n\treturn $data;\n}", "public function getName_product()\n {\n return $this->name_product;\n }", "public function getProductName() {\n //return the value product name\n return $this->ProductName;\n }", "public function get_productName(): string\n {\n // $res is a string;\n // $dev is a YDevice;\n if ($this->_cacheExpiration == 0) {\n $dev = $this->_getDev();\n if (!($dev == null)) {\n return $dev->getProductName();\n }\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::PRODUCTNAME_INVALID;\n }\n }\n $res = $this->_productName;\n return $res;\n }", "public function getProductName()\n {\n if (!isset($this->name))\n {\n if (!$this->name = $this->getHelper()->getName($this->getSlug()))\n {\n $this->name = $this->getHelper()->getNameFromPath($this->getPathname());\n }\n }\n\n return $this->name;\n }", "public function getProductName(){\n return $this->product_name;\n }", "public function getProdName()\n {\n return $this->prod_name;\n }", "public static function get_name() {\n $type = static::get_type();\n return util::string(\"product:{$type}\");\n }", "protected function getProductName(): ?string\n\t{\n\t\tstatic $cache = [];\n\n\t\t$productId = $this->getProductId();\n\t\tif (!$productId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!array_key_exists($productId, $cache))\n\t\t{\n\t\t\tLoader::includeModule('iblock');\n\n\t\t\t$row = ElementTable::getRow([\n\t\t\t\t'select' => [\n\t\t\t\t\t'NAME',\n\t\t\t\t],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=ID' => $productId,\n\t\t\t\t],\n\t\t\t]);\n\t\t\t$cache[$productId] = $row ? (string)$row['NAME'] : null;\n\t\t}\n\n\t\treturn $cache[$productId];\n\t}", "public function getDocumentProductName()\n {\n return (string) $this->document_product_name;\n }", "function tep_get_products_name($product_id, $language = '') {\n global $languages_id;\n\n if (empty($language)) $language = $languages_id;\n\n $product_query = tep_db_query(\"select products_name from \" . TABLE_PRODUCTS_DESCRIPTION . \" where products_id = '\" . (int)$product_id . \"' and language_id = '\" . (int)$language . \"'\");\n $product = tep_db_fetch_array($product_query);\n\n return $product['products_name'];\n }", "public function getProductName(): ?string\n {\n return $this->productName;\n }", "public function getProductName(): ?string\n {\n return $this->productName;\n }", "public function getProductName(): ?string\n {\n return $this->productName;\n }", "public function getName() : string\n {\n return $this->get('name', 'products');\n }", "function get_product_name($pid){\n\t\tglobal $connection;\n\t\t\n\t\t\t$query = \"SELECT name FROM products WHERE id=\" .$pid;\n\t\t\t$result = mysql_query($query, $connection);\n\t\t\tconfirm_query($result);\n\t\t\t$row = mysql_fetch_array($result);\n\t\t\n\t\treturn $row['name'];\n\t}", "function GetProductName ( $whichProduct )\n{\n\n\tmysql_select_db ( 'products' );\n\t$query = 'SELECT * FROM products where ID like '.$whichProduct;\n\n\t$result = mysql_query($query );\n\n\tif ( $result )\n\t{\n\t\t$num_results = mysql_num_rows ( $result );\n\t\tif ( $num_results == 1 )\n\t\t{\n\t\t\t$row = mysql_fetch_object ( $result );\n\t\t\t$productName = $row->name;\n\t\t}\n\t\telse\n\t\t\t$productName = 'General';\n\t}\n\n\treturn $productName;\n}", "private function getProductTypeName() {\n $result = WooCommerceSettings::getProductTypeOptionsForSelect()[$this->wooData->getProductType()];\n return is_array($result) ? $result['name'] : $result;\n }", "public function product_name($name,$category)\n {\n $pro_name = $this->Dbmodel->get_product_name($name,$category); \n return $pro_name;\n }", "public function getProdName(){\n\t\treturn array_keys($this->_products);\n\t}", "function carton_get_formatted_product_name( $product ) {\n\tif ( ! $product || ! is_object( $product ) )\n\t\treturn;\n\n\tif ( $product->get_sku() )\n\t\t$identifier = $product->get_sku();\n\telseif ( $product->is_type( 'variation' ) )\n\t\t$identifier = '#' . $product->variation_id;\n\telse\n\t\t$identifier = '#' . $product->id;\n\n\tif ( $product->is_type( 'variation' ) ) {\n\t\t$attributes = $product->get_variation_attributes();\n\t\t$extra_data = ' &ndash; ' . implode( ', ', $attributes ) . ' &ndash; ' . carton_price( $product->get_price() );\n\t} else {\n\t\t$extra_data = '';\n\t}\n\n\treturn sprintf( __( '%s &ndash; %s%s', 'carton' ), $identifier, $product->get_title(), $extra_data );\n}", "public function fullname()\n\t{\n\t\treturn $this->product->name .' - '. $this->name();\n\t}", "public static function productName(string $project, string $location, string $catalog, string $branch, string $product): string\n {\n return self::getPathTemplate('product')->render([\n 'project' => $project,\n 'location' => $location,\n 'catalog' => $catalog,\n 'branch' => $branch,\n 'product' => $product,\n ]);\n }", "public function getProdTitle()\n {\n return $this->prod_title;\n }", "function get_product_name($pid){\n\t$products = \"scart_products\"; // products table\n\t$serial = \"bookid\"; // products key\n\t$name = \"book_name\"; // products name\n\t$result=mysql_query(\"select $name from $products where $serial=$pid\")\n or die (\"Query $products and pid - $pid - failed error message: \\\"\" . mysql_error () . '\"');\n\t$row=mysql_fetch_array($result);\n\treturn $row[$name];\n}", "public function getProductName($id=''){\r\n if($id != ''){\r\n $res = $this->CI->DatabaseModel->access_database('ts_products','select','',array('prod_id'=>$id));\r\n if(!empty($res)) {\r\n $prodd = $res[0]['prod_urlname'] != '' ? $res[0]['prod_urlname'] : $res[0]['prod_name'] ;\r\n $p = strtolower($prodd);\r\n $p = str_replace(' ','-',$p);\r\n $p = preg_replace('!-+!', '-', $p);\r\n return $p.'/';\r\n }\r\n else {\r\n return '/';\r\n }\r\n }\r\n else {\r\n return '/';\r\n }\r\n die();\r\n\t}", "public function getFullname(): string\n {\n return $this->product->lang->title . ' ' . $this->lang->title;\n }", "public function get_name() : array {\n\t\t$name = $this->dom->find( 'h1.product-name' );\n\t\tif ( ! $name ) {\n\t\t\treturn [ 'product_name' => '' ];\n\t\t}\n\n\t\treturn [ 'product_name' => sanitize_text_field( $name[0]->text() ) ];\n\t}", "function getProductName($ms3Oid) {\n\t\t$this->dbgstart();\n\t\t$sql = \"SELECT Name FROM Product WHERE AsimOid = '$ms3Oid'\";\n\t\t$result = $this->db->sql_query($sql);\n\t\tif ($result) {\n\t\t\t$row = $this->db->sql_fetch_row($result);\n\t\t\t$this->dbgend();\n\t\t\treturn $row[0];\n\t\t}\n\t\t$this->dbgend();\n\t\treturn false;\n\t}", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getProductNameList()\n {\n $productName = [];\n // get the max of product for displaying\n $number = (int) $this->getRequest()->getParam('number');\n if ($number <= 0) {\n // set the default value\n $number = 5;\n }\n $productList = $this->product->getCollection()->addAttributeToFilter('type_id', array('eq' => 'simple'))->setPageSize($number)->setCurPage(1)->load()->getData();\n foreach ($productList as $product) {\n $productName[] = [\n 'name' => $this->productFactory->create()->load($product['entity_id'])->getName()\n ];\n }\n return $productName;\n }", "public function getProduct()\n\t{\n\t\treturn $this->getKeyValue('product'); \n\n\t}", "public function getProductIdentifier()\n {\n $value = $this->_config->get('dataprocessing/products/identifier');\n\n if ($value === null) {\n $value = 'sku';\n }\n\n return $value;\n }", "public function get_name() {\n\t\treturn 'single-product-images';\n\t}", "public function getNameBase()\n {\n if ($this->nameBase === false) {\n $this->setNameBase($this->product->getNameBase());\n }\n return $this->nameBase;\n }", "public function get_title() {\n return esc_html__( 'Onsale Product', 'electro-extensions' );\n }", "public function getProduct()\r\n {\r\n return $this->_params['product'];\r\n }", "public function get_title() {\n return esc_html__( 'Onsale Product', 'Alita-extensions' );\n }", "public function findNameProd($id){\n return Product::where('id',$id)->first()->name;\n }", "function get_products_id_name($product_type) {\r\n $params[0] = array(\"name\" => \":product_type\", \"value\" => &$product_type);\r\n return $this->DBObject->readCursor(\"product_actions.get_products_id_name(:product_type)\", $params);\r\n }", "public static function getSoftwareName()\n\t\t{\n\t\t\treturn 'Wordpress 3.9.1 en WooCommerce 3.0.0+';\n\t\t}", "public function getProduct() {\n return $this->_registry->registry ( 'current_product' );\n }", "public function productName(): string\n{\n return $this->get_productName();\n}", "public function getName()\n {\n return 'recipeproduct';\n }", "public function getProduct()\n {\n return $this->coreRegistry->registry('product');\n }", "public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }", "public function getProductId(): string\n {\n return $this->productId;\n }", "public function getNameproducts($id)\n {\n //? find id\n $product = Product::find($id);\n\n if (is_null($product))\n return '';\n\n return $product->product_name;\n }", "public function getProdName() {\n return $this->ProductName;\n}", "function Product_lookup_name_by_id($product_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('Product.lookup_name_by_id', array(new xmlrpcval($product_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function getShopName()\n {\n return 'oscommerce-2.3.4';\n }", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function productCategoryName() {\n\t\treturn $this->generator->randomElement( static::$categories );\n\t}", "public function getConflictingProductTypeName()\n {\n return $this->conflictingProductTypeName;\n }", "public function get_name() {\n if(get_config(constants::M_COMPONENT,'customname')){\n return get_config(constants::M_COMPONENT,'customname');\n }else {\n return get_string('pluginname', constants::M_COMPONENT);\n }\n }", "private function getManufacturer($product)\n { \n $manufacturers= $product->manufacturers;\n\n if(!$manufacturers->isEmpty())\n {\n $manufacturerName=NULL;\n\n foreach ($manufacturers as $manufacturer) {\n\n $manufacturerName .= $manufacturer->manufacturer_name. '+';\n }\n return trim($manufacturerName,'+');\n }\n else\n {\n return NULL;\n }\n }", "function get_title () {\n\t\t$this->get_post_data();\n\t\treturn apply_filters('woocommerce_product_title', $this->post->post_title, $this);\n\t}", "public function getNombreProducto()\n {\n return $this->nombreProducto;\n }", "public function getProductKey()\n {\n if (array_key_exists(\"productKey\", $this->_propDict)) {\n return $this->_propDict[\"productKey\"];\n } else {\n return null;\n }\n }", "public function getProductKey()\n {\n if (array_key_exists(\"productKey\", $this->_propDict)) {\n return $this->_propDict[\"productKey\"];\n } else {\n return null;\n }\n }", "public function getEntityName()\n {\n return CacheKeys::PRODUCT_VARCHAR;\n }", "function productNameHint()\n{\n\t$query = $_POST['query'];\n\t$productManager = new productManager();\n\treturn $productManager->getNameHint($query);\n}", "protected function getShopName()\n {\n return $this->shopName;\n }", "function get_meta_pkg_name() {\n\tglobal $g;\n\n\t/* XXX: Use pkg annotation */\n\tif (is_pkg_installed(g_get('product_name'))) {\n\t\treturn g_get('product_name');\n\t}\n\tforeach (g_get('alternativemetaports') as $suffix) {\n\t\tif (is_pkg_installed(g_get('product_name') . '-' . $suffix)) {\n\t\t\treturn g_get('product_name') . '-' . $suffix;\n\t\t}\n\t}\n\treturn false;\n}", "public function get_name()\n\t\t{\n\t\t\treturn \"Item is present/not present in the shopping cart\";\n\t\t}", "public function getTitle()\n {\n return $this->getProduct()->getTitle();\n }", "public function get_name() : string\n {\n return $this->additional['name'] ?? '';\n }", "public function getProductName(): ?string {\n $val = $this->getBackingStore()->get('productName');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'productName'\");\n }", "protected function formatProduct(ProductEntity $entity)\n {\n return $this->translator->__f('%name%', [\n '%name%' => $entity->getName()\n ]);\n }", "public function getBrand_name () {\n\t$preValue = $this->preGetValue(\"brand_name\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->brand_name;\n\treturn $data;\n}", "function getProductId($product_name)\n\t{\n\t\tglobal $log;\n $log->info(\"in getProductId \".$product_name);\n\t\tglobal $adb;\n\t\tif($product_name != '')\n\t\t{\n\t\t\t$sql = \"select productid from ec_products where productname='\".$product_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$productid = $adb->query_result($result,0,\"productid\");\n\t\t}\n\t\treturn $productid;\n\t}", "public function getProduct()\n {\n return Mage::registry('current_product');\n }", "function getProductNameFromId($dbc, $id)\n{\n\t$id = cleanString($dbc, $id);\n\t\n\t$q = \"SELECT NAME FROM PRODUCTS WHERE ID = '$id'\";\n\t$r = mysqli_query($dbc, $q);\n\t\n\tif(mysqli_num_rows($r) == 1)\n\t{\n\t\tlist($productName) = mysqli_fetch_array($r);\n\t\treturn $productName;\n\t}else{\n\t\treturn false;\n\t}\n}", "protected function getProduct() {\n return $this->registry->registry('product');\n }", "public function getTabTitle()\n {\n return Mage::helper('chirpify_seller')->__('Product');\n }", "function prodname()\r\n {\r\n //left join oc_product as op on opd.product_id=op.product_id \");\r\n\r\n //return $query->rows; \r\n \r\n $query = $this->db->query(\"SELECT product_id,model,sku FROM `oc_product` WHERE `status`='1'\");\r\n \r\n return $query->rows;\r\n }", "public function getName()\n {\n if (array_key_exists('name', $this->data)) {\n return $this->data['name'];\n }\n\n if ($this->getType() == Reader\\Reader::TYPE_YML) {\n $name = $this->xpath->evaluate('string(/yml_catalog/shop/name)');\n }\n\n if (! $name) {\n $name = null;\n }\n\n $this->data['name'] = $name;\n return $this->data['name'];\n }", "public function getProduct(){\r\n return Mage::registry('current_product');\r\n }", "public function getSoftwareName()\n {\n return $this->getParam(self::SOFTWARE_PARAM_NAME);\n }", "public function get_name()\n {\n // TODO: Implement get_name() method.\n }", "public function getCartName()\n {\n return $this->name;\n }", "function woocommerce_template_loop_product_title() {\n\t\techo '<h3 class=\"products-title\"><a href=' . esc_url(get_the_permalink()) . '>' . esc_html(get_the_title()) . '</a></h3>';\n\t}", "function getManufacturerTitle() {\n \tif ($this->getManufacturerUid()) {\n \t\treturn $this->conn_db->getManufacturerTitle($this->getManufacturerUid());\n \t}\n \t\n }", "public function get_name();", "public function get_name();", "public function get_name();", "public function getProductMetadata()\n {\n return sprintf(\"%s %s %s\",\n $this->productMetadata->getName(),\n $this->productMetadata->getEdition(),\n $this->productMetadata->getVersion());\n }", "public function get_product_names()\n\t{\n\t\t$ret = array();\n\t\t$sum = 0;\n\t\tforeach($this->connections_from(array(\"type\" => \"RELTYPE_ROW\")) as $c)\n\t\t{\n\t\t\t$row = $c->to();\n\t\t\t$ret[] = $row->prod_name();\n\t\t}\n\t\treturn $ret;\n\t}", "function getProdId($product){\r\n require '../../model/dbconnect.php';\r\n $prod = $db->quote($product);\r\n $rows_prod = $db->query(\"SELECT id FROM product WHERE name = $prod\");\r\n if ($rows_prod) {\r\n foreach($rows_prod as $row)\r\n return $row['id'];\r\n }\r\n }", "public function getName()\n {\n return $this->getNodeText('/p:package/p:name');\n }", "public function getProduct()\r\n {\r\n return $this->product;\r\n }", "public function getName()\n {\n return $this->quoteItem->getName();\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }", "public function getProduct()\n {\n return $this->product;\n }" ]
[ "0.877419", "0.86499125", "0.86490726", "0.8393106", "0.838086", "0.83671474", "0.83651763", "0.8189571", "0.8139999", "0.80257905", "0.7909784", "0.7836376", "0.7650471", "0.7636633", "0.7636633", "0.7636633", "0.76065016", "0.7503171", "0.7463885", "0.73901045", "0.72995895", "0.72800857", "0.7237802", "0.7180755", "0.7082827", "0.70567024", "0.69921184", "0.69790447", "0.6954785", "0.6926146", "0.6917235", "0.6911355", "0.68223566", "0.68039465", "0.6792249", "0.6744231", "0.67314756", "0.6712568", "0.6705092", "0.6703321", "0.6681297", "0.66772866", "0.66731", "0.6639621", "0.66380346", "0.6635883", "0.6632338", "0.66293734", "0.6578738", "0.65707004", "0.6568515", "0.65643805", "0.655728", "0.6544206", "0.6534821", "0.6533463", "0.6533329", "0.6504438", "0.6495859", "0.6494905", "0.6484204", "0.6484204", "0.64771897", "0.6442211", "0.64186764", "0.6407468", "0.64006615", "0.6399681", "0.6398416", "0.6392604", "0.6389138", "0.6383667", "0.63747007", "0.6373385", "0.636148", "0.63338196", "0.6333684", "0.6331016", "0.6325235", "0.6307559", "0.630008", "0.6295679", "0.629453", "0.6273992", "0.62651217", "0.62605387", "0.62605387", "0.62605387", "0.6256867", "0.625587", "0.62532336", "0.62380207", "0.6233994", "0.6231844", "0.6227758", "0.6227758", "0.6227758", "0.6227758", "0.6227758", "0.6227758" ]
0.7592094
17
////////////////////////////////////////////////////////////////////// Get product price
public static function getProductPrice($product_id, $amount = 1) { $auth = fn_fill_auth(); $price = fn_get_product_price($product_id, $amount, $auth); return $price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductPrice() {\n //return the value product price\n return $this->ProductPrice;\n }", "public function getPrice() : float\n {\n return $this->get('price', 'products');\n }", "public function getProductPrice()\n {\n return $this->getPrice(!sfConfig::get('app_tax_display_prices_with_tax', false));\n }", "public function get_price() {\n\n\t\t$price = null;\n\t\tif ( $this->is_on_sale() ) {\n\t\t\tif ( strstr($this->sale_price,'%') ) {\n\t\t\t\t$price = round($this->regular_price * ( (100 - str_replace('%','',$this->sale_price) ) / 100 ), 4);\n\t\t\t} else if ( $this->sale_price ) {\n\t\t\t\t$price = $this->sale_price;\n\t\t\t}\n\t\t} else {\n\t\t\t$price = apply_filters('jigoshop_product_get_regular_price', $this->regular_price, $this->variation_id);\n\t\t}\n\t\treturn apply_filters( 'jigoshop_product_get_price', $price, $this->variation_id );\n\n\t}", "public function getPriceProduct()\n {\n return $this->priceProduct;\n }", "public function getProductPrice(){\n return $this->product_price;\n }", "public function getPrice()\n {\n return $this->get(self::_PRICE);\n }", "public function getPrice()\n\t{\n\t\treturn $this->price;\n\t}", "public function the_item_price($product_id){\n\t\treturn get_post_meta($product_id, \"_lms_price\", true);\n\t}", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getPrice() {\n\t\treturn($this->price);\n\t}", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->object->Price;\n }", "public function getPrice()\r\n {\r\n return $this->price;\r\n }", "public function getPrice() {\n return $this->item->getPrice();\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n\n return $this->price;\n }", "public function getPrice()\n {\n return $this->Price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getProductPrice()\n {\n\n if(!sfConfig::get('app_tax_display_prices_with_tax', false))\n return $this->getPrice();\n\n return TaxRatePeer::calculateGrossPrice($this->getPrice(),$this->getTaxTypeId());\n }", "public function getPrice($product)\n {\n return $this->getFinalPrice(1, $product);\n }", "public function getPrice() {\n return $this->_price;\n }", "public function getProductPrice()\n {\n }", "public function getPurchaseProdPrice() {\n return $this->purchaseProdPrice;\n }", "public function getPrice()\n {\n if ($this->_calculatePrice || !$this->getData('price')) {\n return $this->getPriceModel()->getPrice($this);\n } else {\n return $this->getData('price');\n }\n }", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "public function getPrice() {\n $price = 420;\n return $price;\n }", "function get_product_price($product_id)\n {\n $price = $this->get_type_name_by_id('product', $product_id, 'sale_price');\n $discount = $this->get_type_name_by_id('product', $product_id, 'discount');\n $discount_type = $this->get_type_name_by_id('product', $product_id, 'discount_type');\n if ($discount_type == 'amount') {\n $number = ($price - $discount);\n }\n if ($discount_type == 'percent') {\n $number = ($price - ($discount * $price / 100));\n }\n return number_format((float) $number, 2, '.', '');\n }", "function ppom_get_product_price( $product ) {\n\t\n\t$product_price = $product->get_price();\n\t\n\tif( has_filter('woocs_exchange_value') ) {\n\t\tglobal $WOOCS;\n\t\t\n\t\tif($WOOCS->current_currency != $WOOCS->default_currency ) {\n\t\t\tif($WOOCS->is_multiple_allowed) {\n\t\t\t\t$product_price = apply_filters('woocs_raw_woocommerce_price', $product_price);\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$product_price = apply_filters('woocs_exchange_value', $product_price);\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn apply_filters('ppom_product_price', $product_price, $product);\n}", "public function getPrice()\n\t{\n\t\treturn $this->isDiscounted() ? 0.0 : floatval($this->price);\n\t}", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getProductPrice()\n {\n $currentProduct = $this->_registry->registry('current_product');\n \n //qual preco retornar? o base ou o special???\n //o ideal seria usar constante nativa, mas nao encontrei.\n if ('configurable' == $currentProduct->getTypeId()) {\n return $currentProduct->getPriceInfo()->getPrice('regular_price')->getMinRegularAmount()->getValue();\n }\n\n if ('bundle' == $currentProduct->getTypeId()) {\n return $currentProduct->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();\n }\n\n if ('grouped' == $currentProduct->getTypeId()) {\n $regularPrice = 0;\n $usedProds = $currentProduct->getTypeInstance(true)->getAssociatedProducts($currentProduct); \n foreach ($usedProds as $child) {\n if ($child->getId() != $currentProduct->getId()) {\n $regularPrice += $child->getPrice();\n }\n }\n return $regularPrice;\n }\n\n return $currentProduct->getFinalPrice();\n }", "function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n if (array_key_exists(\"price\", $this->_propDict)) {\n return $this->_propDict[\"price\"];\n } else {\n return null;\n }\n }", "public function getPrice()\n {\n return $this->amount;\n }", "public function getPrice()\n {\n $price_is_tax_inc = \\App\\Configuration::get('PRICES_ENTERED_WITH_TAX');\n\n $price = $price_is_tax_inc ? \n $this->price_tax_inc :\n $this->price ;\n\n $priceObject = new \\App\\Price( $price, $price_is_tax_inc, \\App\\Context::getContext()->currency, \\App\\Context::getContext()->currency->conversion_rate);\n\n return $priceObject;\n }", "public function getPrice($productId)\n {\n return $this->_rootElement->find(sprintf($this->priceBox, $productId), Locator::SELECTOR_CSS)->getText();\n }", "public function getProductPrice()\n {\n $currentProduct = Mage::registry('current_product');\n\n //seria melhor usar uma constante nativa, mas nao encontrei.\n if ('configurable' == $currentProduct->getTypeId()) {\n return $currentProduct->getFinalPrice();\n }\n\n if ('bundle' == $currentProduct->getTypeId()) {\n $_priceModel = $currentProduct->getPriceModel();\n list($_minimalPriceTax, $_maximalPriceTax) = $_priceModel->getTotalPrices($currentProduct, null, null, false);\n\n return $_minimalPriceTax;\n }\n\n if ('grouped' == $currentProduct->getTypeId()) {\n $regularPrice = 0;\n $usedProds = $currentProduct->getTypeInstance(true)->getAssociatedProducts($currentProduct); \n foreach ($usedProds as $child) {\n if ($child->getId() != $currentProduct->getId()) {\n $regularPrice += $child->getPrice();\n }\n }\n return $regularPrice;\n }\n\n return $currentProduct->getFinalPrice();\n }", "public function getPrice():float\n {\n return $this->price;\n }", "public function getProductPrice()\n {\n $currentProduct = $this->_registry->registry('current_product');\n\n //seria melhor usar uma constante nativa, mas nao encontrei.\n if ('configurable' == $currentProduct->getTypeId()) {\n return $currentProduct->getPriceInfo()->getPrice('regular_price')->getMinRegularAmount()->getValue();\n }\n\n if ('bundle' == $currentProduct->getTypeId()) {\n return $currentProduct->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()->getValue();\n }\n\n if ('grouped' == $currentProduct->getTypeId()) {\n $regularPrice = 0;\n $usedProds = $currentProduct->getTypeInstance(true)->getAssociatedProducts($currentProduct); \n foreach ($usedProds as $child) {\n if ($child->getId() != $currentProduct->getId()) {\n $regularPrice += $child->getPrice();\n }\n }\n return $regularPrice;\n }\n\n return $currentProduct->getFinalPrice();\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public static function getSpecificPrice(&$product)\n {\n if (!isset(self::$__specificPrice[(int)$product['id_product']])) {\n self::$__specificPrice[(int)$product['id_product']]\n = SpecificPrice::getSpecificPrice(\n (int)$product['id_product'],\n 0,\n (int)BeezupProduct::getCurrency()->id,\n (int)Configuration::get('BEEZUP_COUNTRY'),\n 1,\n 1\n );\n }\n\n return self::$__specificPrice[(int)$product['id_product']];\n }", "public function getPrice(): int\n {\n return $this->getProduct()->getPriceInfo()->getPrice('final_price')->getValue();\n }", "public function getTicketPrice() {\n return $this->get(self::TICKETPRICE);\n }", "public function getProductPrice() {\n\t\t$this->db->select('price');\n\t\t$this->db->from('sujal_products');\n\t\t$this->db->where('id', $this->input->post('product'));\n\t\t$this->db->where('deleted', 0);\n\t\t$ProductPrice = $this->db->get()->row()->price;\n\t\techo json_encode($ProductPrice);\n\t}", "public function on_get_price( $price, $product ) {\n\n\t\t\tif ( isset( $product->cart_item_key ) ) {\n\t\t\t\t//We know this is for a product in the cart.\n\n\t\t\t\t$cart_item = WC()->cart->get_cart_item( $product->cart_item_key );\n\n\t\t\t\tif ( $cart_item && isset( $cart_item['es_adjusted_product_price'] ) ) {\n\t\t\t\t\t//found our cart item, and adjusted quantities.\n\n\t\t\t\t\t$price = $cart_item['es_adjusted_product_price'];\n\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t\treturn $price;\n\n\t\t}", "public function getProdPriceId()\n {\n return $this->prod_price_id;\n }", "public function getPrice()\n {\n return 0.2;\n }", "function tep_get_productPrice($product_id){\n\tif ($product_id){\n\t\tglobal $languages_id,$pf;\n\t\t$product_query = tep_db_query(\"select p.products_id,p.products_price,products_discount from \" . TABLE_PRODUCTS . \" p where p.products_id=\".(int)$product_id );\n\t\tif (tep_db_num_rows($product_query)) {\n\t\t\t$product = tep_db_fetch_array($product_query);\n\t\t\t$product_price = $product['products_price'];\n\t\t\t$rata = $product['products_discount'] > 0 ? number_format((1/(1-$product['products_discount']/100)),2,'.','') : PRODUCTS_RATE;//( $product['products_discount'] > 0 )? number_format( (1 - ($product['products_discount'] / 100)) , 2) : PRODUCTS_RATE;\n\t\t\t//$retail_price = $product['products_price'] * PRODUCTS_RATE;// * $rata;//\n\t\t\t//echo $rata;\n\t\t\t$pf -> loadProduct($product['products_id'],$languages_id);\n\t\t\t$result = array();\n\t\t\t$result['rsPrice'] = $pf -> getRetailSinglePrice($rata);\n\t\t\t$result['sPrice'] = $pf -> getSinglePrice();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "public function getTicket_price()\n {\n return $this->ticket_price;\n }", "public function getOffer_price()\n {\n return $this->offer_price;\n }", "function get_product_price($field_product_id){\r\n\r\n $this->load->model('logistics_model');\r\n $result = $this->logistics_model->get_product_price($field_product_id);\r\n $value = $result->price;\r\n echo $value;\r\n }", "public function getPrice($url) \n\t{\n\t\t$this->api->parseUrl($url);\n $this->api->setParam('ProductType','10');\n\t\treturn $this->api->call(['command' => 'PE_GetProductPrice'])->response();\n\t}", "public function getPrice(){\n return $this->price;\n }", "public function getPrice()\n\t{\n\t\t$item = InvoiceItem::where('description', $this->description)\n\t\t\t->orderBy('updated_at', 'DESC')\n\t\t\t->first();\n\n\t\treturn is_null($item) ? 0 : $item->price;\n\t}", "public function getPrice(): float;", "public function getPrice(): float;", "public function getPrice($id)\n {\n return $this->api->get(\"/products/price/{$id}\");\n }", "public function getPrice()\n {\n return parent::getPrice();\n }", "public static function getProductPrice($id)\n\t{\n\t // rework params\n\t $id = (int) $id;\n\n\t\ttry {\n\t\t\t$db = new OneArchyDB(F2T_DB_HOST, F2T_DB_NAME, F2T_DB_USER, F2T_DB_PASS);\n\t\t\t$db->connect();\n\n\t\t\t$query = 'SELECT price FROM Products WHERE id = ?';\n\t\t\t$price = $db->queryOne($query, [$id]);\n\t\t}\n\t\tcatch (Exception $e) {\n $errorMessage = 'Er is een fout opgetreden bij het oproepen van een productprijs.';\n\n if ($db !== null) {\n $db->logError($errorMessage, ['exception' => $e->getMessage(), 'query' => $query, 'results' => $price, 'productId' => $id, 'site' => 'checkout']);\n }\n\n\t\t\tthrow new Exception($errorMessage);\n\t\t}\n\n\t return $price['price'];\n\t}", "public function get_retail_price_of_product($product_id)\n {\n $address = session('address');\n if ($address) {\n $pp = ProductPrice::priceTemplateFromAddress($product_id, $address);\n } else {\n\n $pp = ProductPrice::where('product_id', $product_id)->get()->first();\n }\n\n if ($pp) {\n return $pp->retail_price;\n }\n\n }", "abstract public function getPrice();", "public function getPrice(InjectableFixture $product)\n {\n $productName = $product->getName();\n\n if ($product instanceof ConfigurableProduct) {\n // Find the price for the specific configurable product that was purchased\n $configurableAttributes = $product->getConfigurableAttributes();\n $productOptions = $product->getCheckoutData()['options']['configurable_options'];\n $checkoutOption = reset($productOptions);\n $attributeKey = $checkoutOption['title'];\n $optionKey = $checkoutOption['value'];\n $attributeValue = $configurableAttributes[$attributeKey]['label']['value'];\n $optionValue = $configurableAttributes[$attributeKey][$optionKey]['option_label']['value'];\n\n $productDisplay = $productName . ' SKU: ' . $product->getVariationSku($checkoutOption);\n $productDisplay .= ' ' . $attributeValue . ' ' . $optionValue;\n } else {\n $productDisplay = $productName . ' SKU: ' . $product->getSku();\n }\n $selector = '//tr[normalize-space(td)=\"' . $productDisplay . '\"]' . $this->priceSelector;\n\n return $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->getText();\n }", "public function getPrice()\n {\n $price = [ $this->price, $this->price_tax_inc ]; // These prices are in Company Currency\n\n $priceObject = Price::create( $price, Context::getContext()->company->currency );\n\n return $priceObject;\n }", "function get_price() {\n\t\t\n\t\treturn $this->price;\n\t\t\n\t\t/*if (!$price) $price = $this->price;\n\t\t\n\t\tif (get_option('woocommerce_prices_include_tax')=='yes' && $this->is_taxable() && woocommerce_customer::is_customer_outside_base()) :\n\t\t\t\n\t\t\t$_tax = &new woocommerce_tax();\n\t\t\t\n\t\t\t$price = $price * 100;\n\t\t\t\n\t\t\t$base_rate \t\t\t= $_tax->get_shop_base_rate( $this->data['tax_class'] );\n\t\t\t$rate \t\t\t\t= $_tax->get_rate( $this->data['tax_class'] );\n\t\t\t\n\t\t\t$base_tax_amount \t= round($_tax->calc_tax( $price, $base_rate, true ));\n\t\t\t$tax_amount \t\t= round($_tax->calc_tax( ($price-$base_tax_amount), $rate, false ));\n\t\t\t\n\t\t\treturn ($price - $base_tax_amount + $tax_amount) / 100;\t\t\t\n\n\t\tendif;\n\t\t\n\t\treturn $price;*/\n\t}", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "public function getPrice()\n\t{\n\t\t$total = intval($this->var['price']);\n\t\t$d = $total/100;\n\t\t$c = $total%100;\n\t\treturn sprintf(\"%d.%02d\",$d,$c);\n\t\t//return \"$d.$c\";\n\t}", "public function getPrice() {\n }", "public function getProductPrice() {\n\t\t\t$data = request()->all();\n\t\t\t$dataArr = explode('-', $data['idSize']);\n\t\t\t$proAttr = ProductsAttribute::where(['product_id'=>$dataArr[0], 'size'=>$dataArr[1]])->first();\n\t\t\t$productData = [\n\t\t\t\t'sku' \t=> $proAttr->sku, \n\t\t\t\t'price' => $proAttr->price,\n\t\t\t\t'stock' => $proAttr->stock\n\t\t\t]; \n\t\t\treturn $productData;\n\t\t}", "public function getSalePrice()\n {\n return $this->sale_price;\n }", "public function getSalePrice()\n {\n return $this->sale_price;\n }", "public function getTotalPrice()\n {\n // use format_currency to get correct decimals and avoid rounding errors\n return $this->getQuantity() * format_currency($this->getProductPrice(),null, true);\n// return $this->getQuantity() * format_currency($this->getNetPrice(),null, true);\n }", "public function getPrice() : int\n {\n return $this->price;\n }", "public function getPriceInfo()\n {\n return $this->price_info;\n }", "public function getGoodsPrice()\n {\n return $this->goods_price;\n }", "public function getPrice()\n {\n return '£' . number_format($this->price, 2);\n }", "public function getPrice()\n {\n $price = Cache::tags([$this->exchange])->get($this->pair, function () {\n return $this->getPriceFromAPI($this->pair);\n });\n return $price;\n }", "public function getSoldPrice() {\r\n\t\treturn $this->soldPrice;\r\n\t}", "public function Price() {\n\t\t$amount = $this->Amount();\n\n\t\t//Transform price here for display in different currencies etc.\n\t\t$this->extend('updatePrice', $amount);\n\n\t\treturn $amount;\n\t}", "public function getPriceAttribute()\n {\n if (isset($this->attributes['price'])) {\n return $this->attributes['price'] / 100;\n }\n\n return null;\n }" ]
[ "0.860591", "0.83980227", "0.82713455", "0.8252125", "0.82487243", "0.82449085", "0.82076913", "0.81453395", "0.81115144", "0.8076827", "0.8034361", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79994345", "0.79828185", "0.79805076", "0.79758054", "0.7966909", "0.7964099", "0.7884482", "0.7879654", "0.7879654", "0.7856362", "0.7853205", "0.78424066", "0.78411204", "0.78045756", "0.7775339", "0.7747483", "0.7730862", "0.7725737", "0.77253795", "0.77162826", "0.7640743", "0.7640743", "0.7629621", "0.76268786", "0.7624132", "0.76043457", "0.757553", "0.7571602", "0.7549992", "0.7542411", "0.7539042", "0.75068855", "0.75068855", "0.75068855", "0.75068855", "0.75067556", "0.7461524", "0.7457523", "0.74457604", "0.74300283", "0.74213356", "0.7386805", "0.7384752", "0.7369705", "0.7361515", "0.73399675", "0.7337148", "0.7331193", "0.7303538", "0.72943467", "0.72943467", "0.727792", "0.7266869", "0.72667503", "0.72606", "0.7254316", "0.724886", "0.7239579", "0.72281444", "0.72101325", "0.7203385", "0.7169041", "0.71345204", "0.71143585", "0.71143585", "0.71080625", "0.70984024", "0.7093999", "0.7091835", "0.70805603", "0.7075581", "0.7065016", "0.7053582", "0.7048996" ]
0.0
-1
/////////////////////////////////////////////////////////////////////// Get product image
public static function getProductImage($product_id) { $products = array($product_id); $data = fn_get_image_pairs($products, 'product', 'M', true, true); foreach ($data as $img) { if (is_array($img)) { foreach ($img as $img_paths) { if (array_key_exists('detailed', $img_paths)) { return $img_paths['detailed']['http_image_path']; } } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProduct_img () {\n\t$preValue = $this->preGetValue(\"product_img\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_img;\n\treturn $data;\n}", "function tep_get_products_image($product_id) {\n\tglobal $languages_id;\n\t$product_query = tep_db_query(\"select products_image from \" . TABLE_PRODUCTS . \" where products_id = '\" . (int)$product_id . \"'\");\n\t$product = tep_db_fetch_array($product_query);\n\treturn $product['products_image'];\n}", "function getProductImage($product_id = null) {\n\t\t// import the country DB\n\t\t$productImages = array();\n\t\tApp::import(\"Model\",\"Product\");\n\t\t$this->Product = &new Product();\n\t\t$productImages = $this->Product->find('first',array('conditions'=>array('Product.id'=>$product_id),'fields'=>array('Product.id','Product.product_image')));\n\t\treturn $productImages['Product']['product_image'];\n\t}", "public function getImage($_product) {\n $sku = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/sku_field'));\n\n $manufacturerId = $_product->getData(Mage::getStoreConfig('icecat_root/icecat/manufacturer'));\n\n $connection = Mage::getSingleton('core/resource')->getConnection('core_read');\n\t\t$query = $connection->select()->from(Mage::getSingleton('core/resource')->getTableName('eav_entity_type'),'entity_type_id')->where('entity_type_code = ?', 'catalog_product')->limit(1);\n $entityTypeId = $connection->fetchOne($query); \n \n $attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')\n ->setCodeFilter(Mage::getStoreConfig('icecat_root/icecat/manufacturer'))\n ->setEntityTypeFilter($_product->getResource()->getTypeId())\n ->getFirstItem();\n \n if ($attributeInfo->getData('backend_type') == 'int' || \n ($attributeInfo->getData('frontend_input') == 'select' && $attributeInfo->getData('backend_type') == 'static' )) {\n $attribute = $attributeInfo->setEntity($_product->getResource());\n $manufacturer = $attribute->getSource()->getOptionText($manufacturerId);\n } else {\n $manufacturer = $manufacturerId;\n } \n \n $this->observer = Mage::getSingleton('icecatimport/observer');\n $url = $this->observer->getImageURL($sku, $manufacturer);\n return $url;\n }", "public static function get_one_product_image($productId)\n {\n $db = new Db();\n $sql = \"SELECT image_filename FROM image i , product_image pi WHERE i.image_id = pi.image_id AND pi.product_id= '\".$productId.\"' ORDER BY pi.image_id\";\n $res = $db->select_to_array($sql);\n reset($res);\n return $res[0]['image_filename'];\n }", "function GetImage()\n {\n //Obtient les images par défaut de chaque produit de la fiche\n $ficheProduct = new EeCommerceFicheProductProduct($this->Core);\n $ficheProduct->AddArgument(new Argument(\"EeCommerceFicheProductProduct\", \"FicheId\", EQUAL, $this->IdEntite));\n $products = $ficheProduct->GetByArg();\n \n $html = \"<div>\";\n \n foreach($products as $product)\n {\n $img = new Image($product->Product->Value->ImageDefault->Value);\n $img->Alt = $img->Title = $product->Product->Value->NameProduct->Value;\n \n $html .= \"<div class='col-md-4' >\" . $img->Show().\"</div>\"; \n }\n \n $html .= \"</div>\";\n \n return $html;\n \n }", "function goods_viewImgProduct(){\n $sql = \"select * from gd_image where get_imgid=:get_imgid order by gd_imgid ASC\";\n $args = [':get_imgid'=>$this->id];\n return $this->run($sql, $args);\n }", "public function getImage()\n {\n return $this->hasOne(ProductImage::class, ['product_id' => 'id'])->where([\n 'product_image.main' => true\n ]);\n }", "public function get_main_product_image() : array {\n\t\tpreg_match( '/mainBigPic = \"(.*?)\";/si', $this->request, $matches );\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn [ 'main_product_image' => '' ];\n\t\t}\n\n\t\treturn [ 'main_product_image' => esc_url_raw( $matches[1] ) ];\n\t}", "public function getImage()\n\t{\n\t\treturn $this->image;\n\t}", "public function getImage()\n\t{\n\t\treturn $this->image;\n\t}", "public function getImage()\n {\n return $this->get('image');\n }", "public function get_image() {\r\n return $this->image;\r\n }", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "function getImage() {\n\t\treturn $this->_image;\n\t}", "function getImage()\r\n\t\t{\r\n\t\t\treturn $this->image;\r\n\t\t\t\r\n\t\t}", "public function getImage() {\n\t\treturn $this->image;\n\t}", "public function getImage() {\n\t\treturn $this->image;\n\t}", "public function getImage() {\n\t\treturn $this->image;\n\t}", "function fe_show_product_image() {\n // wc_get_template( 'single-product/product-image.php' );\n include_once(FESTIVAL_EVENTS_PLUGIN_PATH . 'templates/single-product/product-image.php');\n }", "public function getImage()\n {\n return $this->_image;\n }", "public function getImage()\r\n {\r\n return $this->image;\r\n }", "public function getImage()\r\n {\r\n return $this->image;\r\n }", "public function getImage()\n {\n if (empty($this->image)) {\n $this->image = $this->generateImage();\n }\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->image;\n }", "function getImage()\n {\n return $this->_image;\n }", "function get_product_image_by_post_id( $post_id, $small = false ) {\n\n // Get the image source\n $src = get_post_meta($post_id, '_fullimage', true);\n\n // Get the upload directory\n $upload_dir = untrailingslashit( wp_upload_dir()['baseurl'] );\n\n // If we have no source, use the default instead\n if ($src) {\n\n // Check if file exists in our uploads folder\n $file = $_SERVER['DOCUMENT_ROOT'] . '/wp-content/uploads/product-images/'. $src;\n if(file_exists($file)){\n $output = $upload_dir . '/product-images/' . $src;\n } else {\n $output = '/wp-content/themes/randysworldwide/dist/images/randys_product_default_sm.png';\n }\n // Generate the full image source\n return $output;\n }\n\n // If we got to this part, an image has not been found.\n if ($small) {\n return '/wp-content/themes/randysworldwide/dist/images/randys_product_default_sm.png';\n } else {\n return '/wp-content/themes/randysworldwide/dist/images/randys_product_default.png';\n }\n}", "public function getProfileImage()\n {\n if ($this->configuration->useRawImage()) {\n $imageUrl = $this->configuration->getMediaPublicDirectory() . 'catalog/product' . $this->getImage();\n } else {\n $storeId = $this->getStore()->getId();\n $this->appEmulation->startEnvironmentEmulation($storeId, \\Magento\\Framework\\App\\Area::AREA_FRONTEND, true);\n $imageUrl = $this->imageBuilder->setProduct($this)\n ->setImageId('product_base_image')\n ->create()\n ->getImageUrl();\n $this->appEmulation->stopEnvironmentEmulation();\n }\n\n return $imageUrl;\n }", "function productImage($catId)\n\t{\t\t\n\t\t\n\t\t$table=\"productimages\";\n\t\t$fields=\"*\";\n\t\t$id='*';\n\t\t$key = array(\"isCategory\"=>0,\"tradeId\"=>$catId);\n\t\t$fetchUser = $this->get_record_by_ID($table,$key,$id,$fields);\n\t\tif(count($fetchUser)>0)\n\t\t{\t\t\n\t\t\treturn $fetchUser;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fetchUser[0]['image640By480']= \"images/default.gif\";\n\t\t\t$fetchUser[0]['image640by480Height']= 480;\n $fetchUser[0]['image640by480Width'] = 640;\n\t\t\t$fetchUser[0]['image400by300'] =\"images/default.gif\";;\n $fetchUser[0]['image400by300Height'] = 300;\n $fetchUser[0]['image400by300Width'] = 400;\n $fetchUser[0]['image100by80'] = \"images/default_100_75.gif\";\n $fetchUser[0]['image100by80Height'] = 75;\n $fetchUser[0]['image100by80Width'] = 100;\n\t\t\treturn $fetchUser;\n\t\t}\n\t}", "public function getImage() {\n if ($this->item_image == null) {\n return Yii::app()->request->baseUrl . \"/images/box/default.jpg\";\n } else {\n return Yii::app()->request->baseUrl . \"/images/box/\" . $this->item_image;\n }\n }", "public function getImage()\n {\n return $this->image;\n }", "public function getImage()\n {\n return $this->Image;\n }", "public function mainImage():string\n {\n return ($this->image_1) ? url( $this->image_1 ) : url( env('NO_IMAGE_PRODUCT_DEFAULT','') );\n }", "public function gezippercolorimg($id){\n\n\n\n $productid = Zippercolor::find($id);\n \n\n $filePath = base_path().\"/storage/app/zipper/\".$productid->productImage; \n header('Content-type: image/jpeg');\n $img = Image::make($filePath);\n return $img->response('jpg');\n\n \n }", "public function gezippercolorimg($id){\n\n\n\n $productid = Zippercolor::find($id);\n \n\n $filePath = base_path().\"/storage/app/zipper/\".$productid->productImage; \n header('Content-type: image/jpeg');\n $img = Image::make($filePath);\n return $img->response('jpg');\n\n \n }", "public function getImage() {\n return $this->image;\n }", "public function getImage() {}", "function ciniki_products_imageGet($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 'product_image_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Product Image'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'products', 'private', 'checkAccess');\n $rc = ciniki_products_checkAccess($ciniki, $args['tnid'], 'ciniki.products.imageGet', 0); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki);\n\n //\n // Get the main information\n //\n $strsql = \"SELECT ciniki_product_images.id, \"\n . \"ciniki_product_images.name, \"\n . \"ciniki_product_images.permalink, \"\n . \"ciniki_product_images.sequence, \"\n . \"ciniki_product_images.webflags, \"\n . \"ciniki_product_images.image_id, \"\n . \"ciniki_product_images.description \"\n . \"FROM ciniki_product_images \"\n . \"WHERE ciniki_product_images.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND ciniki_product_images.id = '\" . ciniki_core_dbQuote($ciniki, $args['product_image_id']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.products', array(\n array('container'=>'images', 'fname'=>'id', 'name'=>'image',\n 'fields'=>array('id', 'name', 'permalink', 'sequence', 'webflags', 'image_id', 'description')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['images']) ) {\n return array('stat'=>'ok', 'err'=>array('code'=>'ciniki.products.67', 'msg'=>'Unable to find image'));\n }\n $image = $rc['images'][0]['image'];\n \n return array('stat'=>'ok', 'image'=>$image);\n}", "public function getMediaImageUrl() {\n return $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ()->getBaseUrl ( \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA ) . 'catalog/product';\n }", "public function getImageResource()\n {\n return $this->image;\n }", "public function getImage()\n {\n // merge text options with generation options\n $queryArgs = array_merge(\n $this->getOptions(),\n array(\n \t'text' => $this->getText(),\n )\n );\n \n $url = self::GENERATOR_SERVICE_URL . '?' . http_build_query($queryArgs);\n \n // Set curl options and execute the request\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\n $result = curl_exec($ch);\n \n // if the request fails, throw exception\n if ($result === false) {\n require_once 'Ncstate/Brand/Exception.php';\n throw new Ncstate_Brand_Exception('CURL Error: ' . curl_error($ch));\n }\n \n $im = imagecreatefromstring($result);\n curl_close($ch); \n \n return $this->_store($im);\n }", "public function getImage() {\n\t\t\treturn $this->image;\n\t\t}", "public function getImage()\n {\n return $this->image;\n }", "public function getImgByProduct($id){\n $this->db->select('*');\n $this->db->where('id_product', $id);\n $this->db->from($this->product_img); \n return $this->db->get();\n }", "public function loadproductimagebyid($id){\n\t\t$this->db->where('Product_Id', $id);\n\t\t$query=$this->db->get('tbl_product_images');\n\t\treturn $query->result();\n\t}", "public function getImage() : string\n {\n return $this->image;\n }", "public static function get_product_images($productId)\n {\n $db = new Db();\n $sql = \"SELECT image_filename FROM image i , product_image pi WHERE i.image_id = pi.image_id AND WHERE pi.product_id= '\".$productId.\"'\";\n $res = $db->select_to_array($sql);\n return $res;\n }", "public function getImage(){\n $images = $this->getImageUrls($this->image_size);\n return Utils::saveImage($images->attr('data-url'));\n }", "public function get_image() {\n\n return $this->image_id !== null ? $this->image->full_src() : null;\n }", "public function getImage() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('image'));\n }", "public function Image()\n {\n if ($this->Buyable()) {\n return $this->Buyable()->Image();\n }\n }", "public function getImage()\n {\n return $this->getValue('nb_catalog_item_lang_image');\n }", "public function getImage()\n {\n if($this->image == null){\n return \"https://place-hold.it/50x50\";\n }\n else return IMG_PATH.\"/\".$this->image;\n }", "public function getImage()\n {\n if (empty($this->data)) {\n // failure in processing the image. nothing much we can do\n return null;\n } else {\n $path = $this->data->basePath();\n\n // get path to image\n return $this->processImagePath($path);\n }\n }", "public function show(Product $product)\n {\n // $product->productImages;\n\n return $product->load('productImages', 'primaryProductImages');\n }", "public static function getProductImages($productID) {\n $queryImages = $queryImages = DB::table('media_resized_new as mrn')\n ->leftJoin('product_media_map as pmm','pmm.media_id','=','mrn.media_id')\n ->where('pmm.product_id',$productID)\n ->where('pmm.media_type','gallery')\n ->select('mrn.file as image','mrn.image_type','pmm.product_id')\n ->get();\n \n //echo $queryImages->toSql();\n \n //array to hold images\n $arrImage = array();\n \n if($queryImages) {\n foreach($queryImages as $row) {\n if(in_array($row->image_type, array('listing'))) {\n $arrImage[$row->image_type] = Config::get('constants.API_LISTING_IMAGE_URL').$row->image;\n }\n if($row->image_type = 'gallery') {\n $arrImage['gallery'][] = Config::get('constants.API_GALLERY_IMAGE_URL').$row->image;\n }\n }\n }\n \n return $arrImage;\n }", "public function getImageUrl()\n {\n try {\n $product = $this->itemResolver->getFinalProduct($this->itemOptionsLocator->getOptions($this->getItem()));\n $imageUrl = $this->imageHelper->getDefaultPlaceholderUrl('thumbnail');\n if ($product !== null) {\n $imageUrl = $this->imageHelper->init($product, 'product_thumbnail_image')->getUrl();\n }\n return $imageUrl;\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }", "public function getProductImageDetails($params){\n\t\ttry {\n\t\t\t$query = \"SELECT * FROM store_products_images spi WHERE statusid=1 AND spi.product_id = \".$params['id'];\t\t\t\n\t\t\t//exit;\t\t\t\n\t\t\t$stmt = $this->db->query($query);\t\t\t\n\t\t\treturn $stmt->fetchAll();\n\t\t\t\n\t\t} catch(Exception $e) {\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function getPicturesProduct()\n {\n $aVariantSelections = $this->getVariantSelections();\n if ($aVariantSelections && $aVariantSelections['oActiveVariant'] && !$aVariantSelections['blPerfectFit']) {\n return $aVariantSelections['oActiveVariant'];\n }\n\n return $this->getProduct();\n }", "public function getImage() {\n //return the value image\n return $this->AdvertImage;\n }", "protected function getImageResource () {\n $extension = strtolower( strrchr ( $this->source, '.' ) );\n\n // Convert image to resource object according to its type.\n switch ( $extension ) {\n case '.jpg':\n case '.jpeg':\n $img = @imagecreatefromjpeg( $this->source );\n break;\n case '.gif':\n $img = @imagecreatefromgif( $this->source );\n break;\n case '.png':\n $img = @imagecreatefrompng( $this->source );\n break;\n default:\n $img = false;\n break;\n }\n return $img;\n }", "public function getImage($params, $context)\n {\n $this->validateMethodContext($context, ['role' => OMV_ROLE_ADMINISTRATOR]);\n // Validate the parameters of the RPC service method.\n $this->validateMethodParams($params, 'rpc.common.objectuuid');\n // Get the configuration object.\n $db = \\OMV\\Config\\Database::getInstance();\n return $db->getAssoc('conf.service.tgt.image', $params['uuid']);\n }", "public function productImage(){\n\t\treturn $this->hasmany('App\\ProductImages','product_id');\n\t}", "public function getImageFile() \n {\n return isset($this->imagen) ? Yii::$app->basePath . '/web/img/producto/'. $this->imagen : null;\n }", "function getImagePath () {\n return luxbum::getImage($this->dir, $this->file);\n }", "protected function getImgSrc(Mage_Catalog_Model_Product $product)\n {\n if ($this->isInAdmin() == true) {\n return null;\n }\n\n try {\n return (string) Mage::helper('catalog/image')->init($product, 'thumbnail');\n } catch (Exception $e) {\n return null;\n }\n }", "public function getFotoProducto()\n {\n return $this->fotoProducto;\n }", "public function getRecipeImage()\r\n {\r\n return $this->_recipeImage;\r\n }", "function get()\r\n\t{\r\n\t\t// Get the properties from the URI\r\n\t\t$default = array('file','width','height','crop','quality','nocache');\r\n\t\t$uri_array = $this->uri->uri_to_assoc(3, $default);\r\n\r\n\t\tif( $uri_array['file'] == NULL)\r\n\t\t{\r\n\t\t\t// Don't continue\r\n\t\t\tlog_message(\"error\",\"BackendPro->Image->get : Badly formed image request string: \" . $this->uri->uri_string());\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Try to find the image\r\n\t\tforeach($this->config->item('image_folders') as $folder)\r\n\t\t{\r\n\t\t\tif ( file_exists($folder.$uri_array['file']))\r\n\t\t\t{\r\n\t\t\t\t$this->img_path = $folder.$uri_array['file'];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Image couldn't be found\r\n\t\tif ($this->img_path == NULL)\r\n\t\t{\r\n\t\t\tlog_message(\"error\",\"BackendPro->Image->get : Image dosn't exisit: \" . $uri_array['file']);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Get the size and MIME type of the requested image\r\n\t\t$size = GetImageSize($this->img_path);\r\n\t\t$width = $size[0];\r\n\t\t$height = $size[1];\r\n\r\n\t\t// Make sure that the requested file is actually an image\r\n\t\tif (substr($size['mime'], 0, 6) != 'image/')\r\n\t\t{\r\n\t\t\tlog_message(\"error\",\"BackendPro->Image->get : Requested file is not an accepted type: \" . $this->img_path);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Before we start to check for caches and alike, lets just see if the image\r\n\t\t// was requested with no changes, if so just return the normal image\r\n\t\tif( $uri_array['width'] == NULL AND $uri_array['height'] == NULL AND $uri_array['watermark'] == NULL AND $uri_array['crop'] == NULL AND $uri_array['quality'] == NULL)\r\n\t\t{\r\n\t\t\t$data\t= file_get_contents($this->img_path);\r\n\t\t\theader(\"Content-type:\". $size['mime']);\r\n\t\t\theader('Content-Length: ' . strlen($data));\r\n\t\t\tprint $data;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// We know we have to do something, so before we do lets see if there is\r\n\t\t// cache of the image already\r\n\t\tif( $uri_array['nocache'] == NULL)\r\n\t\t{\r\n\t\t\t// TODO: This should check to see if the image has changed since the last cache?\r\n\t\t\t$image_cache_string = $this->img_path . \" - \" . $uri_array['width'] . \"x\" . $uri_array['height'];\r\n\t\t\t$image_cache_string.= \"x\" . $uri_array['crop'] . \"x\" . $uri_array['quality'];\r\n\t\t\t$image_cache_string = md5($image_cache_string);\r\n\r\n\t\t\tif (file_exists($this->cache.$image_cache_string))\r\n\t\t\t{\r\n\t\t\t\t// Yes a cached image exists\r\n\t\t\t\t$data\t= file_get_contents($this->cache.$image_cache_string);\r\n\r\n\t\t\t\t// Before we output the image, does the local cache have the image?\r\n\t\t\t\t$this->_ConditionalGet($data);\r\n\r\n\t\t\t\theader(\"Content-type: \". $size['mime']);\r\n\t\t\t\theader('Content-Length: ' . strlen($data));\r\n\t\t\t\tprint $data;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// CROP IMAGE\r\n\t\t$offsetX = 0;\r\n\t\t$offsetY = 0;\r\n\t\tif( $uri_array['crop'] != NULL)\r\n\t\t{\r\n\t\t\t$crop = explode(':',$uri_array['crop']);\r\n\t\t\tif(count($crop) == 2)\r\n\t\t\t{\r\n\t\t\t\t$actualRatio = $width / $height;\r\n\t\t\t\t$requestedRatio = $crop[0] / $crop[1];\r\n\r\n\t\t\t\tif ($actualRatio < $requestedRatio)\r\n\t\t\t\t{ \t// Image is too tall so we will crop the top and bottom\r\n\t\t\t\t\t$origHeight\t= $height;\r\n\t\t\t\t\t$height\t\t= $width / $requestedRatio;\r\n\t\t\t\t\t$offsetY\t= ($origHeight - $height) / 2;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($actualRatio > $requestedRatio)\r\n\t\t\t\t{ \t// Image is too wide so we will crop off the left and right sides\r\n\t\t\t\t\t$origWidth\t= $width;\r\n\t\t\t\t\t$width\t\t= $height * $requestedRatio;\r\n\t\t\t\t\t$offsetX\t= ($origWidth - $width) / 2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// RESIZE\r\n\t\t$ratio = $width / $height;\r\n\t\t$new_width = $width;\r\n\t\t$new_height = $height;\r\n\t\tif( $uri_array['width'] != NULL AND $uri_array['height'] != NULL)\r\n\t\t{\r\n\t\t\t// Resize image to fit into both dimensions\r\n\t\t\t$new_ratio = $uri_array['width'] / $uri_array['height'];\r\n\t\t\tif($ratio > $new_ratio)\r\n\t\t\t{\r\n\t\t\t\t// Height is larger\r\n\t\t\t\t$uri_array['height'] = NULL;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Width is larger\r\n\t\t\t\t$uri_array['width'] = NULL;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( $uri_array['width'] == NULL AND $uri_array['height'] != NULL)\r\n\t\t{\t// Keep height ratio\r\n\t\t\t$new_height = $uri_array['height'];\r\n\t\t\t$new_width = $new_height * $ratio;\r\n\t\t}\r\n\t\telse if ( $uri_array['width'] != NULL AND $uri_array['height'] == NULL)\r\n\t\t{\t// Keep width ratio\r\n\t\t\t$new_width = $uri_array['width'];\r\n\t\t\t$new_height = $new_width / $ratio;\r\n\t\t}\r\n\r\n\t\t// QUALITY\r\n\t\t$quality = ($uri_array['quality'] != NULL) ? $uri_array['quality'] : $this->config->item('image_default_quality');\r\n\r\n\t\t$dst_image = imagecreatetruecolor($new_width, $new_height);\r\n\t\t$src_image = imagecreatefromjpeg($this->img_path);\r\n\t\timagecopyresampled($dst_image,$src_image,0, 0, $offsetX, $offsetY, $new_width, $new_height, $width, $height );\r\n\r\n\t\t// SAVE CACHE\r\n\t\tif( $uri_array['nocache'] == NULL)\r\n\t\t{\r\n\t\t\t// Make sure Cache dir is writable\r\n\t\t\t// INFO: This may be the source of the images sometimes not showing, seems some of the cache files can't be found\r\n\t\t\t// INFO: Since we are running this on a linux server its fine but this could cause issues http://codeigniter.com/forums/viewthread/94359/\r\n\t\t\tif ( !is_really_writable($this->cache))\r\n\t\t\t//if( !is_writable($this->cache))\r\n\t\t\t{\r\n\t\t\t\tlog_message('error',\"BackendPro->Image->get : Cache folder isn't writable: \" . $this->cache);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Write image to cache\r\n\t\t\t\timagejpeg($dst_image,$this->cache.$image_cache_string,$quality);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\theader(\"Content-type:\". $size['mime']);\r\n\t\timagejpeg($dst_image,NULL,$quality);\r\n\t}", "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}", "function getThumbnail()\n\t{\n\t\t$id= FormUtil :: getPassedValue('id', isset ($args['id']) ? $args['id'] : null, 'GET');\n\t\t$width= FormUtil :: getPassedValue('width', isset ($args['width']) ? $args['width'] : null, 'GET');\n\t\tif (!SecurityUtil :: checkPermission('crpLicense::License', '::', ACCESS_READ))\n\t\t\tpnShutDown();\n\n\t\t$file= $this->dao->getFile($id, 'image', true);\n\t\t$modifiedDate= $this->dao->getLicenseDate($id, 'lu_date');\n\n\t\tif (!(is_numeric($width) && $width > 0))\n\t\t\t$width= pnModGetVar('crpLicense', 'image_width');\n\t\t$params['width']= $width; //\t$params['append_ghosted']=1;\n\t\t$params['modifiedDate']= $modifiedDate;\n\n\t\tcrpLicense :: imageGetThumbnail($file['binary_data'], $file['name'], $file['content_type'], $params);\n\t}" ]
[ "0.82395536", "0.8027118", "0.78419805", "0.76528615", "0.75091696", "0.7324784", "0.7181343", "0.71272427", "0.697961", "0.6944564", "0.6944564", "0.6932558", "0.6915723", "0.6909591", "0.6909591", "0.6909591", "0.6909591", "0.6895475", "0.68864995", "0.688099", "0.688099", "0.688099", "0.68709713", "0.6867453", "0.6864611", "0.6864611", "0.68544567", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6842438", "0.6828835", "0.68266535", "0.68261266", "0.6814198", "0.68029183", "0.6797097", "0.6780094", "0.6778039", "0.6777705", "0.6777705", "0.6768946", "0.6765069", "0.6756379", "0.6752156", "0.6750868", "0.6740593", "0.6732761", "0.6726115", "0.66589326", "0.66548747", "0.66408366", "0.6638895", "0.66104233", "0.6599071", "0.6596627", "0.6585056", "0.6577985", "0.65633386", "0.6545352", "0.6545189", "0.65435827", "0.65370387", "0.65321964", "0.6530053", "0.6526264", "0.6523549", "0.6522059", "0.65151477", "0.6494475", "0.64850724", "0.64831537", "0.6482601", "0.6466719", "0.64624757", "0.6461817", "0.64349574" ]
0.69119936
13
/////////////////////////////////////////////////////////////////////// Get products filters
public static function getProductsFilters($category_ids = 0, $items_per_page = 0) { $params = array('category_ids' => $category_ids); $data = fn_get_product_filters($params, $items_per_page); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilterProducts()\n {\n return $this->filterProducts;\n }", "abstract protected function getFilters();", "public function getFilters();", "public function GetFilters ();", "public function get($filters = array())\n {\n if (isset($filters['id']))\n {\n\n $result = $this->database->product_get_by_id($filters['id']);\n \n }\n else if (isset($filters['cat_id']) || isset($filters['p.cat_id']))\n {\n $result = $this->database->product_get_by_category($filters);\n }\n else if (isset($filters['token']))\n {\n $result = $this->database->get_product_by_download_token($filters['token']);\n }\n else if (isset($filters['cart']))\n {\n $result = $this->database->get_cart_products();\n }\n else\n {\n $result = $this->database->product_get_all($filters);\n }\n \n return $result;\n }", "public static function getManufacturerFilter() {\n $pArr = self::__getProductsListingData();\n \n return $pArr['mfgFilter'];\n }", "public function getFilters() \r\n\t{\r\n\t\treturn $this->_filters;\r\n\t}", "public function getFilters() \n {\n return $this->filters;\n }", "protected function filter()\n {\n $request = $this->getRequest();\n $session = $request->getSession();\n $filterForm = $this->createForm(new ProductFilterType());\n $em = $this->getDoctrine()->getManager();\n $queryBuilder = $em->getRepository('NiftyThriftyShopBundle:Product')->createQueryBuilder('e')->orderBy('e.productId', 'DESC');\n\n // Reset filter\n if ($request->get('filter_action') == 'reset') {\n $session->remove('ProductControllerFilter');\n }\n\n // Filter action\n if ($request->get('filter_action') == 'filter') {\n // Bind values from the request\n $filterForm->bind($request);\n\n if ($filterForm->isValid()) {\n // Build the query from the given form object\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n // Save filter to session\n $filterData = $filterForm->getData();\n $session->set('ProductControllerFilter', $filterData);\n }\n } else {\n // Get filter from session\n if ($session->has('ProductControllerFilter')) {\n $filterData = $session->get('ProductControllerFilter');\n $filterForm = $this->createForm(new ProductFilterType(), $filterData);\n $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($filterForm, $queryBuilder);\n }\n }\n\n return array($filterForm, $queryBuilder);\n }", "public function getFilters(): array;", "public function getFilters()\r\n {\r\n return $this->filters;\r\n }", "function get_product_category_filters($data) {\n $category_id = $data['category_id'];\n // Return category filters object\n return (object) [\n 'attributes' => get_product_category_attribute_terms($category_id),\n 'subcategories' => get_product_category_subcategories($category_id),\n 'price' => get_product_category_price_min_max($category_id)\n ];\n}", "public static function GET_FILTER(): array\n\t{\n\t\treturn self::$filters;\n\t}", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public function getFilters()\n {\n return $this->filters;\n }", "public static function alm_get_all_filters(){\n global $wpdb;\n \t$prefix = esc_sql( ALM_FILTERS_PREFIX );\n \t$options = $wpdb->options;\n \t$t = esc_sql( \"$prefix%\" );\n \t$sql = $wpdb -> prepare ( \"SELECT option_name FROM $options WHERE option_name LIKE '%s'\", $t );\n \t$filters = $wpdb -> get_col( $sql );\n\n \t$filters = ALMFilters::alm_remove_filter_license_options($filters);\n\n \treturn $filters;\n }", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "protected function _getProductCollection()\n {\n $collection = parent::_getProductCollection();\n\t\t$helper = Mage::helper('catalogMembersonly/productsFilter');\n\t\t$collection = $helper->filterProductCollection($collection);\n\n return $collection;\t\t\n }", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function getFilters(): FilterCollection;", "public function getAllFilters();", "public function getFilters(): array;", "public function getFilter();", "public function getFilter();", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\LicenceType(),\n new Filter\\LicenceStatus(),\n new Filter\\LicenceTrafficArea(),\n new Filter\\EntityType(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "public function getFilters()\n {\n return array();\n }", "public function getProductFilter(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria)\n {\n $result = [];\n \n // Collection/products with last filter group removed\n $prevCollection = $this->getPreviousCollection($searchCriteria);\n $prevProducts = $prevCollection->getItems();\n \n // Get the last filter option\n $lastFilter = $this->filterHelper->getLastFilter($searchCriteria);\n \n // Build product collection with search criteria\n $collection = $this->productHelper->buildCollection($searchCriteria);\n $collection->load();\n $collection->addCategoryIds()->addMinimalPrice();\n $products = $collection->getItems();\n \n // Loop through the list of defined filters\n foreach ($this->filterableList AS $filter) \n {\n $attribute = new Attribute();\n $attribute->setHandle($filter->handle);\n $attribute->setName($filter->name);\n if (isset($filter->condition)) $attribute->setCondition($filter->condition);\n \n switch($filter->type) {\n case 'category':\n $parent = $this->getParentFilter($filter);\n $attribute->setField('category_id');\n $attribute->setType('list');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseCategoryFilter($filter, $products, $parent, $this->productHelper->getFiltersByField($searchCriteria, 'category_id')));\n break;\n \n case 'attribute':\n $attribute->setField($filter->id);\n $attribute->setType('list');\n $attribute->setLogicalAnd($filter->logicalAnd ?? false);\n $isLast = $this->filterBehaviour == 'multiple' && $filter->handle == $lastFilter->getField();\n $attributeProducts = $isLast ? $prevProducts : $products;\n $this->setAttributeValues($searchCriteria, $attribute, $this->parseAttributeFilter($filter, $attributeProducts), $isLast);\n break;\n \n case 'price':\n $attribute->setField('price');\n $attribute->setType('slider');\n $attribute->setLogicalAnd(true);\n $this->setAttributeValues($searchCriteria, $attribute, $this->parsePriceFilter($collection));\n break;\n }\n \n // No values? Then lets not show this attribute\n if (count($attribute->getValues()) == 0) continue;\n \n $result[$filter->handle] = $attribute;\n }\n \n return $result;\n }", "function xh_listFilters()\r\n\t{\r\n\t}", "public function filterProducts(Request $request) {\n\t\t$genre_id = $request->genreId;\n\t\t$author_id = $request->authorId;\n\n\t\t$filtered_products = Product::where('author_id', $author_id)\n\t\t ->where('genre_id', $genre_id)\n\t\t ->orderBy('created_at', 'desc')\n\t\t ->with('image')\n\t\t\t\t\t\t\t\t\t ->where( 'amount', '>', 0 )\n\t\t\t\t\t\t\t\t\t ->get();\n\t\treturn $filtered_products;\n\t}", "protected function getFilterPrices()\n\t{\n\t\tif (!isset($this->priceFilter))\n\t\t{\n\t\t\t$this->priceFilter = array();\n\t\t\tif (self::$catalog)\n\t\t\t{\n\t\t\t\t//TODO: replace \\CCatalogGroup::GetListArray after create cached d7 method\n\t\t\t\t$priceList = \\CCatalogGroup::GetListArray();\n\t\t\t\tif (!empty($priceList))\n\t\t\t\t\t$this->priceFilter = array_keys($priceList);\n\t\t\t\tunset($priceList);\n\t\t\t}\n\t\t}\n\t\treturn $this->priceFilter;\n\t}", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "public function getFilters ()\n {\n $filters = [];\n\n return $filters;\n }", "public function getFilters(): array\n {\n return $this->filters;\n }", "private function _get_filters_section_settings() {\r\n\r\n // Get all product categories\r\n $termArgs = array(\r\n 'taxonomy' => 'product_cat',\r\n 'hide_empty' => false\r\n );\r\n $productTermsObject = get_terms( $termArgs );\r\n $productTerms = array();\r\n\r\n if ( !is_wp_error( $productTermsObject ) ) {\r\n\r\n foreach( $productTermsObject as $term )\r\n $productTerms[ $term->slug ] = $term->name;\r\n\r\n }\r\n\r\n foreach ( WWOF_Product_Listing_Helper::get_all_products( 'ID , post_title' ) as $post ){\r\n $product = wc_get_product( $post->ID );\r\n $allProducts[ WWOF_Functions::wwof_get_product_id( $product ) ] = '[ID : ' . WWOF_Functions::wwof_get_product_id( $product ) . '] ' . $post->post_title;\r\n }\r\n\r\n // Add \"None\" category selection for \"no default\" option\r\n $productTerms2 = array_merge( array ('none' => __( 'No Default' , 'woocommerce-wholesale-order-form' ) ), $productTerms );\r\n\r\n return array(\r\n\r\n array(\r\n 'title' => __( 'Filters Options', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'title',\r\n 'desc' => '',\r\n 'id' => 'wwof_filters_main_title'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Product Category Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'multiselect',\r\n 'desc' => __( 'Only display products belonging to the selected category' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_filters_product_category_filter',\r\n 'class' => 'chosen_select',\r\n 'css' => 'min-width:300px;',\r\n 'custom_attributes' => array(\r\n 'multiple' => 'multiple',\r\n 'data-placeholder' => __( 'Select Some Product Categories...' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'options' => $productTerms\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Exclude Product Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'multiselect',\r\n 'desc' => __( 'Exclude selected products' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_filters_exclude_product_filter',\r\n 'class' => 'chosen_select',\r\n 'css' => 'min-width:300px;',\r\n 'custom_attributes' => array(\r\n 'multiple' => 'multiple',\r\n 'data-placeholder' => __( 'Select Some Products...' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'options' => $allProducts\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Default Product Category on Search Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => __( 'Select a product category to which product are under will be loaded by default in the order form.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_general_default_product_category_search_filter',\r\n 'class' => 'chosen_select',\r\n 'options' => $productTerms2,\r\n 'default' => 'none'\r\n ),\r\n\r\n array(\r\n 'type' => 'sectionend',\r\n 'id' => 'wwof_filters_sectionend'\r\n )\r\n\r\n );\r\n\r\n }", "protected function filters(): array\n {\n return $this->filters;\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 getFilterParameters(): array;", "function _get_filters(){\n $flt = array();\n $filters = array();\n\n if(!isset($_REQUEST['dataflt'])){\n $flt = array();\n }elseif(!is_array($_REQUEST['dataflt'])){\n $flt = (array) $_REQUEST['dataflt'];\n }else{\n $flt = $_REQUEST['dataflt'];\n }\n foreach($flt as $key => $line){\n // we also take the column and filtertype in the key:\n if(!is_numeric($key)) $line = $key.$line;\n $f = $this->_parse_filter($line);\n if(is_array($f)){\n $f['logic'] = 'AND';\n $filters[] = $f;\n }\n }\n return $filters;\n }", "protected function getProductCollection()\r\n {\r\n $searchCollection = Mage::getModel('catalog/product')\r\n ->getCollection()\r\n ->addAttributeToSelect('*')\r\n ->addAttributeToFilter('status', 1)\r\n ->addAttributeToFilter('visibility', 4);\r\n $searchCollection->getSelect()->limit($this->getProductsCount());\r\n $searchCollection->getSelect()->where(\"'\" . date('Y-m-d') . \"' BETWEEN special_from_date AND special_to_date\");\r\n $searchCollection->getSelect()->orWhere(\"'\" . date('Y-m-d') . \"' >= special_from_date\");\r\n// echo $searchCollection->getSelect()->__toString();\r\n return $searchCollection->load();\r\n }", "public function getFilters()\n {\n $filters = [];\n\n return $filters;\n }", "protected function getFilter() {\n\t\t$conditions = $this->getConditions();\n\t\treturn $conditions;\n\t}", "public function getFilters()\n {\n return $this->getOptions()\n ->joinWith('taxGroup.lang')\n ->joinWith('lang');\n }", "public function getFilters()\n {\n if (!$this->extensionInitialized) {\n $this->initExtensions();\n }\n return $this->filters;\n }", "function acf_get_filters()\n{\n}", "public function getFilter(): array\n {\n return $this->model->getFilter();\n }", "public function getFilter() :array;", "public function & GetFilters () {\n\t\t$filters = [];\n\t\tforeach ($this->filters as $direction => $handler) \n\t\t\t$filters[$direction] = $handler[1];\n\t\treturn $filters;\n\t}", "public function getFilters() : array\n {\n return $this->getLoader()->getFilters();\n }", "public function getFilters(): array\n {\n return [];\n }", "public function getActiveFilters()\n {\n \t$ret = $this->getSettingValue('filters', []);\n \treturn (is_array($ret)) ? $ret : [];\n }", "public function getProductOptions($filter = array())\n {\n //$filter = null;\n $products = $this->em\n ->getRepository('GistInventoryBundle:Product')\n ->findBy(\n $filter,\n array('id' => 'ASC')\n );\n\n $prod_opts = array();\n foreach ($products as $prod)\n $prod_opts[$prod->getID()] = $prod->getName();\n\n return $prod_opts;\n }", "public function getFilter(){ }", "public function getActualActionProducts()\n {\n $actionGroupIds = $this->getActionGroupIds();\n $actionCategoriesIds = $this->getActionCategoryIds();\n $actionProductIds = $this->getActionProductIds();\n\n $query = Product::find()\n ->andWhere(['{{%sales_products}}.enabled' => true])\n ->orderBy(['{{%sales_products}}.title' => SORT_ASC]);\n\n if ($this->has_products) {\n // $query->andWhere(['{{%sales_products}}.is_show_in_catalog' => true]);\n } else {\n $dummyCategory = Category::findOne(['name' => Category::DUMMY_PLAN_CATEGORY_NAME]);\n $actionCategoriesIds[] = $dummyCategory->id;\n }\n\n if ($actionGroupIds) {\n $query->andWhere(['IN', 'group_id', $actionGroupIds]);\n }\n\n if ($actionCategoriesIds) {\n $query->andWhere(['IN', 'category_id', $actionCategoriesIds]);\n }\n\n if ($actionProductIds) {\n $query->andWhere(['IN', 'id', $actionProductIds]);\n }\n\n return $query;\n }", "public function getFilters()\n {\n return array_filter($this->request->only($this->filters));\n }", "abstract public function filters();", "public function getFilters() {\n\t\treturn array(\n\t\t\t'size' => new Twig_Filter_Function('Cake_Number_Filters::size'),\n\t\t\t'pct' => new Twig_Filter_Function('Cake_Number_Filters::percentage'),\n\t\t\t'curr' => new Twig_Filter_Function('Cake_Number_Filters::currency'),\n\t\t\t'p' => new Twig_Filter_Function('Cake_Number_Filters::precision'),\n\t\t);\n\t}", "function wcfmu_products_filter_menu() {\r\n\tglobal $WCFM, $WCFMu, $wp_query;\r\n\t\r\n\t$wcfmu_products_menus = apply_filters( 'wcfmu_products_menus', array( 'all' => __( 'All', 'wc-frontend-manager-ultimate'), \r\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\t\t\t\t\t\t\t\t\t'publish' => __( 'Published', 'wc-frontend-manager-ultimate'),\r\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\t\t\t\t\t\t\t\t\t'draft' => __( 'Draft', 'wc-frontend-manager-ultimate'),\r\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\t\t\t\t\t\t\t\t\t'pending' => __( 'Pending', 'wc-frontend-manager-ultimate')\r\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\t\t\t\t\t\t\t\t) );\r\n\t\r\n\t$product_status = ! empty( $_GET['product_status'] ) ? sanitize_text_field( $_GET['product_status'] ) : 'all';\r\n\t$count_products = wp_count_posts( 'product' );\r\n\t$count_products->all = $count_products->publish + $count_products->pending + $count_products->draft;\r\n\t?>\r\n\t<ul class=\"wcfm_products_menus\">\r\n\t\t<?php\r\n\t\t$is_first = true;\r\n\t\tforeach( $wcfmu_products_menus as $wcfmu_products_menu_key => $wcfmu_products_menu) {\r\n\t\t\t?>\r\n\t\t\t<li class=\"wcfm_products_menu_item\">\r\n\t\t\t\t<?php\r\n\t\t\t\tif($is_first) $is_first = false;\r\n\t\t\t\telse echo \" | \";\r\n\t\t\t\t?>\r\n\t\t\t\t<a class=\"<?php echo ( $wcfmu_products_menu_key == $product_status ) ? 'active' : ''; ?>\" href=\"<?php echo get_wcfm_products_url( $wcfmu_products_menu_key ); ?>\"><?php echo $wcfmu_products_menu . ' ('. $count_products->$wcfmu_products_menu_key .')'; ?></a>\r\n\t\t\t</li>\r\n\t\t\t<?php\r\n\t\t}\r\n\t\t?>\r\n\t</ul>\r\n\t\r\n\t<div class=\"wcfm_products_filter_wrap wcfm_filters_wrap\">\r\n\t<?php\t\r\n\t// Category Filtering\r\n\t$product_categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0&parent=0' );\r\n\t$categories = array();\r\n\t\r\n\techo '<select id=\"dropdown_product_cat\" name=\"dropdown_product_cat\" class=\"dropdown_product_cat\" style=\"width: 150px;\">';\r\n\t echo '<option value=\"\" selected=\"selected\">' . __( 'Select a category', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\tif ( $product_categories ) {\r\n\t\t\t$WCFM->library->generateTaxonomyHTML( 'product_cat', $product_categories, $categories );\r\n\t\t}\r\n\techo '</select>';\r\n\t\r\n\t// Type filtering\r\n\t$product_types = apply_filters( 'wcfm_product_types', array('simple' => __('Simple Product', 'wc-frontend-manager'), 'variable' => __('Variable Product', 'wc-frontend-manager'), 'grouped' => __('Grouped Product', 'wc-frontend-manager'), 'external' => __('External/Affiliate Product', 'wc-frontend-manager') ) );\r\n\t$output = '<select name=\"product_type\" id=\"dropdown_product_type\" style=\"width: 160px;\">';\r\n\t$output .= '<option value=\"\">' . __( 'Show all product types', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\r\n\tforeach ( $product_types as $product_type_name => $product_type_label ) {\r\n\t\t$output .= '<option value=\"' . $product_type_name . '\">' . $product_type_label . '</option>';\r\n\t\r\n\t\tif ( 'simple' == $product_type_name ) {\r\n\t\t\t\r\n\t\t\t$product_type_options = apply_filters( 'wcfm_non_allowd_product_type_options', array( 'virtual' => 'virtual', 'downloadable' => 'downloadable' ) ); \r\n\t\t\t\r\n\t\t\tif( !empty( $product_type_options['downloadable'] ) ) {\r\n\t\t\t\t$output .= '<option value=\"downloadable\" > &rarr; ' . __( 'Downloadable', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( !empty( $product_type_options['virtual'] ) ) {\r\n\t\t\t\t$output .= '<option value=\"virtual\" > &rarr; ' . __( 'Virtual', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t$output .= '</select>';\r\n\t\r\n\techo apply_filters( 'woocommerce_product_filters', $output );\r\n\t\r\n\t\r\n\t$is_marketplace = wcfm_is_marketplace();\r\n\t$user_arr = array( '' => __('All Vendors', 'wc-frontend-manager' ) );\r\n\tif( $is_marketplace ) {\r\n\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\tif( $is_marketplace == 'wcpvendors' ) {\r\n\t\t\t\t$vendors = WC_Product_Vendors_Utils::get_vendors();\r\n\t\t\t\tif( !empty( $vendors ) ) {\r\n\t\t\t\t\tforeach ( $vendors as $vendor ) {\r\n\t\t\t\t\t\t$user_arr[$vendor->term_id] = esc_html( $vendor->name );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$args = array(\r\n\t\t\t\t\t'role__in' => array( 'dc_vendor', 'vendor' ),\r\n\t\t\t\t\t'orderby' => 'login',\r\n\t\t\t\t\t'order' => 'ASC',\r\n\t\t\t\t\t'count_total' => false,\r\n\t\t\t\t\t'fields' => array( 'ID', 'display_name' )\r\n\t\t\t\t ); \r\n\t\t\t\t$all_users = get_users( $args );\r\n\t\t\t\tif( !empty( $all_users ) ) {\r\n\t\t\t\t\tforeach( $all_users as $all_user ) {\r\n\t\t\t\t\t\t$user_arr[$all_user->ID] = $all_user->display_name;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t$WCFM->wcfm_fields->wcfm_generate_form_field( array(\r\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\"dropdown_vendor\" => array( 'type' => 'select', 'options' => $user_arr, 'attributes' => array( 'style' => 'width: 150px;' ) )\r\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 ) );\r\n\t\t}\r\n\t}\r\n\t\r\n\techo '</div>';\r\n}", "public function getProducts()\n\t{\n\t\t$context = 'product' . $type;\n\n\t\t$q = 'SELECT a.*, (SELECT b.path FROM #__gazebos_gallery AS b WHERE b.product_id = a.id ' .\n\t\t\t' ORDER BY b.ordering ASC LIMIT 1) AS image FROM #__gazebos_products AS a' .\n\t\t\t' WHERE a.state = 1 AND a.type_id = ' . $this->item->id;\n\n\t\t$filter_material = $this->getState($context . 'filter.material');\n\t\tif (is_array($filter_material) && !empty($filter_material) && !empty($filter_material[0]))\n\t\t{\n\t\t\t$q .= ' AND a.material_id IN (' . implode(',', $filter_material) . ')';\n\t\t}\n\n\t\t$filter_shape = $this->getState($context . 'filter.shape');\n\t\tif (is_array($filter_shape) && !empty($filter_shape) && !empty($filter_shape[0]))\n\t\t{\n\t\t\t$q .= ' AND a.shape_id IN (' . implode(',', $filter_shape) . ')';\n\t\t}\n\n\t\t$filter_style = $this->getState($context . 'filter.style');\n\t\tif (is_array($filter_style) && !empty($filter_style) && !empty($filter_style[0]))\n\t\t{\n\t\t\t$q .= ' AND a.style_id IN (' . implode(',', $filter_style) . ')';\n\t\t}\n\n\t\t$results = $this->getDbo()->setQuery($q)->loadObjectList('id');\n\n\t\tif ($results !== null)\n\t\t{\n\t\t\tforeach ($results as $product)\n\t\t\t{\n\t\t\t\t$Itemid = GazebosHelper::getProductTypeMenuItem($type);\n\t\t\t\t$product->link = JRoute::_('index.php?option=com_gazebos&view=product&id=' . $product->id . '&Itemid=' . $Itemid);\n\n\t\t\t\tif (!empty($product->image))\n\t\t\t\t{\n\t\t\t\t\t$product->image = EEHtml::asset(\"products/{$product->id}/thumbs/199x160_{$product->image}\", 'com_gazebos');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "public function getFilter(): array\n {\n return $this->filter;\n }", "public function getFilter(): array\n {\n return $this->filter;\n }", "private static function _getFilter() {}", "public static function getProductsOptions()\n {\n return self::get('products') ?: [];\n }", "public function getFilter()\n {\n return $this->get(self::FILTER);\n }", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\AddressType(),\n new Filter\\AddressComplaint(),\n new Filter\\AddressOpposition(),\n new Filter\\LicenceStatus(),\n new Filter\\ApplicationStatus(),\n new Filter\\AddressConditionUndertaking(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "function thrive_dashboard_get_products()\n{\n $products = array();\n $products = apply_filters('thrive_dashboard_installed_products', $products);\n\n return $products;\n}", "public function getProductOptionsTransfer($filter = array())\n {\n //$filter = null;\n $products = $this->em\n ->getRepository('GistInventoryBundle:Product')\n ->findBy(\n $filter,\n array('id' => 'ASC')\n );\n\n $prod_opts = array();\n foreach ($products as $prod)\n $prod_opts[$prod->getItemCode()] = $prod->getName();\n\n return $prod_opts;\n }", "public function getFilters (): array\n\t{\n\t\treturn [\n\t\t\t\"itemName\" => \"itemName\"\n\t\t];\n\t}", "public function getProductCollection()\n {\n $collection = $this->productCollectionFactory->create();\n $this->prepareProductCollection($collection);\n $attributeSplashCode = $this->_attributeSplashHelper->getAttributeSplashCode();\n\n $attributeSplash = $this->getAttributeSplash();\n \n $collection->addAttributeToSelect('*');\n $collection->addAttributeToSelect('name');\n $collection->addStoreFilter()->addAttributeToFilter($attributeSplashCode , $attributeSplash->getAttributeId());\n \n $collection->addAttributeToFilter('status', Status::STATUS_ENABLED);\n $collection->addAttributeToFilter('visibility', array('neq' => \\Magento\\Catalog\\Model\\Product\\Visibility::VISIBILITY_NOT_VISIBLE));\n \n \n return $collection;\n }", "public function get_selectedFilters()\n {\n // RETURN : var is initialised\n if ( !$this->arr_selectedFilters === null )\n {\n return $this->arr_selectedFilters;\n }\n // RETURN : var is initialised\n // RETURN : no piVars, set var to false\n if ( empty( $this->pObj->piVars ) )\n {\n $this->arr_selectedFilters = false;\n return $this->arr_selectedFilters;\n }\n // RETURN : no piVars, set var to false\n // Set default\n $this->arr_selectedFilters = false;\n\n // LOOP : each filter table\n foreach ( ( array ) $this->conf_view[ 'filter.' ] as $table => $fields )\n {\n // CONTINUE : table hasn't any dot\n if ( rtrim( $table, '.' ) == $table )\n {\n continue;\n }\n // CONTINUE : table hasn't any dot\n // LOOP : each filter field\n foreach ( array_keys( ( array ) $fields ) as $fieldWiDot )\n {\n if ( substr( $fieldWiDot, -1 ) != '.' )\n {\n continue;\n }\n $field = substr( $fieldWiDot, 0, -1 );\n $tableField = $table . $field;\n if ( isset( $this->pObj->piVars[ $tableField ] ) )\n {\n // #41754.02, 121010, dwildt, 2-\n// $this->arr_selectedFilters = true;\n// return $this->arr_selectedFilters;\n // #41754.02, 121010, dwildt, 1+\n $this->arr_selectedFilters[] = $tableField;\n }\n }\n // LOOP : each filter field\n }\n // LOOP : each filter table\n return $this->arr_selectedFilters;\n }", "protected function products()\n {\n return Product::enabled()->withImages()\n ->where('title', 'like', \"%{$this->query}%\")\n ->orWhere('description', 'like', \"%{$this->query}%\")\n ->orderBy('updated_at', 'desc')\n ->get();\n }", "function similarProducts() {\n $filter = Yii::$app->session->get('filterOption');\n }", "protected function _getProductCollection()\n {\n $collection = parent::_getProductCollection();\n\n /*\n * Collections using Product Flat index require different processing.\n */\n if (Mage::getStoreConfigFlag('catalog/frontend/flat_catalog_product')) {\n $collection\n ->getSelect()\n ->where(new Zend_Db_Expr('price_index.final_price < price_index.price'));\n } else {\n $today = date('Y-m-d', time());\n $collection\n ->addAttributeToFilter('special_price', array('is' => new Zend_Db_Expr('not null')))\n ->addAttributeToFilter('special_from_date', array(\n 'or' => array(\n 0 => array('date' => true, 'to' => $today),\n 1 => array('is' => new Zend_Db_Expr('null')),\n )), 'left')\n ->addAttributeToFilter('special_to_date', array(\n 'or' => array(\n 0 => array('date' => true, 'from' => $today),\n 1 => array('is' => new Zend_Db_Expr('null')),\n )), 'left');\n }\n\n return $collection;\n }", "function alm_filters_installed(){\n \t //Empty return\n \t}", "public function getFilters() {\n\t\tif (!$this->filter) {\n\t\t\t$f = $this->db->getAndFilter();\n\t\t} else {\n\t\t\t$f = $this->filter;\n\t\t}\n\t\tforeach ($this->join as $j) {\n\t\t\t$f->subEq($j[2]->getFilters());\n\t\t}\n\t\treturn $f;\n\t}", "public function getCategoryProductWithFilter($categoryId , $filters = []) {\n\n $prefix = config('database.connections.mysql.prefix');\n\n $sql = \"Select p.id\n FROM {$prefix}products as p \n INNER JOIN {$prefix}category_product as cp on p.id = cp.product_id \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"INNER JOIN {$prefix}product_property_integer_values as ppiv ON p.id = ppiv.product_id \";\n }\n\n }\n }\n\n if('attribute' == $type) {\n\n\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n $sql .= \"INNER JOIN {$prefix}product_attribute_integer_values as paiv ON p.id = paiv.product_id \";\n }\n }\n }\n\n $sql .= \"WHERE cp.category_id = ? \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"AND ppiv.property_id = {$property->id} AND ppiv.value={$value}\";\n }\n\n }\n }\n }\n\n foreach ($filters as $type => $filterArray) {\n if('attribute' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n\n $sql .= \"AND paiv.attribute_id = {$attribute->id} AND paiv.value={$value}\";\n\n\n }\n }\n }\n\n $products = DB::select($sql, [$categoryId]);\n\n $collect = Collection::make([]);\n\n foreach ($products as $productArray) {\n\n $product = $this->findProductById($productArray->id);\n\n if($product->type == \"VARIABLE_PRODUCT\") {\n $collect->push(($product->getVariableMainProduct()));\n } else {\n $collect->push($this->findProductById($productArray->id));\n }\n }\n\n return $collect;\n\n /**\n * FROM avored_products as p\n *\n *\n *\n *\n * where ppiv.property_id = 1 AND\n */\n\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\") {\n\t\t\t$sSavedFilterList = isset($UserProfile) ? $UserProfile->GetSearchFilters(CurrentUserName(), \"fvw_spmlistsrch\") : \"\";\n\t\t} else {\n\t\t\t$sSavedFilterList = \"\";\n\t\t}\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id->AdvancedSearch->ToJSON(), \",\"); // Field id\n\t\t$sFilterList = ew_Concat($sFilterList, $this->detail_jenis_spp->AdvancedSearch->ToJSON(), \",\"); // Field detail_jenis_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_jenis_spp->AdvancedSearch->ToJSON(), \",\"); // Field id_jenis_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->status_spp->AdvancedSearch->ToJSON(), \",\"); // Field status_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->no_spp->AdvancedSearch->ToJSON(), \",\"); // Field no_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tgl_spp->AdvancedSearch->ToJSON(), \",\"); // Field tgl_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->keterangan->AdvancedSearch->ToJSON(), \",\"); // Field keterangan\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jumlah_up->AdvancedSearch->ToJSON(), \",\"); // Field jumlah_up\n\t\t$sFilterList = ew_Concat($sFilterList, $this->bendahara->AdvancedSearch->ToJSON(), \",\"); // Field bendahara\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nama_pptk->AdvancedSearch->ToJSON(), \",\"); // Field nama_pptk\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nip_pptk->AdvancedSearch->ToJSON(), \",\"); // Field nip_pptk\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kode_program->AdvancedSearch->ToJSON(), \",\"); // Field kode_program\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kode_kegiatan->AdvancedSearch->ToJSON(), \",\"); // Field kode_kegiatan\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kode_sub_kegiatan->AdvancedSearch->ToJSON(), \",\"); // Field kode_sub_kegiatan\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tahun_anggaran->AdvancedSearch->ToJSON(), \",\"); // Field tahun_anggaran\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jumlah_spd->AdvancedSearch->ToJSON(), \",\"); // Field jumlah_spd\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nomer_dasar_spd->AdvancedSearch->ToJSON(), \",\"); // Field nomer_dasar_spd\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tanggal_spd->AdvancedSearch->ToJSON(), \",\"); // Field tanggal_spd\n\t\t$sFilterList = ew_Concat($sFilterList, $this->id_spd->AdvancedSearch->ToJSON(), \",\"); // Field id_spd\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kode_rekening->AdvancedSearch->ToJSON(), \",\"); // Field kode_rekening\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nama_bendahara->AdvancedSearch->ToJSON(), \",\"); // Field nama_bendahara\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nip_bendahara->AdvancedSearch->ToJSON(), \",\"); // Field nip_bendahara\n\t\t$sFilterList = ew_Concat($sFilterList, $this->no_spm->AdvancedSearch->ToJSON(), \",\"); // Field no_spm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tgl_spm->AdvancedSearch->ToJSON(), \",\"); // Field tgl_spm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->status_spm->AdvancedSearch->ToJSON(), \",\"); // Field status_spm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nama_bank->AdvancedSearch->ToJSON(), \",\"); // Field nama_bank\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nomer_rekening_bank->AdvancedSearch->ToJSON(), \",\"); // Field nomer_rekening_bank\n\t\t$sFilterList = ew_Concat($sFilterList, $this->npwp->AdvancedSearch->ToJSON(), \",\"); // Field npwp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->pimpinan_blud->AdvancedSearch->ToJSON(), \",\"); // Field pimpinan_blud\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nip_pimpinan->AdvancedSearch->ToJSON(), \",\"); // Field nip_pimpinan\n\t\t$sFilterList = ew_Concat($sFilterList, $this->no_sptb->AdvancedSearch->ToJSON(), \",\"); // Field no_sptb\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tgl_sptb->AdvancedSearch->ToJSON(), \",\"); // Field tgl_sptb\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "public function getFilter()\n {\n return $this->filterComposite;\n }", "function GetFilterList() {\n\t\tglobal $UserProfile;\n\n\t\t// Load server side filters\n\t\tif (EW_SEARCH_FILTER_OPTION == \"Server\") {\n\t\t\t$sSavedFilterList = isset($UserProfile) ? $UserProfile->GetSearchFilters(CurrentUserName(), \"fspplistsrch\") : \"\";\n\t\t} else {\n\t\t\t$sSavedFilterList = \"\";\n\t\t}\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tgl->AdvancedSearch->ToJSON(), \",\"); // Field tgl\n\t\t$sFilterList = ew_Concat($sFilterList, $this->no_spp->AdvancedSearch->ToJSON(), \",\"); // Field no_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jns_spp->AdvancedSearch->ToJSON(), \",\"); // Field jns_spp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kd_mata->AdvancedSearch->ToJSON(), \",\"); // Field kd_mata\n\t\t$sFilterList = ew_Concat($sFilterList, $this->urai->AdvancedSearch->ToJSON(), \",\"); // Field urai\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh->AdvancedSearch->ToJSON(), \",\"); // Field jmlh\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh1->AdvancedSearch->ToJSON(), \",\"); // Field jmlh1\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh2->AdvancedSearch->ToJSON(), \",\"); // Field jmlh2\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh3->AdvancedSearch->ToJSON(), \",\"); // Field jmlh3\n\t\t$sFilterList = ew_Concat($sFilterList, $this->jmlh4->AdvancedSearch->ToJSON(), \",\"); // Field jmlh4\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nm_perus->AdvancedSearch->ToJSON(), \",\"); // Field nm_perus\n\t\t$sFilterList = ew_Concat($sFilterList, $this->alamat->AdvancedSearch->ToJSON(), \",\"); // Field alamat\n\t\t$sFilterList = ew_Concat($sFilterList, $this->npwp->AdvancedSearch->ToJSON(), \",\"); // Field npwp\n\t\t$sFilterList = ew_Concat($sFilterList, $this->pimpinan->AdvancedSearch->ToJSON(), \",\"); // Field pimpinan\n\t\t$sFilterList = ew_Concat($sFilterList, $this->bank->AdvancedSearch->ToJSON(), \",\"); // Field bank\n\t\t$sFilterList = ew_Concat($sFilterList, $this->rek->AdvancedSearch->ToJSON(), \",\"); // Field rek\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nospm->AdvancedSearch->ToJSON(), \",\"); // Field nospm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->tglspm->AdvancedSearch->ToJSON(), \",\"); // Field tglspm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ppn->AdvancedSearch->ToJSON(), \",\"); // Field ppn\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps21->AdvancedSearch->ToJSON(), \",\"); // Field ps21\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps22->AdvancedSearch->ToJSON(), \",\"); // Field ps22\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps23->AdvancedSearch->ToJSON(), \",\"); // Field ps23\n\t\t$sFilterList = ew_Concat($sFilterList, $this->ps4->AdvancedSearch->ToJSON(), \",\"); // Field ps4\n\t\t$sFilterList = ew_Concat($sFilterList, $this->kodespm->AdvancedSearch->ToJSON(), \",\"); // Field kodespm\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nambud->AdvancedSearch->ToJSON(), \",\"); // Field nambud\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nppk->AdvancedSearch->ToJSON(), \",\"); // Field nppk\n\t\t$sFilterList = ew_Concat($sFilterList, $this->nipppk->AdvancedSearch->ToJSON(), \",\"); // Field nipppk\n\t\t$sFilterList = ew_Concat($sFilterList, $this->prog->AdvancedSearch->ToJSON(), \",\"); // Field prog\n\t\t$sFilterList = ew_Concat($sFilterList, $this->prog1->AdvancedSearch->ToJSON(), \",\"); // Field prog1\n\t\t$sFilterList = ew_Concat($sFilterList, $this->bayar->AdvancedSearch->ToJSON(), \",\"); // Field bayar\n\t\tif ($this->BasicSearch->Keyword <> \"\") {\n\t\t\t$sWrk = \"\\\"\" . EW_TABLE_BASIC_SEARCH . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Keyword) . \"\\\",\\\"\" . EW_TABLE_BASIC_SEARCH_TYPE . \"\\\":\\\"\" . ew_JsEncode2($this->BasicSearch->Type) . \"\\\"\";\n\t\t\t$sFilterList = ew_Concat($sFilterList, $sWrk, \",\");\n\t\t}\n\t\t$sFilterList = preg_replace('/,$/', \"\", $sFilterList);\n\n\t\t// Return filter list in json\n\t\tif ($sFilterList <> \"\")\n\t\t\t$sFilterList = \"\\\"data\\\":{\" . $sFilterList . \"}\";\n\t\tif ($sSavedFilterList <> \"\") {\n\t\t\tif ($sFilterList <> \"\")\n\t\t\t\t$sFilterList .= \",\";\n\t\t\t$sFilterList .= \"\\\"filters\\\":\" . $sSavedFilterList;\n\t\t}\n\t\treturn ($sFilterList <> \"\") ? \"{\" . $sFilterList . \"}\" : \"null\";\n\t}", "private function filters() {\n\n\n\t}", "public function getCbProducts()\n {\n $model = KenedoModel::getModel('ConfigboxModelAdminProducts');\n return $model->getRecords(\n array(),\n array(),\n array(array('propertyName' => 'title', 'direction', 'ASC'))\n );\n }", "public function getFilters()\n {\n if (null === $this->filters) {\n $this->filters = array();\n foreach ($this->getExtensions() as $extension) {\n $this->filters = array_merge($this->filters, $extension->getFilters());\n }\n }\n\n return $this->filters;\n }", "public function getProductSelections();", "public function filters()\n {\n return [\n \n ];\n }", "private static function __getProductsListingData() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_Vqmod;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n // optional Product List Filter\n $output = '';\n $result = array();\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $filterlist_sql = \"select distinct c.categories_id as id, cd.categories_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd, \" . TABLE_TEMPLATES_BOXES . \" tb, \" . TABLE_PRODUCT_ATTRIBUTES . \" pa where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '\" . (int)$lC_Language->getID() . \"' and tb.code = 'manufacturers' and tb.id = pa.id and pa.products_id = p.products_id and pa.value = '\" . (int)$_GET['manufacturers'] . \"' order by cd.categories_name\";\n } else {\n $filterlist_sql = \"select distinct m.manufacturers_id as id, m.manufacturers_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_MANUFACTURERS . \" m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '\" . (int)$current_category_id . \"' order by m.manufacturers_name\";\n }\n $Qfilterlist = $lC_Database->query($filterlist_sql);\n $Qfilterlist->execute();\n if ($Qfilterlist->numberOfRows() > 1) {\n $output .= '<p><form name=\"filter\" action=\"' . lc_href_link(FILENAME_DEFAULT) . '\" method=\"get\">' . $lC_Language->get('filter_show') . '&nbsp;';\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $output .= lc_draw_hidden_field('manufacturers', $_GET['manufacturers']);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_categories')));\n } else {\n $output .= lc_draw_hidden_field('cPath', $cPath);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_manufacturers')));\n }\n if (isset($_GET['sort'])) {\n $output .= lc_draw_hidden_field('sort', $_GET['sort']);\n }\n while ($Qfilterlist->next()) {\n $options[] = array('id' => $Qfilterlist->valueInt('id'), 'text' => $Qfilterlist->value('name'));\n }\n $output .= lc_draw_pull_down_menu('filter', $options, (isset($_GET['filter']) ? $_GET['filter'] : null), 'onchange=\"this.form.submit()\"');\n $output .= lc_draw_hidden_session_id_field() . '</form></p>' . \"\\n\";\n }\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $lC_Products->setManufacturer($_GET['manufacturers']);\n }\n $Qlisting = $lC_Products->execute(); \n \n $result['mfgFilter'] = $output;\n $result['Qlisting'] = $Qlisting;\n \n return $result;\n }", "public static function getFilters() {\n\t\t$filters = new stdClass();\n\n\t\t$filters->offset = array_key_exists('offset', $_GET) ? intval($_GET['offset']) : 0;\n\t\t$filters->count = array_key_exists('count', $_GET) ? intval($_GET['count']) : 100;\n\n\t\treturn $filters;\n\t}", "public function getFilters() {\n\t\treturn $this->getWorksheet()->getFilters();\n\t}", "public function getFilters(): array\n {\n return $this->request->only($this->filters);\n }", "public function getFilterOptions()\n {\n return $this->getOptions()\n ->joinWith(['lang','taxGroup'])\n ->where(['is_filter' => true]);\n }", "private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }", "function thrive_dashboard_get_integrations_products()\n{\n $products = array();\n\n $products = apply_filters('thrive_dashboard_integrations_products', $products);\n\n return $products;\n}", "public function getFilterValues()\n {\n return $this->filter_values;\n }", "function es_filter_products_query( &$query ) {\n\tglobal $typenow, $wp_query;\n\n\tif ( 'product' == $typenow ) {\n\t\tif ( isset( $_GET['allow_backorders_filter'] ) && ! empty ( $_GET['allow_backorders_filter'] ) ) {\n\t\t\t$backorders = array(\n 'key' => '_backorders',\n 'value' => $_GET['allow_backorders_filter'],\n 'compare' => '='\n );\n\t\t\t\n\t\t\t$meta_query_array[] = $backorders;\n\t\t\t//$query->query_vars['meta_value'] = $_GET['allow_backorders_filter'];\n\t\t\t//$query->query_vars['meta_key'] = '_backorders';\n\t\t}\n\t\t\n\t\tif ( isset( $_GET['price_filter'] ) && ! empty ( $_GET['price_filter'] ) ) {\n\t\t\t\n\t\t\tif ( $_GET['price_filter'] == 'member-price' )\n\t\t\t\t$prices = array(\n\t\t\t\t\t'key' => 'member_price',\n\t\t\t\t\t'value' => 0,\n\t\t\t\t\t'compare' => '>'\n\t\t\t\t);\n\t\t\telseif ( $_GET['price_filter'] == 'sale-price' )\n\t\t\t\t$prices = array(\n\t\t\t\t\t'key' => '_sale_price',\n\t\t\t\t\t'value' => 0,\n\t\t\t\t\t'compare' => '>'\n\t\t\t\t);\n\t\t\t\n\t\t\t$meta_query_array[] = $prices;\n\t\t\t//$query->query_vars['meta_value'] = $_GET['allow_backorders_filter'];\n\t\t\t//$query->query_vars['meta_key'] = '_backorders';\n\t\t}\n\t\t\n\t\tif (!empty($meta_query_array))\n\t\t\t$query->query_vars['meta_query'] = $meta_query_array;\n\t}\n}", "public function getUserFilters()\n {\n $filters = ItemFilterModel::model()->find('play_id = :playId', array(\n ':playId' => $this->playid\n ));\n\n return $filters;\n }", "public function getElasticaFilters()\n {\n return $this->elasticaFilters;\n }" ]
[ "0.8039647", "0.7357673", "0.73423076", "0.702183", "0.69961786", "0.6967614", "0.69666815", "0.6953517", "0.6932206", "0.6922349", "0.6907537", "0.68912137", "0.68902403", "0.6856241", "0.6856241", "0.6856241", "0.6856241", "0.6856241", "0.6856241", "0.6856241", "0.6856241", "0.6856241", "0.6838253", "0.67858535", "0.67848724", "0.6776146", "0.676954", "0.6760727", "0.6756329", "0.6756302", "0.6756302", "0.6722821", "0.67217505", "0.6702352", "0.6699375", "0.66612786", "0.66596615", "0.66492516", "0.6603403", "0.6603173", "0.65706813", "0.6550629", "0.6547978", "0.652637", "0.6515623", "0.6511369", "0.650803", "0.65039486", "0.6493625", "0.64616936", "0.6441709", "0.6435231", "0.6431388", "0.6423375", "0.6408079", "0.6407589", "0.64073974", "0.63999444", "0.6389226", "0.63860226", "0.6372344", "0.63638604", "0.6359412", "0.6347403", "0.6342325", "0.6329244", "0.6329244", "0.6326265", "0.6316845", "0.630444", "0.6281288", "0.62745506", "0.6262456", "0.62582225", "0.62474227", "0.6238304", "0.62375134", "0.62374604", "0.62355715", "0.6233867", "0.6232846", "0.62237227", "0.62132627", "0.62094736", "0.6203646", "0.62020904", "0.6193494", "0.6193284", "0.6192834", "0.61803156", "0.6173196", "0.61543036", "0.61488545", "0.6137741", "0.6129023", "0.61266625", "0.6111695", "0.61064005", "0.6104308", "0.6103653", "0.6101339" ]
0.0
-1
/////////////////////////////////////////////////////////////////////// Get products from category
public static function getCategoryProducts($category_id, $products_per_page = 9, $curr_page = 1) { $params = array(); $params['cid'] = $category_id; $params['extend'] = array('categories'); $params['page'] = $curr_page; list($products, $search) = fn_get_products($params, $products_per_page); return $products; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProductsByCategory()\n\t{\n\t\tglobal $con;\n\t\tif (isset($_GET['cat'])){\n\t\t\t$cat_id = $_GET['cat'];\n\t\t\t$get_products = \"select * from products where prod_cat='$cat_id'\";\n\t\t\t$run_products = mysqli_query($con, $get_products);\n\t\t\t$count = mysqli_num_rows($run_products);\n\t\t\t\n\t\t\tif ($count == 0)\n\t\t\t\techo \"<h2>No Products in this category</h2>\";\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\techo \"\n\t\t\t\t<div class='single_product'>\n\t\t\t\t\t<h3>$prod_title</h3>\n\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t}\n\t}", "function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public function getProducts($category) {\n $sql = \"SELECT * FROM products INNER JOIN categories on products.product_CategoryID = categories.category_ID WHERE category_Name = '\".$category.\"'\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"products\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"product_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"product_Name\"] . '\",' .\n '\"Category\": \"' . $row[\"category_Name\"] . '\",' .\n '\"Price\": \"' . $row[\"product_Price\"] . '\",' .\n '\"Brand\": \"' . $row[\"product_Brand\"] . '\",' .\n '\"Description\": \"' . $row[\"product_Description\"] . '\",' .\n '\"ImagePath\": \"' . $row[\"product_ImagePath\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Return the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n }", "function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}", "public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }", "public function getProductsByCategory($category){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ProductoDAO -> getProductsByCategory($category));\n $resList = array();\n while($res = $this -> Conexion -> extraer()){\n array_push($resList, new Producto($res[0], $res[1], $res[2], \"\", $res[3]));\n }\n $this -> Conexion -> cerrar();\n return $resList;\n }", "public function getProductsByCategory($id){ \n $products = Product::where('category_id',$id)->get(); \n return $products;\n }", "function getProductsByCategory($categoryId){ \n $db = acmeConnect(); \n $sql = 'SELECT * FROM inventory WHERE categoryId = :categoryId'; \n $stmt = $db->prepare($sql); \n $stmt->bindValue(':categoryId', $categoryId, PDO::PARAM_INT); \n $stmt->execute(); \n $products = $stmt->fetchAll(PDO::FETCH_ASSOC); \n $stmt->closeCursor(); \n return $products; \n }", "public function product_get_by_category($data)\n {\n $queryColumn = \"DESCRIBE \" . $this->db_table_prefix . \"products\";\n $resultColumn = $this->commonDatabaseAction($queryColumn);\n $resultColumn = $this->resultArray($resultColumn);\n $columns = php_array_column($resultColumn, 'Field');\n \n $query = \"SELECT p.*, c.name as catName\n \t FROM \" . $this->db_table_prefix . \"products p\n JOIN \" . $this->db_table_prefix . \"categories c\n ON p.cat_id = c.id \";\n \n if (!empty($data))\n {\n $query .= 'WHERE 1';\n foreach ($data as $key => $value)\n {\n $pos = strpos($key, '.');\n $columnArray = ($pos) ? explode('.', $key) : ''; \n $columnName = (!empty($columnArray)) ? $columnArray[1] : $key ;\n \n if (in_array($columnName, $columns))\n {\n $query .= ' AND ' . $key . ' = ' . $value;\n }\n }\n }\n $query .= \" ORDER BY p.id DESC\";\n\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }", "protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }", "public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }", "function getProductByCategorySearch($category_id, $keyword){\r\n\t\t$unix_product = array();\r\n\t\t//$has_printed = false;\r\n\t\t$total_product_1 = 0;\r\n\t\t$total_product_2 = 0;\r\n\t\t$keyword=strtolower($keyword);\r\n\t\t\r\n\t\tif($category_id!=0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category WHERE parent_id=\".$category_id);\t\r\n\t\t}\r\n\t\telseif($category_id==0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category\");\t\r\n\t\t}\r\n\t\twhile($rc=mysql_fetch_array($q_category)){\r\n\t\t\t$cat_id = $rc['category_id'];\r\n\t\t\t//if($category_id!=0){\r\n\t\t\t$q_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$cat_id.\" AND lower(D.name) LIKE '%$keyword%'\");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$total_product_1 = mysql_num_rows($q_product_id);\t\t\t\t\t\t\t\t\t\r\n\t\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t\t$product = new product($product_id);\r\n\t\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\t\techo '<div class=\"item\">';\r\n\t\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'_'.$total_product_1.'</div>';\r\n\t\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\t\techo '</a>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\t}\r\n\t\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Search Child Category\r\n\t\t$q_child_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$category_id.\" AND lower(D.name) LIKE '%$keyword%'\");\r\n\t\t$total_product_2 = mysql_num_rows($q_child_product_id);\r\n\t\twhile($rp=mysql_fetch_array($q_child_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().$total_product_2.'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t\t}\r\n\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t}\r\n\t\t//Info if Search No Result \r\n\t\t/*\r\n\t\tif($total_product_1==0 && $total_product_2==0){\r\n\t\t\techo '<div class=\"no_item\" style=\"height:200px;padding: 10px 10px 10px 20px; color: #CCC; font-size: 20px;\">';\r\n\t\t\t\techo 'No Result! RUn'.$total_product_1.'_'.$total_product_2;\r\n\t\t\t\t//echo ':)'.$rLanguage->text(\"Logout\");\t\r\n\t\t\techo '</div>';\r\n\t\t}\r\n\t\t*/\r\n\t}", "function get_ProductsBy_CatID($data) {\r\n $params[0] = array(\"name\" => \":category_id\", \"value\" => &$data['category_id']);\r\n $params[1] = array(\"name\" => \":prodType\", \"value\" => &$data['prodType']);\r\n return $this->DBObject->readCursor(\"product_actions.get_ProductsBy_CatID(:category_id,:prodType)\", $params);\r\n }", "public function getByCategory($category)\n {\n $products = $this->db->query('SELECT DISTINCT p.*' . $this->joinSql . ' WHERE c.name = ?;', $category->name, '\\LRC\\Webshop\\Product');\n foreach ($products as $product) {\n $product->categoryIds = $this->getCategories($product, true);\n }\n return $products;\n }", "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function getProductsByCategory ($category_id) {\n\t\t\n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n \n\t\ttry {\n \n\t\t\t/*\n $query = \"SELECT ea_product.id, ea_product.upc, ea_product.brand, ea_product.product_name, ea_product.product_description, ea_product.avg_price, ea_image.file\n\t\t\tFROM ea_product LEFT JOIN ea_image\n ON ea_product.upc = ea_image.upc\n WHERE ea_product.category_id = '$category_id'\n\t\t\tORDER BY ea_product.avg_price\";\n */\n \n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n\t\t\tFROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND category_id = '$category_id'\n\t\t\tORDER BY avg_price\";\n //print(\"$query\");\n\t\t\tforeach($this->dbo->query($query) as $row) {\n\t\t\t\t$id = stripslashes($row[0]);\n\t\t\t\t$upc = strval(stripslashes($row[1]));\n\t\t\t\t$brand = $this->convertFancyQuotes(stripslashes($row[2]));\n\t\t\t\t$product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n\t\t\t\t$product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n\t\t\t\t$avg_price = stripslashes($row[5]);\n\t\t\t\t$category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n \n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n \n $product[\"image_path\"] = $this->getImagePath($upc);\n \n $products[] = $product;\n\t\t\t}\n\t\n\t\t} catch (PDOException $e) {\n\t\t\t$this->errorCode = 1;\n\t\t\t$errorCode = -1;\n\t\t\t$errorMessage = \"PDOException for getProductsByCategory.\";\n\t\t}\t\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $category_name;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n\t}", "public function GetProductsByCategory($category_id) {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\n WHERE categoryID = :category_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':category_id' => $category_id,\n ]);\n }", "public function getProductByCat($catid){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE catId = '$catid' \";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "function productByCategory($id)\n {\n \t\n }", "public function getProductsByCategoryId($id){\r\n\t\treturn $this->query(\"SELECT * FROM beer WHERE FK_categoryID = '$id'\");\r\n\t}", "public function productByCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsByCategory($category);\n $this->view->render('Riding Gear', $vars);\n }", "function getProductsbyCategory($CatId){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT id, name, description, price, stock, img_src \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock`>0 AND `category_id`=?\");\n\t\t$sth \t-> execute(array($CatId));\n\t\t\n\t\treturn \t$sth;\n\t}", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function getProducts()\n {\n\n $categories = ProductCategory::all();\n\n $products = Product::paginate(10);\n return $products;\n }", "function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function getCategory()\n\t\t{\n\t\t\t$sql = \"SELECT id_category,name_cate FROM tbl_category_products\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\t\t\t$pre->execute();\n\n\t\t\treturn $pre->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "function getProductByCategoryPath($path){\r\n\t\t$q_product_id=getResultSet(\"SELECT product_id FROM \".DB_PREFIX.\"product_to_category WHERE category_id=\".$path);\r\n\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\t\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t}\t\t\r\n\t}", "function getProductsByCat($catId) {\r\n $catId = intval($catId);\r\n $sql = \"SELECT * FROM products WHERE category_id = '{$catId}'\";\r\n\r\n include '../config/db.php';\r\n\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}", "function get_products() {\n\t\tApp::Import('model', 'Product');\n\t\t$this->Product = &new Product;\n\n\t\t$products = $this->Product->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t\"Product.short_description != ''\",\n\t\t\t\t'Availability.cart_allowed' => true,\n\t\t\t\t'Product.active' => true\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'TaxClass' => array(\n\t\t\t\t\t'fields' => array('id', 'value')\n\t\t\t\t),\n\t\t\t\t'Image' => array(\n\t\t\t\t\t'conditions' => array('Image.is_main' => '1'),\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'Manufacturer' => array(\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'CategoriesProduct' => array(\n\t\t\t\t\t'Category' => array(\n\t\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'Availability' => array(\n\t\t\t\t\t'fields' => array('id', 'cart_allowed')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'Product.id',\n\t\t\t\t'Product.name',\n\t\t\t\t'Product.short_description',\n\t\t\t\t'Product.url',\n\t\t\t\t'Product.retail_price_with_dph',\n\t\t\t\t'Product.ean',\n\t\t\t\t'Product.zbozi_name',\n\t\t\t\t'Product.heureka_name',\n\t\t\t\t'Product.discount_common',\n\t\t\t\t'Product.zbozi_cpc',\n\t\t\t\t'Product.heureka_cpc'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$products = array_filter($products, array('ExportsController', 'empty_category'));\n\t\t\n\t\tforeach ($products as $i => $product) {\n\t\t\t$products[$i]['Product']['retail_price_with_dph'] = $this->Product->assign_discount_price($products[$i]);\n\t\t\t$products[$i]['Product']['name'] = str_replace('&times;', 'x', $products[$i]['Product']['name']);\n\t\t\t$products[$i]['Product']['short_description'] = str_replace('&times;', 'x', $products[$i]['Product']['short_description']);\n\t\t}\n\n\t\treturn $products;\n\t}", "public function getProductsByCategory(String $category){\n\t\t// get the products\n\t\t$products = $this->getProducts();\n\n\t\t$categoryProducts = [];\n\n\t\t// exctract the products that belong to the category\n\t\tforeach ($products as $key => $product) {\n\t\t\tif($product['name_category'] == $category){\n\t\t\t\tarray_push($categoryProducts, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $categoryProducts;\n\t}", "public static function loadProductsByCatId($p_catId)\n {\n $ret = array();\n\n $sql = \"select * from products where CatID = $p_catId\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n //$catId = $row[\"CatID\"];\n $catId = $p_catId;\n $classify = $row[\"Classify\"];\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n array_push($ret, $p);\n }\n\n return $ret;\n }", "public function get_category_products($cat_id){\n\t\t$data = array();\n\t\tif ($stmt = $this->Database->prepare(\"SELECT product_id, product_name, product_body, product_price, total_product, product_image, product_type FROM \" . $this->db_table . \" WHERE cat_id = ?\")) {\n\t\t\t$stmt->bind_param(\"i\", $cat_id);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->bind_result($product_id, $product_name, $product_body, $product_price, $total_product, $product_image, $product_type);\n\t\t\t//$stmt->fetch_array();\n\n\t\t\twhile ($stmt->fetch())\n\t\t\t{\n\t\t\t\t$data[] = array(\n\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t'product_name' => $product_name,\n\t\t\t\t\t'product_body' => $product_body,\n\t\t\t\t\t'product_price' => $product_price,\n\t\t\t\t\t'total_product' => $total_product,\n\t\t\t\t\t'product_image' => $product_image,\n\t\t\t\t\t'product_type' => $product_type\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$stmt->close();\n\t\t}\n\n\t\treturn $data;\n\t}", "function getProducts()\n {\n $ret = array();\n foreach ($this->getItems() as $item)\n if ($item->item_type == 'product')\n if ($pr = $item->tryLoadProduct())\n $ret[] = $pr;\n return $ret;\n }", "function listProductsByCategory($category) {\r\n\t\t$query = \"SELECT * FROM \".TBL_PRODUCTS.\" WHERE category = :category AND available = '1' AND stock > 0\";\r\n\t\t$stmt = $this->connection->prepare($query);\r\n\t\t$stmt->execute(array(':category' => $category));\r\n\t\t$dbarray = $stmt->fetchAll();\r\n\t\t$count = $stmt->rowCount();\r\n\t\tif(!$dbarray || $count < 1){\r\n\t\t\treturn false; // failure\r\n\t\t} else {\r\n\t\t\treturn $dbarray; // success\r\n\t\t}\r\n\t}", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function get()\n {\n $products = $this->productRepository->all();\n foreach($products as $product) {\n\n $product->category = $this->categoryRepository->find($product->category_id)->title;\n $product->section_id = $this->categoryRepository->find($product->category_id)->section_id;\n $product->section = $this->sectionRepository->find($product->section_id)->title;\n }\n return $products;\n\n }", "public function getProducts()\n {\n return $this->hasMany(Product::className(), ['category_id' => 'id']);\n }", "public function get_product_by_cat($prod_id = '', $order_by = '', $limit = '', $offset = ''){\n\t\tif($prod_id !== '' && $limit===''){\n\t\t\t// getting specific tutorial if tutorial id is passed in parameter\n\t\t\t$query = $this->db->get_where('product', array('category' => $prod_id));\n\t\t\treturn $query->result();\n\t\t}\n\n\t\tif($order_by !== ''){\n\t\t\t// getting all tutorials ordered by count in descending order\n\t\t\t$query = $this->db->get('product');\n\t\t\t$this->db->order_by($order_by, 'DESC');\n\t\t\treturn $query->result();\n\t\t}\n\t\tif($prod_id !== '' && $limit !== ''){\t\n\t\t$this->db->order_by('visits', 'DESC');\n\t\t\t$query = $this->db->limit($limit, $offset)\n\t\t\t\t\t\t\t ->get_where('product', array('category' => $prod_id));\n\t\t\treturn $query->result();\n\t\t}\n\t}", "function getProductCategories () {\r\n $sql = \"SELECT * FROM stockgroups\";\r\n return runQuery($sql);\r\n}", "function getProducts()\n\t{\n\t\tglobal $con;\n\t\tif (!isset($_GET['cat'])){\n\t\t\tif (!isset($_GET['brand'])) {\n\t\t\t\t$get_products = \"select * from products order by RAND() LIMIT 0, 6\";\n\t\t\t\t$run_products = mysqli_query($con, $get_products);\n\n\t\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\t\techo \"\n\t\t\t\t\t<div class='single_product'>\n\t\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t\t<div class='item_det'>\n\t\t\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function category_products_get($cat = 0, $limit = 0)\n\t{\n \n if(!empty($cat)){\n if(!empty($limit)){\n //$data = $this->db->get_where(\"products\", ['id' => $id])->row_array();\n $this->db->select('a.*');\n $this->db->from('products a');\n $this->db->where('a.cat_id', $cat);\n $this->db->order_by('a.id', 'DESC');\n $this->db->limit($limit);\n $query = $this->db->get();\n $data = $query->result();\n } else {\n //$data = $this->db->get_where(\"products\", ['id' => $id])->row_array();\n $this->db->select('a.*');\n $this->db->from('products a');\n $this->db->where('a.cat_id', $cat);\n $this->db->order_by('a.id', 'DESC');\n $query = $this->db->get();\n $data = $query->result();\n }\n $this->response($data, REST_Controller::HTTP_OK);\n }else{\n $this->response(\"Please provide a category id.\", REST_Controller::HTTP_BAD_REQUEST);\n }\n \n }", "function particularproductlist($id)\n\t{\n\t\t$getParproduct=\"SELECT * from product_category where ptdcatgry_id = $id\";\n\t\t$product_data=$this->get_results( $getParproduct );\n\t\treturn $product_data;\n\t}", "public function getProductsByCategory($slug){\n $category = Category::where(['url'=> $slug, 'status' => 1])->first();\n \n if($category){\n // Show parent category\n if($category->parent_id != 0){\n $parent_categories = Category::with('categories')->where('id', $category->parent_id)->get();\n }else{\n $parent_categories = [$category];\n }\n \n // Show products by category_id\n $products = Product::where('category_id', $category->id)->where('status', 1)->orderBy('id', 'DESC')->paginate(8);\n\n return view('frontend.products_by_category')->withCategory($category)->withProducts($products)->withParentCategories($parent_categories);\n }\n return abort(404, 'Unauthorized action.');\n }", "public function testGetProductsListByCategory()\n\t{\n\t\t/**\n\t\t * @var shopModel $shopModel\n\t\t */\n\t\t$shopModel = getModel('shop');\n\n\t\t$product_repository = $shopModel->getProductRepository();\n\n\t\t$args = new stdClass();\n\t\t$args->module_srl = 104;\n\t\t$args->category_srls = array(self::CATEGORY_TSHIRTS);\n\t\t$output = $product_repository->getProductList($args);\n\n\t\t$products = $output->products;\n\t\t$this->assertEquals(1, count($products));\n\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$this->assertNull($product->parent_product_srl);\n\n\t\t\t$this->assertTrue($product->isConfigurable());\n\t\t\t$this->assertTrue(is_a($product, 'ConfigurableProduct'));\n\n\t\t\t$this->assertEquals(6, count($product->associated_products));\n\n\t\t\tforeach($product->associated_products as $associated_product)\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($associated_product, 'SimpleProduct'));\n\t\t\t}\n\t\t}\n\n\t}", "function getKidsGirlCategoryProducts($cat_id,$limit,$start)\n\t\t\t\t{\n\t\t\t\t$otherconditions='';\n\t\t\t\tif(!isset($_SESSION['orderby'])) $_SESSION['orderby']='product_id';\n\t\t\t\tif(isset($_SESSION['filter'])) $otherconditions=$_SESSION['filter'];\t\t\t\t\n\t\t\t\t$sql=\"SELECT product. * , product_people.people_cat_id,brand.brand_name, color.color_name, product_type.type_name FROM product\n\n\t\t\t\tINNER JOIN product_type ON product.product_type_id = product_type.product_type_id\n\t\t\t\tINNER JOIN product_color ON product.product_id = product_color.product_id \n\t\t\t\tINNER JOIN color ON product_color.color_id = color.color_id\n\t\t\t\tINNER JOIN brand ON product.brand_id = brand.brand_id\n\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\tWHERE product_people.people_cat_id = '4'\n\t\t\t\tAND product.product_type_id= \".$cat_id.\" \".$otherconditions.\" ORDER BY \".$_SESSION['orderby'].\" DESC LIMIT \".$start.\",\".$limit;\n\t\t\t\t$result = $this->db->query($sql);\n\t\t\t\tif($result->num_rows()>0){\n\t\t\t\t$_SESSION['product_count']=$result->num_rows();\n\t\t\t\treturn $result->result();\n\t\t\t\t}else{\n\t\t\t\treturn 'empty';\n\t\t\t\t}\n\t\t\t\t}", "public function index()\n {\n return ProductResource::collection(Product::with('categories')->get());\n }", "public function fetch_products_by_cat($id) {\n $this->db->select('product.id,product.name,product.price,product.status,product_categories.product_id,product_categories.category_id,(SELECT product_images.image_name FROM product_images WHERE product_images.product_id = product.id ORDER BY id ASC LIMIT 1) AS pr_img');\n $this->db->from('product');\n $this->db->join('product_categories', 'product_categories.product_id = product.id');\n $this->db->where('product_categories.category_id', $id);\n $r = $this->db->get();\n return $r->result_array();\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "function getProductsBySubCategori($id) {\r\n \r\n $db = new SQL_Conect_PDO(); \r\n $sql = \"SELECT * FROM `products` WHERE `Id_sub_categories` = :Id \"\r\n . \"ORDER BY `Name` ASC \";\r\n \r\n $ArrPars['Id'] = $id; \r\n\r\n $db->SetQuery($sql, $ArrPars); \r\n $res = $db->GetQueryAll_Class(\"Product\");\r\n \r\n return $res;\r\n }", "public function productBySubCategoryAction()\n {\n $category = $this->route['category'];\n $vars['products'] = $this->model->getProductsBySubCategory($category);\n $this->view->render('Riding Gear', $vars);\n }", "public function readProductosCategoria(){\n $sql='SELECT nomCategoria, idProducto, producto.foto, nombre, producto.descripcion,precio FROM producto INNER JOIN categoria USING (idCategoria) WHERE idCategoria = ? AND producto.estado=1 AND producto.estadoEliminacion=1';\n $params=array($this->categoria);\n return Database::getRows($sql, $params);\n }", "public function getProducts (){\n\t\t$cache = Zend_Registry::get('cache');\n\t\t// see if product - list is already in cache\n\t\tif(!$productArray = $cache->load('productsByManufacturerId'.$this->id)) {\n\t\t\t$productTable = Website_Model_CbFactory::factory('Website_Model_MysqlTable', 'product');\n\t\t\t$products = $productTable->fetchAll('manufacturer='.$this->id);\n\t\t\tforeach($products as $product){\n\t\t\t\t$productArray[] = Website_Model_CbFactory::factory('Website_Model_Product',$product->id);\n\t\t\t}\n\t\t\t$cache->save($productArray,'productsByManufacturerId'.$this->id,array('model'));\n\t\t}\n\t\treturn $productArray;\n\t}", "protected function export_categoryless_products()\n {\n $table = $this->getTableName(\"catalog_product_entity\");\n $categoryProductsTable = $this->getTableName(\"catalog_category_product\");\n $catalogProductWebsite = $this->getTableName(\"catalog_product_website\");\n $rootCategoryId = $this->_fStore->getRootCategoryId();\n $sql = \"SELECT DISTINCT(entity_id), type_id, sku FROM {$table}\n LEFT JOIN (`{$categoryProductsTable}`) ON ({$table}.`entity_id` = `{$categoryProductsTable}`.`product_id`)\n LEFT JOIN (`{$catalogProductWebsite}`) ON ({$table}.`entity_id` = `{$catalogProductWebsite}`.`product_id`)\n WHERE (`{$categoryProductsTable}`.`product_id` IS NULL OR `{$categoryProductsTable}`.`category_id` NOT IN ({$this->_getCategoriesForStore()}))\n AND {$table}.entity_type_id = {$this->_product_entity_type_id}\n AND `{$catalogProductWebsite}`.`website_id` = \" . $this->getWebsiteId($this->_fStore_id); \n \n return $this->export_products($sql, 'categoryless_products');\n }", "private function getProducts() {\n\n $products = [];\n\n $args = array(\n 'post_type' => 'product'\n );\n $loop = new WP_Query( $args );\n if ( $loop->have_posts() ) {\n while ( $loop->have_posts() ) :\n $loop->the_post();\n $product = new Product();\n $product->setTitle(get_the_title());\n $product->setId(get_the_ID());\n $products[] = $product;\n endwhile;\n }\n wp_reset_postdata();\n\n return $products;\n }", "public function index()\n {\n return ProductCategoryResource::collection(ProductCategory::all());\n }", "public function getCatalogoCategory($category) {\n $cat = Category::findOrFail($category);\n $prods = $cat->productTypes->pluck('id');\n $products = ProductType::whereIn('id', $prods)->paginate(8);\n\n // Manipolazione dei prodotti !!!\n $products->map(function ($product) {\n\n });;\n\n return view('frontoffice.pages.shop', ['products' => $products, 'parent' => $cat]);\n }", "public function getAssignedProducts($categoryId);", "public function getCategoriaProductos(){\n\t\t$sql = \"SELECT marca.marca, productos.id_producto, productos.nombre, productos.precio, productos.precio_total, productos.url_imagen, presentaciones.presentacion, proveedores.proveedor, marca.marca, tipo_producto.tipo_producto \n\t\tFROM productos \n\t\tINNER JOIN marca ON productos.id_marca = marca.id_marca \n\t\tINNER JOIN presentaciones ON productos.id_presentacion = presentaciones.id_presentacion \n\t\tINNER JOIN proveedores ON productos.id_proveedor = proveedores.id_proveedor \n\t\tINNER JOIN tipo_producto ON productos.id_tipo_producto = tipo_producto.id_tipo_producto \n\t\tWHERE productos.id_marca = ? AND productos.id_estado = 1 AND proveedores.id_estado = 3\";\n\t\t$params = array($this->id_marca);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function getProductCollectionFromCategoryBottom() {\n $categoryId = $this->getCurrentcat();\n $not_in_array_left = $this->getProductCollectionFromFourRow();\n $not_in_array_right = $this->getProductCollectionFromThreeRow();\n $not_in_array_parent = $this->getProductId();\n $custom_array = array(2202,2354,2161);\n $not_in_array = array_merge($not_in_array_left, $not_in_array_right,$not_in_array_parent,$custom_array);\n $category = $this->categoryFactory->create()->load($categoryId);\n\t $collection = $category->getProductCollection()->addAttributeToSelect('*')\n\t ->addAttributeToFilter('type_id', array('eq' => 'grouped'))\n ->addAttributeToFilter('status',\\Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Status::STATUS_ENABLED)->setPageSize(20)\n ->addAttributeToFilter('entity_id', array('nin' => $not_in_array));\n return $collection;\n \n \t}", "public function getproducts($method,$category,$string=false,$limit=false,$page=false,$sorting=false,$sortvalue=false,$token=false) \n\t{\n\t\n\t\t$min \t= 0;\n\t\t$max \t= 0;\n\t\t$pages = 0;\n\t\t\n\t\t$postsearch \t= false;\n\t\t$searchresults \t= [];\n\t\t$pricebars \t\t= [];\n\t\n\t\tisset($string) ? $this->textstring = $string : $this->textstring = false;\n\t\tisset($category) ? $this->category = $this->revSeo($category) : $this->category = false;\n\t\tisset($this->pageid) ? $this->page_id = (int)$this->pageid : $this->page_id = 1;\t\n\t\tisset($this->cat) ? $this->product_cat = $this->revSeo($this->cat) : $this->product_cat = $this->category;\n\t\tisset($this->subcat) ? $this->product_subcat = $this->revSeo($this->subcat) : $this->product_subcat = false;\t\n\t\t\n\t\tif(isset($_SESSION['token'])) {\n\t\t\t$token = $_SESSION['token'];\n\t\t} else {\n\t\t\t$token = $cryptography->getToken();\n\t\t\t$_SESSION['token'] = $token;\n\t\t}\n\t\n\t\t$hostaddr = $this->getbase();\n\t\t\n\t\t// Loading the shop configuration.\n\t\t$shopconf = $this->json->load_json(self::INVENTORY_PATH . self::SHOPCONF);\n\t\t$configuration = [];\n\t\t\n\t\tif($shopconf !== null) {\n\t\t\tforeach($shopconf as $conf) {\t\n\t\t\t\tarray_push($configuration,$conf);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Logic for pagination on products.\n\t\tif($limit == false) {\n\t\t\t$siteconf \t= $this->json->load_json(self::INVENTORY_PATH . self::SITECONF);\n\t\t\t$result \t= $this->getasetting($siteconf,'site.maxproducts.visible.in.cat');\n\t\t\t$limit \t\t= (int) $result;\n\t\t\t$limit_products = $limit;\n\t\t\t} else {\n\t\t\t$limit_products = $limit;\n\t\t}\n\t\t\n\t\tif($page != false) {\n\t\t\t$page_products = $page;\n\t\t\t} else {\n\t\t\t$page_products = 1;\n\t\t}\n\t\t\n\t\t$productlist = $this->json->decode();\t\n\n\t\t$activelist = [];\n\n\t\tfor($i = 0; $i < count($productlist); $i++) {\t\n\t\t\tif($productlist[$i]['product.status'] == 1) {\n\t\t\t\tarray_push($activelist,$productlist[$i]);\n\t\t\t}\n\t\t}\n\n\t\t$productlist = array_reverse($activelist);\n\n\t\t// rows function\n\t\t\n\t\tif($method == 'rows') {\n\t\t\t\n\t\t\t$products = array();\n\t\t\t\n\t\t\tfor($i = 0; $i < count($productlist); $i++) {\t\n\t\t\t\n\t\t\t\t$ts = $productlist;\n\t\t\t\t\n\t\t\t\t\t$key = [];\n\t\t\t\t\tarray_push($key,($i+1));\n\t\t\t\t\tarray_push($key,$this->sanitizer->maxstring($this->sanitizer->cleaninput($productlist[$i]['product.id']),10,false));\n\t\t\t\t\tarray_push($key,$this->sanitizer->maxstring($this->sanitizer->cleaninput($productlist[$i]['product.title']),10,false));\n\t\t\t\t\tarray_push($key,$this->sanitizer->maxstring($this->sanitizer->cleaninput($productlist[$i]['product.description']),30,true));\n\t\t\t\t\tarray_push($key,$this->sanitizer->cleaninput($productlist[$i]['product.category']));\n\t\t\t\t\tarray_push($key,$this->getsitecurrency(self::INVENTORY_PATH . self::SITECONF,self::INVENTORY_PATH . self::CURRENCIES).' '.$this->sanitizer->cleaninput($productlist[$i]['product.price']));\n\t\t\t\t\tarray_push($key,$this->sanitizer->cleaninput($productlist[$i]['product.stock']));\n\t\t\t\t\tarray_push($products,$key);\n\t\t\t}\n\t\t\t\n\t\t\treturn $products;\n\t\t}\n\n\t\t// refine function.\n\t\t\n\t\tif($method == 'refine') {\n\t\t\t\n\t\t\tif(!isset($this->refinekey)) {\n\t\t\t\t$query = 'tag';\n\t\t\t\t} else {\n\t\t\t\t$query = $this->refinekey;\n\t\t\t}\n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t\t\n\t\t\t\t\t$var1 = $this->sanitizer->cleaninput($c['variant.title1']); \n\t\t\t\t\t$var2 = $this->sanitizer->cleaninput($c['variant.title2']);\n\t\t\t\t\t$var3 = $this->sanitizer->cleaninput($c['variant.title3']);\n\t\t\t\t\t$find = $this->sanitizer->sanitize($query,'search');\n\t\t\t\t\tif(is_array($find)) {\n\t\t\t\t\t\t$find \t= implode(',',$find);\n\t\t\t\t\t}\n\t\t\t\t\tif(strlen($find) >=3) { \n\t\t\t\t\t\tif(stristr($var1,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($var2,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($var3,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {}\t\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$productlist = $searchresults;\n\t\t\t$method = 'list';\n\t\t\t$postsearch = true;\n\t\t}\n\t\t\n\t\t// end refine\n\t\t\n\t\t// search function.\n\t\t\n\t\tif($method == 'search') {\n\t\t\t\n\t\t\tif(!isset($this->searchkey)) {\n\t\t\t\t$query = 'tag';\n\t\t\t\t} else {\n\t\t\t\t$query = $this->searchkey;\n\t\t\t}\n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t\t\n\t\t\t\t\t$title = $this->sanitizer->cleaninput($c['product.title']); \n\t\t\t\t\t$desc = $this->sanitizer->cleaninput($c['product.description']);\n\t\t\t\t\t$tags = $this->sanitizer->cleaninput($c['product.tags']);\n\t\t\t\t\t$find = $this->sanitizer->sanitize($query,'search');\n\t\t\t\n\t\t\t\t\tif(strlen($find) >=3) { \n\t\t\t\t\t\tif(stristr($title,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($desc,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif(stristr($tags,$find)) {\n\t\t\t\t\t\t\tif($c['product.id'] != \"\") {\n\t\t\t\t\t\t\t\tif(!in_array($c,$searchresults)) {\n\t\t\t\t\t\t\t\t\tarray_push($searchresults,$c);\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {}\t\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$productlist = $searchresults;\n\t\t\t$method = 'list';\n\t\t\t$postsearch = true;\n\t\t}\n\t\t\n\t\t// end search\n\t\t\n\t\t// pricebar\n\t\tif($method == 'pricebar') {\n\t\t\t\n\t\t\tif(!isset($this->maxprice)) {\n\t\t\t\t$maxprice = self::MAXINT;\n\t\t\t\t} else {\n\t\t\t\t$maxprice = (int)$this->maxprice;\n\t\t\t}\n\t\t\t\n\t\t\tif(!isset($this->minprice)) {\n\t\t\t\t$minprice = 1;\n\t\t\t\t} else {\n\t\t\t\t$minprice = $this->sanitizer->sanitize((int)$this->minprice,'num');\n\t\t\t}\n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t$productprice = $this->sanitizer->cleaninput($c['product.price']); \n\t\n\t\t\t\tif($c['product.price'] != \"\") {\n\t\t\t\t\tif(($productprice >= $minprice) && ($productprice <= $maxprice)) {\n\t\t\t\t\t\tif(!in_array($c,$pricebars)) {\n\t\t\t\t\t\t\tarray_push($pricebars,$c);\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t} \t\n\t\t\t}\n\t\t\t\n\t\t\t$productlist = $pricebars;\n\t\t\t$method = 'list';\t\n\t\t\t$postsearch = true;\n\t\t}\n\t\t// end pricebar\n\t\t\n\t\tif($productlist !== null) {\n\t\t\t$amount_products = count($productlist);\n\t\t\t} else {\n\t\t\t$amount_products = 0;\n\t\t}\n\n\t\tif($amount_products < 1) {\n\t\t\t\techo 'There are not enough products to view.';\n\t\t}\n\t\t\t\n\t\t// build pagination for product page.\n\t\tif($amount_products >= 1) {\n\n\t\t\t$pagination = true;\n\t\t\t\n\t\t\tif(isset($this->page)) {\n\t\t\t\t$page_products = (int)$this->page;\n\t\t\t\t} else {\n\t\t\t\t$page_products = 1;\n\t\t\t}\n\t\t \n\t\t\tif($amount_products < 1) {\n\t\t\t\techo 'There are not enough products to view.';\n\t\t\t\t// exit;\n\t\t\t}\n\n\t\t\tif($limit_products >= 500) {\n\t\t\t\techo 'There are too many products to view. Please edit the appropiate max product value setting in site.json.';\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($limit_products <= 1) {\n\t\t\t\t$limit_products = 10;\n\t\t\t}\n\n\t\t\tif($page_products < 1) {\n\t\t\t\t$page_products = 1;\n\t\t\t}\n\t\t\t\n\t\t\t// todo: fix bug on limit ~ amount\n\t\t\tif($limit_products > $amount_products) {\n\t\t\t\t$limit_products = $amount_products;\n\t\t\t}\n\t\t\t\n\t\t\t$pages = round($amount_products / $limit_products);\n\t\t\t\n\t\t\tif($page_products == 1) {\n\t\t\t\t$min = 0;\n\t\t\t\t$max = $limit_products;\n\t\t\t}\n\t\t\t\n\t\t\tif($page_products > 1) {\n\t\t\t\t$min = (($page_products -1) * $limit_products);\n\t\t\t\t$max = ($page_products * $limit_products);\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($max > $amount_products) {\n\t\t\t\t$min = ($amount_products - $limit_products); \n\t\t\t\t$max = $amount_products; \n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$pagination = false;\n\t\t}\n\t\t\n\t\t// top paginate links\n\t\t$string_pag = '<div id=\"ts-paginate\">';\n\t\t$string_pag .= '<div id=\"ts-paginate-left\">';\n\t\t$string_pag .= 'Showing product ';\n\t\t\n\t\tif($min == 0) {\n\t\t\t$string_pag .= $min+1;\n\t\t\t} else {\n\t\t\t$string_pag .= $min;\n\t\t}\n\t\n\t\t$string_pag .= ' to ';\n\t\t$string_pag .= $max;\n\t\t$string_pag .= '</div>';\n\t\t$string_pag .= '<div id=\"ts-paginate-right\">';\n\t\t$string_pag .= 'Page '.$page_products.' of '.$pages; \n\t\t\n\t\tif($page != $pages) {\n\t\t $string_pag .= '&nbsp;<span id=\"ts-paginate-arrow\"><a href=\"'.($page_products+1).'/\">&rarr;</a></span>';\n\t\t} \n\t\t\n\t\t$string_pag .= '</div>';\n\t\t$string_pag .= '</div>';\n\t\t\n\t\t// carousel selection.\n\t\tif($configuration[0]['products.carousel'] == 1 && $this->category == 'index') {\n\t\t\t$carousel = true;\n\t\t}\n\n\t\t$this->textstring .= \"<div id=\\\"ts-product\\\">\";\n\t\t\n\t\tif($productlist !== null) {\n\t\t\t\n\t\t\t$ts \t = array();\n\t\t\t$shoplist = $productlist;\n\t\t\n\t\t\tif($pagination == false) {\n\t\t\t\t$min = 0;\n\t\t\t\t$max = count($productlist);\n\t\t\t} \n\t\t\t\n\t\t\tfor($k = $min; $k < count($productlist); $k++) {\t\n\t\t\t\n\t\t\t\t$c = $productlist[$k];\n\t\t\t\t\n\t\t\t\tif(($c['product.featured'] == '1') && ($c['product.featured.location'] == $this->product_cat)) {\n\t\t\t\t\t$this->textstring .= '<div class=\"ts-product-image-div-featured\">';\n\t\t\t\t\t$this->textstring .= '<h3>'.$this->sanitizer->cleaninput($c['product.title']).'</h3>'; \n\t\t\t\t\t$this->textstring .= '<div>'.$this->sanitizer->cleaninput($c['product.description']).'</div>'; \n\t\t\t\t\t$this->textstring .= '<a href=\"'.$this->sanitizer->cleaninput($c['product.url']).'\"><img src=\"'.$hostaddr.'/'.$this->sanitizer->cleaninput($c['product.featured.image']).'\" class=\"ts-product-image\"/></a></div>';\n\t\t\t\t}\n\t\t\t\t\tif($this->product_subcat != false) {\n\t\t\t\t\t\t// category and subcategory\n\n\t\t\t\t\t\tif($this->revSeo($c['product.category.sub']) == $this->revSeo($this->product_subcat) && ($this->revSeo($c['product.category']) == $this->revSeo($this->product_cat)) && ($c['product.status'] == '1')) {\n\t\t\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} elseif($this->product_cat != false) {\n\t\t\t\t\t\t// only category\n\t\t\t\t\t\tif($this->revSeo($c['product.category']) == $this->revSeo($this->product_cat)) {\n\t\t\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// no cat nor subcat, might be search.\n\t\t\t\t\t\tif($postsearch != false) {\n\t\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t$this->sanitizer->cleaninput($c['product.title']);\n\t\t\t\tif($postsearch != false) {\n\t\t\t\t\t\tarray_push($ts,$c);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\t// flip array order, as most products are added sequentially...\n\t\t\t$ts = array_reverse($ts);\t\n\t\t\t\n\t\t\t// sorting of products.\n\t\t\tif($sorting == true) {\n\t\t\t\t// sort array\n\t\t\t\tif(isset($sortvalue)) {\n\n\t\t\t\t\t$pieces = explode(':',$sortvalue,2);\n\t\t\t\t\t\n\t\t\t\t\tif(isset($pieces)) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch(strtolower(trim($pieces[0]))) {\n\t\t\t\t\t\t\tcase 'price':\n\t\t\t\t\t\t\t$sort = array_column($ts, 'product.price');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'title':\n\t\t\t\t\t\t\t$sort = array_column($ts, 'product.title');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($sort)) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tswitch(strtolower(trim($pieces[1]))) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcase 'ascending':\n\t\t\t\t\t\t\t\tarray_multisort($sort, SORT_ASC, $ts);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 'descending':\n\t\t\t\t\t\t\t\tcase 'decending':\n\t\t\t\t\t\t\t\tarray_multisort($sort, SORT_DESC, $ts);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} else {}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// pagination count correction.\n\t\t\t$ts_pag = count($ts);\n\n\t\t\tif($ts_pag > $limit) {\n\t\t\t\t$this->textstring .= $string_pag;\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($k <= 0) {\n\t\t\t\treturn '<div id=\"ts-products-noproducts\">There are no products in this category.</div>';\n\t\t\t}\n\t\t\t\n\t\t\tif($method == 'array') {\n\t\t\t\treturn $ts;\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($pagination == false) {\n\t\t\t\t$i = count($ts);\n\t\t\t\t} else {\n\t\t\t\t$i = $max;\n\t\t\t}\n\n\t\t\tif($i >= 0) { \n\t\t\t\n\t\t\t\twhile($i >= 0) {\n\t\t\t\t\t\n\t\t\t\t\tif(isset($ts[$i]['product.stock'])) {\n\t\t\t\t\t\t$stock = (int) $ts[$i]['product.stock'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$stock = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($stock <= 5) {\n\t\t\t\t\t\t$status = 'ts-product-status-red'; // low stock\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t$status = 'ts-product-status-green';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(isset($ts[$i]['product.image']) != \"\") {\n\t\t\t\t\t\t$productimage = '<div class=\"ts-product-image-div\"><img src=\"'.$hostaddr.$this->sanitizer->cleaninput($ts[$i]['product.image']).'\" class=\"ts-product-image\"/></div>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t$productimage = '<div class=\"ts-product-image-icon\">&#128722;</div>';\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tswitch($method) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'list':\n\n\t\t\t\t\t\tif(isset($ts[$i]['product.description'])) {\n\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-product-list\\\">\";\n\t\t\t\t\t\t\t$this->textstring .= $productimage;\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-link\\\"><a href=\\\"\".$this->getbase().\"category/\".$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.category'])).\"/item/\".$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.category'])).'/'.$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.title'])).'/'.$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\".(int)$this->page_id.\"/\\\">\".$this->sanitizer->maxstring($this->sanitizer->cleaninput($ts[$i]['product.title']),10,false).\"</a> </div>\";\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-desc\\\">\".$this->sanitizer->maxstring($this->sanitizer->cleaninput($ts[$i]['product.description']),30,true).\"</div>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// $this->textstring .= \"<div class=\\\"ts-list-product-cat\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.category']).\"</div>\";\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-price\\\">\".$this->getsitecurrency(self::INVENTORY_PATH . self::SITECONF,self::INVENTORY_PATH . self::CURRENCIES).' '.$this->sanitizer->cleaninput($ts[$i]['product.price']).\"</div>\";\n\t\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-list-product-status\\\">left in stock.<div class=\\\"\".$status.\"\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.stock']).\"</div></div>\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(isset($configuration[0]['products.quick.cart']) == 'yes') {\n\t\t\t\t\t\t\t\t$this->textstring .= \"<div><input type='number' name='qty' size='1' value='1' min='1' max='9999' id='ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"'><input type='button' onclick='OpenShop.addtocart(\\\"\".(int)$ts[$i]['product.id'].\"\\\",\\\"ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"\\\",\\\"\".$token.\"\\\",\\\"\".$hostaddr.\"\\\");' class='ts-list-cart-button' name='add_cart' value='\".$this->sanitizer->cleaninput($configuration[0]['products.cart.button']).\"' /></div>\";\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$this->textstring .= \"<div class='ts-list-view-link'><a href=\\\"product/\".$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\\\">view</a></div>\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->textstring .= \"</div>\";\n\t\t\t\t\t\t} \n\t\t\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'group':\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-product-group\\\">\";\n\t\t\t\t\t\t$this->textstring .= $productimage;\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-link\\\"><a href=\\\"item/\".$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.category'])).'/'.$this->seoUrl($this->sanitizer->cleaninput($ts[$i]['product.title'])).'/'.$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.title']).\"</a> </div>\";\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-desc\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.description']).\"</div>\";\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-price\\\">\".$this->getsitecurrency(self::INVENTORY_PATH . self::SITECONF,self::INVENTORY_PATH . self::CURRENCIES).' '.$this->sanitizer->cleaninput($ts[$i]['product.price']).\"</div>\";\n\t\t\t\t\t\t// $this->textstring .= \"<div class=\\\"ts-group-product-cat\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.category']).\"</div>\";\n\t\t\t\t\t\t$this->textstring .= \"<div class=\\\"ts-group-product-status\\\">left in stock.<div class=\\\"\".$status.\"\\\">\".$this->sanitizer->cleaninput($ts[$i]['product.stock']).\"</div></div>\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(isset($configuration[0]['products.quick.cart']) == 'yes') {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->textstring .= \"<div><input type='number' name='qty' size='1' min='1' max='9999' value='1' id='ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"'><input type='button' onclick='OpenShop.addtocart(\\\"\".(int)$ts[$i]['product.id'].\"\\\",\\\"ts-group-cart-qty-\".($i+1).'-'.(int)$ts[$i]['product.id'].\"\\\",\\\"\".$token.\"\\\",\\\"\".$host.\"\\\");' class='ts-group-cart-button' name='add_cart' value='\".$this->sanitizer->cleaninput($configuration[0]['products.cart.button']).\"' /></div>\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->textstring .= \"<div class='ts-group-view-link'><a href=\\\"product/\".$this->sanitizer->cleaninput($ts[$i]['product.id']).\"/\\\">view</a></div>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->textstring .= \"</div>\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t$i--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t}\n\n\t\t$this->textstring .= \"</div>\";\t\t\n\t\t\n\t\treturn array($k,$this->textstring);\n\t}", "public function index()\n {\n return ProductCategory::orderBy('name')->get();\n }", "public function getProductCategory()\n {\n return $this->hasMany(ProductCategory::className(), ['category_id' => 'id']);\n }", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "function getCatPro() {\n\n if(isset($_GET['cat'])){\n\n\n\n $cat_id = $_GET['cat'];\n\n\n global $con;\n\n $run_cat_pro = mysqli_query($con,\"SELECT * FROM products WHERE product_cat = '$cat_id'\");\n\n\n\n $count_cats = mysqli_num_rows($run_cat_pro);\n\n if($count_cats == 0) {\n\n echo \"<div class='no-cat'>\n\n <h1> We're sorry! There are currently no products with that category. :(</h1>\n\n </div>\";\n } else {\n\n while($row_cat_pro = mysqli_fetch_array($run_cat_pro)) {\n\n $pro_id = $row_cat_pro['product_id'];\n $pro_cat = $row_cat_pro['product_cat'];\n $pro_brand = $row_cat_pro['product_brand'];\n $pro_title = $row_cat_pro['product_title'];\n $pro_price = $row_cat_pro['product_price'];\n $pro_image = $row_cat_pro['product_image'];\n\n echo \"\n <div class='single-product cf'>\n\n <h4><a href='#'>$pro_title</a></h4>\n <a href='details.php?pro_id=$pro_id'><img src='admin/product_images/$pro_image' /></a>\n <p>\n Price: $ $pro_price\n </p>\n\n <a href='index.php?add_cart=$pro_id'><button>Add To Cart</button></a>\n </div>\n\n \";\n\n }\n }\n }\n }", "public function getProductCollection()\n {\n $category = $this->getCurrentCategory();\n if (isset($this->_productCollections[$category->getId()])) {\n $collection = $this->_productCollections[$category->getId()];\n } else {\n $collection = Mage::helper('catalogsearch')\n ->getEngine()\n ->getResultCollection()\n ->setStoreId($category->getStoreId());\n $this->prepareProductCollection($collection);\n $this->_productCollections[$category->getId()] = $collection;\n }\n\n return $collection;\n }", "public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function getProduct();", "function pro_featured_products()\n{\n\t$args = array( 'type' => 'product', 'orderby' => 'name', 'taxonomy' => 'product_cat' );\n\t$categories = get_categories( $args );\n\t$cats = array();\n\t\n\tforeach ( $categories as $category )\n\t{\n\t\t$cat_name = $category->name;\n\t\t$cats[$cat_name] = $cat_name;\n\t}\n\t\n\treturn $cats;\n}", "public function action_cat()\n {\n $cat = $this->request->param('cat');\n $cat = mysql_real_escape_string ($cat);\n \n // Получаем список продукций\n // $category = ORM::factory('category')->where('cat_id', '=', $cat)->find();\n $category = ORM::factory('category')->where('path', '=', $cat)->find();\n\n if(!$category->loaded()){\n $this->redirect();\n }\n \n $count = $category->products->where('status', '<>', 0)->count_all();\n $pagination = Pagination::factory(array('total_items'=>$count,'items_per_page'=>2));\n $prods = array();\n $products = $category->products\n ->where('status', '<>', 0)\n ->limit($pagination->items_per_page)\n ->offset($pagination->offset)\n ->find_all();\n $prs = $category->products\n ->select('prod_cats.prod_id')\n ->where('status', '<>', 0)\n ->find_all();\n foreach ($prs as $p)\n {\n $prods[] = $p->prod_id;\n }\n if(count($prods))\n $brands = ORM::factory('brand')\n ->join('products')\n ->on('brand.brand_id', '=', 'products.brand_id')\n ->where('products.prod_id','in',$prods)\n ->group_by('brand.title')\n ->order_by('brand.title', 'ASC')\n ->find_all();\n \n \n \n //$products = $category->products->where('status', '!=', 0)->find_all();\n // $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/c' . $category->cat_id);\n $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/' . $category->path);\n $this->template->breadcrumbs = Breadcrumb::generate($this->breadcrumbs);\n \n $content = View::factory('/' . $this->theme . 'index/catalog/v_catalog_cat', array(\n 'products' => $products,\n 'cat' => $cat,\n 'pagination' =>$pagination,\n 'brands' =>$brands,\n \n ));\n \n // Выводим в шаблон\n \n $this->template->title = $category->title;\n $this->template->page_title = $category->title;\n $this->template->page_caption = $category->title;\n $this->template->center_block = array($content);\n $this->template->block_right = null; \n $filter = Filter::factory();\n $filter->loadFiltersOptions($category->cat_id);\n $this->template->filter = $filter->render();\n }", "public function GetAllProduct(){\r\n\t\r\n\t\t\t$m_product = new m_product();\r\n\t\t\t$CatFlowingPro = $m_product->GetAll();\r\n\t\t\r\n\t\t\r\n\t\t\t//view\r\n\t\t\tinclude(\"view/layout/header.php\");\r\n\t\t\tinclude(\"view/layout/menu.php\");\r\n\t\t\tinclude(\"view/category/cat_detail.php\");\r\n\t\t\tinclude(\"view/layout/footer.php\");\r\n\t\t}", "public function getVisibleProductCollection($category){\n $layer = $this->getLayer();\n $layer->setCurrentCategory($category);\n return $layer->getProductCollection();\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'categorables');\n }", "function getProducts()\n {\n $db = $this->getPearDb();\n\n // The query is big, but it does use indexes. Anyway, the involved\n // tables almost never change, so we utilize MySQL's query cache\n $sql = \"(\n # User permissions\n SELECT DISTINCT pe_u.parameterValue AS productId\n FROM user u\n JOIN permission pe_u\n ON pe_u.doerId = u.id\n AND pe_u.allowed = '1'\n AND pe_u.actionId = 6 # 6 = use_product\n WHERE u.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Customer permissions\n SELECT DISTINCT pe_c.parameterValue AS productId\n FROM permission pe_c\n WHERE pe_c.doerId = \" . $this->id . \"\n AND pe_c.allowed = '1'\n AND pe_c.actionId = 6 # 6 = use_product\n\n ) UNION (\n\n SELECT productId\n FROM site s\n WHERE s.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Kollage is always on\n SELECT 1\n\n )\";\n $productIds = $db->getCol($sql);\n $productIds = array_filter(array_unique($productIds), 'intval');\n\n $product = new Vip_Product;\n $product->columnIn('id', $productIds);\n // Customer-specific products are only enabled for that customer.\n $product->addWhereSql('customerId IN (0, ' . $this->id . ')');\n $product->setOrderBySql('sortOrder,title');\n $products = $product->findAll();\n foreach ($products as $product) {\n $product->setCustomer($this);\n }\n\n return $products;\n }", "function relatedProducts($people_cat_id, $product_type_id, $product_id)\n\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t$sql= 'SELECT product. *\n\t\t\t\tFROM product\n\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\tWHERE product.product_type_id = '.$people_cat_id.'\n\t\t\t\tAND product_people.people_cat_id = '.$product_type_id.'\n\t\t\t\tAND product.product_id != '.$product_id.'\n\t\t\t\tORDER BY product.product_id DESC';\n\t\t\t\t\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t\n\t\t\t\t}", "public function getAllProducts( $params = [] )\n {\n if(!config(\"constant.getDataFromApis\")){\n return $this->starrtecUnifiedPosHandler->getCategoryProducts( $params );\n }else{\n return $this->starrtecPosApiHandler->getCategoryProducts( $params );\n }//..... end if-else() .....//\n }", "public function getCollectionProducts()\n {\n\t\t$collection_Products = $this->ShopifyClient->call('GET','/admin/products.json?collection_id='.$this->config['collection_id']);\t\t\n\t\t$arra = array();\n\t\tif(!empty($collection_Products['products']))\n\t\t{\n\t\t\t$keyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images',\n\t\t\t\t\t\t\t'image','options',array('variants'=>array('id','price','sku','compare_at_price','weight','weight_unit')));\n\t\t\t$shopifyKeyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images','image','options',\n\t\t\t\t\t\t\t\t array('variants'=>array(0 =>array('id','price','sku','compare_at_price','weight','weight_unit'))));\n\t\t\t\n\t\t\tforeach($collection_Products as $key=>$var) {\n\t\t\t\tforeach($var as $k=>$val) {\n\t\t\t\t\t$arra['data'][] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$status_code = 200;\n\t\t\t$message = 'success';\t\n\t}else\n\t{\n\t\t$status_code = 404; \n\t\t$message = 'Collections products not found';\n\t\t$arra['data'] = array();\n\t\t$arra['data_count'] = 0;\n\t}\t\n\t\t$collection_Products = $this->getJsonDataFormat($arra,$status_code,$message);\n\t\treturn $collection_Products;\n }", "public function getCategoryProductWithFilter($categoryId , $filters = []) {\n\n $prefix = config('database.connections.mysql.prefix');\n\n $sql = \"Select p.id\n FROM {$prefix}products as p \n INNER JOIN {$prefix}category_product as cp on p.id = cp.product_id \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"INNER JOIN {$prefix}product_property_integer_values as ppiv ON p.id = ppiv.product_id \";\n }\n\n }\n }\n\n if('attribute' == $type) {\n\n\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n $sql .= \"INNER JOIN {$prefix}product_attribute_integer_values as paiv ON p.id = paiv.product_id \";\n }\n }\n }\n\n $sql .= \"WHERE cp.category_id = ? \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"AND ppiv.property_id = {$property->id} AND ppiv.value={$value}\";\n }\n\n }\n }\n }\n\n foreach ($filters as $type => $filterArray) {\n if('attribute' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n\n $sql .= \"AND paiv.attribute_id = {$attribute->id} AND paiv.value={$value}\";\n\n\n }\n }\n }\n\n $products = DB::select($sql, [$categoryId]);\n\n $collect = Collection::make([]);\n\n foreach ($products as $productArray) {\n\n $product = $this->findProductById($productArray->id);\n\n if($product->type == \"VARIABLE_PRODUCT\") {\n $collect->push(($product->getVariableMainProduct()));\n } else {\n $collect->push($this->findProductById($productArray->id));\n }\n }\n\n return $collect;\n\n /**\n * FROM avored_products as p\n *\n *\n *\n *\n * where ppiv.property_id = 1 AND\n */\n\n }", "public function getRelatedProducts($category_id, $count)\n {\n return $this->with('images','manufacturer', 'category')->where('category_id' , '=', $category_id)->take($count)->get();\n }", "private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }", "public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}", "function getProductListWithFilter($results6, $category_id)\n{\n if (!empty($category_id)) {\n foreach ($results6 as $key => $value) {\n echo '<div id = \"product\"><a href =\"index.php?action=product&id=' . $value['product_id'] . '\">' . $value['name'] . ' ' .\n $value['model'] . '<br><img src=' . $value['picture'] . '><br><br>' . $value['price'] . '</a><br><br></div>';\n }\n }\n}", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "public function getArrayOfproducts(): array\n {\n $products = $this->model->getByCategory('helmet', $this->route['action']);\n return $products;\n }", "function showProducts()\n\t{\n\t\tif($_GET['id']!='')\n\t\t{\n\t\t\t$sql = \"SELECT \t* FROM products_table where category_id=\".(int)$_GET['id'] ;\n\t\n\t\t\t$query = new Bin_Query();\n\t\n\t\t\tif($query->executeQuery($sql))\n\t\t\t{\n\t\t\t\t$totrows = $query->totrows;\n\t\t\t}\n\t\t\tif($totrows > 0)\n\t\t\t\treturn Display_DManageProducts::productList($query->records);\n\t\t\telse\n\t\t\t\treturn Display_DManageProducts::displayNoProductFound();\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\techo 'Select SubCategory';\n\t\t}\t\n\t}", "public static function loadProductsByCId($p_cId)\n {\n $ret = array();\n\n $sql = \"select * from products where Classify = $p_cId and Quantity >0\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $catId = $row[\"CatID\"];\n //$catId = $p_catId;\n //$classify = $p_cId;\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $p_cId);\n array_push($ret, $p);\n }\n\n return $ret;\n }", "public function getProducts() \n {\n return $this->_products;\n }", "public function getAllProducts(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM products\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "function getProducts(Store $s)\n {\n $curl_url = $s->getApiPath() . \"v2/products\";\n $products = CurlHandler::GET($curl_url, $s->getAccessToken());\n return $products;\n }", "public function getCategoryCloud()\n {\n $sql = \"\n SELECT\n PC.id as cat_id,\n PC.category,\n P2C.id,\n P2C.cat_id,\n COUNT(P2C.id) AS amount\n FROM Prod2Cat AS P2C\n LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n GROUP BY P2C.cat_id\n -- ORDER BY amount DESC\n \";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n return $res;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "function viewAllProducts()\r\n{\r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"SELECT * FROM products JOIN categories WHERE products.category_id = categories.category_id\");\r\n \r\n $results = array();\r\n if \r\n // Function used to pull all records from Table\r\n ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n return $results;\r\n}", "function getproduct($catid,$tag){\t\n\t\t$sql = 'SELECT `a`.`id`,`a`.`name`,`a`.`tag` FROM `'.DB_TABLE_PREFIX.'product` as `a` INNER JOIN `'.DB_TABLE_PREFIX.'catproductproduct` as `b` ON `a`.`id`=`b`.`productid` WHERE `b`.`catproductid`='.$catid;\t\t\n\t\tif($tag!=NULL){\n\t\t\t$sql.=' AND `a`.`tag` LIKE \"%'.$tag.'%\"';\t\t\t\n\t\t}\n\t\t_trace($sql);\n\t\treturn mysql_query($sql);\t\t\n\t}", "public function index()\n {\n $prodcucts = Product::with('category')->paginate(10);\n\n return new ProductCollection($prodcucts);\n }" ]
[ "0.78338933", "0.76558006", "0.76031697", "0.75194204", "0.7432102", "0.7363974", "0.7353783", "0.7304371", "0.72689754", "0.72550684", "0.7253018", "0.72108316", "0.71816784", "0.71806896", "0.71123636", "0.70842934", "0.7079781", "0.7070807", "0.7040877", "0.70061", "0.7000267", "0.6992637", "0.69901717", "0.69856447", "0.69717455", "0.6941588", "0.69371635", "0.69150746", "0.6911912", "0.69022167", "0.68912756", "0.6881844", "0.6854148", "0.68505245", "0.6809697", "0.67909855", "0.67808753", "0.67715746", "0.67693055", "0.6766351", "0.6736268", "0.6716721", "0.6711771", "0.6708053", "0.6695205", "0.6693675", "0.66923624", "0.66632164", "0.6643106", "0.6641221", "0.66268396", "0.6616192", "0.6604904", "0.6588864", "0.65882236", "0.6585282", "0.6581331", "0.65803564", "0.6574421", "0.65738124", "0.6565733", "0.65446484", "0.6539357", "0.65389794", "0.65366393", "0.6525466", "0.65201247", "0.65197915", "0.651511", "0.65150285", "0.6514355", "0.65097314", "0.65087026", "0.6506148", "0.6498409", "0.6494511", "0.64840287", "0.64797395", "0.6476887", "0.64754903", "0.6475043", "0.6473159", "0.64696497", "0.6462125", "0.6443454", "0.64418757", "0.64406097", "0.6438591", "0.6427974", "0.64257973", "0.6408757", "0.64054096", "0.6403775", "0.6398106", "0.6395566", "0.6395566", "0.6395566", "0.6395566", "0.63947725", "0.63947284", "0.63887423" ]
0.0
-1
/////////////////////////////////////////////////////////////////////// Get products data from any category in desired format
public static function getMyProductsData($category_id, $products_per_page = 9, $curr_page = 1) { //First get the products ids from the selected category $products_ids = self::getCategoryProducts($category_id, $products_per_page, $curr_page); $product_data = array(); $category_data = self::getCategoryData($category_id); foreach ($products_ids as $product) { $product_data[] = array('product_id' => $product['product_id'], 'product_name' => self::getProductName($product['product_id']), 'product_image_url' => $root_url . self::getProductImage($product['product_id']), 'product_price' => self::getProductPrice($product['product_id']), 'product_count' => $category_data['product_count'], 'category_dress_type_id' => $product['category_dress_type_id'], 'subcategory_dress_type_id' => $product['subcategory_dress_type_id']); } return $product_data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProducts($category) {\n $sql = \"SELECT * FROM products INNER JOIN categories on products.product_CategoryID = categories.category_ID WHERE category_Name = '\".$category.\"'\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"products\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"product_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"product_Name\"] . '\",' .\n '\"Category\": \"' . $row[\"category_Name\"] . '\",' .\n '\"Price\": \"' . $row[\"product_Price\"] . '\",' .\n '\"Brand\": \"' . $row[\"product_Brand\"] . '\",' .\n '\"Description\": \"' . $row[\"product_Description\"] . '\",' .\n '\"ImagePath\": \"' . $row[\"product_ImagePath\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Return the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n }", "public function product_get_by_category($data)\n {\n $queryColumn = \"DESCRIBE \" . $this->db_table_prefix . \"products\";\n $resultColumn = $this->commonDatabaseAction($queryColumn);\n $resultColumn = $this->resultArray($resultColumn);\n $columns = php_array_column($resultColumn, 'Field');\n \n $query = \"SELECT p.*, c.name as catName\n \t FROM \" . $this->db_table_prefix . \"products p\n JOIN \" . $this->db_table_prefix . \"categories c\n ON p.cat_id = c.id \";\n \n if (!empty($data))\n {\n $query .= 'WHERE 1';\n foreach ($data as $key => $value)\n {\n $pos = strpos($key, '.');\n $columnArray = ($pos) ? explode('.', $key) : ''; \n $columnName = (!empty($columnArray)) ? $columnArray[1] : $key ;\n \n if (in_array($columnName, $columns))\n {\n $query .= ' AND ' . $key . ' = ' . $value;\n }\n }\n }\n $query .= \" ORDER BY p.id DESC\";\n\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n return $this->resultArray($result);\n }\n else\n {\n return null;\n }\n }", "function getProductsByCategory()\n\t{\n\t\tglobal $con;\n\t\tif (isset($_GET['cat'])){\n\t\t\t$cat_id = $_GET['cat'];\n\t\t\t$get_products = \"select * from products where prod_cat='$cat_id'\";\n\t\t\t$run_products = mysqli_query($con, $get_products);\n\t\t\t$count = mysqli_num_rows($run_products);\n\t\t\t\n\t\t\tif ($count == 0)\n\t\t\t\techo \"<h2>No Products in this category</h2>\";\n\t\t\t\n\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\techo \"\n\t\t\t\t<div class='single_product'>\n\t\t\t\t\t<h3>$prod_title</h3>\n\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t</div>\n\t\t\t\t\";\n\t\t\t}\n\t\t}\n\t}", "function get_ProductsBy_CatID($data) {\r\n $params[0] = array(\"name\" => \":category_id\", \"value\" => &$data['category_id']);\r\n $params[1] = array(\"name\" => \":prodType\", \"value\" => &$data['prodType']);\r\n return $this->DBObject->readCursor(\"product_actions.get_ProductsBy_CatID(:category_id,:prodType)\", $params);\r\n }", "function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }", "public function getProductsByCategory ($category_id) {\n\t\t\n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n \n\t\ttry {\n \n\t\t\t/*\n $query = \"SELECT ea_product.id, ea_product.upc, ea_product.brand, ea_product.product_name, ea_product.product_description, ea_product.avg_price, ea_image.file\n\t\t\tFROM ea_product LEFT JOIN ea_image\n ON ea_product.upc = ea_image.upc\n WHERE ea_product.category_id = '$category_id'\n\t\t\tORDER BY ea_product.avg_price\";\n */\n \n $query = \"SELECT ea_product.id, upc, brand, product_name, \n product_description, avg_price, ea_category.name\n\t\t\tFROM ea_product, ea_category\n WHERE ea_product.category_id = ea_category.id\n AND category_id = '$category_id'\n\t\t\tORDER BY avg_price\";\n //print(\"$query\");\n\t\t\tforeach($this->dbo->query($query) as $row) {\n\t\t\t\t$id = stripslashes($row[0]);\n\t\t\t\t$upc = strval(stripslashes($row[1]));\n\t\t\t\t$brand = $this->convertFancyQuotes(stripslashes($row[2]));\n\t\t\t\t$product_name = $this->convertFancyQuotes(stripslashes($row[3]));\n\t\t\t\t$product_description = $this->convertFancyQuotes(stripslashes($row[4]));\n\t\t\t\t$avg_price = stripslashes($row[5]);\n\t\t\t\t$category_name = $this->convertFancyQuotes(stripslashes($row[6]));\n \n $product[\"id\"] = $id;\n $product[\"upc\"] = $upc;\n $product[\"brand\"] = $brand;\n $product[\"product_name\"] = $product_name;\n $product[\"product_description\"] = $product_description;\n $product[\"avg_price\"] = $avg_price;\n $product[\"category_name\"] = $category_name;\n \n $product[\"image_path\"] = $this->getImagePath($upc);\n \n $products[] = $product;\n\t\t\t}\n\t\n\t\t} catch (PDOException $e) {\n\t\t\t$this->errorCode = 1;\n\t\t\t$errorCode = -1;\n\t\t\t$errorMessage = \"PDOException for getProductsByCategory.\";\n\t\t}\t\n \n\t\t$error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t\n\t\t$data[\"search\"] = $category_name;\n $data[\"query\"] = $query;\n \n $data[\"products\"] = $products;\n\n $data = json_encode($data);\n \n\t\treturn $data;\n\t}", "function get_product_category_filters($data) {\n $category_id = $data['category_id'];\n // Return category filters object\n return (object) [\n 'attributes' => get_product_category_attribute_terms($category_id),\n 'subcategories' => get_product_category_subcategories($category_id),\n 'price' => get_product_category_price_min_max($category_id)\n ];\n}", "public function prod_list_by_category() {\n $url_cate = get_raw_app_uri();\n if (!empty($url_cate)) {\n $Product = new Product();\n $info = $Product->getProductByCategory($url_cate);\n $data['content'] = 'list_product'; \n $data['product'] = $info['product'];\n $data['paging'] = $info['paging'];\n $data['selected'] = $url_cate;\n \n //seo\n \n $Category = new ProductCategory();\n $list_cate = $Category->getCategoryByLink($url_cate);\n if ($list_cate->countRows() > 0){\n $list_cate->fetchNext();\n $data['title_page'] = $list_cate->get_prod_cate_name();\n $data['description'] = $list_cate->get_prod_cate_meta_description();\n $data['keywords'] = $list_cate->get_prod_cate_keywords();\n }else{\n $data['title_page'] = '';\n $data['description'] = '';\n $data['keywords'] = '';\n }\n \n $array_menus = array();\n $filter = array();\n $filter['parent_id'] = 0;\n Menu::getMenuTree($array_menus, $filter);\n $data['array_menus'] = $array_menus;\n \n $this->load->view('temp', $data);\n } else {\n redirect(Variable::getDefaultPageString());\n }\n }", "protected function getData()\n {\n\n $file_prod_path = $_SERVER['DOCUMENT_ROOT'] . '/web/products.xml';\n $file_cat_path = $_SERVER['DOCUMENT_ROOT'] . '/web/categories.xml';\n\n if(!file_exists($file_cat_path)){\n return \"File \" . $file_cat_path . \" not found\";\n }\n $xml_cat = json_decode(json_encode(simplexml_load_string(file_get_contents($file_cat_path))),true)['item'];\n\n if(!file_exists($file_prod_path)){\n return \"File\" . $file_prod_path . \"not found\";\n }\n $xml_prod = json_decode(json_encode(simplexml_load_string(file_get_contents($file_prod_path))),true)['item'];\n $result = $xml_prod;\n foreach($xml_prod as $key => $value){\n $result[$key]['name'] = $xml_cat[array_search($value['categoryId'], array_column($xml_cat, 'id'))]['name'];\n }\n\n\n if ($this->_filtered) {\n $result = array_filter($result, function ($value) {\n $conditions = [true];\n if (!empty($this->id)) {\n $conditions[] = strpos($value['id'], $this->id) !== false;\n }\n if (!empty($this->price)) {\n $conditions[] = strpos($value['price'], $this->price) !== false;\n }\n if (!empty($this->hidden)) {\n $conditions[] = strpos($value['hidden'], $this->hidden) !== false;\n }\n if (!empty($this->name)) {\n $conditions[] = strpos($value['name'], $this->name) !== false;\n }\n return array_product($conditions);\n });\n }\n\n return $result;\n }", "private static function __getProductsListingData() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_Vqmod;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n // optional Product List Filter\n $output = '';\n $result = array();\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $filterlist_sql = \"select distinct c.categories_id as id, cd.categories_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_CATEGORIES . \" c, \" . TABLE_CATEGORIES_DESCRIPTION . \" cd, \" . TABLE_TEMPLATES_BOXES . \" tb, \" . TABLE_PRODUCT_ATTRIBUTES . \" pa where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '\" . (int)$lC_Language->getID() . \"' and tb.code = 'manufacturers' and tb.id = pa.id and pa.products_id = p.products_id and pa.value = '\" . (int)$_GET['manufacturers'] . \"' order by cd.categories_name\";\n } else {\n $filterlist_sql = \"select distinct m.manufacturers_id as id, m.manufacturers_name as name from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c, \" . TABLE_MANUFACTURERS . \" m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '\" . (int)$current_category_id . \"' order by m.manufacturers_name\";\n }\n $Qfilterlist = $lC_Database->query($filterlist_sql);\n $Qfilterlist->execute();\n if ($Qfilterlist->numberOfRows() > 1) {\n $output .= '<p><form name=\"filter\" action=\"' . lc_href_link(FILENAME_DEFAULT) . '\" method=\"get\">' . $lC_Language->get('filter_show') . '&nbsp;';\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $output .= lc_draw_hidden_field('manufacturers', $_GET['manufacturers']);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_categories')));\n } else {\n $output .= lc_draw_hidden_field('cPath', $cPath);\n $options = array(array('id' => '', 'text' => $lC_Language->get('filter_all_manufacturers')));\n }\n if (isset($_GET['sort'])) {\n $output .= lc_draw_hidden_field('sort', $_GET['sort']);\n }\n while ($Qfilterlist->next()) {\n $options[] = array('id' => $Qfilterlist->valueInt('id'), 'text' => $Qfilterlist->value('name'));\n }\n $output .= lc_draw_pull_down_menu('filter', $options, (isset($_GET['filter']) ? $_GET['filter'] : null), 'onchange=\"this.form.submit()\"');\n $output .= lc_draw_hidden_session_id_field() . '</form></p>' . \"\\n\";\n }\n\n if (isset($_GET['manufacturers']) && !empty($_GET['manufacturers'])) {\n $lC_Products->setManufacturer($_GET['manufacturers']);\n }\n $Qlisting = $lC_Products->execute(); \n \n $result['mfgFilter'] = $output;\n $result['Qlisting'] = $Qlisting;\n \n return $result;\n }", "function getProductByCategorySearch($category_id, $keyword){\r\n\t\t$unix_product = array();\r\n\t\t//$has_printed = false;\r\n\t\t$total_product_1 = 0;\r\n\t\t$total_product_2 = 0;\r\n\t\t$keyword=strtolower($keyword);\r\n\t\t\r\n\t\tif($category_id!=0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category WHERE parent_id=\".$category_id);\t\r\n\t\t}\r\n\t\telseif($category_id==0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category\");\t\r\n\t\t}\r\n\t\twhile($rc=mysql_fetch_array($q_category)){\r\n\t\t\t$cat_id = $rc['category_id'];\r\n\t\t\t//if($category_id!=0){\r\n\t\t\t$q_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$cat_id.\" AND lower(D.name) LIKE '%$keyword%'\");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$total_product_1 = mysql_num_rows($q_product_id);\t\t\t\t\t\t\t\t\t\r\n\t\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t\t$product = new product($product_id);\r\n\t\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\t\techo '<div class=\"item\">';\r\n\t\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'_'.$total_product_1.'</div>';\r\n\t\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\t\techo '</a>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\t}\r\n\t\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Search Child Category\r\n\t\t$q_child_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$category_id.\" AND lower(D.name) LIKE '%$keyword%'\");\r\n\t\t$total_product_2 = mysql_num_rows($q_child_product_id);\r\n\t\twhile($rp=mysql_fetch_array($q_child_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().$total_product_2.'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t\t}\r\n\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t}\r\n\t\t//Info if Search No Result \r\n\t\t/*\r\n\t\tif($total_product_1==0 && $total_product_2==0){\r\n\t\t\techo '<div class=\"no_item\" style=\"height:200px;padding: 10px 10px 10px 20px; color: #CCC; font-size: 20px;\">';\r\n\t\t\t\techo 'No Result! RUn'.$total_product_1.'_'.$total_product_2;\r\n\t\t\t\t//echo ':)'.$rLanguage->text(\"Logout\");\t\r\n\t\t\techo '</div>';\r\n\t\t}\r\n\t\t*/\r\n\t}", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }", "function getProductsByCategory($categoryId){ \n $db = acmeConnect(); \n $sql = 'SELECT * FROM inventory WHERE categoryId = :categoryId'; \n $stmt = $db->prepare($sql); \n $stmt->bindValue(':categoryId', $categoryId, PDO::PARAM_INT); \n $stmt->execute(); \n $products = $stmt->fetchAll(PDO::FETCH_ASSOC); \n $stmt->closeCursor(); \n return $products; \n }", "public function get_category_products($cat_id){\n\t\t$data = array();\n\t\tif ($stmt = $this->Database->prepare(\"SELECT product_id, product_name, product_body, product_price, total_product, product_image, product_type FROM \" . $this->db_table . \" WHERE cat_id = ?\")) {\n\t\t\t$stmt->bind_param(\"i\", $cat_id);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\t$stmt->bind_result($product_id, $product_name, $product_body, $product_price, $total_product, $product_image, $product_type);\n\t\t\t//$stmt->fetch_array();\n\n\t\t\twhile ($stmt->fetch())\n\t\t\t{\n\t\t\t\t$data[] = array(\n\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t'product_name' => $product_name,\n\t\t\t\t\t'product_body' => $product_body,\n\t\t\t\t\t'product_price' => $product_price,\n\t\t\t\t\t'total_product' => $total_product,\n\t\t\t\t\t'product_image' => $product_image,\n\t\t\t\t\t'product_type' => $product_type\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$stmt->close();\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function _getCategoryDataContent() {\n\n $categoryName = Mage::registry('current_category')->getName();\n $_cat = new Mage_Catalog_Block_Navigation();\n $curent_cat = $_cat->getCurrentCategory();\n $curent_cat_id = $curent_cat->getId();\n $parentId = Mage::getModel('catalog/category')->load($curent_cat_id)->getParentId();\n $parent = Mage::getModel('catalog/category')->load($parentId);\n $categorydaddy = $parent->getName();\n\n $category_id = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();\n $category = Mage::getModel('catalog/category')->load($category_id);\n $products = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSelect('*')\n ->addCategoryFilter($category)\n ->addFieldToFilter('visibility', Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH)\n ->load();\n\n $cartsku = array();\n $data = array();\n $impression = [];\n $impressions = [];\n $count = 0;\n $end = 32;\n foreach ($products as $item) {\n $count++;\n $cartsku[] = $item->getSku();\n $impression['id'] = $item->getSku();\n $impression['name'] = $item->getName();\n $impression['brand'] = $item->getBrand();\n $impression['category'] = $categoryName;\n $impression['list'] = $categoryName;\n $impression['position'] = $count;\n $impressions[] = $impression;\n if ($count == $end) break;\n }\n\n $data['event'] = 'category';\n\n $google_tag_params = array();\n $google_tag_params['ecomm_pagetype'] = 'category';\n $google_tag_params['ecomm_category'] = $categoryName;\n $google_tag_params['ecomm_daddy'] = $categorydaddy;\n $google_tag_params['ecomm_prodid'] = $cartsku;\n $google_tag_params['impressions'] = $impressions;\n\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n $data['google_tag_params'] = $google_tag_params;\n\n $data = array(\n 'event' => 'category',\n 'google_tag_params' => $google_tag_params\n );\n\n /* Facebook Conversion API Code */\n $custom_data = array(\n \"content_ids\" => $cartsku,\n \"content_type\" => \"product\",\n \"content_category\" => $categoryName,\n );\n $this->createFacebookRequest(\"ViewCategory\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n \n return $data;\n }", "public function readProductosCategoria(){\n $sql='SELECT nomCategoria, idProducto, producto.foto, nombre, producto.descripcion,precio FROM producto INNER JOIN categoria USING (idCategoria) WHERE idCategoria = ? AND producto.estado=1 AND producto.estadoEliminacion=1';\n $params=array($this->categoria);\n return Database::getRows($sql, $params);\n }", "public function getCategory()\n\t\t{\n\t\t\t$sql = \"SELECT id_category,name_cate FROM tbl_category_products\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\t\t\t$pre->execute();\n\n\t\t\treturn $pre->fetchAll(PDO::FETCH_ASSOC);\n\t\t}", "function getProductCategories () {\r\n $sql = \"SELECT * FROM stockgroups\";\r\n return runQuery($sql);\r\n}", "public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function getProductsByCategory($category){\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ProductoDAO -> getProductsByCategory($category));\n $resList = array();\n while($res = $this -> Conexion -> extraer()){\n array_push($resList, new Producto($res[0], $res[1], $res[2], \"\", $res[3]));\n }\n $this -> Conexion -> cerrar();\n return $resList;\n }", "function getSalesByProdCatXML($intYear, $catId, $forDataURL) {\n // Function to connect to the DB\n $link = connectToDB();\n\n\t$strSQL = \"SELECT g.CategoryName,p.ProductName,ROUND(SUM(d.Quantity),0) as Quantity, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total FROM FC_Categories as g, FC_Products as p, FC_Orders as o, FC_OrderDetails as d WHERE year(o.OrderDate)=\" . $intYear . \" and g.CategoryID=\" . $catId . \" and d.ProductID=p.ProductID and g.CategoryID=p.CategoryID and o.OrderID=d.OrderID GROUP BY g.CategoryName,p.ProductName\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\n\t//Initialize <categories> element\n\t$strCat = \"<categories>\";\n\t\n\t//Initialize datasets\n\t$strAmtDS = \"<dataset seriesname='Revenue'>\";\n\t$strQtyDS = \"<dataset seriesName='Quantity' parentYAxis='S'>\";\n\t\n\t//Iterate through each data row\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n //Product Names are long - so show 8 characters and ... and show full thing in tooltip\n if (strlen($ors['ProductName'])>8)\n $shortName = escapeXML(substr($ors['ProductName'],0,8) . \"...\",$forDataURL);\n else\n $shortName = escapeXML($ors['ProductName'],$forDataURL);\n $strCat .= \"<category label='\" . $shortName . \"' toolText='\" . escapeXML($ors['ProductName'],$forDataURL) . \"'/>\";\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' />\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n //Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\t\n\treturn $strXML;\n}", "protected function export_categoryless_products()\n {\n $table = $this->getTableName(\"catalog_product_entity\");\n $categoryProductsTable = $this->getTableName(\"catalog_category_product\");\n $catalogProductWebsite = $this->getTableName(\"catalog_product_website\");\n $rootCategoryId = $this->_fStore->getRootCategoryId();\n $sql = \"SELECT DISTINCT(entity_id), type_id, sku FROM {$table}\n LEFT JOIN (`{$categoryProductsTable}`) ON ({$table}.`entity_id` = `{$categoryProductsTable}`.`product_id`)\n LEFT JOIN (`{$catalogProductWebsite}`) ON ({$table}.`entity_id` = `{$catalogProductWebsite}`.`product_id`)\n WHERE (`{$categoryProductsTable}`.`product_id` IS NULL OR `{$categoryProductsTable}`.`category_id` NOT IN ({$this->_getCategoriesForStore()}))\n AND {$table}.entity_type_id = {$this->_product_entity_type_id}\n AND `{$catalogProductWebsite}`.`website_id` = \" . $this->getWebsiteId($this->_fStore_id); \n \n return $this->export_products($sql, 'categoryless_products');\n }", "function getCategory(){\n\t\t\t$data = array(); \n\t\t\t$query = \"select * from packages_category\";\n\t\t\t$result = mysql_query($query);\n\t\t \n\t\t\tif($result){\n\t\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\tarray_push($data,$row);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\tdie(\"error in mysql query \" . mysql_error());\n\t\t\t}\n\t\t}", "public function getCategoryCloud()\n {\n $sql = \"\n SELECT\n PC.id as cat_id,\n PC.category,\n P2C.id,\n P2C.cat_id,\n COUNT(P2C.id) AS amount\n FROM Prod2Cat AS P2C\n LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n GROUP BY P2C.cat_id\n -- ORDER BY amount DESC\n \";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n return $res;\n }", "function productByCategory($id)\n {\n \t\n }", "public function getProductCollectionFromCategoryBottom() {\n $categoryId = $this->getCurrentcat();\n $not_in_array_left = $this->getProductCollectionFromFourRow();\n $not_in_array_right = $this->getProductCollectionFromThreeRow();\n $not_in_array_parent = $this->getProductId();\n $custom_array = array(2202,2354,2161);\n $not_in_array = array_merge($not_in_array_left, $not_in_array_right,$not_in_array_parent,$custom_array);\n $category = $this->categoryFactory->create()->load($categoryId);\n\t $collection = $category->getProductCollection()->addAttributeToSelect('*')\n\t ->addAttributeToFilter('type_id', array('eq' => 'grouped'))\n ->addAttributeToFilter('status',\\Magento\\Catalog\\Model\\Product\\Attribute\\Source\\Status::STATUS_ENABLED)->setPageSize(20)\n ->addAttributeToFilter('entity_id', array('nin' => $not_in_array));\n return $collection;\n \n \t}", "function getProductsByCat($catId) {\r\n $catId = intval($catId);\r\n $sql = \"SELECT * FROM products WHERE category_id = '{$catId}'\";\r\n\r\n include '../config/db.php';\r\n\r\n $rs = mysqli_query($link, $sql);\r\n mysqli_close($link);\r\n\r\n return createSnartyRsArray($rs);\r\n}", "function getProductListWithFilter($results6, $category_id)\n{\n if (!empty($category_id)) {\n foreach ($results6 as $key => $value) {\n echo '<div id = \"product\"><a href =\"index.php?action=product&id=' . $value['product_id'] . '\">' . $value['name'] . ' ' .\n $value['model'] . '<br><img src=' . $value['picture'] . '><br><br>' . $value['price'] . '</a><br><br></div>';\n }\n }\n}", "function productList() {\n\t$categoryIds = array_merge ( [ \n\t\t\t$this->id \n\t], $this->subcategoryIds () );\n\tprint_r ( $categoryIds );\n\t// Find all products that match the retrieved category IDs\n\treturn Product::whereIn ( 'cate_id', $categoryIds )->get ();\n}", "public function getProduct_category () {\n\t$preValue = $this->preGetValue(\"product_category\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->getClass()->getFieldDefinition(\"product_category\")->preGetData($this);\n\treturn $data;\n}", "public function getCategoryDataFront()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('updated_at', 'desc')->Where('deactivate', 0)->take(4)->get();\n\n foreach($categories as $categoryWiseResource)\n {\n $files = explode(\",\", $categoryWiseResource['file']);\n $categoryWiseResource['attachments'] = Attachment::WhereIn('id', $files)->get();\n }\n \n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }", "public function getCategoryData()\n {\n $_category = Mage::registry('current_category');\n $data = array();\n if ($_category) {\n $data['categoryId'] = $_category->getId();\n $data['categoryName'] = $_category->getName();\n }\n return $data;\n }", "public function GetAllProduct(){\r\n\t\r\n\t\t\t$m_product = new m_product();\r\n\t\t\t$CatFlowingPro = $m_product->GetAll();\r\n\t\t\r\n\t\t\r\n\t\t\t//view\r\n\t\t\tinclude(\"view/layout/header.php\");\r\n\t\t\tinclude(\"view/layout/menu.php\");\r\n\t\t\tinclude(\"view/category/cat_detail.php\");\r\n\t\t\tinclude(\"view/layout/footer.php\");\r\n\t\t}", "public function getProductsByCategory($id){ \n $products = Product::where('category_id',$id)->get(); \n return $products;\n }", "public function getCategoryProductWithFilter($categoryId , $filters = []) {\n\n $prefix = config('database.connections.mysql.prefix');\n\n $sql = \"Select p.id\n FROM {$prefix}products as p \n INNER JOIN {$prefix}category_product as cp on p.id = cp.product_id \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"INNER JOIN {$prefix}product_property_integer_values as ppiv ON p.id = ppiv.product_id \";\n }\n\n }\n }\n\n if('attribute' == $type) {\n\n\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n $sql .= \"INNER JOIN {$prefix}product_attribute_integer_values as paiv ON p.id = paiv.product_id \";\n }\n }\n }\n\n $sql .= \"WHERE cp.category_id = ? \";\n\n foreach ($filters as $type => $filterArray) {\n if('property' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $property = $this->findPropertyByIdentifier($identifier);\n\n if(\"INTEGER\" == $property->data_type) {\n\n $sql .= \"AND ppiv.property_id = {$property->id} AND ppiv.value={$value}\";\n }\n\n }\n }\n }\n\n foreach ($filters as $type => $filterArray) {\n if('attribute' == $type) {\n foreach ($filterArray as $identifier => $value) {\n $attribute = $this->findAttributeByIdentifier($identifier);\n\n $sql .= \"AND paiv.attribute_id = {$attribute->id} AND paiv.value={$value}\";\n\n\n }\n }\n }\n\n $products = DB::select($sql, [$categoryId]);\n\n $collect = Collection::make([]);\n\n foreach ($products as $productArray) {\n\n $product = $this->findProductById($productArray->id);\n\n if($product->type == \"VARIABLE_PRODUCT\") {\n $collect->push(($product->getVariableMainProduct()));\n } else {\n $collect->push($this->findProductById($productArray->id));\n }\n }\n\n return $collect;\n\n /**\n * FROM avored_products as p\n *\n *\n *\n *\n * where ppiv.property_id = 1 AND\n */\n\n }", "function get_products() {\n\t\tApp::Import('model', 'Product');\n\t\t$this->Product = &new Product;\n\n\t\t$products = $this->Product->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t\"Product.short_description != ''\",\n\t\t\t\t'Availability.cart_allowed' => true,\n\t\t\t\t'Product.active' => true\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'TaxClass' => array(\n\t\t\t\t\t'fields' => array('id', 'value')\n\t\t\t\t),\n\t\t\t\t'Image' => array(\n\t\t\t\t\t'conditions' => array('Image.is_main' => '1'),\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'Manufacturer' => array(\n\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t),\n\t\t\t\t'CategoriesProduct' => array(\n\t\t\t\t\t'Category' => array(\n\t\t\t\t\t\t'fields' => array('id', 'name')\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'Availability' => array(\n\t\t\t\t\t'fields' => array('id', 'cart_allowed')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'fields' => array(\n\t\t\t\t'Product.id',\n\t\t\t\t'Product.name',\n\t\t\t\t'Product.short_description',\n\t\t\t\t'Product.url',\n\t\t\t\t'Product.retail_price_with_dph',\n\t\t\t\t'Product.ean',\n\t\t\t\t'Product.zbozi_name',\n\t\t\t\t'Product.heureka_name',\n\t\t\t\t'Product.discount_common',\n\t\t\t\t'Product.zbozi_cpc',\n\t\t\t\t'Product.heureka_cpc'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$products = array_filter($products, array('ExportsController', 'empty_category'));\n\t\t\n\t\tforeach ($products as $i => $product) {\n\t\t\t$products[$i]['Product']['retail_price_with_dph'] = $this->Product->assign_discount_price($products[$i]);\n\t\t\t$products[$i]['Product']['name'] = str_replace('&times;', 'x', $products[$i]['Product']['name']);\n\t\t\t$products[$i]['Product']['short_description'] = str_replace('&times;', 'x', $products[$i]['Product']['short_description']);\n\t\t}\n\n\t\treturn $products;\n\t}", "public function categoryDetails() {\n\t\t$this->load->model(\"homeModel\");\n\t\t$response = array(\"error\" => FALSE);\n\n\t\t$output = array();\n\n\t\t$post = $this->input->raw_input_stream;\n\t\t$post = json_decode($post);\n\t\t$category = $post->category;\n\n\n\t\t$packages = $this->homeModel->getPackagesInCategory($category);\n\t\tif ($packages != null) {\n\t\t\tforeach ($packages as $key => $value) {\n\t\t\t\t$subPackages = $this->homeModel->getSubpackagesInCategory($value->id);\n\t\t\t\t$services = array();\n\n\t\t\t\tif ($subPackages != null) {\n\t\t\t\t\tforeach ($subPackages as $key => $sub) {\n\t\t\t\t\t\t$services = $this->homeModel->getServicesInSubpackage($sub->id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$row['package'] = $value;\n\t\t\t\t$row['sub_packages'] = $subPackages;\n\t\t\t\t$row['services'] = $services;\n\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t}\n\n\t\t$response['packages'] = $packages;\n\t\t$response['data'] = $output;\n\t\techo json_encode($response);\n\t}", "protected function getProducts()\r\n {\r\n $category = new Category((int)Configuration::get('FIELD_FEATUREDPSL_CAT'), (int)Context::getContext()->language->id);\r\n\r\n $searchProvider = new CategoryProductSearchProvider(\r\n $this->context->getTranslator(),\r\n $category\r\n );\r\n\r\n $context = new ProductSearchContext($this->context);\r\n\r\n $query = new ProductSearchQuery();\r\n\r\n $nProducts = (int)Configuration::get('FIELD_FEATUREDPSL_NBR');\r\n if ($nProducts < 0) {\r\n $nProducts = 12;\r\n }\r\n\r\n $query\r\n ->setResultsPerPage($nProducts)\r\n ->setPage(1)\r\n ;\r\n $query->setSortOrder(new SortOrder('product', 'position', 'asc'));\r\n $result = $searchProvider->runQuery(\r\n $context,\r\n $query\r\n );\r\n\r\n $assembler = new ProductAssembler($this->context);\r\n\r\n $presenterFactory = new ProductPresenterFactory($this->context);\r\n $presentationSettings = $presenterFactory->getPresentationSettings();\r\n $presenter = new ProductListingPresenter(\r\n new ImageRetriever(\r\n $this->context->link\r\n ),\r\n $this->context->link,\r\n new PriceFormatter(),\r\n new ProductColorsRetriever(),\r\n $this->context->getTranslator()\r\n );\r\n\r\n $products_for_template = [];\r\n\t\t$products_features=$result->getProducts();\r\n\t\tif(is_array($products_features)){\r\n\t\t\tforeach ($products_features as $rawProduct) {\r\n\t\t\t\t$products_for_template[] = $presenter->present(\r\n\t\t\t\t\t$presentationSettings,\r\n\t\t\t\t\t$assembler->assembleProduct($rawProduct),\r\n\t\t\t\t\t$this->context->language\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n return $products_for_template;\r\n }", "function getSalesByProdXML($intYear, $intMonth, $intCatId, $forDataURL) {\n\t$strXML=\"\";\n // Function to connect to the DB\n $link = connectToDB();\n\n\t//Initialize <categories> element\n\t$strCat = \"<categories>\";\n\t\n\t//Initialize datasets\n\t$strAmtDS = \"<dataset seriesname='Revenue'>\";\n\t$strQtyDS = \"<dataset seriesName='Units Sold' parentYAxis='S'>\";\n\t\n\t//First we need to get unique categories in the database\n\t$strSQL = \"SELECT g.CategoryName,p.ProductName,ROUND(SUM(d.Quantity),0) as Quantity, ROUND(SUM(d.Quantity*p.UnitPrice),0) As Total FROM FC_Categories as g, FC_Products as p, FC_Orders as o, FC_OrderDetails as d WHERE year(o.OrderDate)=\" . $intYear . \" and month(o.OrderDate)=\" . $intMonth . \" and g.CategoryID=\" . $intCatId . \" and d.ProductID= p.ProductID and g.CategoryID= p.CategoryID and o.OrderID= d.OrderID GROUP BY g.CategoryName,p.ProductName \";\n $result = mysql_query($strSQL) or die(mysql_error());\n\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n $strCat .= \"<category label='\" . escapeXML($ors['ProductName'],$forDataURL) . \"'/>\";\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' />\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n\t//Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\t\n\treturn $strXML;\n}", "public static function loadProductsByCatId($p_catId)\n {\n $ret = array();\n\n $sql = \"select * from products where CatID = $p_catId\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n //$catId = $row[\"CatID\"];\n $catId = $p_catId;\n $classify = $row[\"Classify\"];\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n array_push($ret, $p);\n }\n\n return $ret;\n }", "protected function _getProductData() {\n\n\n $cat_id = Mage::getModel('catalog/layer')->getCurrentCategory()->getId();\n $category = Mage::getModel('catalog/category')->load($cat_id);\n $data['event'] = 'product';\n\n $finalPrice = $this->getFinalPriceDiscount();\n if($finalPrice):\n $google_tag_params = array();\n $google_tag_params['ecomm_prodid'] = $this->getProduct()->getSku();\n $google_tag_params['name'] = $this->getProduct()->getName();\n $google_tag_params['brand'] = $this->getProduct()->getBrand();\n $google_tag_params['ecomm_pagetype'] = 'product';\n $google_tag_params['ecomm_category'] = $category->getName();\n $google_tag_params['ecomm_totalvalue'] = (float)$this->formatNumber($finalPrice);\n \n $customer = Mage::getSingleton('customer/session');\n if ($customer->getCustomerId()){\n $google_tag_params['user_id'] = (string) $customer->getCustomerId(); \n }\n if($this->IsReturnedCustomer()){\n $google_tag_params['returnCustomer'] = 'true';\n }\n else {\n $google_tag_params['returnCustomer'] = 'false';\n }\n\n $data['google_tag_params'] = $google_tag_params;\n\n /* Facebook Conversion API Code */\n $custom_data = array(\n \"content_name\" => $this->getProduct()->getName(),\n \"content_ids\" => [$this->getProduct()->getSku()],\n \"content_category\" => $category->getName(),\n \"content_type\" => \"product\",\n \"value\" => (float)$this->formatNumber($finalPrice),\n \"currency\" => \"BRL\"\n );\n $this->createFacebookRequest(\"ViewContent\", [], [], $custom_data);\n /* End Facebook Conversion API Code */\n\n endif;\n\n return $data;\n }", "function getProductByCategoryPath($path){\r\n\t\t$q_product_id=getResultSet(\"SELECT product_id FROM \".DB_PREFIX.\"product_to_category WHERE category_id=\".$path);\r\n\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\t\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t}\t\t\r\n\t}", "function get_category_productdata($conditions_array=array(),$rows_per_page=10,$start=0)\n\t{\n\t\t$rows=array();\n\t\t$this->db->from('red_support_category as rsc');\n\t\t$this->db->join('red_support_product as rsp','rsc.id=rsp.category_id');\n\t\t$this->db->where($conditions_array);\n\t\t$result=$this->db->get();\n\t\tforeach($result->result_array() as $row)\n\t\t{\n\t\t\t$rows[]=$row;\n\t\t}\n\t\treturn $rows;\n\t\n\t}", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "function getProductsbyCategory($CatId){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn->prepare(\"\tSELECT id, name, description, price, stock, img_src \n\t\t\t\t\t\t\t\t\tFROM `product` \n\t\t\t\t\t\t\t\t\tWHERE `stock`>0 AND `category_id`=?\");\n\t\t$sth \t-> execute(array($CatId));\n\t\t\n\t\treturn \t$sth;\n\t}", "function getCategories() {\n\t$sql = \"select * FROM category ORDER BY id\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->query($sql); \n\t\t$categories = $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t$db = null;\n\t\techo '{\"data\": ' . json_encode($categories) . '}';\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public static function data4Select($category)\n {\n // Grouped data\n $all_data = BusinessPartner::where('category_id', $category)->get();\n $results = array();\n foreach ($all_data as $buz) {\n $coupons = array();\n foreach ($buz->coupons as $l) {\n $tmp['id'] = $l->id;\n $tmp['text'] = $l->name;\n $coupons[] = $tmp;\n }\n $group['text'] = $buz->name;\n $group['children'] = $coupons;\n\n if (count($coupons)) {\n $results[] = $group;\n }\n }\n return array(\"results\"=>$results);\n }", "function get_product_by_filter($category_id,$brand_id){\n $this->db->select(\"tp.name as product_name,\n pp.prod_id,\n pp.prod_price_id,\n pp.sold_as,\n pp.attributes_value,\n pp.price,\n pp.tax_rate\")\n ->from('tbl_products as tp')\n ->join('tbl_product_price as pp','pp.prod_id=tp.prod_id','left')\n ->join('tbl_product_attributes as tpa','tpa.attributes_id=pp.attributes_id','left')\n ->where(array(\"tp.category_id\"=>$category_id,\"tp.is_deleted\"=>\"0\",\"tp.brand_id\"=>$brand_id));\n return $this->db->get()->result();\n }", "public function category_products_get($cat = 0, $limit = 0)\n\t{\n \n if(!empty($cat)){\n if(!empty($limit)){\n //$data = $this->db->get_where(\"products\", ['id' => $id])->row_array();\n $this->db->select('a.*');\n $this->db->from('products a');\n $this->db->where('a.cat_id', $cat);\n $this->db->order_by('a.id', 'DESC');\n $this->db->limit($limit);\n $query = $this->db->get();\n $data = $query->result();\n } else {\n //$data = $this->db->get_where(\"products\", ['id' => $id])->row_array();\n $this->db->select('a.*');\n $this->db->from('products a');\n $this->db->where('a.cat_id', $cat);\n $this->db->order_by('a.id', 'DESC');\n $query = $this->db->get();\n $data = $query->result();\n }\n $this->response($data, REST_Controller::HTTP_OK);\n }else{\n $this->response(\"Please provide a category id.\", REST_Controller::HTTP_BAD_REQUEST);\n }\n \n }", "public static function getCategoryItems($category)\n\t{\n\t\t$db = new CSF\\Modules\\Data(\"nutrition\");\n\n\t\t$selectParam = array(\n\t\t\t\t\t\"table\"=>\"foodInfo\",\n\t\t\t\t\t\"columns\"=>array(\n\t\t\t\t\t\t\t\"number\",\n\t\t\t\t\t\t\t\"name\"\n\t\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t$items = $db->selectData($selectParam)\n\t\t\t\t\t->where(array(\"category\"=>$category))\n\t\t\t\t\t->execute();\n\n\t\techo json_encode($items, true);\n\t}", "function get_data_product() {\n $query = $this->db->query('select * from BI_emarsys_product_feeds');\n \n \tif ($query->num_rows() > 0) {\n\t\t\treturn $query->result_array();\n\t\t}\n }", "function getInventoryByProdXML($catName, $forDataURL) {\n // Function to connect to the DB\n $link = connectToDB();\n\n\t$strSQL = \"SELECT p.ProductName,ROUND((SUM(p.UnitsInStock)),0) as Quantity , ROUND((SUM(p.UnitsInStock*p.UnitPrice)),0) as Total from FC_Categories as c , FC_Products as p WHERE c.CategoryID=p.CategoryID and c.CategoryName='\" . $catName . \"' GROUP BY p.ProductName Having SUM(p.UnitsInStock)>0\";\n $result = mysql_query($strSQL) or die(mysql_error());\n\n\t//Initialize <categories> element\n\t$strCat = \"<categories>\";\n\t\n\t//Initialize datasets\n\t$strAmtDS = \"<dataset seriesname='Cost of Inventory'>\";\n\t$strQtyDS = \"<dataset seriesName='Quantity' parentYAxis='S'>\";\n\t\t\n\t//Iterate through each data row\n if ($result) {\n while($ors = mysql_fetch_array($result)) {\n //Product Names are long - so show 8 characters and ... and show full thing in tooltip\n if (strlen($ors['ProductName'])>8)\n $shortName = escapeXML(substr($ors['ProductName'],0,8) . \"...\",$forDataURL);\n else\n $shortName = escapeXML($ors['ProductName'],$forDataURL);\n\n $strCat .= \"<category label='\" . $shortName . \"' toolText='\" . escapeXML($ors['ProductName'],$forDataURL) . \"'/>\";\n $strAmtDS .= \"<set value='\" . $ors['Total'] . \"' />\";\n $strQtyDS .= \"<set value='\" . $ors['Quantity'] . \"'/>\";\n }\n }\n mysql_close($link);\n\n //Closing elements\n\t$strCat .= \"</categories>\";\n\t$strAmtDS .= \"</dataset>\";\n\t$strQtyDS .= \"</dataset>\";\n\t//Entire XML - concatenation\n\t$strXML = $strCat . $strAmtDS . $strQtyDS;\n\t\n\treturn $strXML;\n}", "protected function _getItemsData()\n {\n $layer = $this->getLayer();\n $key = $layer->getStateKey().'_SUBCATEGORIES';\n $data = $layer->getCacheData($key);\n\n if ($data === null) {\n\n $categories = $this->getChildrenCategories();\n\n /** @var $productCollection Smile_ElasticSearch_Model_Resource_Catalog_Product_Collection */\n $productCollection = $layer->getProductCollection();\n $facets = $productCollection->getFacetedData('categories');\n\n $data = array();\n foreach ($categories as $category) {\n /** @var $category Mage_Catalog_Model_Category */\n $categoryId = $category->getId();\n if (isset($facets[$categoryId])) {\n $category->setProductCount($facets[$categoryId]);\n } else {\n $category->setProductCount(0);\n }\n if ($category->getIsActive() && $category->getProductCount()) {\n $data[$categoryId] = array(\n 'label' => Mage::helper('core')->escapeHtml($category->getName()),\n 'value' => $categoryId,\n 'count' => $category->getProductCount(),\n );\n }\n }\n\n if ($this->getUseUrlRewrites()) {\n $data = $this->_appendUrlRewritesToData($data);\n }\n\n $data = array_values($data);\n\n $tags = $layer->getStateTags();\n $layer->getAggregator()->saveCacheData($data, $key, $tags);\n }\n\n return $data;\n }", "function getProducts(){\r\n\r\n\t$products = false;\r\n\t$pList = simplexml_load_file('data/productList.xml');\r\n\tif( isset( $pList->product ) ){\r\n\t\t$products = array();\r\n\t\tforeach ($pList->product as $p) {\r\n\t\t\t$cur = array();\r\n\t\t\t\r\n\t\t\t$cur['id'] \t\t\t= (string)$p->id;\r\n\t\t\t$cur['name'] \t\t= (string)$p->name;\r\n\t\t\t$cur['category'] \t= (string)$p->category;\r\n\t\t\t$cur['price'] \t\t= (string)$p->price;\r\n\t\t\t$cur['quantity'] \t= (string)$p->quantity;\r\n\t\t\t$cur['offer'] \t\t= (string)$p->offer;\r\n\t\t\t$cur['picture'] \t= (string)$p->picture;\r\n\t\t\t$cur['date'] \t\t= (string)$p->date;\r\n\t\t\t$cur['userId'] \t\t= (string)$p->userId;\r\n\t\t\t$cur['status'] \t\t= (string)$p->status;\r\n\r\n\t\t\t$products[] = $cur;\r\n\t\t\tunset($cur);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\treturn $products;\r\n}", "function particularproductlist($id)\n\t{\n\t\t$getParproduct=\"SELECT * from product_category where ptdcatgry_id = $id\";\n\t\t$product_data=$this->get_results( $getParproduct );\n\t\treturn $product_data;\n\t}", "public function fetchCategory(){\n \t$ch = curl_init();\n //getting specific orders after $time\n $encode = $this->urlPath.\"/rest/V1/categories\";\n\t\t\n curl_setopt($ch, CURLOPT_URL, $encode);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $headers = array();\n $headers[] = 'Authorization: Bearer '.$this->apiKey;\n $headers[] = 'Content-Type: application/json';\n //$headers[] = 'Accept: application/json';\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $result = curl_exec($ch);\n\n curl_close ($ch);\n\n\n\n\n return $result;\n\t\t\t \n }", "public function getAllProducts(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM products\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "function listProductsByCategory($category) {\r\n\t\t$query = \"SELECT * FROM \".TBL_PRODUCTS.\" WHERE category = :category AND available = '1' AND stock > 0\";\r\n\t\t$stmt = $this->connection->prepare($query);\r\n\t\t$stmt->execute(array(':category' => $category));\r\n\t\t$dbarray = $stmt->fetchAll();\r\n\t\t$count = $stmt->rowCount();\r\n\t\tif(!$dbarray || $count < 1){\r\n\t\t\treturn false; // failure\r\n\t\t} else {\r\n\t\t\treturn $dbarray; // success\r\n\t\t}\r\n\t}", "public function get()\n {\n $products = $this->productRepository->all();\n foreach($products as $product) {\n\n $product->category = $this->categoryRepository->find($product->category_id)->title;\n $product->section_id = $this->categoryRepository->find($product->category_id)->section_id;\n $product->section = $this->sectionRepository->find($product->section_id)->title;\n }\n return $products;\n\n }", "public function getCategoryList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_category');\r\n\t\t$this->db->where(\"(category_parent_id = '' OR category_parent_id = '0')\");\r\n\t\t$this->db->where('category_status', '1');\r\n\t\t$this->db->where('category_type', 'Product');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "function select_product_capacity_by_category_id($data)\n {\n $category_id = $data['category_id'];\n $sub_category_id = $data['sub_category_id'];\n $query = new Query;\n $capacity = $query->select('capacity')->from('core_products')->where(\"category_id = $category_id\");\n if($sub_category_id != '')\n {\n $capacity = $capacity->where(\"sub_category_id = $sub_category_id\");\n }\n \n return $capacity = $capacity->groupBy(['core_products.capacity'])->orderBy(['core_products.capacity' => SORT_ASC])->All();\n }", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "public function getCategoriaProductos(){\n\t\t$sql = \"SELECT marca.marca, productos.id_producto, productos.nombre, productos.precio, productos.precio_total, productos.url_imagen, presentaciones.presentacion, proveedores.proveedor, marca.marca, tipo_producto.tipo_producto \n\t\tFROM productos \n\t\tINNER JOIN marca ON productos.id_marca = marca.id_marca \n\t\tINNER JOIN presentaciones ON productos.id_presentacion = presentaciones.id_presentacion \n\t\tINNER JOIN proveedores ON productos.id_proveedor = proveedores.id_proveedor \n\t\tINNER JOIN tipo_producto ON productos.id_tipo_producto = tipo_producto.id_tipo_producto \n\t\tWHERE productos.id_marca = ? AND productos.id_estado = 1 AND proveedores.id_estado = 3\";\n\t\t$params = array($this->id_marca);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function wProduct($cat,$subCat){\n $sql =\"SELECT * from subcategory inner join category on subcategory.categoryID=category.categoryID WHERE subcategory.subCategoryID='$subCat'\";\n $result = $this->db->query($sql);\n if($result->num_rows > 0){\n $gtbl = $result->fetch_assoc();\n $table_product=$gtbl['table_product'];\n\n $sqlP =\"SELECT * from \".$table_product.\" order by productID desc \";\n $resultP = $this->db->query($sqlP);\n if($resultP->num_rows > 0){\n while($rowP = $resultP->fetch_assoc()){\n $data[] = $rowP;\n }\n \n }\n \n }\n return !empty($data)?$data:false;\n }", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function getCollectionProducts()\n {\n\t\t$collection_Products = $this->ShopifyClient->call('GET','/admin/products.json?collection_id='.$this->config['collection_id']);\t\t\n\t\t$arra = array();\n\t\tif(!empty($collection_Products['products']))\n\t\t{\n\t\t\t$keyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images',\n\t\t\t\t\t\t\t'image','options',array('variants'=>array('id','price','sku','compare_at_price','weight','weight_unit')));\n\t\t\t$shopifyKeyArr = array('id','title','body_html','created_at','vendor','product_type','tags','images','image','options',\n\t\t\t\t\t\t\t\t array('variants'=>array(0 =>array('id','price','sku','compare_at_price','weight','weight_unit'))));\n\t\t\t\n\t\t\tforeach($collection_Products as $key=>$var) {\n\t\t\t\tforeach($var as $k=>$val) {\n\t\t\t\t\t$arra['data'][] = $this->createProductArray($val,$shopifyKeyArr,$keyArr);\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t$status_code = 200;\n\t\t\t$message = 'success';\t\n\t}else\n\t{\n\t\t$status_code = 404; \n\t\t$message = 'Collections products not found';\n\t\t$arra['data'] = array();\n\t\t$arra['data_count'] = 0;\n\t}\t\n\t\t$collection_Products = $this->getJsonDataFormat($arra,$status_code,$message);\n\t\treturn $collection_Products;\n }", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function actionCategories()\n {\n // $model ->select('category')\n // ->from('product')\n // ->distinct()\n // ->all();\n \n // if ($model) {\n // foreach ($model as $row) {\n // print_r($row['category']);\n // }\n // }\n $query = product::find()->select('category')->distinct();\n foreach($query as $row)\n {\n print_r($row->category);\n }\n \n exit();\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return $model;\n\n }", "function getcategorys_list(){\n \n global $wpdb;\n\n$post_per_page = (isset($_REQUEST['post_per_page'])) ? $_REQUEST['post_per_page'] : 1; \n\n$offset = $post_per_page * ($_REQUEST['page'] - 1);\n// Setup the arguments to pass in\n$args = array(\n'offset' => $offset,\n'number' => $post_per_page,\n'order' => 'DESC',\n'hide_empty'=>0\n);\n// Gather the series\n$mycategory = get_terms( 'products', $args );\n\n\n\n if(!empty($mycategory)){\n foreach($mycategory as $post)\n {\n\n \n $im = $post->taxonomy.'_'. $post->term_id; \n $collection_image = get_field('category_image',$im); \n\n $title = $collection_image['title'];\n $url = get_term_link($post);\n $medium= get_image_url($collection_image['id'],'medium');\n\n if(empty($medium)){\n $medium = (get_template_directory_uri().\"/images/no-image.png\"); \n }\n \n\n printf('<div class=\"col-lg-3 col-md-4 col-sm-4 col-xs-6\">\n <div class=\"product_info\"><a href=\"'.$url.'\" title=\"\" class=\"overly\"><span><img src=\"'.$medium.'\" alt=\"\" title=\"\"></span></a>\n <h4>'.$post->name.'</h4>\n <a href=\"'.$url.'\" title=\"View More\" class=\"link\">View More</a> </div>\n </div>');\n\n\n }\n }\n die();\n}", "function tep_get_subCategory($tagValue){\n\tglobal $languages_id,$customer_group_id;\n\t//禁用的电池分类ID @nathan 2011-11-2\n\t//$disable_batteries = array(1,3,21,23,25,73,111,307,314,499);\n\t$disable_batteries = array(23,25,73,111,307,499);\n\t$disable_batteries_three = array(188,191,192,193,194,195,502,556,112,115,117,126,129,136,139,141,172,175,601,181,306,312,313,500,501,562,197,198,202,204,205,206,208,210,211,212,213,217,218,220,503,504,505,521,557,558,559,560,561,563,507,508,509,510,511,512,513,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,741);\n\t$jsonData = array();\n\tif (isset($tagValue) && !empty($tagValue)){\n\t\t# \n\t\t# URL\n\t\t# Ʒ\n\t\t# |_| |=|\n\t\t$topNavi_categories_sql = sprintf(\"SELECT DISTINCT C.categories_id,C.parent_id, CD.categories_name FROM %s AS CD INNER JOIN %s AS C ON CD.categories_id=C.categories_id WHERE CD.language_id=%u AND C.products_group_access like '%s' AND C.parent_id=%u ORDER BY C.sort_order ASC\",TABLE_CATEGORIES_DESCRIPTION,TABLE_CATEGORIES,(int)$languages_id,\"%\".$customer_group_id.\"%\",(int)$tagValue);\n\t\t$topNavi_categories_query = tep_db_query($topNavi_categories_sql);\n\t\tif (tep_db_num_rows($topNavi_categories_query) > 0){\n\t\t\t$i = 0;\n\t\t\twhile ($topNavi_categories = tep_db_fetch_array($topNavi_categories_query)) {\n\t\t\t\t//禁止显示的电池分类 @nathan 2011-11-2\n\t\t\t\tif($tagValue == 408 && in_array($topNavi_categories['categories_id'], $disable_batteries)) continue;\n\n\t\t\t\t$products_in_category = tep_count_products_in_category($topNavi_categories['categories_id']);\n\t\t\t\tif ($products_in_category > 0){\n\t\t\t\t\t$jsonData[$i]['name'] = $topNavi_categories['categories_name'];\n\t\t\t\t\t$jsonData[$i]['url'] = tep_href_link(FILENAME_DEFAULT,tep_get_abscPath($topNavi_categories['categories_id']),'NONSSL',false);\n\t\t\t\t\t$jsonData[$i]['parent'] = '0';\n\t\t\t\t\t$jsonData[$i]['num'] = tep_count_products_in_category($topNavi_categories['categories_id']);\n\t\t\t\t\t$i++;\n\t\t\t\t\t$sub_categories_sql = sprintf(\"SELECT DISTINCT C.categories_id,C.parent_id, CD.categories_name FROM %s AS CD INNER JOIN %s AS C ON CD.categories_id=C.categories_id WHERE CD.language_id=%u AND C.products_group_access like '%s' AND C.parent_id=%u ORDER BY C.sort_order ASC\",TABLE_CATEGORIES_DESCRIPTION,TABLE_CATEGORIES,(int)$languages_id,\"%\".$customer_group_id.\"%\",(int)$topNavi_categories['categories_id']);\n\t\t\t\t\t$sub_categories_query = tep_db_query($sub_categories_sql);\n\t\t\t\t\tif (tep_db_num_rows($sub_categories_query) > 0){\n\t\t\t\t\t\twhile ($sub_categories = tep_db_fetch_array($sub_categories_query)) {\n\t\t\t\t\t\t\tif(in_array($sub_categories['categories_id'], $disable_batteries_three)) continue;\n\t\t\t\t\t\t\t$products_in_subcategory = tep_count_products_in_category($sub_categories['categories_id']);\n\t\t\t\t\t\t\tif ($products_in_subcategory > 0){\n\t\t\t\t\t\t\t\t$jsonData[$i]['name'] = $sub_categories['categories_name'];\n\t\t\t\t\t\t\t\t$jsonData[$i]['url'] = tep_href_link(FILENAME_DEFAULT,tep_get_abscPath($sub_categories['categories_id']),'NONSSL',false);\n\t\t\t\t\t\t\t\t$jsonData[$i]['parent'] = $sub_categories['categories_id'];\n\t\t\t\t\t\t\t\t$jsonData[$i]['num'] = tep_count_products_in_category($sub_categories['categories_id']);\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t}unset($products_in_subcategory);\n\t\t\t\t\t\t}unset($sub_categories);\n\t\t\t\t\t}unset($sub_categories_query,$sub_categories_sql);\n\t\t\t\t}unset($products_in_category);\n\t\t\t}unset($topNavi_categories);\n\t\t}unset($topNavi_categories_query,$topNavi_categories_sql);\n\t\t//echo json_encode($jsonData);\n\t\treturn $jsonData;\n\t}else{\n\t\treturn false;\n\t}\n}", "public function wProductDescription($categoryID,$subCategoryID,$productID){\n $sql =\"SELECT * from subcategory inner join category on subcategory.categoryID=category.categoryID WHERE subcategory.subCategoryID='$subCategoryID'\";\n $result = $this->db->query($sql);\n if($result->num_rows > 0){\n $gtbl = $result->fetch_assoc();\n $table_product=$gtbl['table_product'];\n\n $sqlP =\"SELECT * from \".$table_product.\" where categoryID='$categoryID' and subCategoryID='$subCategoryID' and productID='$productID' \";\n $resultP = $this->db->query($sqlP);\n if($resultP->num_rows > 0){\n while($rowP = $resultP->fetch_assoc()){\n $data[] = $rowP;\n }\n \n }\n \n }\n return !empty($data)?$data:false;\n }", "public static function getAll() {\n $SQL = 'Select * from product inner JOIN product_category on product.product_category_id = product_category.product_category_id;';\n $prep = DataBase::getInstance()->prepare($SQL);\n $prep -> execute();\n return $prep->fetchAll(PDO::FETCH_OBJ);\n }", "public function getcategory()\r\n{\r\n {\r\n $sql = \"select * from categories\";\r\n $result = $this->connect()->query($sql);\r\n if ($result->rowCount() > 0) {\r\n while ($row = $result->fetch()) {\r\n $data[] = $row;\r\n\r\n }\r\n return $data;\r\n }\r\n }\r\n}", "function get_products_with_attributes() {\n global $db;\n if(isset($_SESSION['languages_id'])){ $language_id = (int)$_SESSION['languages_id'];} else { $language_id=1;}\n $query = 'SELECT DISTINCT attrib.products_id, description.products_name, products.products_quantity, products.products_model, products.products_image\n FROM '.TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description, '.TABLE_PRODUCTS.' products\n WHERE attrib.products_id = description.products_id AND\n attrib.products_id = products.products_id AND \n description.language_id='.$language_id.' \n ORDER BY description.products_name ';\n $products = $db->Execute($query);\n while(!$products->EOF){\n $products_array[] = $products->fields['products_id'];\n $products->MoveNext();\n }\n return $products_array;\n }", "public function fetch_products_by_cat($id) {\n $this->db->select('product.id,product.name,product.price,product.status,product_categories.product_id,product_categories.category_id,(SELECT product_images.image_name FROM product_images WHERE product_images.product_id = product.id ORDER BY id ASC LIMIT 1) AS pr_img');\n $this->db->from('product');\n $this->db->join('product_categories', 'product_categories.product_id = product.id');\n $this->db->where('product_categories.category_id', $id);\n $r = $this->db->get();\n return $r->result_array();\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function getSearchData()\n\t{\n\t\t$search_data \t\t=\tjson_decode($this->request->getContent(),true);\n\t\t$search_term\t\t=\t$search_data['search_term'];\n\t\t$area_id\t\t\t=\t$search_data['area_id'];\n\t\t$city_id\t\t\t=\t$search_data['city_id'];\n\t\t$page_number\t\t=\t$search_data['page_number'];\n\t\t\n\t\t$products = $this->_productCollectionFactory->create()->addAttributeToSelect(\n\t\t\t'*'\n\t\t)->addFieldToFilter(\n\t\t\t'name',\n\t\t\t['like' => '%'.$search_term.'%']\n\t\t)-> addAttributeToFilter('visibility', array('in' => array(4) )\n\t\t)-> addAttributeToFilter('status', array('in' => array(1) ))\n\t\t->addCategoryIds()->setPageSize(10)\n ->setCurPage($page_number);\n\t\t\n\t\t\n\t\t$products->getSelect()\n\t\t\t\t->join(array(\"marketplace_product\" => 'marketplace_product'),\"`marketplace_product`.`mageproduct_id` = `e`.`entity_id`\",array(\"seller_id\" => \"seller_id\"))\n\t\t\t\t->join(array(\"marketplace_userdata\" => 'marketplace_userdata'),\"`marketplace_userdata`.`seller_id` = `marketplace_product`.`seller_id` AND (FIND_IN_SET('\".$area_id.\"', `area_id`)) AND (FIND_IN_SET('\".$city_id.\"', `region_id`)) \",array(\"shop_url\", \"logo_pic\")); \n\t\t\n\t\t\n\t\t$all_response \t=\tarray();\n\t\t$all_response['data'] \t=\tarray();\n\t\t$categories \t=\tarray();\n\t\t$seller_data \t=\tarray();\n\t\t$priceHelper \t= \t$this->_objectManager->create('Magento\\Framework\\Pricing\\Helper\\Data'); // Instance of Pricing Helper\n\t\t$StockState \t= \t$this->_objectManager->get('\\Magento\\CatalogInventory\\Api\\StockStateInterface');\n\t\t$store \t\t\t\t= \t$this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore();\n\t\tforeach($products as $product_data){\n\t\t\tif(!isset($all_response['data'][$product_data->getSellerId()])){\t\t\t\n\t\t\t\t$all_response['data'][$product_data->getSellerId()]['seller']\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=> ucfirst($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'shop_url'=> ($product_data->getShopUrl()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'logo'=> $product_data->getLogoPic(),\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}\n\t\t\t$categories\t\t\t=\t$product_data->getCategoryIds();\n\t\t\t$formattedPrice \t= \t$priceHelper->currency($product_data->getPrice(), true, false);\n\t\t\t\n\t\t\t$product_quantity\t=\t$StockState->getStockQty($product_data->getId(), $product_data->getStore()->getWebsiteId());\n\t\t\t$collectioncat \t\t= \t$this->_categoryCollectionFactory->create();\n\t\t\t$collectioncat->addAttributeToSelect(array('name'), 'inner');\n\t\t\t$collectioncat->addAttributeToFilter('entity_id', array('in' => $categories));\n\t\t\t$collectioncat->addAttributeToFilter('level', array('gt' => 1));\n\t\t\t$collectioncat->addIsActiveFilter();\n\t\t\t$productImageUrl \t= \t$store->getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product/';\n\t\t\t\n\t\t\t$shortdescription\t=\t$product_data->getShortDescription();\n\t\t\tif($shortdescription==null){\n\t\t\t\t$shortdescription\t=\t\"\";\n\t\t\t}\n\t\t\tif($product_data->getTypeId()!=\"simple\"){\n\t\t\t\t$price\t\t\t=\t0;\n\t\t\t\t$product_price\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t\t$_children = $product_data->getTypeInstance()->getUsedProducts($product_data);\n\t\t\t\tforeach ($_children as $child){\n\t\t\t\t\t$productPrice = $child->getPrice();\n\t\t\t\t\t$price = $price ? min($price, $productPrice) : $productPrice;\n\t\t\t\t}\n\t\t\t\t$special_price\t=\t$product_data->getFinalPrice(); \n\t\t\t\tif($price <= $product_data->getFinalPrice()){\n\t\t\t\t\t$special_price\t=\tnull; \n\t\t\t\t}\n\t\t\t\t$formattedPrice\t\t\t=\t$price; \n\t\t\t\t$product_price\t\t\t=\t$product_data->getProductPrice();\n\t\t\t\t$product_special_price\t=\t$product_data->getProductSpecialPrice();\n\t\t\t}else{\n\t\t\t\t$formattedPrice\t\t\t=\t$product_data->getPrice(); \n\t\t\t\t$special_price\t\t\t=\t$product_data->getFinalPrice(); \n\t\t\t\t$product_price\t\t\t=\t0;\n\t\t\t\t$product_special_price\t=\t0;\n\t\t\t}\n\t\t\tif($formattedPrice == $special_price ){\n\t\t\t\t$special_price\t\t\t=\tnull; \n\t\t\t}\n\t\t\t$formattedPrice\t\t\t\t=\tnumber_format($formattedPrice, 2);\n\t\t\tif($special_price !=null){\n\t\t\t\t$special_price\t\t\t\t=\tnumber_format($special_price, 2);\n\t\t\t}\n\t\t\t$all_response['data'][$product_data->getSellerId()]['products'][]\t=\tarray(\n\t\t\t\t\t\t\t\t\t\t\t\t'id'=>$product_data->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$product_data->getName(),\n\t\t\t\t\t\t\t\t\t\t\t\t'sku'=>$product_data->getSku(),\n\t\t\t\t\t\t\t\t\t\t\t\t'short_description'=>$shortdescription,\n\t\t\t\t\t\t\t\t\t\t\t\t'price'=>$formattedPrice,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_price'=>$product_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_special_price'=>$product_special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'special_price'=>$special_price,\n\t\t\t\t\t\t\t\t\t\t\t\t'image'=>ltrim($product_data->getImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'small_image'=>ltrim($product_data->getSmallImage(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'thumbnail'=>ltrim($product_data->getThumbnail(), \"/\"),\n\t\t\t\t\t\t\t\t\t\t\t\t'quantity'=>$product_quantity,\n\t\t\t\t\t\t\t\t\t\t\t\t'product_data'=>$product_data->getData(),\n\t\t\t\t\t\t\t\t\t\t\t\t'productImageUrl'=>$productImageUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t'categories'=>$collectioncat->getData(),\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t$all_response['data'][$product_data->getSellerId()]['categories']\t=\t$collectioncat->getData();\n\t\t}\n\t\t\n\t\t\n\t\t$search_data \t=\t[['page_number'=>$page_number,'total_count'=>$products->getSize()]];\n\t\tif(!empty($all_response['data'])){\n\t\t\tforeach($all_response['data'] as $serller_id=>$seller_data){\n\t\t\t\t$customer_data \t\t\t\t\t= \t$this->_objectManager->create('Magento\\Customer\\Model\\Customer')->load($serller_id);\n\t\t\t\t$seller_data['seller']['name']\t=\ttrim($customer_data->getData('firstname').\" \".$customer_data->getData('lastname'));\n\t\t\t\t$search_data[]\t=\t[\n\t\t\t\t\t\t\t\t\t\t'seller_data'=>$seller_data['seller'],\n\t\t\t\t\t\t\t\t\t\t'products'=>$seller_data['products'],\n\t\t\t\t\t\t\t\t\t\t'categories'=>$seller_data['categories']\n\t\t\t\t\t\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $search_data;\n\t}", "public function getProduct();", "private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }", "private function getCategoryNames()\n {\n $categoryData = array();\n $this->_connection = $this->_resourceConnection->getConnection();\n $table = $this->_connection->getTableName('catalog_category_entity_varchar');\n $query = \"\n SELECT *\n FROM `{$table}`\n WHERE attribute_id = '{$this->nameAttributeId}'\n \";\n\n $result = $this->_connection->fetchAll($query);\n\n if (count($result) > 0) {\n foreach ($result as $category) {\n if (isset($category['entity_id'])) {\n $categoryData[$category['entity_id']][$category['store_id']] = $category['value'];\n } else {\n $categoryData[$category['row_id']][$category['store_id']] = $category['value'];\n }\n }\n }\n\n return $categoryData;\n }", "public function getProductByCat($catid){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE catId = '$catid' \";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "public function get($id = NULL){\n\t\t$data = array();\n\n\t\tif(is_array($id)){\n\t\t\t// get product based on array of ids\n\t\t\t$items = '';\n\t\t\tforeach ($id as $item) {\n\t\t\t\tif ($items != '') {\n\t\t\t\t\t$items .= ',';\n\t\t\t\t}\n\t\t\t\t$items .= $item;\n\t\t\t}\n\t\t\tif ($result = $this->Database->query(\"SELECT product_id, product_name, product_body, product_price, total_product, product_image, product_type FROM $this->db_table WHERE product_id IN ($items) ORDER BY product_name\")) \n\t\t\t{\n\t\t\t\tif ($result->num_rows > 0) {\n\t\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t\t{\n\t\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\t'product_id' => $row['product_id'],\n\t\t\t\t\t\t\t'product_name' => $row['product_name'],\n\t\t\t\t\t\t\t'product_body' => $row['product_body'],\n\t\t\t\t\t\t\t'product_price' => $row['product_price'],\n\t\t\t\t\t\t\t'total_product' => $row['total_product'],\n\t\t\t\t\t\t\t'product_image' => $row['product_image'],\n\t\t\t\t\t\t\t'product_type' => $row['product_type']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($id != NULL){\n\t\t\t\tif ($stmt = $this->Database->prepare(\"SELECT \n\t\t\t\t\t$this->db_table.product_id, \n\t\t\t\t\t$this->db_table.cat_id, \n\t\t\t\t\t$this->db_table.product_name,\n\t\t\t\t\t$this->db_table.product_body, \n\t\t\t\t\t$this->db_table.product_price, \n\t\t\t\t\t$this->db_table.total_product, \n\t\t\t\t\t$this->db_table.product_image, \n\t\t\t\t\t$this->db_table.product_type,\n\t\t\t\t\tcategories.cat_name AS cat_name\n\t\t\t\t\tFROM $this->db_table, categories\n\t\t\t\t\tWHERE $this->db_table.product_id = ? AND $this->db_table.cat_id = categories.cat_id\"))\n\t\t\t{\n\t\t\t\t$stmt->bind_param(\"i\", $id);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$stmt->store_result();\n\t\t\t\t$stmt->bind_result($product_id, $cat_id, $product_name, $product_body, $product_price, $total_product, $product_image, $product_type, $cat_name);\n\t\t\t\t$stmt->fetch();\n\n\t\t\t\tif ($stmt->num_rows > 0) {\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t\t'product_id' => $product_id,\n\t\t\t\t\t\t\t'cat_id' => $cat_id,\n\t\t\t\t\t\t\t'product_name' => $product_name,\n\t\t\t\t\t\t\t'product_body' => $product_body,\n\t\t\t\t\t\t\t'product_price' => $product_price,\n\t\t\t\t\t\t\t'total_product' => $total_product,\n\t\t\t\t\t\t\t'product_image' => $product_image,\n\t\t\t\t\t\t\t'product_type' => $product_type,\n\t\t\t\t\t\t\t'cat_name' => $cat_name\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$stmt->close();\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//get all poroducts\n\t\t\tif($result=$this->Database->query(\"SELECT * FROM \" . $this->db_table .\" ORDER BY product_name\"))\n\t\t\t{\n\t\t\t\tif($result->num_rows > 0){\n\n\t\t\t\t\twhile ($row = $result->fetch_array()) {\n\t\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t\t'product_id' => $row['product_id'],\n\t\t\t\t\t\t\t'cat_id' => $row['cat_id'],\n\t\t\t\t\t\t\t'product_name' => $row['product_name'],\n\t\t\t\t\t\t\t'product_body' => $row['product_body'],\n\t\t\t\t\t\t\t'product_price' => $row['product_price'],\n\t\t\t\t\t\t\t'total_product' => $row['total_product'],\n\t\t\t\t\t\t\t'product_image' => $row['product_image'],\n\t\t\t\t\t\t\t'product_type' => $row['product_type']\n\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "public function get_inventory_by_category_summary()\n\t{\n\t\t$this->db->select(\n\t\t\t$this->datas_table.\".category_id, \".\n\t\t\t$this->categories_table.\".code, \".\n\t\t\t$this->categories_table.\".name, \".\n\t\t\t\"COUNT(\".$this->datas_table.\".category_id) AS total\"\n\t\t);\n\t\t$this->db->from($this->datas_table);\n\n\t\t// join categories table\n\t\t$this->db->join(\n\t\t\t$this->categories_table,\n\t\t\t$this->datas_table.'.category_id = '.$this->categories_table.'.id',\n\t\t\t'left');\n\n\t\t$this->db->where($this->datas_table.'.deleted', '0');\n\n\t\t$this->db->group_by($this->datas_table.'.category_id');\n\n\t\t$datas = $this->db->get();\n\t\treturn $datas;\n\t}", "public function getCategoryFieds() {\n\t\t$result = $fields = array();\n\t\n\t\t$query = $this->db->query('DESCRIBE '. DB_PREFIX . 'category_description');\n\t\t$result = $query->rows;\n\t\t\n\t\tforeach ($result as $row) {\n\t\t\tif ($row['Field'] == 'product_id' || $row['Field'] == 'language_id') { continue; }\n\t\t\t$field = $row['Field'];\n\t\t\t$fields[$field] = $field;\n\t\t}\n\t\treturn $fields;\n\t}", "function get_all()\n {\n $this->db->select('products.*, company_category.category');\n $this->db->join('company_category', 'company_category.id = products.cat_id');\n return $this->db->get($this->table)->result();\n }", "function getProductsBySubCategori($id) {\r\n \r\n $db = new SQL_Conect_PDO(); \r\n $sql = \"SELECT * FROM `products` WHERE `Id_sub_categories` = :Id \"\r\n . \"ORDER BY `Name` ASC \";\r\n \r\n $ArrPars['Id'] = $id; \r\n\r\n $db->SetQuery($sql, $ArrPars); \r\n $res = $db->GetQueryAll_Class(\"Product\");\r\n \r\n return $res;\r\n }", "function viewAllProducts()\r\n{\r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"SELECT * FROM products JOIN categories WHERE products.category_id = categories.category_id\");\r\n \r\n $results = array();\r\n if \r\n // Function used to pull all records from Table\r\n ($stmt->execute() && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n return $results;\r\n}", "public function getAllProducts()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table;\";\n $resultset = $this->db->executeFetchAll($sql);\n foreach ($resultset as $value) {\n $value->description = $this->filter->parse($value->description, [\"markdown\"]);\n $value->description = $this->content->tokenTruncate($value->description, 100);\n }\n return $resultset;\n }", "function displayCategory()\r\n\t {\r\n\t \t$productId = JRequest::getVar('product_id');\r\n\t \t\r\n\t \t$model = $this->getModel('qrcode');\r\n\t \t$productList = $model->getProductByCategory();//Store product details based on category.\r\n\t \tob_clean();\r\n\t \t\r\n\t \techo \"<b>\".JText::_('COM_QRCODE_VIEW_DEFAULT_PRODUCT_LIST').\"</b>\";\r\n \r\n\t \t\t\t$options = array();\r\n $default = \"\";\r\n if($productId)\r\n {\r\n \t$default = $productId;\r\n }\r\n $options[] = JHTML::_('select.option', \"0\", JText::_('COM_QRCODE_VIEW_DEFAULT_DISPLAY_ALL'));\r\n foreach ($productList as $key=>$val) {\r\n $options[] = JHTML::_('select.option', $val['product_id'], $val['product_name']);\r\n }\r\n echo JHTML::_('select.genericlist', $options, 'qrcode', 'onchange=getProductId(this.value)','value', 'text', $default); \r\n exit();\r\n\t }", "function getProducts()\n\t{\n\t\tglobal $con;\n\t\tif (!isset($_GET['cat'])){\n\t\t\tif (!isset($_GET['brand'])) {\n\t\t\t\t$get_products = \"select * from products order by RAND() LIMIT 0, 6\";\n\t\t\t\t$run_products = mysqli_query($con, $get_products);\n\n\t\t\t\twhile($row = mysqli_fetch_array($run_products)) {\n\t\t\t\t\t$prod_id = $row['prod_id'];\n\t\t\t\t\t$prod_cat = $row['prod_cat'];\n\t\t\t\t\t$prod_brand = $row['prod_brand'];\n\t\t\t\t\t$prod_price = $row['prod_price'];\n\t\t\t\t\t$prod_image = $row['prod_img'];\n\n\t\t\t\techo \"\n\t\t\t\t\t<div class='single_product'>\n\t\t\t\t\t\t<img src='admin_area/product_images/$prod_image'>\t\n\t\t\t\t\t\t<div class='item_det'>\n\t\t\t\t\t\t\t<h2>$prod_price</h2>\n\t\t\t\t\t\t\t<a href='details.php?pro_id=$prod_id' style='float:left;'>Details</a>\n\t\t\t\t\t\t\t<a href='index.php?add_cart=$prod_id'><button>Add to Cart</button></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function getProducts()\n{\n/// getProducts function Code Starts ///\n global $db;\n $loading_str = file_get_contents(\"functions/loader-b64.txt\");\n $aWhere = array();\n/// Manufacturers Code Starts ///\n if (isset($_REQUEST['man']) && is_array($_REQUEST['man'])) {\n foreach ($_REQUEST['man'] as $sKey => $sVal) {\n if ((int) $sVal != 0) {\n $aWhere[] = 'manufacturer_id=' . (int) $sVal;\n }\n }\n }\n/// Manufacturers Code Ends ///\n /// Products Categories Code Starts ///\n if (isset($_REQUEST['p_cat']) && is_array($_REQUEST['p_cat'])) {\n foreach ($_REQUEST['p_cat'] as $sKey => $sVal) {\n if ((int) $sVal != 0) {\n $aWhere[] = 'p_cat_id=' . (int) $sVal;\n }\n }\n }\n/// Products Categories Code Ends ///\n /// Categories Code Starts ///\n if (isset($_REQUEST['cat']) && is_array($_REQUEST['cat'])) {\n foreach ($_REQUEST['cat'] as $sKey => $sVal) {\n if ((int) $sVal != 0) {\n $aWhere[] = 'cat_id=' . (int) $sVal;\n }\n }\n }\n/// Categories Code Ends ///\n $per_page = 6;\n if (isset($_GET['page'])) {\n $page = $_GET['page'];\n } else {\n $page = 1;\n }\n $start_from = ($page - 1) * $per_page;\n $sLimit = \" order by 1 DESC LIMIT $start_from,$per_page\";\n $sWhere = (count($aWhere) > 0 ? ' WHERE ' . implode(' or ', $aWhere) : '') . $sLimit;\n $get_products = \"select * from products \" . $sWhere;\n $run_products = mysqli_query($db, $get_products);\n while ($row_products = mysqli_fetch_array($run_products)) {\n $pro_id = $row_products['product_id'];\n $pro_title = $row_products['product_title'];\n $pro_price = $row_products['product_price'];\n $pro_img1 = $row_products['product_img1'];\n $manufacturer_id = $row_products['manufacturer_id'];\n $get_manufacturer = \"select * from manufacturers where manufacturer_id='$manufacturer_id'\";\n $run_manufacturer = mysqli_query($db, $get_manufacturer);\n $row_manufacturer = mysqli_fetch_array($run_manufacturer);\n $manufacturer_name = $row_manufacturer['manufacturer_title'];\n $pro_url = 'images/' . $row_products['product_url'] . '.php';\n echo \"\n <div class='col-md-4 col-sm-6 center-responsive' >\n <div class='product' >\n <a href='$pro_url' >\n <img src='\" . $loading_str . \"' class='img-responsive' id='imageId_$pro_id'>\n </a>\n <div class='text' >\n <center>\n <p class='btn btn-primary'> $manufacturer_name </p>\n </center>\n <hr>\n <h3><a href='$pro_url' >$pro_title</a></h3>\n <p class='price' >Rs. $pro_price</p>\n <p class='buttons' >\n <a href='$pro_url' class='btn btn-default' >View details</a>\n <a href='cart.php?itemId=$pro_id&quantity=1&price=$pro_price&size=Medium' class='btn btn-primary'>\n <i class='fa fa-shopping-cart'></i> Add to cart\n </a>\n <a href='index.php?subscribe=true&product_id=$pro_id' class='btn btn-primary'>Subscribe</a>\n </div>\n </div>\n </div>\n <script>\n var wid = screen.availWidth;\n var level = 0;\n if (wid <= 425) level = 3;\n else if (wid <= 768) level = 2;\n else if (wid <= 1440) level = 1;\n else level = 0;\n $(document).ready(function () {\n $.ajax({\n url: 'http://0.0.0.0:3000/image',\n type: 'POST',\n data: JSON.stringify({ image_name: '\" . $pro_img1 . \"', level: level }),\n contentType: 'application/json; charset=utf-8',\n success: function (response) {\n document.getElementById('imageId_$pro_id').src = response.data;\n }\n });\n });\n </script>\n \";\n // loadImages($pro_img1, $pro_id);\n }\n/// getProducts function Code Ends ///\n}", "public function getProductsData($productCollection)\n {\n /** @var Oggetto_YandexPrices_Model_Api_Market $api */\n $api = Mage::getModel('oggetto_yandexprices/api_market');\n /** @var Oggetto_YandexPrices_Helper_Data $helper */\n $helper = Mage::helper('oggetto_yandexprices');\n\n $data = [];\n /** @var Mage_Catalog_Model_Product $product */\n foreach ($productCollection as $product) {\n $price = $api->fetchPriceFromMarket($product->getName(), true);\n if (!is_null($price)) {\n $productPrice = $product->getFinalPrice();\n\n $priceFormatted = $helper->formatPrice($price, $this::YANDEX_MARKET_PRICE_CURRENCY);\n $priceAdduced = $helper->adducePrice($priceFormatted, $productPrice);\n\n $data[] = [\n 'product_id' => $product->getId(),\n 'price' => $priceAdduced\n ];\n } else {\n $data[] = [\n 'product_id' => $product->getId(),\n 'price' => $price\n ];\n }\n }\n\n return $data;\n }", "function getKidsGirlCategoryProducts($cat_id,$limit,$start)\n\t\t\t\t{\n\t\t\t\t$otherconditions='';\n\t\t\t\tif(!isset($_SESSION['orderby'])) $_SESSION['orderby']='product_id';\n\t\t\t\tif(isset($_SESSION['filter'])) $otherconditions=$_SESSION['filter'];\t\t\t\t\n\t\t\t\t$sql=\"SELECT product. * , product_people.people_cat_id,brand.brand_name, color.color_name, product_type.type_name FROM product\n\n\t\t\t\tINNER JOIN product_type ON product.product_type_id = product_type.product_type_id\n\t\t\t\tINNER JOIN product_color ON product.product_id = product_color.product_id \n\t\t\t\tINNER JOIN color ON product_color.color_id = color.color_id\n\t\t\t\tINNER JOIN brand ON product.brand_id = brand.brand_id\n\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\tWHERE product_people.people_cat_id = '4'\n\t\t\t\tAND product.product_type_id= \".$cat_id.\" \".$otherconditions.\" ORDER BY \".$_SESSION['orderby'].\" DESC LIMIT \".$start.\",\".$limit;\n\t\t\t\t$result = $this->db->query($sql);\n\t\t\t\tif($result->num_rows()>0){\n\t\t\t\t$_SESSION['product_count']=$result->num_rows();\n\t\t\t\treturn $result->result();\n\t\t\t\t}else{\n\t\t\t\treturn 'empty';\n\t\t\t\t}\n\t\t\t\t}", "public function product_list_by_main_category(){\n $main_category_id = $_REQUEST['main_category_id'];\n $product_list = $this->User_Model->get_list_by_id_fields('product_id, product_name, tax_rate, min_ord_limit, max_ord_limit, product_unit, product_details, product_img','product_status',1,'main_category_id',$main_category_id,'','','product_name','ASC','product');\n if ($product_list) {\n foreach ($product_list as $product_list1) {\n $product_id = $product_list1->product_id;\n $product_attribute_list = $this->API_Model->product_attribute_list($product_id);\n // $product_attribute_list = $this->User_Model->get_list_by_id_fields('pro_attri_id, product_id, pro_attri_weight, pro_attri_mrp, pro_attri_price, pro_attri_dis_per, pro_attri_dis_amt','pro_attri_status',1,'product_id',$product_id,'','','pro_attri_id','ASC','product_attribute');\n $product_list1->product_attribute_list = $product_attribute_list;\n $product_img_list = $this->User_Model->get_list_by_id_fields('product_images_id, product_images_name','product_id',$product_id,'','','','','product_images_id','ASC','product_images');\n $product_list1->product_img_list = $product_img_list;\n }\n $response[\"status\"] = TRUE;\n $response[\"img_path\"] = base_url().'assets/images/product/';\n $response[\"product_list\"] = $product_list;\n } else {\n $response[\"status\"] = FALSE;\n $response[\"img_path\"] = base_url().'assets/images/product/';\n $response[\"product_list\"] = $product_list;\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function getCategory(Request $request)\n\t{\n\t\t$params = $request->all();\n\n\t\t$categories = new Categories;\n\n\t\tif(isset($params['category']) && $params['category']!=\"\"){\n\t\t\t$categories = $categories->where('slug', \"=\", $params['category']);\n\t\t}\n\n\t\t$categories = $categories->where('cat_status',1);\t\t\n\n\t\tif(isset($params['onlyParent']) && $params['onlyParent']){\n\t\t\t$categories = $categories->where('ancestors','exists',false);\n\t\t}\n\n\t\t$categories = $categories->get();\n\n\t\tif(empty($categories) || !is_object($categories) || empty($categories->toArray())){\n\t\t\treturn response([],404);\n\t\t}\n\n\t\tif(isset($params['withChild']) && $params['withChild']){\n\n\t\t\tforeach($categories as &$category){\t\t\t\t\n\t\t\t\t$category['children'] = array();\n\t\t\t\t$category['children'] = Categories::where('cat_status',1)->where('ancestors.0._id','=',$category['_id'])->get(array('_id','slug','cat_title','metaTitle','metaDescription','metaKeywords'));\n\t\t\t}\n\n\t\t}\t\n\t\t\n\t\t\n\t\tif(isset($params['withCount']) && $params['withCount']){\n\n\t\t\t// db.products.aggregate([{$group:{_id:\"$categories\",count:{$sum:1}}}])\n\n\t\t\t$products = DB::collection('products')->raw(function($collection){\n\n\t\t\t\treturn $collection->aggregate(array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$match' => array(\n\t\t\t\t\t\t\t'status' => 1\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$project' => array('categories' => 1)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$unwind' => array(\n\t\t\t\t\t\t\t'path' => '$categories',\n\t\t\t\t\t\t\t'preserveNullAndEmptyArrays' => true\t\n\t\t\t\t\t\t)\n\t\t\t\t\t),\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'$group' => array(\n\t\t\t\t\t\t\t'_id'=>'$categories',\n\t\t\t\t\t\t\t'count' => array(\n\t\t\t\t\t\t\t\t'$sum' => 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));\n\t\t\t});\n\n\t\t\t$processedPro = [];\n\t\t\tforeach($products['result'] as $product){\n\n\t\t\t\t$cat = $product['_id'];\n\n\t\t\t\t$processedPro[$cat] = $product['count'];\n\n\t\t\t}\n\n\t\t\tforeach($categories as &$category){\n\n\t\t\t\t$category['productCount'] = isset($processedPro[$category['_id']])?$processedPro[$category['_id']]:0;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn response($categories);\n\t}", "function get_store_data()\n\t{\n\t\t// fetch data from db\n\t\t$_data = index_array($this->db_fetch('client_data', array('where' => array('key' => 'product'))), 'type', TRUE);\n\t\t// split data\n\t\tforeach($_data as $type => $vals)\n\t\t{\n\t\t\t$pos = array();\n\t\t\tforeach($vals as $id => $val)\n\t\t\t{\n\t\t\t\tif( !isset($tags) || !in_array($val['tag'], $tags) )\n\t\t\t\t{\n\t\t\t\t\t// check for position taken\n\t\t\t\t\twhile(in_array($val['position'], $pos))\n\t\t\t\t\t{\n\t\t\t\t\t\t++$val['position'];\n\t\t\t\t\t}\n\t\t\t\t\t// save pos to array\n\t\t\t\t\t$pos[] = $val['position'];\n\t\t\t\t\t//\n\t\t\t\t\t$output[$type][$val['position']] = $val;\n\t\t\t\t\t//\n\t\t\t\t\t$tags[] = $val['tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort array\n\t\t\tksort($output[$type]);\n\t\t}\n\t\t// return output\n\t\treturn $output;\n\t}" ]
[ "0.7130287", "0.7115679", "0.70061517", "0.69423157", "0.6795876", "0.679498", "0.67094636", "0.6633895", "0.66204107", "0.65789807", "0.6570548", "0.65668446", "0.6566067", "0.6560655", "0.6527133", "0.65191704", "0.65167236", "0.6510186", "0.6503721", "0.64848894", "0.64531714", "0.6424842", "0.6419129", "0.6347219", "0.63344055", "0.6324976", "0.6300156", "0.62997806", "0.6297775", "0.62974286", "0.6292313", "0.6281031", "0.6277661", "0.62688977", "0.62676877", "0.62637365", "0.6252455", "0.62401557", "0.62371093", "0.62296444", "0.62246585", "0.62210006", "0.621842", "0.6214403", "0.6194323", "0.618268", "0.6181763", "0.61770636", "0.6158244", "0.61379045", "0.61193633", "0.6115842", "0.6111907", "0.61077636", "0.61033386", "0.61022854", "0.6092753", "0.6091678", "0.60804254", "0.6075261", "0.6066177", "0.6065863", "0.60594165", "0.6050686", "0.60491824", "0.6049144", "0.60481465", "0.6045617", "0.6044509", "0.60434884", "0.6043", "0.60368925", "0.6035319", "0.6022512", "0.60183144", "0.60166764", "0.60137105", "0.60062176", "0.59887075", "0.5987492", "0.59845173", "0.596203", "0.5960789", "0.59542257", "0.59489644", "0.594764", "0.594405", "0.5943505", "0.5942239", "0.5941948", "0.5940783", "0.5937311", "0.5935613", "0.5934964", "0.5932387", "0.59317887", "0.5931663", "0.59302604", "0.5927843", "0.5927158" ]
0.615536
49
////////////////////////////////////////////////////////////////////// GET ALL PRODUCTS BY PRODUCT TYPE
public static function GET_ALL_PRODUCTS_BY_TYPE($prd_type, $curr_page = 1) { $model_type = $_POST['model_type']; $designer_type = isset($_POST['designer_type']) && !empty($_POST['designer_type']) ? $_POST['designer_type'] : ""; $parent_cat = (isset($_POST['parent_cat']) && $_POST['parent_cat'] == 1) ? true : false; //Parent cat if ($parent_cat == true) { switch ($model_type) { case "girl": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=260 AND category_dress_type_id='" . $prd_type . "'"); break; case "boy": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=261 AND category_dress_type_id='" . $prd_type . "'"); break; default: Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=260 AND category_dress_type_id='" . $prd_type . "'"); break; } $products_ids = Db_Actions::DbGetResults(); } else if ($prd_type == 'no-type' && $designer_type == "") { switch ($model_type) { case "girl": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=260"); break; case "boy": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=261"); break; default: Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=260"); break; } $products_ids = Db_Actions::DbGetResults(); } else if (is_numeric($prd_type)) { switch ($model_type) { case "girl": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE subcategory_dress_type_id='" . $prd_type . "' AND category_id=260"); break; case "boy": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE subcategory_dress_type_id='" . $prd_type . "' AND category_id=261"); break; default: Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE subcategory_dress_type_id='" . $prd_type . "' AND category_id=260"); break; } $products_ids = Db_Actions::DbGetResults(); } else if ($prd_type == 'no-type' && $designer_type != "") { switch ($model_type) { case "girl": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE brand_type='" . $designer_type . "' AND category_id=260"); break; case "boy": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE brand_type='" . $designer_type . "' AND category_id=261"); break; default: Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE brand_type='" . $designer_type . "' AND category_id=260"); break; } $products_ids = Db_Actions::DbGetResults(); } if (!isset($products_ids->empty_result)) { $product_data = array(); foreach ($products_ids as $product) { $product_data[] = array('product_id' => $product->product_id, 'product_name' => self::getProductName($product->product_id), 'product_image_url' => $root_url . self::getProductImage($product->product_id), 'product_price' => self::getProductPrice($product->product_id), 'category_dress_type_id' => $product->category_dress_type_id, 'subcategory_dress_type_id' => $product->subcategory_dress_type_id); } $max_products_per_page = 9; $offset = $curr_page * $max_products_per_page - $max_products_per_page; $slice = array_slice($product_data, $offset, $max_products_per_page); $counter = 0; foreach ($slice as $product_item) { $counter++; if ($counter == 1) { ?><div class="cs-product-row"><?php } ?> <div class="cs-product <?php if ($counter == 2) echo 'cs-prd-middle'; ?>" product_id="<?php echo $product_item['product_id'] ?>" product_title="<?php echo $product_item['product_name'] ?>" product_price="<?php echo $product_item['product_price'] ?>" category_ids="<?php echo $product_item['category_id'] ?>" category_dress_type_id="<?php echo $product_item['category_dress_type_id'] ?>" subcategory_dress_type_id="<?php echo $product_item['subcategory_dress_type_id'] ?>"> <img src="<?php echo $product_item['product_image_url'] ?>" width="97" height="126" alt="dress" product_title="<?php echo $product_item['product_name'] ?>" class="cs-main-product-image" draggable="false" category_dress_type_id="<?php echo $product_item['category_dress_type_id'] ?>" subcategory_dress_type_id="<?php echo $product_item['subcategory_dress_type_id'] ?>" /> <h3 class="cs-product-title"><?php echo substr($product_item['product_name'], 0, 14) ?></h3> <h4 class="cs-price">$<?php echo number_format($product_item['product_price'], 2) ?></h4> <div class="cs-variations"> <?php //self::getProductColorVariations($product_item['product_id']); ?> </div> </div> <?php if ($counter == 3) { ?></div><?php $counter = 0; } } } else { return new stdClass(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProducts()\n {\n $ret = array();\n foreach ($this->getItems() as $item)\n if ($item->item_type == 'product')\n if ($pr = $item->tryLoadProduct())\n $ret[] = $pr;\n return $ret;\n }", "private function getProducts(): array\n {\n return $this->_type === 'price'\n ? $this->_priceProducts\n : $this->_stockProducts;\n }", "function getProductTypes(){\n\t\t$id = $_GET['id'];\n\t\t$elem_id = $_GET['elem_id'];\n\t\t$wc = $this->getWc($id);\n\t\t$types = array();\n\t\tforeach ($wc as $k=>$v){\n\t\t\t$types[$v['ptid']] = true;\n\t\t}\n\t\tif ($elem_id){\n\t\t\t$elem = $this->getWc($id, $elem_id);\n\t\t\tunset($types[$elem['ptid']]);\n\t\t}\n\t\t$sql = \"SELECT id, name FROM product_types WHERE visible > 0 AND id NOT IN ('\".implode(\"', '\", array_keys($types)).\"')\";\n\t\t$rows = sql_getRows($sql, true);\n\t\treturn $rows;\n\t}", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function getProducts()\n\t{\n\t\t$context = 'product' . $type;\n\n\t\t$q = 'SELECT a.*, (SELECT b.path FROM #__gazebos_gallery AS b WHERE b.product_id = a.id ' .\n\t\t\t' ORDER BY b.ordering ASC LIMIT 1) AS image FROM #__gazebos_products AS a' .\n\t\t\t' WHERE a.state = 1 AND a.type_id = ' . $this->item->id;\n\n\t\t$filter_material = $this->getState($context . 'filter.material');\n\t\tif (is_array($filter_material) && !empty($filter_material) && !empty($filter_material[0]))\n\t\t{\n\t\t\t$q .= ' AND a.material_id IN (' . implode(',', $filter_material) . ')';\n\t\t}\n\n\t\t$filter_shape = $this->getState($context . 'filter.shape');\n\t\tif (is_array($filter_shape) && !empty($filter_shape) && !empty($filter_shape[0]))\n\t\t{\n\t\t\t$q .= ' AND a.shape_id IN (' . implode(',', $filter_shape) . ')';\n\t\t}\n\n\t\t$filter_style = $this->getState($context . 'filter.style');\n\t\tif (is_array($filter_style) && !empty($filter_style) && !empty($filter_style[0]))\n\t\t{\n\t\t\t$q .= ' AND a.style_id IN (' . implode(',', $filter_style) . ')';\n\t\t}\n\n\t\t$results = $this->getDbo()->setQuery($q)->loadObjectList('id');\n\n\t\tif ($results !== null)\n\t\t{\n\t\t\tforeach ($results as $product)\n\t\t\t{\n\t\t\t\t$Itemid = GazebosHelper::getProductTypeMenuItem($type);\n\t\t\t\t$product->link = JRoute::_('index.php?option=com_gazebos&view=product&id=' . $product->id . '&Itemid=' . $Itemid);\n\n\t\t\t\tif (!empty($product->image))\n\t\t\t\t{\n\t\t\t\t\t$product->image = EEHtml::asset(\"products/{$product->id}/thumbs/199x160_{$product->image}\", 'com_gazebos');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "private function getProducts() {\n\n $products = [];\n\n $args = array(\n 'post_type' => 'product'\n );\n $loop = new WP_Query( $args );\n if ( $loop->have_posts() ) {\n while ( $loop->have_posts() ) :\n $loop->the_post();\n $product = new Product();\n $product->setTitle(get_the_title());\n $product->setId(get_the_ID());\n $products[] = $product;\n endwhile;\n }\n wp_reset_postdata();\n\n return $products;\n }", "public function getProductTypes()\n {\n $pageIds = $this->database->getPageIdsRecursive(\n $this->controller->configModel->get('storageFolder'),\n $this->controller->configModel->get('recurseDepth')\n );\n if ($pageIds === false) {\n throw new \\tx_nclib_exception('label_error_no_pages_found', $this->controller);\n }\n $fields = 'DISTINCT producttype as productType';\n $startTime = $this->controller->dateFilter['iStartTime'];\n $endTime = $this->controller->dateFilter['iEndTime'];\n $where = array(\n 'producttype != \\'\\'',\n 'hidden=0',\n 'deleted=0',\n 'type=' . $this->getModelType(),\n 'publishdate >= ' . $startTime,\n 'publishdate <= ' . $endTime,\n sprintf('%s.pid in (%s)', $this->getTableName(), implode(',', $pageIds)),\n );\n $where = $this->database->getWhere($where);\n $orderBy = 'producttype';\n $groupBy = '';\n\n $this->database->clear();\n\n $records = $this->database->getQueryRecords($this->getTableName(), $fields, $where, $groupBy, $orderBy);\n if (!$records || !\\tx_nclib::isLoopable($records)) {\n return false;\n }\n $result = array();\n foreach ($records as $record) {\n $result[] = $record['productType'];\n }\n return $result;\n }", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public static function fetchAll() {\n $db = new PDO(DB_SERVER, DB_USER, DB_PW);\n // 2. Prepare the query\n $sql = 'SELECT * FROM ProductType';\n $statement = $db->prepare($sql);\n // 3. Run the query\n $success = $statement->execute();\n // 4. Handle the results\n $arr = [];\n while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {\n $theProductType = new ProductType($row);\n array_push($arr, $theProductType);\n }\n return $arr;\n }", "function thrive_dashboard_get_thrive_products($type = '', $sort = true)\n{\n $products = array();\n\n $response = wp_remote_get(THRIVE_DASHBOARD_PRODUCTS_URL, array('sslverify' => false));\n if (is_wp_error($response)) {\n return $products;\n }\n\n $products = json_decode($response['body']);\n if ($type != '') {\n foreach ($products as $key => $product) {\n if ($product->type != $type) {\n unset($products[$key]);\n }\n }\n }\n\n if ($sort == true) {\n usort($products, function ($a, $b) {\n return strcasecmp($a->name, $b->name);\n });\n }\n\n return $products;\n}", "public function fetchMPTypes() {\n\t\t\n\t\t$this->_productTypes = array();\n\t\t$sql = \"SELECT * FROM product_types WHERE parent_ptype_id IS NULL\"; \n\t\t$dbh = $this->_conn->query( $sql);\n\t\n\t\twhile ( $row = $dbh->fetch() )\t{\n\t\t\t\t$this->_productTypes[] = new ProductTypes( $row[\"ptype_id\"], $row[\"parent_ptype_id\"], $row[\"type_name\"] );\n\t\t }\t\n\t\t \n\t\treturn $this->_productTypes;\n\t}", "function searchProduct($type,$input)\n {\n $products;\n switch($type)\n {\n case 0:\n $products=Product::search($input);\n break;\n case 1:\n $products=Product::searchByName($input);\n break;\n case 2:\n $products=Product::searchByGroup($input);\n break;\n case 3:\n $products=Product::searchBySupplier($input);\n break;\n case 4:\n $products=Product::searchByTag($input);\n break;\n case 5: $products=Product::searchByDescription($input);\n break;\n default:\n break;\n }\n if(!empty($products))\n {\n return $products;\n }else {\n return false;\n }\n }", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function getItems($type);", "public function getAllProducts()\n {\n\n $query = $this->db->get_where('products', array('pro_status' => 1));\n return $query->result();\n }", "public function all_products()\n\t{\n\t\t$this->db->where('product_status = 1');\n\t\t$query = $this->db->get('product');\n\t\t\n\t\treturn $query;\n\t}", "public function get_all_event_products(){\n\t\t\n\t\t$args = array(\n\t\t\t'type' => 'event',\n\t\t);\n\t\t$products = wc_get_products( $args );\n\t\treturn $products;\n \n\t}", "public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}", "public function getProductsFromType($type) {\n\n // Get product Type\n $productType = ProductType::findOrFail($type);\n \n // Get product from type\n $products = $productType->products()->paginate(8);\n\n // Get first category of product\n $category = $productType->categories->first();\n\n // Manipulate product\n $products->map(function ($product) {\n $product->payment = number_format((float)$product->payment, 2, '.', '');\n \n return $product;\n });;\n\n\n \n\n return view('frontoffice.pages.products', ['products' => $products, 'type' => $productType->name, 'category' => $category]);\n }", "public function getAllProducts()\n {\n return $this->productRepository->all();\n }", "public function get_all_productes() \r\n\t{\r\n\t\t$res=mysql_query(\"select * from products\") or die(mysql_error());\r\n\t\treturn $res;\r\n\t}", "public function getAll()\n {\n return $this->products;\n }", "public function product1(){\r\n\t\t$sql =\"SELECT * FROM `products`,`manufactures`,`protypes` WHERE manufactures.manu_ID = products.manu_ID AND protypes.type_ID = products.type_ID\";\r\n\t\t$result = self::$conn->query($sql);\r\n\t\treturn $this->getData($result);\r\n\t}", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function getAllProtypes(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM protypes\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "public function getAllproducts() {\r\n\r\n\t\t$res = $this->db->get('items');\r\n\r\n\t\treturn $res->result();\r\n\t}", "public function index()\n {\n return ProductType::all();\n }", "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function getAllProducts(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM products\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "function relatedProducts($people_cat_id, $product_type_id, $product_id)\n\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t$sql= 'SELECT product. *\n\t\t\t\tFROM product\n\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\tWHERE product.product_type_id = '.$people_cat_id.'\n\t\t\t\tAND product_people.people_cat_id = '.$product_type_id.'\n\t\t\t\tAND product.product_id != '.$product_id.'\n\t\t\t\tORDER BY product.product_id DESC';\n\t\t\t\t\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t\n\t\t\t\t}", "function get_static_products() {\r\n return $this->DBObject->readCursor(\"product_actions.get_static_products\", null);\r\n }", "public function productRetrieveAll(){\n\t\t$productId\t\t\t=\tself::getUserId();\n\t\t$productTable\t\t=\tself::getUserTable();\n\t\t$joinTable\t\t\t=\tself::getJoinTable();\n\t\t$productArray\t\t=\tself::getUserArray(); //multi dimension array output\t\t\n\t\t$dbFieldArray\t\t=\tarray();\n\t\tforeach($productArray as $prodIndex => $prodVal){\n\t\t\t$dbFieldArray[]\t=\t$productArray[$prodIndex][0]; //Get db fields only from multi dimension array\n\t\t}\t\t\n\t\t$productCond\t\t=\tself::getUserCond();\t\t\n\t\t$retArray\t\t\t=\tself::retrieveEntry($productTable, $dbFieldArray, $joinTable,$productCond);\n\t\t$returnValue \t\t= \tarray();\t\t\t \t \n\t\tforeach ($retArray as $retIndex => $retValue) {\n $$retIndex \t\t= \t$retValue;\n $mainArr \t\t=\texplode('|', $$retIndex);\t\t\t\n\t\t\t$returnValue[] \t= \t$mainArr;\t\t\t\t\t\t \n }\n\t\treturn $returnValue;\n\t}", "public function getAllRelatedProducts($product)\n {\n static $products = [];\n\n if (array_key_exists($product->id, $products)) {\n return $products[$product->id];\n }\n\n $products[$product->id] = [$product];\n\n if ($product->type == 'simple') {\n if ($product->parent_id) {\n $products[$product->id][] = $product->parent;\n }\n\n $products[$product->id] = array_merge(\n $products[$product->id],\n $this->getParentBundleProducts($product),\n $this->getParentGroupProducts($product)\n );\n } elseif ($product->type == 'configurable') {\n foreach ($product->variants as $variant) {\n $products[$product->id][] = $variant;\n }\n }\n\n return $products[$product->id];\n }", "public function get_products() {\n $product_ids = array();\n\n\t\tforeach ( $this->get_conditions() as $condition ) {\n\t\t\tif ( isset( $condition['product_ids'] ) && is_array( $condition['product_ids'] ) ) {\n\t\t\t\t$product_ids = array_merge( $product_ids, $condition['product_ids'] );\n\t\t\t}\n\t\t}\n\n\t\t$products = array();\n\t\tforeach ( $product_ids as $product_id ) {\n\t\t\t$product = wc_get_product( $product_id );\n\t\t\tif ( $product ) {\n\t\t\t\t$products[$product_id] = wp_kses_post( $product->get_formatted_name() );\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n }", "protected function getAllProducts()\r\n {\r\n \r\n // Enter the query into the Data Access Layer\r\n $sql = \"SELECT * from tbl_products\";\r\n \r\n // Make a connection anjd run the query on the SQL statement\r\n $results = $this->connect->query($sql);\r\n \r\n // Get the number of rows that were returned\r\n $numRows = $results->num_rows;\r\n \r\n // Return results only of the number of rows is greater than zero\r\n if ($numRows > 0) {\r\n // Pass the results of the query to the next class\r\n return $results;\r\n } else {\r\n echo \"Could not find products\";\r\n }\r\n }", "public static function getAll() {\n $SQL = 'Select * from product inner JOIN product_category on product.product_category_id = product_category.product_category_id;';\n $prep = DataBase::getInstance()->prepare($SQL);\n $prep -> execute();\n return $prep->fetchAll(PDO::FETCH_OBJ);\n }", "public function get_types($type_array)\n\t{\n\t\t$_products = $this->product->get_products_by_types($type_array);\n\t\trequire_once($GLOBALS['config']['views']. '/products.php');\n\t}", "public static function fetch_all_product_ids() {\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\t$product_ids = $wpdb->get_results( \"SELECT ID FROM $wpdb->posts WHERE post_type = 'product' AND post_status = 'publish';\" );\r\n\r\n\t\t\treturn $product_ids;\r\n\t\t}", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "public function getItems()\n\t{\n\t\tif (!isset($this->items))\n\t\t{\n\t\t\t$this->items = parent::getItems();\n\n\t\t\tif (empty($this->items))\n\t\t\t{\n\t\t\t\tJFactory::getApplication()->setError('Product not found.');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ($this->items as $product)\n\t\t\t\t{\n\t\t\t\t\t$Itemid = GazebosHelper::getProductTypeMenuItem($product->type_id);\n\t\t\t\t\t$product->link = JRoute::_('index.php?option=com_gazebos&view=product&id=' . $product->id . '&Itemid=' . $Itemid);\n\t\t\t\t\t$product->type_link = JRoute::_('index.php?Itemid=' . $Itemid);\n\t\t\n\t\t\t\t\tif (!empty($product->image))\n\t\t\t\t\t{\n\t\t\t\t\t\t$product->image = EEHtml::asset(\"products/{$product->id}/thumbs/200x200_{$product->image}\", 'com_gazebos', array('alt' => $product->title));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn (array) $this->items;\n\t}", "public function getProductos(){\n\t\n\treturn $this->productos;\n\t}", "public function getSimpleProducts()\n {\n return $this->getProduct()->getTypeInstance()->getUsedProducts($this->getProduct(), null);\n }", "public function getProducts()\n {\n $products = [\n [\"name\" => \"Sledgehammer\", \"price\" => 125.75],\n [\"name\" => \"Axe\", \"price\" => 190.50],\n [\"name\" => \"Bandsaw\", \"price\" => 562.131],\n [\"name\" => \"Chisel\", \"price\" => 12.9],\n [\"name\" => \"Hacksaw\", \"price\" => 18.45],\n ];\n return $products;\n }", "public function getProducts() {\r\n $collection = Mage::helper('CrmTicket/Product')->getProducts();\r\n $products = array();\r\n foreach ($collection as $item) {\r\n $products[$item->getId()] = $item->getname();\r\n }\r\n return $products;\r\n }", "public function getAllProductLibrariesOfType ($product_type) {\n $data = \\Drupal::database()->select('taxonomy_term_field_data', 't');\n $data->leftJoin('taxonomy_term__field_icon', 'ic', \"t.tid = ic.entity_id\");\n $data->leftJoin('taxonomy_term__field_product_type', 'pt', \"t.tid = pt.entity_id\");\n $data->leftJoin('taxonomy_term__field_favorite', 'ff', \"t.tid = ff.entity_id\");\n $data->condition('pt.field_product_type_target_id', $product_type, '=');\n $data->condition('t.vid', 'product_library', '=');\n $data->condition('ic.bundle', 'product_library', '=');\n $data->condition('ff.bundle', 'product_library', '=');\n $data->fields('t', ['tid','name','description__value','description__format']);\n $data->fields('ic', ['field_icon_target_id']);\n $data->fields('pt', ['field_product_type_target_id']);\n $data->fields('ff', ['field_favorite_value']);\n $result = $data->execute()->fetchAll();\n\n $url = '';\n $fresult = [];\n foreach ($result as $term) {\n $fid = $term->field_icon_target_id;\n if(!empty($fid)) {\n $file = \\Drupal\\file\\Entity\\File::load($fid);\n $image_uri = $file->getFileUri();\n $style = \\Drupal\\image\\Entity\\ImageStyle::load('media_library');\n // Get URI.\n $uri = $style->buildUri($image_uri);\n // Get URL.\n $url = $style->buildUrl($image_uri);\n }\n $plain_desc = preg_match_all(\"|<[^>]+>(.*)</[^>]+>|U\",$term->description__value, $out, PREG_SET_ORDER);\n $description = $out[0][1];\n $fresult[] = [\n 'tid' => $term->tid,\n 'name' => $term->name,\n 'description' => $description,\n 'group' => $term->field_product_type_target_id,\n 'icon' => $url,\n 'favorite' => $term->field_favorite_value,\n ];\n }\n $response = $fresult;\n \n return new JsonResponse($response); \n }", "public static function getPriceTypes() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName('a.id', 'value'));\n\t\t$query->select($db->quoteName('a.name', 'text'));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_price_types', 'a'));\n\t\t\n\t\tif (JFactory::getUser()->guest) {\n\t\t\t$query->where($db->quoteName('a.published') . ' = 1');\n\t\t}\n\t\t\n\t\t$db->setQuery($query);\n\t\treturn $db->loadObjectList();\n\t}", "function getProducts()\n {\n $db = $this->getPearDb();\n\n // The query is big, but it does use indexes. Anyway, the involved\n // tables almost never change, so we utilize MySQL's query cache\n $sql = \"(\n # User permissions\n SELECT DISTINCT pe_u.parameterValue AS productId\n FROM user u\n JOIN permission pe_u\n ON pe_u.doerId = u.id\n AND pe_u.allowed = '1'\n AND pe_u.actionId = 6 # 6 = use_product\n WHERE u.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Customer permissions\n SELECT DISTINCT pe_c.parameterValue AS productId\n FROM permission pe_c\n WHERE pe_c.doerId = \" . $this->id . \"\n AND pe_c.allowed = '1'\n AND pe_c.actionId = 6 # 6 = use_product\n\n ) UNION (\n\n SELECT productId\n FROM site s\n WHERE s.customerId = \" . $this->id . \"\n\n ) UNION (\n\n # Kollage is always on\n SELECT 1\n\n )\";\n $productIds = $db->getCol($sql);\n $productIds = array_filter(array_unique($productIds), 'intval');\n\n $product = new Vip_Product;\n $product->columnIn('id', $productIds);\n // Customer-specific products are only enabled for that customer.\n $product->addWhereSql('customerId IN (0, ' . $this->id . ')');\n $product->setOrderBySql('sortOrder,title');\n $products = $product->findAll();\n foreach ($products as $product) {\n $product->setCustomer($this);\n }\n\n return $products;\n }", "protected function get_detected_products () {\n if ( $this->type == 'theme' ) {\n return $this->get_detected_theme();\n } elseif ( $this->type == 'plugin' ) {\n return $this->get_detected_plugins();\n } else {\n return array();\n }\n }", "public function getAllList(){\n $collection = new Db\\Collection($this->getProductTable());\n return $collection->load();\n }", "function GetProducts(){\n $query = $this->db->prepare(\"SELECT `p`.`id` as `id_producto`, `p`.`nombre` as `nombre_producto`, `p`.`descripcion` as `desc_producto`, `p`.`precio` as `precio`, `p`.`stock` as `stock`, `c`.`nombre` as `nombre_categoria` FROM producto p INNER JOIN categoria c ON `p`.`id_categoria`=`c`.`id`\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_OBJ);\n }", "public function getTipoProducto(){\n $items = TcTipoProducto::where('id_estado','=',1)->get();\n return $items;\n }", "function getProductNameProductType($parent_admin_id,$DbConnection)\n {\n\t$final_product_type_list=array();\n\t$query_product_type = \"SELECT name FROM product_type USE INDEX(pte_aid_status) WHERE account_id='$parent_admin_id' AND status=1\";\n\t$result_query = mysql_query($query_product_type,$DbConnection);\n\twhile($row=mysql_fetch_object($result_query))\n\t{\t\t\n\t\t$final_product_type_list[]=$row->name;\n\t\t\n\t}\n\treturn $final_product_type_list;\n }", "function get_sale_product_list($type, $category_id)\n\t{\n\t\tif ($type == 'category')\n\t\t\t$products = $this->db->get_where('product', array(\n\t\t\t\t'category_id' => $category_id\n\t\t\t))->result_array();\n\t\tif ($type == 'sub_category')\n\t\t\t$products = $this->db->get_where('product', array(\n\t\t\t\t'sub_category_id' => $category_id\n\t\t\t))->result_array();\n\t\tforeach ($products as $row) {\n\t\t\techo '<p onclick=\"add_product(' . $row['product_id'] . ')\" style=\"cursor: pointer;\">\n\t\t\t\t\t<span class=\"fa-stack fa-2x text-success\">\n\t\t\t\t\t\t<i class=\"fa fa-circle-o fa-stack-2x\"></i>\n\t\t\t\t\t\t<i class=\"fa fa-plus fa-stack-1x\"></i>\n\t\t\t\t\t</span>' . $row['name'] . '' . ' '. '(' . $row['stock_quantity'] . ')\n\t\t\t\t</p>';\n\t\t}\n\t}", "function getProducts(Store $s)\n {\n $curl_url = $s->getApiPath() . \"v2/products\";\n $products = CurlHandler::GET($curl_url, $s->getAccessToken());\n return $products;\n }", "public function ListarProductos()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "public function getProduct(): array\r\n {\r\n $pro = [];\r\n $result = $this->DataB->query('SELECT * FROM product');\r\n\r\n while ($row = $result->fetch_assoc()) {\r\n $pro[] = $row;\r\n }\r\n\r\n return $pro;\r\n }", "public function getProductos() {\r\n $pdo = Database::connect();\r\n $sql = \"select * from producto\";\r\n $resultado = $pdo->query($sql);\r\n //transformamos los registros en objetos:\r\n $listado = array();\r\n foreach ($resultado as $res) {\r\n $producto = new Producto($res['codigo'], $res['descripcion'], $res['cantidad'], $res['precio']);\r\n array_push($listado, $producto);\r\n }\r\n Database::disconnect();\r\n //retornamos el listado resultante:\r\n return $listado;\r\n }", "public static function getProductos() {\r\n\r\n $consulta = \"SELECT * FROM productos\";\r\n\r\n $conexion = ConexionDB::conectar(\"tienda\");\r\n\r\n try {\r\n $stmt = $conexion->prepare($consulta);\r\n $stmt->execute();\r\n $resultado = $stmt->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, \"Carrodelacompra\\Producto\");\r\n } catch (PDOException $e){\r\n\t\t echo $e->getMessage();\r\n } \r\n \r\n ConexionDB::desconectar();\r\n return $resultado;\r\n \r\n\r\n }", "public function get_all()\n\t{\n\t\t$query = $this->db->get('products');\n\t\treturn $query->result_array();\n\t}", "function get_products_with_attributes() {\n global $db;\n if(isset($_SESSION['languages_id'])){ $language_id = (int)$_SESSION['languages_id'];} else { $language_id=1;}\n $query = 'SELECT DISTINCT attrib.products_id, description.products_name, products.products_quantity, products.products_model, products.products_image\n FROM '.TABLE_PRODUCTS_ATTRIBUTES.' attrib, '.TABLE_PRODUCTS_DESCRIPTION.' description, '.TABLE_PRODUCTS.' products\n WHERE attrib.products_id = description.products_id AND\n attrib.products_id = products.products_id AND \n description.language_id='.$language_id.' \n ORDER BY description.products_name ';\n $products = $db->Execute($query);\n while(!$products->EOF){\n $products_array[] = $products->fields['products_id'];\n $products->MoveNext();\n }\n return $products_array;\n }", "public function getAllProductTypes($indexBy = null)\n {\n if (!$this->_fetchedAllProductTypes) {\n $results = DigitalProducts_ProductTypeRecord::model()->findAll();\n\n if (!isset($this->_productTypesById)) {\n $this->_productTypesById = [];\n }\n\n foreach ($results as $result) {\n $productType = DigitalProducts_ProductTypeModel::populateModel($result);\n $this->_productTypesById[$productType->id] = $productType;\n }\n\n $this->_fetchedAllProductTypes = true;\n }\n\n if ($indexBy == 'id') {\n $productTypes = $this->_productTypesById;\n } else if (!$indexBy) {\n $productTypes = array_values($this->_productTypesById);\n } else {\n $productTypes = [];\n foreach ($this->_productTypesById as $productType) {\n $productTypes[$productType->$indexBy] = $productType;\n }\n }\n\n return $productTypes;\n }", "public function getProductType();", "public function getPriceTypes() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_price_types', 'a'));\n\t\t\n\t\t//echo nl2br(str_replace('#__','pihps_',$query));\n\t\t$db->setQuery($query);\n\t\treturn $db->loadObjectList('id');\n\t}", "public function getAllProducts(){\r\n\t\treturn $this->query(\"SELECT * FROM beer\");\r\n\t}", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "protected function products()\n {\n return Product::enabled()->withImages()\n ->where('title', 'like', \"%{$this->query}%\")\n ->orWhere('description', 'like', \"%{$this->query}%\")\n ->orderBy('updated_at', 'desc')\n ->get();\n }", "private static function loadItems($type)\n\t{\n\t\tself::$_items[$type]=array();\n\t\t$models=self::model()->findAll();\n\t\tforeach($models as $model)\n\t\t\tself::$_items[$type][$model->id]=$model->productType->name;\n\t}", "public function all(){\n \t\t$response = $this->curl->get( $this->api_url, [ \n\t\t\t'access_token' => $this->token\n\t\t]);\n\n \t\tif( $response->success ){\n \t\t\t$products = [];\n\t\t\tforeach ($response->products as $product) {\n\t \t\t\t$tmp = new Product( $this );\n\t \t\t\t$tmp->fetch($product);\n\t \t\t\t$products[] = $tmp;\n\n\t \t\t\treturn $products;\n\t \t\t}//foreach\n \t\t}//if\n \t\telse{\n \t\t\t// Throw error according to status\n \t\t}//else\n\n \t}", "public function getProducts(): array\r\n {\r\n try {\r\n $statement = $this->db->prepare(\"select * from products\");\r\n $statement->execute();\r\n return $this->products = $statement->fetchAll(\\PDO::FETCH_ASSOC);\r\n } catch (\\PDOException $e) {\r\n throw new \\Mpopa\\ExpException(\"Can't get products: \" . $e->getMessage());\r\n }\r\n }", "public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function getProduct();", "function get_all_product_posts($query ) {\n if (is_post_type_archive( 'product') && !is_admin() && $query->is_main_query()) {\n $query->set('posts_per_page' , '16');\n $query->set('orderby', 'title');\n $query->set('order' , 'ASC');\n } //elseif for categories\n}", "public function relatedproducts($typeids = array(), $type = NULL){\n \t$relatedproducts = array();\n global $base_url;\n switch ($type) {\n \tcase 'cat':\n \t\tbreak;\n \t\n \tdefault:\n\t\t if (!empty($typeids)) {\n\t\t $product_ids = array();\n\t\t $products = \\Drupal::database()->select('node__field_product_reference', 'frc');\n\t\t $products->join('node_field_data','nfd','nfd.nid=frc.entity_id');\n\t\t //$products->leftjoin('node__field_product_type', 'fpt', 'fpt.entity_id=frc.field_product_reference_target_id');\n\t\t $products->leftjoin('node__field_category', 'nfc', 'nfc.entity_id=frc.field_product_reference_target_id');\n\t\t $products->fields('frc', array('field_product_reference_target_id'));\n\t\t $products->condition('frc.entity_id', $typeids, 'IN');\n\t\t $products->condition('nfd.status', 1);\n\t\t //$products->orderBy('fpt.field_product_type_value', 'ASC');\n\t\t $products->orderBy('nfc.field_category_target_id', 'ASC');\n\t\t $products_id = $products->execute()->fetchAll();\n\t\t foreach ($products_id as $pid) {\n\t\t $product_ids[$pid->field_product_reference_target_id] = $pid->field_product_reference_target_id;\n\t\t }\n\t\t \n\t\t $product_ids = array_unique($product_ids);\n\t\t //print_r($product_ids);\n\t\t $product_counter = count($product_ids);\n\n\t\t\t\t\tif (!empty($product_ids)) {\n\t\t foreach ($product_ids as $productid) { \n\t\t $proimg =''; \n\t\t $nodeload = Node::load($productid); \n\t\t $product_image = \\Drupal\\image\\Entity\\ImageStyle::load('related_products')->buildUrl($nodeload->field_banner_image->entity->getFileUri());\n\t\t if ($nodeload->get('field_select_series')->target_id != '') {\n\t\t $serieslink = $nodeload->get('field_select_series')->target_id;\n\n\t\t } else {\n\t\t $serieslink = $nodeload->id();\n\t\t }\n\t\t $alias = \\Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $serieslink);\n\t\t if(($nodeload->get('field_product_type')->value!='2') && ($nodeload->get('field_product_type')->value!='4')){ //2 for assay kits, 4=labware\n\t\t $proimg = $product_image;\n\t\t }\n\t\t $relatedproducts[$productid]['nodeid'] = $serieslink;\n\t\t $relatedproducts[$productid]['title'] = $nodeload->getTitle(); \n\t\t $relatedproducts[$productid]['body'] = trim_text($nodeload->get('field_product_summary')->value, $length = 100, $ellipses = true, $strip_html = true);\n\t\t $relatedproducts[$productid]['productalias'] = $base_url.$alias;\n\t\t $relatedproducts[$productid]['product_image'] = $proimg;\n\t\t }\n\t\t }\n\t\t \treturn $relatedproducts;\n\t\t } \n \t\tbreak;\n }\n }", "public function getAllProducts()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table;\";\n $resultset = $this->db->executeFetchAll($sql);\n foreach ($resultset as $value) {\n $value->description = $this->filter->parse($value->description, [\"markdown\"]);\n $value->description = $this->content->tokenTruncate($value->description, 100);\n }\n return $resultset;\n }", "public function getProductList()\n {\n $output = $this->product->getProuductList();\n return $output;\n }", "function relatedProductsSearch($product_type_id, $product_id)\n\t\t\t\t{\n\t\t\t\t$sql= 'SELECT product. *\n\t\t\t\tFROM product\n\t\t\t\tWHERE product.product_type_id = '.$product_type_id.'\n\t\t\t\tAND product.product_id != '.$product_id.'\n\t\t\t\tORDER BY product.product_id DESC';\n\t\t\t\t\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t}", "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 getTargetType($type) {\n $retObj = array();\n switch ($type) {\n case 'Brand':\n $retObj[] = new ProductBrand($this->targetData);\n $retObj[] = new ProductBrand();\n \n return $retObj;\n break;\n case 'Condition':\n $retObj[] = new ProductCanonicalCondition($this->targetData);\n $retObj[] = new ProductCanonicalCondition();\n \n return $retObj;\n break;\n case 'Category':\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1', $this->targetData);\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1');\n \n return $retObj;\n break;\n case 'Channel':\n $retObj[] = new ProductChannel($this->targetData);\n $retObj[] = new ProductChannel();\n \n return $retObj;\n break;\n case 'Item ID':\n $retObj[] = new ProductOfferId($this->targetData);\n $retObj[] = new ProductOfferId();\n \n return $retObj;\n break;\n case 'Product type':\n $retObj[] = new ProductType('PRODUCT_TYPE_L1', $this->targetData);\n $retObj[] = new ProductType('PRODUCT_TYPE_L1');\n \n return $retObj;\n break;\n case 'Channel exclusivity':\n $retObj[] = new ProductChannelExclusivity($this->targetData);\n $retObj[] = new ProductChannelExclusivity();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_0':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_1':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_2':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_3':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_4':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n \n default:\n break;\n }\n }", "public function selectAll(ItemType $type): array\n {\n $sql = 'SELECT * FROM library WHERE type = :type';\n\n $statement = $this->connection->prepare($sql);\n $statement->bindValue('type', $type->getValue(), ParameterType::STRING);\n $result = $statement->execute();\n\n $list = [];\n foreach ($result->fetchAllAssociative() as $row) {\n $list[] = LibraryItem::createFromDatabaseArray($row);\n }\n\n return $list;\n }", "public function getArrayOfproducts(): array\n {\n $products = $this->model->getByCategory('helmet', $this->route['action']);\n return $products;\n }", "public function getAllProducts( $params = [] )\n {\n if(!config(\"constant.getDataFromApis\")){\n return $this->starrtecUnifiedPosHandler->getCategoryProducts( $params );\n }else{\n return $this->starrtecPosApiHandler->getCategoryProducts( $params );\n }//..... end if-else() .....//\n }", "function get_product_collection($type, $offset = 1, $limit = 10, $modifiedAfter = null, $createdAfter = null)\n\t{\n\t\t$data = array();\n\t/*\tMage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n\t\t\n\t\t$collection = Mage::getModel('catalog/product')\n\t\t\t->getCollection()\n\t\t\t->addAttributeToSelect('*') // select all attributes\n\t\t\t->addFieldToFilter('type_id', $type);\n*/\n\t\t$storeId = Mage::app()->getStore()->getStoreId();\n\n\t\t$collection = Mage::getResourceModel('catalog/product_collection')\n\t\t\t->addStoreFilter($storeId)\n\t\t\t->addAttributeToSelect('*')\n\t\t\t->addFieldToFilter('type_id', $type);\n\n\t\tif (!empty($modifiedAfter)) {\n\t\t$collection->addAttributeToFilter('updated_at', array('gteq' => $modifiedAfter));\n\t\t}\n\n\t\tif (!empty($createdAfter)) {\n\t\t\t$collection->addAttributeToFilter('updated_at', array('gteq' => $createdAfter));\n }\n\t\t\n\t\t$collection->setPageSize($limit) // limit number of results returned //\n\t\t\t->setOrder('entity_id', 'DESC')\n\t\t\t->setCurPage($offset);\n\t\t\n\t\tforeach ($collection as $product) {\n\t\t\t$stocklevel = Mage::getSingleton('cataloginventory/stock_item')\n\t\t\t\t\t\t\t->loadByProduct($product)->getData();\n\n\t\t\t$data[]\t= array_merge(\n\t\t\t\t$product->getData(), \n\t\t\t\tarray('prod_url'\t=> $product->getProductUrl()),\n\t\t\t\tarray('stock'\t\t=> $stocklevel)\n\t\t\t);\n\t\t}\n\t\treturn $data;\n\t}", "public function getProducts (){\n\t\t$cache = Zend_Registry::get('cache');\n\t\t// see if product - list is already in cache\n\t\tif(!$productArray = $cache->load('productsByManufacturerId'.$this->id)) {\n\t\t\t$productTable = Website_Model_CbFactory::factory('Website_Model_MysqlTable', 'product');\n\t\t\t$products = $productTable->fetchAll('manufacturer='.$this->id);\n\t\t\tforeach($products as $product){\n\t\t\t\t$productArray[] = Website_Model_CbFactory::factory('Website_Model_Product',$product->id);\n\t\t\t}\n\t\t\t$cache->save($productArray,'productsByManufacturerId'.$this->id,array('model'));\n\t\t}\n\t\treturn $productArray;\n\t}", "public function getSpecific()\n {\n $qb = $this->em->createQueryBuilder();\n $results = $qb->select('p')\n ->from('Plugin\\DoctrineExample\\Entity\\Product', 'p')\n ->orderBy('p.title', 'ASC')->getQuery()->execute();\n return $results;\n }", "public function getALL()\n {\n // Sentencia SQL\n $sql = \"SELECT categorias.nombre AS 'NombreDeLaCategoria', productos.* FROM productos INNER JOIN categorias ON categorias.id = productos.categoria_id ORDER BY stock ASC\";\n $productos = $this->conexion->query($sql);\n\n // Retorno el resultado a \"productosControlles.php\" al metodo \"gestion()\"\n return $productos;\n }", "private function setup_products() {\n\t\tglobal $wpdb;\n\n\t\t$ids = [];\n\t\t$d = $wpdb->get_results( \"SELECT distinct `products` FROM `{$wpdb->prefix}thespa_data`\", ARRAY_A );\n\t\tforeach ( $d as $datum ) {\n\t\t\t$prs = explode( \",\", $datum['products'] );\n\t\t\tforeach ( $prs as $pr ) {\n\t\t\t\tif ( !isset( $ids[$pr] ) ) {\n\t\t\t\t\tarray_push($ids, $pr );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$i = 0;\n\t\tforeach ( $ids as $id ) {\n\t\t\t$product = wc_get_product( $id );\n\t\t\tif ( is_object( $product ) ) {\n\t\t\t\t$this->products[$i] = [\n\t\t\t\t\t'id' => $id,\n\t\t\t\t\t'name' => $product->get_title(),\n\t\t\t\t\t'url' => $product->get_permalink(),\n\t\t\t\t\t'img' => wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'medium', true )[0],\n\t\t\t\t\t'cost' => $product->get_price_html(),\n\t\t\t\t];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}", "public function getAll() {\n $manufacturer = new Manufacturer();\n $product_category = new ProductCategory();\n $manufacturers = $manufacturer->getTable();\n $product_categories = $product_category->getTable();\n\n $query = self::query()\n ->join($manufacturers, $manufacturers.'.id', '=', $this->table . '.manufacturer_id')\n ->join($product_categories, $product_categories.'.id', '=', $this->table . '.category_id')\n ->select(\n $this->table.'.id',\n $this->table . '.price',\n $this->table . '.name as product_name',\n $manufacturers.'.name as manufacturer_name',\n $manufacturers . '.country',\n $product_categories . '.name as category_name',\n $this->table.'.release_year'\n );\n\n return $query->get();\n }", "public function getProducts()\n {\n return $this->_products;\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'bundleable');\n }", "public function getProducts() \n {\n return $this->_products;\n }", "public function getAllProduct(){\n\t\t//query for get all data from tbl_product combinning with tbl_category(catName) and tbl_brand(brandName) using INNER JOIN\n\t\t$sql = \"SELECT tbl_product.*, tbl_category.catName, tbl_brand.brandName\n\t\t\t\tFROM tbl_product\n\t\t\t\tINNER JOIN tbl_category\n\t\t\t\tON tbl_product.catId = tbl_category.catId\n\t\t\t\tINNER JOIN tbl_brand\n\t\t\t\tON tbl_product.brandId = tbl_brand.brandId\n\t\t\t\tORDER BY tbl_product.pid DESC \";\n\t\t//Same Query using Alias(giving a temporary name to a table or Column)\n\t\t/*$sql = \"SELECT p.*, c.catName, b.brandName\n\t\t\t\tFROM tbl_product AS p, tbl_category AS c, tbl_brand AS b\n\t\t\t\tWHERE p.catId = c.catId AND p.brandId = b.brandId\n\t\t\t\tORDER BY p.pid DESC \";*/\n\t\t$result = $this->db->select($sql);\n\t\tif ($result) {\n\t\t\treturn $result;\n\t\t}else{\n\t\t\t$msg = \"<span class='error'>Product not found !.</span>\";\n\t\t\treturn $msg;\n\t\t}\n\t}", "public function get_items_by_type($type) {\n if (is_string($type)) {\n $type = array($type);\n }\n $items = array();\n\n foreach ($type as $item) {\n $results = $this->get_object_content($item);\n if ($results !== array()) {\n $items[$item] = $results;\n }\n }\n\n return $items;\n }", "function getAllFeatureProducts(){\n $sql = self::$connection->prepare(\"SELECT * FROM products WHERE feature = 1\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "private function getGoodsByType($type){\n foreach ($type as $key => $t){\n if($t->pid==0){\n $goodsId = Type::where('pid',$t->id)->get(['id'])->toArray();\n $type[$key]['goods'] = Goods::whereIn('type',$goodsId)->limit(9)->get();\n }\n }\n\n return $type;\n }", "function getProductByCategory(){\n $return = array(); \n $pids = array();\n \n $products = Mage::getResourceModel ( 'catalog/product_collection' );\n \n foreach ($products->getItems() as $key => $_product){\n $arr_categoryids[$key] = $_product->getCategoryIds();\n \n if($this->_config['catsid']){ \n if(stristr($this->_config['catsid'], ',') === FALSE) {\n $arr_catsid[$key] = array(0 => $this->_config['catsid']);\n }else{\n $arr_catsid[$key] = explode(\",\", $this->_config['catsid']);\n }\n \n $return[$key] = $this->inArray($arr_catsid[$key], $arr_categoryids[$key]);\n }\n }\n \n foreach ($return as $k => $v){ \n if($v==1) $pids[] = $k;\n } \n \n return $pids; \n }", "function GetAllDataProductType($param = [])\n {\n if (isset($param['search_value']) && $param['search_value'] != '') {\n $this->db->group_start();\n $i = 0;\n foreach ($param['search_field'] as $row => $val) {\n if ($val['searchable'] == 'true') {\n if ($i == 0) {\n $this->db->like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n } else {\n $this->db->or_like('LCASE(`'.$val['data'].'`)', strtolower($param['search_value']));\n }\n $i++;\n }\n }\n $this->db->group_end();\n }\n if (isset($param['row_from']) && isset($param['length'])) {\n $this->db->limit($param['length'], $param['row_from']);\n }\n if (isset($param['order_field'])) {\n if (isset($param['order_sort'])) {\n $this->db->order_by($param['order_field'], $param['order_sort']);\n } else {\n $this->db->order_by($param['order_field'], 'desc');\n }\n } else {\n $this->db->order_by('a.id', 'desc');\n }\n $data = $this->db\n ->select('*, a.id')\n ->where('a.is_delete', 0)\n ->get('t4_product_type a')\n ->result_array();\n\n return $data;\n }", "public function getDocumentProducts(): array\r\n {\r\n return $this->document['products'] ?? [];\r\n }", "public function getProducts()\n {\n return $this->basket->products()->get();\n }", "function getAll() {\n $this->getConnection();\n $request = \"SELECT P.ID_PRODUIT, P.DATE_CREATION, P.NOM, P.PRIX, P.DESCRIPTION, P.ID_CATEGORIE, P.IMAGE, C.NOM AS CATEGORIE \n FROM PRODUIT P INNER JOIN CATEGORIE C ON P.ID_CATEGORIE=C.ID_CATEGORIE\";\n $result = $this->select($request);\n return $result;\n }" ]
[ "0.75347793", "0.7290423", "0.71831596", "0.7152271", "0.7044046", "0.69870675", "0.6917111", "0.68047285", "0.6802177", "0.67308116", "0.67185414", "0.6695362", "0.66740596", "0.6663321", "0.664337", "0.6631771", "0.66282165", "0.6626387", "0.66048217", "0.659865", "0.6572242", "0.6549595", "0.6546137", "0.65118855", "0.65116835", "0.64742327", "0.6459205", "0.6459017", "0.64370996", "0.64362645", "0.6418892", "0.6403475", "0.64012796", "0.6383606", "0.6376527", "0.63472116", "0.63309014", "0.6326995", "0.63121897", "0.6297418", "0.6295299", "0.62904775", "0.6286213", "0.6278683", "0.62770504", "0.62587506", "0.62513775", "0.6248585", "0.6233587", "0.6223453", "0.62215906", "0.62157214", "0.6213278", "0.62053704", "0.61952347", "0.61903495", "0.6186005", "0.61819464", "0.61730003", "0.6171763", "0.61618483", "0.6157769", "0.6154896", "0.6141076", "0.61410224", "0.61378866", "0.6137185", "0.6137154", "0.6136548", "0.6132797", "0.61287385", "0.61237407", "0.61219066", "0.6116069", "0.60997224", "0.60957384", "0.6091838", "0.60865504", "0.607754", "0.6076374", "0.6075015", "0.6072285", "0.6065697", "0.60648394", "0.60647047", "0.60485154", "0.60445994", "0.60432804", "0.6034801", "0.6032196", "0.6026659", "0.60248166", "0.60196424", "0.6018211", "0.6003195", "0.600076", "0.5998213", "0.59883523", "0.5986315", "0.5980374" ]
0.63773113
34
/////////////////////////////////////////////////////////////////////// Get total products count
public static function getTotalSearchResultsCount() { $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : ''; $search_term = $_POST['search_term']; if (isset($_POST['model_type'])) { $model_type = $_POST['model_type']; switch ($model_type) { case "girl": Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260"); Db_Actions::DbSelect("SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%" . $search_term . "%'"); break; case "boy": Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261"); break; } } $products_count = Db_Actions::DbGetResults(); if (!isset($products_count->empty_result)) { foreach ($products_count as $count) { echo ceil($count->totalprds / 9); } } else { echo 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductCount()\n {\n $count = 0;\n \tforeach ($this->getItems() as $item) {\n \t $count += $item['count'];\n \t}\n \treturn $count;\n }", "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "public function getProductCount()\n {\n return count($this->products);\n }", "public function getCountProduct()\n {\n return $this->product_model->countAll();\n }", "public function numberOfProducts(){\n if (!$this->cart_id){\n return 0;\n }\n return JeproshopCartModelCart::getNumberOfProducts($this->cart_id);\n }", "public function getNumProducts()\n {\n return $this->numProducts;\n }", "public function ProductCount()\n {\n return Products::count();\n }", "public function NumOfProducts()\n {\n return Product::all()->count();\n }", "public function getProductsCount()\n\t{\n\t\tif ($this->hasData('products_count')) {\n\t\t\treturn $this->getData('products_count');\n\t\t}\n\n\t\tif (null === $this->getData('products_count')) {\n\t\t\t$this->setData('products_count', self::DEFAULT_PRODUCTS_COUNT);\n\t\t}\n\n\t\treturn $this->getData('products_count');\n\t}", "public function getProductsCount()\n {\n if (null === $this->_productsCount) {\n $this->_productsCount = self::DEFAULT_PRODUCTS_COUNT;\n }\n return $this->_productsCount;\n }", "public function getAllProductsCount()\n {\n\n return $this->all()->count();\n }", "public function count()\n {\n $count = 0;\n foreach($this->_data as &$product) {\n $count += $product['quantity'];\n }\n\n\t\treturn $count;\n\t}", "public function countProduct(){\n return count(Product::all());\n }", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public function getProNumRows()\n {\n return $this->db->count_all('products');\n }", "public function getBasketProductsCount(): int\n\t{\n\t\tif ($this->basketProducts === null) {\n\t\t\t$this->getBasketProducts();\n\t\t}\n\n\t\treturn $this->basketProductsCount;\n\t}", "public function getProductTotalCount($productData) {\n if (isset ( $productData ['sku'] )) {\n return count ( $productData ['sku'] );\n }\n }", "function getProductCount($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/count.json' , $params ),true);\n\t}", "public static function itemCount() {\n\t\t$items = self::current('products');\n\t\t\n\t\t// count(false) == 1? Seriously, PHP? -_-\n\t\tif($items !== false and empty($items)) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\treturn count(self::items());\n\t}", "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productstable = $oostable['products'];\n $products_to_categoriestable = $oostable['products_to_categories'];\n $products = $dbconn->Execute(\"SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '\" . intval($category_id) . \"'\");\n\n $products_count += $products->fields['total'];\n\n return $products_count;\n}", "public function countProducts()\n {\n $count = 0;\n foreach($this->products as $product) {\n /** @var ProductAbstract $product */\n switch ($product->getRequiredData()->getType()) {\n case DataAbstract::TYPE_CONFIGURABLE:\n /** @var Configurable $product */\n if (method_exists($product, 'getSimpleProducts')) {\n foreach ($product->getSimpleProducts() as $simple) {\n /** @var Simple $simple */\n $count++;\n }\n }\n $count++;\n break;\n default:\n $count++;\n break;\n }\n }\n\n return $count;\n }", "public static function getOrderedProductsQuantity(): string\n {\n $query = new Query();\n $total = $query->select([\n 'COUNT(*) as total'\n ])\n ->from(['sale_items'])\n ->where([\n 'customer_auth_id' => Yii::$app->user->identity->id,\n 'sale_id' => 0\n ])\n ->scalar();\n\n return $total;\n }", "public function totalCount();", "public function totalCount();", "public function getTotalQuantity()\n {\n $quantity = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $quantity = $quantity + $basketProduct->getQuantity();\n }\n }\n \n return $quantity;\n }", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}", "public function getCountProducts(){\n global $connect;\n $query = $connect->PDO->prepare(\"SELECT count(id) FROM `pagTab`\");\n $query->execute();\n $row = $query->fetchAll();\n return $row;\n }", "function count_products()\n\t{\t\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\t\t\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->total_number_of_search_results = 0;\n\t\t\t\n\t\t\treturn $this->total_number_of_search_results;\n\t\t}\n\t\t\t\n\t\t//Find the total number of search results\n\t\t$count_search_results_sql = '\n\t\t\t\tSELECT COUNT(*) ' .\n\t\t\t\t'FROM (SELECT DISTINCT product.id FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY product.id) AS product_count';\n\t\t\n\t\t$this->total_number_of_search_results = $this->_db->get_first_cell($count_search_results_sql);\n\t\n\t\treturn $this->total_number_of_search_results;\n\t}", "public function get_total_items()\n {\n $num = 0;\n\n if (isset($_SESSION['cart'])) {\n foreach ($_SESSION['cart'] as $item) {\n $num = $num + $item;\n }\n }\n return $num;\n }", "public function get_total_items()\n\t{\n\t\t$num = 0;\n\t\t\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\tforeach($_SESSION['cart'] as $item)\n\t\t\t{\n\t\t\t\t$num = $num + $item;\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public function count() {\n\n // query to count all product records\n $query = \"SELECT count(*) FROM $this->table_name\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n // get row value\n $rows = $stmt->fetch(PDO::FETCH_NUM);\n\n // return count\n return $rows[0];\n }", "function sizeCart(){\n\t\t//return array_sum($this->articulos);\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$cantidad = $book['cantidad'];\n\t\t\t$sum += $cantidad;\n\t\t}\n\t\t\n\t\treturn $sum;\n\t}", "function get_total_prod_count($type, $modifiedAfter = null)\n\t{\n\t\t$collection = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('type_id', $type);\n\t\t\t\t\t\t\n\t\tif (!empty($modifiedAfter)) {\n\t\t\t$collection->addAttributeToFilter('updated_at', array('gteq' => $modifiedAfter));\n\t\t}\n\t\treturn $collection->getSize();\n\t}", "public function getTotalCount()\n {\n $this->loadItems();\n return $this->calculator->getCount($this->items);\n }", "public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n $total += ($item->Quantity) ? $item->Quantity : 1;\n }\n\n return $total;\n }", "function getRowCount() {\n\t\t$saleData = $this->getProducts();\n\t\t$saleSize = sizeof($saleData);\n\t\treturn $saleSize -=1;\n\t}", "private function CountProductsAction($dom)\n {\n $nbProducts = 0;\n $rows = $dom->documentElement->getElementsByTagName('row');\n $nbProducts = $rows->length;\n// foreach($dom->documentElement->getElementsByTagName('row') as $zRow)\n// {\n// $nbProducts++;\n// }\n return $nbProducts;\n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function getCountOfProduct(timpanyProductInterface $product)\n {\n return $this->_items[$product->getIdentifier()]['count'];\n }", "public function totalAmountOfShops()\n {\n return Shop::getTotalAmountOfShops();\n\n }", "public function countTotalItems()\n\t{\n\t\t$sql = \"SELECT * FROM items\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->num_rows();\n\t}", "function similarProductCount()\n {\n if($this->soap)\n return count($this->soap['SimilarProducts']);\n else\n return count($this->similarProducts);\n }", "public function getShopCount()\n {\n return $this->count(self::_SHOP);\n }", "public function getNumTotalItems()\n {\n return $this->numTotalItems;\n }", "public static function count_product_ids() {\r\n\r\n\t\t\tif ( false === $count_product_ids = get_transient( 'cptpro_number_of_product_ids' ) ) {\r\n\r\n\t\t\t\t$count_product_ids = count( YIKES_Custom_Product_Tabs_Pro_Admin::fetch_all_product_ids() );\r\n\r\n\t\t\t\tset_transient( 'cptpro_number_of_product_ids', $count_product_ids, 10 * MINUTE_IN_SECONDS );\r\n\t\t\t}\r\n\r\n\t\t\treturn $count_product_ids;\r\n\t\t}", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getProductItemCounts()\n {\n if (array_key_exists(\"productItemCounts\", $this->_propDict)) {\n if (is_a($this->_propDict[\"productItemCounts\"], \"\\Microsoft\\Graph\\Model\\KeyValuePair\") || is_null($this->_propDict[\"productItemCounts\"])) {\n return $this->_propDict[\"productItemCounts\"];\n } else {\n $this->_propDict[\"productItemCounts\"] = new KeyValuePair($this->_propDict[\"productItemCounts\"]);\n return $this->_propDict[\"productItemCounts\"];\n }\n }\n return null;\n }", "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($order1, true));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, false));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, true));\n }", "public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }", "public function getTotalCount()\n\t{\n\t\treturn $this->totalCount;\n\t}", "function getProductCount($cat_id) {\n $ci = & get_instance();\n $query = $ci->db->get_where(ES_PRODUCTS, array('category_id' => $cat_id));\n return $query->num_rows();\n}", "public function getTotalCount()\n {\n return $this->totalCount;\n }", "function countProducts() {\r\n global $tableProducts;\r\n\r\n return countFields($tableProducts);\r\n}", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = array_reduce($items->all(), function ($a, ItemCollection $item) {\n return $a += $item->quantity;\n }, 0);\n\n return $count;\n }", "public function getCartVolume() {\n $product_total = 0;\n\n $products = $this->getProducts();\n\n foreach ($products as $product) {\n //$product_total += $product['quantity'];\n $product_total += $product['quantity'];\n }\n\n return $product_total;\n }", "public function list_items_total()\n\t{\n\t\t$cnt = $this->list_items(NULL, NULL, NULL, NULL, TRUE);\n\t\tif (is_array($cnt))\n\t\t{\n\t\t\treturn count($cnt);\n\t\t}\n\t\treturn $cnt;\n\t}", "public static function countItems()\n {\n $count = 0;\n if (isset($_SESSION['cart'])) {\n $count = count($_SESSION['cart']);\n }\n \n return $count;\n }", "public function total(): int\n {\n return Arr::get($this->meta, 'total', $this->count());\n }", "protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}", "public function total(): int\n {\n return count($this->all());\n }", "public function getTotalItems()\n\t{\n\t\treturn $this->totalItems;\n\t}", "public function record_count() {\n $count = $this->db->count_all('product');\n return $count;\n }", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function getTotalItemCount();", "public function TotalItems()\n {\n return $this->getTotalItems();\n }", "public function total_sold()\n\t{\n\t\t$sold = self::$_ci->cart_item_m->count_by(array('status' => 'pg-success'));\n\t\t\n\t\treturn (int) $sold;\n\t\t\n\t}", "static public function getTotalCount()\n\t{\n\t\treturn self::$count;\n\t}", "public function count() {\r\n\r\n return $this->total_size;\r\n\r\n }", "function cart_count(){\n\t\tif(isset($_SESSION['cart'])){\n\t\t\t$cart = $_SESSION['cart'];\n\t\t\t$item_count = 0;\n\t\t\tforeach($cart as $item_id => $item_quantity){\n\t\t\t\t$item_count += $item_quantity;\n\t\t\t}\n\t\t\treturn $item_count;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "protected function get_total_count() {\n\t\treturn affiliate_wp()->utils->data->get( \"{$this->batch_id}_total_count\", 0 );\n\t}", "public function getBasketPrice(){\n $sum = 0;\n foreach ($this->products as $i => $product) {\n $sum += $product->price * $product->count;\n }\n return $sum;\n }", "public function getTotalItemCount()\n {\n return $this->totalItemCount;\n }", "public function getTotalItemCount()\n\t{\n\t\treturn $this->_totalItemCount;\n\t}", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = $items->sum(function ($item) {\n return $item['quantity'];\n });\n\n return $count;\n }", "public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_source_id))) {\n $qty += $inventory->qty;\n }\n }\n\n $orderedInventory = $this->product->ordered_inventories\n ->where('channel_id', $this->channel->id)->first();\n\n if ($orderedInventory) {\n $qty -= $orderedInventory->qty;\n }\n\n return $qty;\n }", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function modelTotalRecord(){\n\t\t\t$total = DB::rowCount(\"select id from products\");\n\t\t\treturn $total;\n\t\t}", "public function getTotalItems()\n {\n return intval($this->property('limit'));\n }", "public function getPriceCount() {\n return $this->count(self::PRICE);\n }", "function fetchTotalObjectCount()\n {\n $db = eZDB::instance();\n $objectCount = array();\n $objectCount = $db->arrayQuery( \"SELECT COUNT(*) AS count FROM ezcontentobject\" );\n $totalObjectCount = $objectCount[0][\"count\"];\n return $totalObjectCount;\n }", "public function getTotalCount()\n {\n return $this->provider->totalCount;\n }", "public static function totalNumber()\n {\n return (int)self::find()->count();\n }", "public function getNbProd()\n {\n return $this->CollProduit->taille();\n }", "public function getCurrentGoodsCount()\n {\n return $this->count(self::_CURRENT_GOODS);\n }", "public function count()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n }, 0);\n }" ]
[ "0.9037382", "0.8439049", "0.8264127", "0.8241029", "0.8151488", "0.81248486", "0.7985635", "0.7962265", "0.7855166", "0.78177196", "0.7803576", "0.7787321", "0.77714914", "0.7663036", "0.76594704", "0.7622011", "0.7527503", "0.7517384", "0.7510045", "0.7503049", "0.74653906", "0.7401024", "0.7371964", "0.73553103", "0.73553103", "0.733143", "0.73302084", "0.7293153", "0.72717804", "0.72533596", "0.7217639", "0.72173107", "0.7214077", "0.71654135", "0.7134772", "0.71325195", "0.71294445", "0.7118175", "0.711356", "0.711356", "0.711356", "0.7110915", "0.71051204", "0.7090103", "0.708146", "0.7080147", "0.70795125", "0.7060907", "0.70590276", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.70589346", "0.7050159", "0.7027879", "0.7015595", "0.7004584", "0.7001478", "0.70003366", "0.69967175", "0.69958127", "0.6983189", "0.6969466", "0.69530725", "0.6951285", "0.6943904", "0.69234186", "0.690507", "0.6898737", "0.6896679", "0.68858254", "0.68852633", "0.6885145", "0.6882687", "0.686543", "0.6860708", "0.6858245", "0.68534964", "0.6840744", "0.68398225", "0.68389434", "0.68384886", "0.6833723", "0.6828248", "0.68275666", "0.6814649", "0.6813038", "0.68102145", "0.68069994", "0.6803448", "0.6799338", "0.67965406" ]
0.71261084
37
/////////////////////////////////////////////////////////////////////// Get total products count
public static function getTotalproductsCount($cat_id) { //First get the products ids from the selected category $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : ''; $designer_type = isset($_POST['designer_type']) && !empty($_POST['designer_type']) ? $_POST['designer_type'] : ""; if (isset($_POST['model_type'])) { $model_type = $_POST['model_type']; switch ($model_type) { case "girl": if (!empty($category_dress_type_id)) { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND category_dress_type_id='$category_dress_type_id'"); } else if (!empty($designer_type)) { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND brand_type='$designer_type'"); } else { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260"); } break; case "boy": if (!empty($category_dress_type_id)) { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261 AND category_dress_type_id='$category_dress_type_id'"); } else if (!empty($designer_type)) { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261 AND brand_type='$designer_type'"); } else { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261"); } break; default: if (!empty($category_dress_type_id)) { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND category_dress_type_id='$category_dress_type_id'"); } else if (!empty($designer_type)) { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND brand_type='$designer_type'"); } else { Db_Actions::DbSelect("SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260"); } break; } } $products_count = Db_Actions::DbGetResults(); if (!isset($products_count->empty_result)) { foreach ($products_count as $count) { echo ceil($count->totalprds / 9); } } else { echo 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductCount()\n {\n $count = 0;\n \tforeach ($this->getItems() as $item) {\n \t $count += $item['count'];\n \t}\n \treturn $count;\n }", "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "public function getProductCount()\n {\n return count($this->products);\n }", "public function getCountProduct()\n {\n return $this->product_model->countAll();\n }", "public function numberOfProducts(){\n if (!$this->cart_id){\n return 0;\n }\n return JeproshopCartModelCart::getNumberOfProducts($this->cart_id);\n }", "public function getNumProducts()\n {\n return $this->numProducts;\n }", "public function ProductCount()\n {\n return Products::count();\n }", "public function NumOfProducts()\n {\n return Product::all()->count();\n }", "public function getProductsCount()\n\t{\n\t\tif ($this->hasData('products_count')) {\n\t\t\treturn $this->getData('products_count');\n\t\t}\n\n\t\tif (null === $this->getData('products_count')) {\n\t\t\t$this->setData('products_count', self::DEFAULT_PRODUCTS_COUNT);\n\t\t}\n\n\t\treturn $this->getData('products_count');\n\t}", "public function getProductsCount()\n {\n if (null === $this->_productsCount) {\n $this->_productsCount = self::DEFAULT_PRODUCTS_COUNT;\n }\n return $this->_productsCount;\n }", "public function getAllProductsCount()\n {\n\n return $this->all()->count();\n }", "public function count()\n {\n $count = 0;\n foreach($this->_data as &$product) {\n $count += $product['quantity'];\n }\n\n\t\treturn $count;\n\t}", "public function countProduct(){\n return count(Product::all());\n }", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public function getProNumRows()\n {\n return $this->db->count_all('products');\n }", "public function getBasketProductsCount(): int\n\t{\n\t\tif ($this->basketProducts === null) {\n\t\t\t$this->getBasketProducts();\n\t\t}\n\n\t\treturn $this->basketProductsCount;\n\t}", "public function getProductTotalCount($productData) {\n if (isset ( $productData ['sku'] )) {\n return count ( $productData ['sku'] );\n }\n }", "function getProductCount($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/count.json' , $params ),true);\n\t}", "public static function itemCount() {\n\t\t$items = self::current('products');\n\t\t\n\t\t// count(false) == 1? Seriously, PHP? -_-\n\t\tif($items !== false and empty($items)) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\treturn count(self::items());\n\t}", "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productstable = $oostable['products'];\n $products_to_categoriestable = $oostable['products_to_categories'];\n $products = $dbconn->Execute(\"SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '\" . intval($category_id) . \"'\");\n\n $products_count += $products->fields['total'];\n\n return $products_count;\n}", "public function countProducts()\n {\n $count = 0;\n foreach($this->products as $product) {\n /** @var ProductAbstract $product */\n switch ($product->getRequiredData()->getType()) {\n case DataAbstract::TYPE_CONFIGURABLE:\n /** @var Configurable $product */\n if (method_exists($product, 'getSimpleProducts')) {\n foreach ($product->getSimpleProducts() as $simple) {\n /** @var Simple $simple */\n $count++;\n }\n }\n $count++;\n break;\n default:\n $count++;\n break;\n }\n }\n\n return $count;\n }", "public static function getOrderedProductsQuantity(): string\n {\n $query = new Query();\n $total = $query->select([\n 'COUNT(*) as total'\n ])\n ->from(['sale_items'])\n ->where([\n 'customer_auth_id' => Yii::$app->user->identity->id,\n 'sale_id' => 0\n ])\n ->scalar();\n\n return $total;\n }", "public function totalCount();", "public function totalCount();", "public function getTotalQuantity()\n {\n $quantity = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $quantity = $quantity + $basketProduct->getQuantity();\n }\n }\n \n return $quantity;\n }", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}", "public function getCountProducts(){\n global $connect;\n $query = $connect->PDO->prepare(\"SELECT count(id) FROM `pagTab`\");\n $query->execute();\n $row = $query->fetchAll();\n return $row;\n }", "function count_products()\n\t{\t\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\t\t\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->total_number_of_search_results = 0;\n\t\t\t\n\t\t\treturn $this->total_number_of_search_results;\n\t\t}\n\t\t\t\n\t\t//Find the total number of search results\n\t\t$count_search_results_sql = '\n\t\t\t\tSELECT COUNT(*) ' .\n\t\t\t\t'FROM (SELECT DISTINCT product.id FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY product.id) AS product_count';\n\t\t\n\t\t$this->total_number_of_search_results = $this->_db->get_first_cell($count_search_results_sql);\n\t\n\t\treturn $this->total_number_of_search_results;\n\t}", "public function get_total_items()\n {\n $num = 0;\n\n if (isset($_SESSION['cart'])) {\n foreach ($_SESSION['cart'] as $item) {\n $num = $num + $item;\n }\n }\n return $num;\n }", "public function get_total_items()\n\t{\n\t\t$num = 0;\n\t\t\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\tforeach($_SESSION['cart'] as $item)\n\t\t\t{\n\t\t\t\t$num = $num + $item;\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public function count() {\n\n // query to count all product records\n $query = \"SELECT count(*) FROM $this->table_name\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n // get row value\n $rows = $stmt->fetch(PDO::FETCH_NUM);\n\n // return count\n return $rows[0];\n }", "function sizeCart(){\n\t\t//return array_sum($this->articulos);\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$cantidad = $book['cantidad'];\n\t\t\t$sum += $cantidad;\n\t\t}\n\t\t\n\t\treturn $sum;\n\t}", "function get_total_prod_count($type, $modifiedAfter = null)\n\t{\n\t\t$collection = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('type_id', $type);\n\t\t\t\t\t\t\n\t\tif (!empty($modifiedAfter)) {\n\t\t\t$collection->addAttributeToFilter('updated_at', array('gteq' => $modifiedAfter));\n\t\t}\n\t\treturn $collection->getSize();\n\t}", "public function getTotalCount()\n {\n $this->loadItems();\n return $this->calculator->getCount($this->items);\n }", "public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n $total += ($item->Quantity) ? $item->Quantity : 1;\n }\n\n return $total;\n }", "function getRowCount() {\n\t\t$saleData = $this->getProducts();\n\t\t$saleSize = sizeof($saleData);\n\t\treturn $saleSize -=1;\n\t}", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "private function CountProductsAction($dom)\n {\n $nbProducts = 0;\n $rows = $dom->documentElement->getElementsByTagName('row');\n $nbProducts = $rows->length;\n// foreach($dom->documentElement->getElementsByTagName('row') as $zRow)\n// {\n// $nbProducts++;\n// }\n return $nbProducts;\n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function getCountOfProduct(timpanyProductInterface $product)\n {\n return $this->_items[$product->getIdentifier()]['count'];\n }", "public function totalAmountOfShops()\n {\n return Shop::getTotalAmountOfShops();\n\n }", "public function countTotalItems()\n\t{\n\t\t$sql = \"SELECT * FROM items\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->num_rows();\n\t}", "public function getNumTotalItems()\n {\n return $this->numTotalItems;\n }", "function similarProductCount()\n {\n if($this->soap)\n return count($this->soap['SimilarProducts']);\n else\n return count($this->similarProducts);\n }", "public function getShopCount()\n {\n return $this->count(self::_SHOP);\n }", "public static function count_product_ids() {\r\n\r\n\t\t\tif ( false === $count_product_ids = get_transient( 'cptpro_number_of_product_ids' ) ) {\r\n\r\n\t\t\t\t$count_product_ids = count( YIKES_Custom_Product_Tabs_Pro_Admin::fetch_all_product_ids() );\r\n\r\n\t\t\t\tset_transient( 'cptpro_number_of_product_ids', $count_product_ids, 10 * MINUTE_IN_SECONDS );\r\n\t\t\t}\r\n\r\n\t\t\treturn $count_product_ids;\r\n\t\t}", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getItemsCount()\n {\n return $this->count(self::_ITEMS);\n }", "public function getProductItemCounts()\n {\n if (array_key_exists(\"productItemCounts\", $this->_propDict)) {\n if (is_a($this->_propDict[\"productItemCounts\"], \"\\Microsoft\\Graph\\Model\\KeyValuePair\") || is_null($this->_propDict[\"productItemCounts\"])) {\n return $this->_propDict[\"productItemCounts\"];\n } else {\n $this->_propDict[\"productItemCounts\"] = new KeyValuePair($this->_propDict[\"productItemCounts\"]);\n return $this->_propDict[\"productItemCounts\"];\n }\n }\n return null;\n }", "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($order1, true));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, false));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, true));\n }", "public function totalRecount()\n {\n $products = $this->products;\n $newTotal = 0;\n foreach ($products as $product) {\n if ($product->removed) {\n continue;\n }\n $newTotal += $product->count * $product->price;\n }\n $this->total = $newTotal;\n $this->save();\n }", "public function getTotalCount()\n\t{\n\t\treturn $this->totalCount;\n\t}", "public function getTotalCount()\n {\n return $this->totalCount;\n }", "function getProductCount($cat_id) {\n $ci = & get_instance();\n $query = $ci->db->get_where(ES_PRODUCTS, array('category_id' => $cat_id));\n return $query->num_rows();\n}", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = array_reduce($items->all(), function ($a, ItemCollection $item) {\n return $a += $item->quantity;\n }, 0);\n\n return $count;\n }", "function countProducts() {\r\n global $tableProducts;\r\n\r\n return countFields($tableProducts);\r\n}", "public function getCartVolume() {\n $product_total = 0;\n\n $products = $this->getProducts();\n\n foreach ($products as $product) {\n //$product_total += $product['quantity'];\n $product_total += $product['quantity'];\n }\n\n return $product_total;\n }", "public function list_items_total()\n\t{\n\t\t$cnt = $this->list_items(NULL, NULL, NULL, NULL, TRUE);\n\t\tif (is_array($cnt))\n\t\t{\n\t\t\treturn count($cnt);\n\t\t}\n\t\treturn $cnt;\n\t}", "public function total(): int\n {\n return Arr::get($this->meta, 'total', $this->count());\n }", "public static function countItems()\n {\n $count = 0;\n if (isset($_SESSION['cart'])) {\n $count = count($_SESSION['cart']);\n }\n \n return $count;\n }", "protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}", "public function total(): int\n {\n return count($this->all());\n }", "public function getTotalItems()\n\t{\n\t\treturn $this->totalItems;\n\t}", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function record_count() {\n $count = $this->db->count_all('product');\n return $count;\n }", "public function TotalItems()\n {\n return $this->getTotalItems();\n }", "public function getTotalItemCount();", "public function total_sold()\n\t{\n\t\t$sold = self::$_ci->cart_item_m->count_by(array('status' => 'pg-success'));\n\t\t\n\t\treturn (int) $sold;\n\t\t\n\t}", "static public function getTotalCount()\n\t{\n\t\treturn self::$count;\n\t}", "public function count() {\r\n\r\n return $this->total_size;\r\n\r\n }", "protected function get_total_count() {\n\t\treturn affiliate_wp()->utils->data->get( \"{$this->batch_id}_total_count\", 0 );\n\t}", "function cart_count(){\n\t\tif(isset($_SESSION['cart'])){\n\t\t\t$cart = $_SESSION['cart'];\n\t\t\t$item_count = 0;\n\t\t\tforeach($cart as $item_id => $item_quantity){\n\t\t\t\t$item_count += $item_quantity;\n\t\t\t}\n\t\t\treturn $item_count;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getBasketPrice(){\n $sum = 0;\n foreach ($this->products as $i => $product) {\n $sum += $product->price * $product->count;\n }\n return $sum;\n }", "public function getTotalItemCount()\n {\n return $this->totalItemCount;\n }", "public function getTotalItemCount()\n\t{\n\t\treturn $this->_totalItemCount;\n\t}", "public function getTotalQuantity()\n {\n $items = $this->getContent();\n\n if ($items->isEmpty()) return 0;\n\n $count = $items->sum(function ($item) {\n return $item['quantity'];\n });\n\n return $count;\n }", "public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_source_id))) {\n $qty += $inventory->qty;\n }\n }\n\n $orderedInventory = $this->product->ordered_inventories\n ->where('channel_id', $this->channel->id)->first();\n\n if ($orderedInventory) {\n $qty -= $orderedInventory->qty;\n }\n\n return $qty;\n }", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function getTotalItems()\n {\n return intval($this->property('limit'));\n }", "public function modelTotalRecord(){\n\t\t\t$total = DB::rowCount(\"select id from products\");\n\t\t\treturn $total;\n\t\t}", "public function getPriceCount() {\n return $this->count(self::PRICE);\n }", "function fetchTotalObjectCount()\n {\n $db = eZDB::instance();\n $objectCount = array();\n $objectCount = $db->arrayQuery( \"SELECT COUNT(*) AS count FROM ezcontentobject\" );\n $totalObjectCount = $objectCount[0][\"count\"];\n return $totalObjectCount;\n }", "public function getTotalCount()\n {\n return $this->provider->totalCount;\n }", "public static function totalNumber()\n {\n return (int)self::find()->count();\n }", "public function getNbProd()\n {\n return $this->CollProduit->taille();\n }", "public function getCurrentGoodsCount()\n {\n return $this->count(self::_CURRENT_GOODS);\n }", "public function count()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return $item['quantity'];\n })->reduce(function($carry, $item) {\n return $carry + $item;\n }, 0);\n }" ]
[ "0.9036443", "0.8438465", "0.82642376", "0.82395667", "0.81511134", "0.8123478", "0.7984946", "0.796109", "0.7854186", "0.7816254", "0.780203", "0.778626", "0.7771025", "0.76620847", "0.76596975", "0.76221657", "0.75255394", "0.7517025", "0.7509003", "0.7501235", "0.7464314", "0.73989487", "0.73720026", "0.73558295", "0.73558295", "0.7332389", "0.733061", "0.7292975", "0.727009", "0.72543734", "0.7218368", "0.7216613", "0.7214748", "0.7165411", "0.7136652", "0.7133928", "0.7129774", "0.71266174", "0.71181536", "0.7114192", "0.7114192", "0.7114192", "0.7110177", "0.71057796", "0.7090211", "0.7080942", "0.70804274", "0.7078344", "0.7060555", "0.70587504", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.7058657", "0.705024", "0.7027444", "0.7016278", "0.7005731", "0.70016855", "0.6999658", "0.69974583", "0.6996326", "0.69830906", "0.6969911", "0.6953092", "0.69518197", "0.6945533", "0.6924416", "0.69066596", "0.68988025", "0.6898255", "0.68873096", "0.6886942", "0.68859875", "0.6883534", "0.68661803", "0.6860494", "0.68592304", "0.6854153", "0.6842014", "0.68407696", "0.6840657", "0.68389034", "0.6834694", "0.682973", "0.68290263", "0.6814804", "0.68136233", "0.6810704", "0.6808351", "0.68026966", "0.6798466", "0.6796428" ]
0.0
-1
////////////////////////////////////////////////////////////////////// Get total products count in category
public static function getTotalCategoryPageCount($cat_id) { $category_data = self::getCategoryData($cat_id); echo ceil((int) $category_data['product_count'] / 9); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function oos_total_products_in_category($category_id)\n{\n\n $products_count = 0;\n\n $dbconn =& oosDBGetConn();\n $oostable =& oosDBGetTables();\n\n $productstable = $oostable['products'];\n $products_to_categoriestable = $oostable['products_to_categories'];\n $products = $dbconn->Execute(\"SELECT COUNT(*) AS total FROM $productstable p, $products_to_categoriestable p2c WHERE p.products_id = p2c.products_id AND p.products_status >= '1' AND p2c.categories_id = '\" . intval($category_id) . \"'\");\n\n $products_count += $products->fields['total'];\n\n return $products_count;\n}", "public function getProductCount()\n {\n $count = 0;\n \tforeach ($this->getItems() as $item) {\n \t $count += $item['count'];\n \t}\n \treturn $count;\n }", "public function getVisibleProductCount($category)\n {\n return $this->_getHelper()->getVisibleProductCount($category);\n }", "public function count()\n {\n $categories = (new Magento())->api('categories')\n ->all($this->pageSize, $this->currentPage)\n ->json();\n\n return $categories['total_count'];\n }", "protected function totalCategory(): int\n {\n $this->mockHandler->append(new Response(200, $this->responseHeaders, $this->readResponseFile('category/list.json')));\n \n $countResponseData = $this->fetchCategories();\n \n return ! empty($countResponseData->meta->pagination->total) ? (int) $countResponseData->meta->pagination->total : 0;\n }", "public static function getTotalProductCount() {\n Db_Actions::DbSelect(\"SELECT COUNT(id) FROM cscart_products\");\n }", "public function numberOfProducts(){\n if (!$this->cart_id){\n return 0;\n }\n return JeproshopCartModelCart::getNumberOfProducts($this->cart_id);\n }", "protected function totalCategories() {\n\n return $this->taxonomy->count();\n }", "public function getTotalProducts()\n {\n $resource = $this->_productFactory->create()->getResource();\n \n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n $resource->getTable('catalog_product_entity'),\n ['total_product' => 'count( entity_id )']\n )->where(\n 'vendor_id = :vendor_id'\n );\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n \n $total = $connection->fetchOne($select, $bind);\n return $total;\n }", "public function getCountProductsCategory($currentCategory)\n {\n return Product::join('product_category', function ($query) use ($currentCategory) {\n $query->on('products.id', '=', 'product_category.product_id')\n ->where('product_category.category_id', '=', \"$currentCategory->id\");\n })\n ->whereHas('price')\n ->whereIsVisible(true)\n ->count();\n }", "public function getCountProduct()\n {\n return $this->product_model->countAll();\n }", "public function getProductsCount()\n {\n if (null === $this->_productsCount) {\n $this->_productsCount = self::DEFAULT_PRODUCTS_COUNT;\n }\n return $this->_productsCount;\n }", "public function getProductCount()\n {\n return count($this->products);\n }", "public function getCountCategory()\n {\n return $this->category_model->countAll();\n }", "public function getProductsCount()\n\t{\n\t\tif ($this->hasData('products_count')) {\n\t\t\treturn $this->getData('products_count');\n\t\t}\n\n\t\tif (null === $this->getData('products_count')) {\n\t\t\t$this->setData('products_count', self::DEFAULT_PRODUCTS_COUNT);\n\t\t}\n\n\t\treturn $this->getData('products_count');\n\t}", "function tep_products_in_category_count($categories_id, $include_deactivated = false) {\n $products_count = 0;\n\n if ($include_deactivated) {\n $products_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c where p.products_id = p2c.products_id and p2c.categories_id = '\" . $categories_id . \"'\");\n } else {\n //$products_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c where p.products_id = p2c.products_id and p.products_status != '0' and p2c.categories_id = '\" . $categories_id . \"'\");\n $products_query = tep_db_query(\"select count(*) as total from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c where p.products_id = p2c.products_id and p2c.categories_id = '\" . $categories_id . \"'\");\n }\n\n $products = tep_db_fetch_array($products_query);\n\n $products_count += $products['total'];\n\n $childs_query = tep_db_query(\"select categories_id from \" . TABLE_CATEGORIES . \" where parent_id = '\" . $categories_id . \"'\");\n if (tep_db_num_rows($childs_query)) {\n while ($childs = tep_db_fetch_array($childs_query)) {\n $products_count += tep_products_in_category_count($childs['categories_id'], $include_deactivated);\n }\n }\n\n return $products_count;\n}", "function tep_products_in_category_count($categories_id, $include_deactivated = false) {\n $OSCOM_Db = Registry::get('Db');\n\n if ($include_deactivated) {\n $Qproducts = $OSCOM_Db->get([\n 'products p',\n 'products_to_categories p2c'\n ], [\n 'count(*) as total'\n ], [\n 'p.products_id' => [\n 'rel' => 'p2c.products_id'\n ],\n 'p2c.categories_id' => (int)$categories_id\n ]);\n } else {\n $Qproducts = $OSCOM_Db->get([\n 'products p',\n 'products_to_categories p2c'\n ], [\n 'count(*) as total'\n ], [\n 'p.products_id' => [\n 'rel' => 'p2c.products_id'\n ],\n 'p.products_status' => '1',\n 'p2c.categories_id' => (int)$categories_id\n ]);\n }\n\n $products_count = $Qproducts->valueInt('total');\n\n $Qchildren = $OSCOM_Db->get('categories', 'categories_id', ['parent_id' => (int)$categories_id]);\n\n while ($Qchildren->fetch()) {\n $products_count += call_user_func(__FUNCTION__, $Qchildren->valueInt('categories_id'), $include_deactivated);\n }\n\n return $products_count;\n }", "public function count_products($category_id)\n {\n $children = array();\n $rs = array();\n $rs = $this->db->distinct()\n ->select('child_id')\n ->from('product_configurable_link')\n ->join('product', 'product.id = product_configurable_link.child_id')\n ->where('product.quantity >', 0)\n ->get();\n\n if ($rs->num_rows()) {\n $rs = $rs->result_array();\n $children = array_column($rs, 'child_id');\n }\n if ($children) {\n // End - Get id of all products which are child of any product.\n // Get total number of products which are either configurable or standard but not child.\n $rs = array();\n $rs = $this->db->select('product.id')\n ->from('product')\n ->join('cat_prod', 'cat_prod.pid = product.id')\n ->where('cat_prod.cid', $category_id)\n ->where_not_in('product.id', $children)\n ->get();\n\n return $rs->num_rows();\n } else {\n return 0;\n }\n // End - Get number of products which are either configurable or standard but not child.\n }", "function olc_products_in_category_count($categories_id, $include_deactivated = false) {\n\t$products_count = 0;\n\n\tif ($include_deactivated) {\n\t\t$products_query = olc_db_query(SELECT.\"count(*) as total\".SQL_FROM . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c where p.products_id = p2c.products_id and p2c.categories_id = '\" . $categories_id . APOS);\n\t} else {\n\t\t$products_query = olc_db_query(SELECT.\"count(*) as total\".SQL_FROM . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '\" . $categories_id . APOS);\n\t}\n\n\t$products = olc_db_fetch_array($products_query);\n\n\t$products_count += $products['total'];\n\n\t$childs_query = olc_db_query(SELECT.\"categories_id\".SQL_FROM . TABLE_CATEGORIES . SQL_WHERE.\"parent_id = '\" . $categories_id . APOS);\n\tif (olc_db_num_rows($childs_query)) {\n\t\twhile ($childs = olc_db_fetch_array($childs_query)) {\n\t\t\t$products_count += olc_products_in_category_count($childs['categories_id'], $include_deactivated);\n\t\t}\n\t}\n\n\treturn $products_count;\n}", "public function countProductInCategory($prodList){\n\n $catIns = new BuckysShopCategory();\n $categoryList = $catIns->getCategoryList();\n\n $catProdCountList = [];\n if(count($prodList) > 0){\n\n foreach($prodList as $itemData){\n if(isset($catProdCountList[$itemData['catID']])){\n $catProdCountList[$itemData['catID']]++;\n }else{\n $catProdCountList[$itemData['catID']] = 1;\n }\n }\n }\n\n if(count($catProdCountList) > 0 && count($categoryList) > 0){\n foreach($categoryList as &$tmpCatData){\n isset($catProdCountList[$tmpCatData['catID']]) ? $tmpCatData['count'] = $catProdCountList[$tmpCatData['catID']] : $tmpCatData['count'] = 0;\n }\n }\n\n return $categoryList;\n }", "public function getAllProductsCount()\n {\n\n return $this->all()->count();\n }", "function count_category_products($category_id, $include_deactivated = false) {\n\t\t$products_count = 0;\n\t\tif ($include_deactivated) {\n\t\t\t$products_query = olc_db_query(\"select count(*) as total from \".TABLE_PRODUCTS.\" p, \".TABLE_PRODUCTS_TO_CATEGORIES.\" p2c where p.products_id = p2c.products_id and p2c.categories_id = '\".$category_id.\"'\");\n\t\t} else {\n\t\t\t$products_query = olc_db_query(\"select count(*) as total from \".TABLE_PRODUCTS.\" p, \".TABLE_PRODUCTS_TO_CATEGORIES.\" p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '\".$category_id.\"'\");\n\t\t}\n\n\t\t$products = olc_db_fetch_array($products_query);\n\n\t\t$products_count += $products['total'];\n\n\t\t$childs_query = olc_db_query(\"select categories_id from \".TABLE_CATEGORIES.\" where parent_id = '\".$category_id.\"'\");\n\t\tif (olc_db_num_rows($childs_query)) {\n\t\t\twhile ($childs = olc_db_fetch_array($childs_query)) {\n\t\t\t\t$products_count += $this->count_category_products($childs['categories_id'], $include_deactivated);\n\t\t\t}\n\t\t}\n\t\treturn $products_count;\n\t}", "function tep_count_products_in_category($category_id, $include_inactive = false) {\n $products_count = 0;\n\ttep_get_subcategories($category_list,$category_id);\n\t$category_list[] = $category_id;\n\t$products_sql = \"select count(*) as total from \" . TABLE_PRODUCTS . \" p, \" . TABLE_PRODUCTS_TO_CATEGORIES . \" p2c where p.products_id = p2c.products_id and p2c.categories_id in (\" . join(',',$category_list) . \")\";\n if ($include_inactive == false) {\n\t\t$products_sql.= \" and p.products_status = '1'\";\n }\n\t$products_query = tep_db_query($products_sql);\n $products = tep_db_fetch_array($products_query);\n $products_count = $products['total'];\n\n return $products_count;\n }", "public static function select_product_count_by_category_id($category_id=null)\n {\n try {\n $query = new Query;\n if($category_id != null)\n {\n $count = $query->select('COUNT(*) as count')->from('core_products')->where(\"category_id = $category_id\")->andWhere(\"product_status = 1\")->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])->All();\n return $count[0]['count'];\n \n }else\n {\n $query = new Query;\n $pending_products_count = $query->select('COUNT(*) as count')->from('core_products')\n ->where(\"product_status = 0\")\n //->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])\n ->All();//pending products count \n $total_count['pending_products_count'] = $pending_products_count[0]['count'];\n\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_products')\n //->where(\"product_status = 1\")\n //->andWhere(['>=','core_products.product_expires_on',date(\"Y-m-d H:i:s\")])\n ->All();\n $total_count['total_products_count'] = $count[0]['count'];\n return $total_count;\n }\n \n \n \n } catch (ErrorException $e) {\n Yii::warning($e->getMessage());\n }\n \n \n }", "public function getBasketProductsCount(): int\n\t{\n\t\tif ($this->basketProducts === null) {\n\t\t\t$this->getBasketProducts();\n\t\t}\n\n\t\treturn $this->basketProductsCount;\n\t}", "public function getProductTotalCount($productData) {\n if (isset ( $productData ['sku'] )) {\n return count ( $productData ['sku'] );\n }\n }", "function getCategoryCount() {\n\t\treturn count($this->domit_rss_categories);\n\t}", "function getCategoryCount() {\n\t\treturn count($this->domit_rss_categories);\n\t}", "public function getCategoryCount()\n {\n return count(get_the_category($this->id));\n }", "function getProductCount($cat_id) {\n $ci = & get_instance();\n $query = $ci->db->get_where(ES_PRODUCTS, array('category_id' => $cat_id));\n return $query->num_rows();\n}", "public function ProductCount()\n {\n return Products::count();\n }", "public function get_category_count()\n {\n $result=$this->db->count_all($this->table_name);\n return $result;\n }", "public function getTotalCount()\n {\n $this->loadItems();\n return $this->calculator->getCount($this->items);\n }", "public function countCats() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$where = \"WHERE category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}categories $where\" );\n\t\t$count = $get->fetch_row();\n\t\treturn $count[0];\n\t}", "public function countProdukByCategory($id_category){\n $this->db->where(array('deleted_at' => null, 'status' => 1));\n $this->db->where('id_category', $id_category);\n $this->db->from($this->product);\n return $this->db->count_all_results();\n }", "function count_all($category_id){\n\t\t\t\t\t$sql= 'SELECT COUNT( * ) AS numrows\n\t\t\t\t\tFROM customize_apparel_product\t\t\t\t\t\n\t\t\t\t\tWHERE customize_apparel_product.customize_apparel_category_id = '.$category_id.'';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\t\treturn $Q->row ()->numrows;\n\t\t\t\t}", "function count_products()\n\t{\t\n\t\tif(!$this->validate())\n\t\t\treturn false;\n\n\t\tif(empty($this->keywords_to_search_for))\n\t\t\t$this->set_keywords_from_search_query();\n\t\t\t\t\t\n\t\t$keyword_filter \t= $this->build_keyword_sql_filter($this->keywords_to_search_for);\n\t\t\n\t\t$category_filter \t= $this->build_category_sql_filter($this->in_category_id);\n\t\t\n\t\tif(empty($keyword_filter))\t\n\t\t{\n\t\t\t$this->total_number_of_search_results = 0;\n\t\t\t\n\t\t\treturn $this->total_number_of_search_results;\n\t\t}\n\t\t\t\n\t\t//Find the total number of search results\n\t\t$count_search_results_sql = '\n\t\t\t\tSELECT COUNT(*) ' .\n\t\t\t\t'FROM (SELECT DISTINCT product.id FROM product ' .\n\t\t\t\t'\tINNER JOIN product_keyword ON product_keyword.product_id = product.id ' .\n\t\t\t\t'\tINNER JOIN keyword ON product_keyword.keyword_id = keyword.id ' .\n\t\t\t\t'WHERE ('.$keyword_filter.') '.$category_filter . ' AND product.is_active = 1 ' . \n\t\t\t\t'GROUP BY product.id) AS product_count';\n\t\t\n\t\t$this->total_number_of_search_results = $this->_db->get_first_cell($count_search_results_sql);\n\t\n\t\treturn $this->total_number_of_search_results;\n\t}", "public function total_items()\n {\n $total_items = 0;\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n foreach ($items as $key)\n {\n $total_items =+ ($total_items + $key['qty']);\n }\n return $total_items;\n }\n }", "public static function getCategoryCount($categoryId)\n {\n return (int) FrontendModel::get('database')->getVar(\n 'SELECT COUNT(i.id) AS count\n FROM menu AS i\n WHERE i.category_id = ?',\n array((int) $categoryId)\n );\n }", "public static function getTotalSearchResultsCount() {\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $search_term = $_POST['search_term'];\n\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n Db_Actions::DbSelect(\"SELECT product_id FROM cscart_product_descriptions WHERE product LIKE '%\" . $search_term . \"%'\");\n break;\n case \"boy\":\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "public function NumOfProducts()\n {\n return Product::all()->count();\n }", "public function getNumProducts()\n {\n return $this->numProducts;\n }", "public function countProducts()\n {\n $count = 0;\n foreach($this->products as $product) {\n /** @var ProductAbstract $product */\n switch ($product->getRequiredData()->getType()) {\n case DataAbstract::TYPE_CONFIGURABLE:\n /** @var Configurable $product */\n if (method_exists($product, 'getSimpleProducts')) {\n foreach ($product->getSimpleProducts() as $simple) {\n /** @var Simple $simple */\n $count++;\n }\n }\n $count++;\n break;\n default:\n $count++;\n break;\n }\n }\n\n return $count;\n }", "public function count()\n {\n $count = 0;\n foreach($this->_data as &$product) {\n $count += $product['quantity'];\n }\n\n\t\treturn $count;\n\t}", "function countAllProducts($id){\n\t\t$result = $this->CategoriesProduct->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'CategoriesProduct.category_id' => $id\n\t\t\t),\n\t\t\t'contain' => array()\n\t\t));\n\n\t\treturn $result;\n\t}", "public function getTotalCount()\n\t{\n\t\treturn $this->totalCount;\n\t}", "public static function getTotalproductsCount($cat_id) {\n//First get the products ids from the selected category\n\n $category_dress_type_id = isset($_POST['product_type']) ? $_POST['product_type'] : '';\n $designer_type = isset($_POST['designer_type']) && !empty($_POST['designer_type']) ? $_POST['designer_type'] : \"\";\n if (isset($_POST['model_type'])) {\n $model_type = $_POST['model_type'];\n switch ($model_type) {\n case \"girl\":\n if (!empty($category_dress_type_id)) {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND category_dress_type_id='$category_dress_type_id'\");\n }\n else if (!empty($designer_type)) {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND brand_type='$designer_type'\");\n }\n else {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n }\n break;\n case \"boy\":\n if (!empty($category_dress_type_id)) {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261 AND category_dress_type_id='$category_dress_type_id'\");\n }\n else if (!empty($designer_type)) {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261 AND brand_type='$designer_type'\");\n }\n else {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=261\");\n }\n\n break;\n default:\n if (!empty($category_dress_type_id)) {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND category_dress_type_id='$category_dress_type_id'\");\n }\n else if (!empty($designer_type)) {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260 AND brand_type='$designer_type'\");\n }\n else {\n Db_Actions::DbSelect(\"SELECT DISTINCT COUNT(product_id) AS totalprds FROM cscart_products_categories WHERE category_id=260\");\n }\n break;\n }\n }\n $products_count = Db_Actions::DbGetResults();\n if (!isset($products_count->empty_result)) {\n foreach ($products_count as $count) {\n echo ceil($count->totalprds / 9);\n }\n }\n else {\n echo 0;\n }\n }", "function countProductsSoldInCategories() {\r\n global $conn;\r\n $select = \"SELECT category, SUM(quantitysold) AS aqs FROM product GROUP BY category;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}", "public function totalCount();", "public function totalCount();", "public function totalCategoria()\n {\n return $this->totalCentral() + $this->totalSeccional();\n }", "public function categoryCount($category_id)\n {\n return static::where('category_id', $category_id)->count();\n }", "public function getTotalQuantity()\n {\n $quantity = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $quantity = $quantity + $basketProduct->getQuantity();\n }\n }\n \n return $quantity;\n }", "protected function calculateTotalItemCount()\n\t{\n\t\t$this->addScopes();\n\t\treturn CActiveRecord::model($this->modelClass)->count($this->getCriteria());\n\t}", "public function getTotalCount()\n {\n return $this->totalCount;\n }", "public function getAmountOfCocktails($cat){\r\n $con = $this->db->getConnection();\r\n if ($cat!= 0) {\r\n $query = 'SELECT COUNT(*) as count FROM cocktail_details WHERE category='.$cat;\r\n }else{\r\n $query = 'SELECT COUNT(*) as count FROM cocktail_details';\r\n }\r\n $sql = mysqli_query($con, $query);\r\n $row = mysqli_fetch_array($sql,MYSQLI_ASSOC);\r\n return $row['count'];\r\n }", "public function countProduct(){\n return count(Product::all());\n }", "protected function get_total_count() {\n\t\treturn affiliate_wp()->utils->data->get( \"{$this->batch_id}_total_count\", 0 );\n\t}", "public function CountProByCategory($id) {\n $this->db->select('product.id as pro_id,\n product_category.id as cate_id,\n product_to_category.id_category');\n\n $this->db->join('product_to_category', 'product_to_category.id_product=product.id');\n $this->db->join('product_category', 'product_to_category.id_category=product_category.id');\n\n $this->db->where('product_to_category.id_category', $id);\n $this->db->order_by('product.id', 'desc');\n $this->db->group_by('product.id');\n $q = $this->db->get('product');\n return $q->num_rows();\n }", "public function countTotalItems($params = array())\n {\n $query = $this->getEntityManager()\n ->createQuery(\n 'SELECT COUNT(i.id) as total FROM AppBundle:FeedItem i\n JOIN i.feed f\n WHERE f.category= :category')\n ->setParameter('category', $params);\n\n\n return $query->getSingleScalarResult();\n }", "function fetchCategoryCount()\n\t{\n\t\t$this->db->select('category_id');\n\t\t$query = $this->db->get('tbl_category');\n\t\treturn $query->num_rows();\n\t}", "public function addCountToAllCategories($categoryCollection)\n {\n $isAnchor = array();\n $isNotAnchor = array();\n foreach ($categoryCollection as $category) {\n if ($category->getIsAnchor()) {\n $isAnchor[] = $category->getId();\n } else {\n $isNotAnchor[] = $category->getId();\n }\n }\n $productCounts = array();\n if ($isAnchor || $isNotAnchor) {\n $select = $this->getProductCountSelect();\n\n Mage::dispatchEvent(\n 'catalog_product_collection_before_add_count_to_categories',\n array('collection' => $this)\n );\n\n $stmt = clone $select;\n $stmt->limit(); //reset limits\n $fromPart = $stmt->getPart(Zend_Db_Select::FROM);\n $catIndexJoinConditional = explode(' AND ', $fromPart['cat_index']['joinCondition']);\n $catIndexJoinConditional = array_slice($catIndexJoinConditional, 0, 3);\n $fromPart['cat_index']['joinCondition'] = implode(' AND ', $catIndexJoinConditional);\n $stmt->setPart(Zend_Db_Select::FROM, $fromPart);\n\n if ($isAnchor) {\n $stmt->where('count_table.category_id IN (?)', $isAnchor);\n }\n if ($isNotAnchor) {\n $stmt->where('count_table.category_id IN (?)', $isNotAnchor);\n $stmt->where('count_table.is_parent = 1');\n }\n\n $productCounts += $this->getConnection()->fetchPairs($stmt);\n $stmt = null;\n $select = null;\n $this->unsProductCountSelect();\n }\n\n foreach ($categoryCollection as $category) {\n $_count = 0;\n if (isset($productCounts[$category->getId()])) {\n $_count = $productCounts[$category->getId()];\n }\n $category->setProductCount($_count);\n }\n\n return $this;\n }", "public function getPostCountForCategory($categoryId) {\n try {\n \n $postCountsForCategory = \"\";\n // method calling... \n $postCountsForCategory = CurbSideCategoryCollection::model()->getPostCountForCategory($categoryId);\n } catch (Exception $ex) {\n Yii::log(\"SkiptaUserService:getPostCountForCategory::\".$ex->getMessage().\"--\".$ex->getTraceAsString(), 'error', 'application');\n }\n return $postCountsForCategory;\n }", "function fetchCategoryCount() {\n $this->db->select('category_id');\n $query = $this->db->get('tbl_category');\n return $query->num_rows();\n }", "public function CountProByCategory_all() {\n $this->db->select('product.id as pro_id,\n product_category.id as cate_id,\n product_to_category.id_category');\n\n $this->db->join('product_to_category', 'product_to_category.id_product=product.id');\n $this->db->join('product_category', 'product_to_category.id_category=product_category.id');\n\n // $this->db->where('product_to_category.id_category',$id);\n $this->db->order_by('product.id', 'desc');\n $this->db->where('product.lang', $this->language);\n $this->db->group_by('product.id');\n $q = $this->db->get('product');\n return $q->num_rows();\n }", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function getShopCount()\n {\n return $this->count(self::_SHOP);\n }", "public static function getTotalCategoryDocuments($categoryId)\n {\n $db = JFactory::getDbo();\n\n $query = $db->getQuery(true);\n\n $query = \"SELECT COUNT(a.id) FROM #__papiersdefamilles_documents AS a\n INNER JOIN #__papiersdefamilles_documentcategories AS b\n ON a.id = b.document_id\n WHERE b.category_id = $categoryId AND a.num_id != ''\";\n\n $result = $db->setQuery($query)->loadResult();\n\n return $result;\n }", "function get_total_prod_count($type, $modifiedAfter = null)\n\t{\n\t\t$collection = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('type_id', $type);\n\t\t\t\t\t\t\n\t\tif (!empty($modifiedAfter)) {\n\t\t\t$collection->addAttributeToFilter('updated_at', array('gteq' => $modifiedAfter));\n\t\t}\n\t\treturn $collection->getSize();\n\t}", "public function getCountProducts(){\n global $connect;\n $query = $connect->PDO->prepare(\"SELECT count(id) FROM `pagTab`\");\n $query->execute();\n $row = $query->fetchAll();\n return $row;\n }", "public function total(): int\n {\n return count($this->all());\n }", "public function get_total_items()\n {\n $num = 0;\n\n if (isset($_SESSION['cart'])) {\n foreach ($_SESSION['cart'] as $item) {\n $num = $num + $item;\n }\n }\n return $num;\n }", "function getCategoryDocumentCount($module_srl, $category_srl)\n\t{\n\t\t$args = new stdClass;\n\t\t$args->module_srl = $module_srl;\n\t\t$args->category_srl = $category_srl;\n\t\t$output = executeQuery('document.getCategoryDocumentCount', $args);\n\t\treturn (int)$output->data->count;\n\t}", "public function getTotalCube()\n {\n $cube = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $cube = $cube + $basketProduct->getProduct()->getCube() * $basketProduct->getQuantity();\n }\n }\n \n return $cube;\n }", "function countCategories(){\n return $this->db->count_all('post_category');\n \t\t }", "public function getProductItemCounts()\n {\n if (array_key_exists(\"productItemCounts\", $this->_propDict)) {\n if (is_a($this->_propDict[\"productItemCounts\"], \"\\Microsoft\\Graph\\Model\\KeyValuePair\") || is_null($this->_propDict[\"productItemCounts\"])) {\n return $this->_propDict[\"productItemCounts\"];\n } else {\n $this->_propDict[\"productItemCounts\"] = new KeyValuePair($this->_propDict[\"productItemCounts\"]);\n return $this->_propDict[\"productItemCounts\"];\n }\n }\n return null;\n }", "public function CountProByCategory_p($id) {\n $this->db->select('product.id as pro_id,\n product_category.id as cate_id,\n product_to_category.id_category');\n\n $this->db->join('product_to_category', 'product_to_category.id_product=product.id');\n $this->db->join('product_category', 'product_to_category.id_category=product_category.id');\n\n $this->db->where('product_to_category.id_category', $id);\n $this->db->order_by('product.price_sale', 'esc');\n $this->db->order_by('product.price', 'esc');\n $this->db->group_by('product.id');\n $q = $this->db->get('product');\n return $q->num_rows();\n }", "function sizeCart(){\n\t\t//return array_sum($this->articulos);\n\t\t$sum = 0;\n\t\tforeach ($this->articulos as $bookid => $book) {\n\t\t\t$cantidad = $book['cantidad'];\n\t\t\t$sum += $cantidad;\n\t\t}\n\t\t\n\t\treturn $sum;\n\t}", "public function getTotalCount()\n {\n if ($this->getPagination() === false) {\n return $this->getCount();\n } elseif ($this->_totalCount === null) {\n $this->_totalCount = $this->prepareTotalCount();\n }\n\n return $this->_totalCount;\n }", "public function list_items_total()\n\t{\n\t\t$cnt = $this->list_items(NULL, NULL, NULL, NULL, TRUE);\n\t\tif (is_array($cnt))\n\t\t{\n\t\t\treturn count($cnt);\n\t\t}\n\t\treturn $cnt;\n\t}", "public function countInCategory($category)\n\t{\n\t\treturn App::getDb()->fetchColumn(\"\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM feedback\n\t\t\tWHERE category_id = ?\n\t\t\", array($category->id));\n\t}", "public function findCountCategories()\n {\n $query = self::getDb()->prepare(\"\n\t\t\tSELECT COUNT(id)\n\t\t\tFROM {$this->repository}\n\t\t\");\n $query->execute();\n $count = $query->fetch();\n return $count[0];\n }", "function count_all_kids($cat_id){\n\t\t\t\t\t$sql= 'SELECT COUNT( * ) AS numrows\n\t\t\t\t\tFROM product\n\t\t\t\t\tJOIN product_people ON product_people.product_id = product.product_id\n\t\t\t\t\tWHERE product.product_type_id = '.$cat_id.'\n\t\t\t\t\tAND product_people.people_cat_id =\"3\"';\n\t\t\t\t\t\n\t\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\t\treturn $Q->row ()->numrows;\n\t\t\t\t}", "public function getPriceCount() {\n return $this->count(self::PRICE);\n }", "public function get_total_items()\n\t{\n\t\t$num = 0;\n\t\t\n\t\tif (isset($_SESSION['cart']))\n\t\t{\n\t\t\tforeach($_SESSION['cart'] as $item)\n\t\t\t{\n\t\t\t\t$num = $num + $item;\n\t\t\t}\n\t\t}\n\t\treturn $num;\n\t}", "public function total(): int\n {\n return Arr::get($this->meta, 'total', $this->count());\n }", "public function countCath()\n\t{\n \t\treturn $this->findAll('kategoria')->count('*');\n\t}", "public function cekRowsPerCat(){\n $query = \"SELECT COUNT(*) AS numrows FROM \".NEWS_TABLE.\" WHERE newsCategory =\".$this->idCategory;\n $result = mysql_query($query) or die('Error, query failed');\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $numrows = $row['numrows']; \n \n return $numrows;\n }", "static public function getTotalCount()\n\t{\n\t\treturn self::$count;\n\t}", "public function getTotalCollectionCount() {\n return $this->totalCollectionCount;\n }", "function getProductCount($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product/count.json' , $params ),true);\n\t}", "public function getTotalPrice()\n {\n $price = 0;\n \n if ($this->hasProducts()) {\n foreach ($this->getBasketProductsJoinProduct() as $basketProduct) {\n $price = $price + $basketProduct->getTotalPrice();\n }\n }\n \n return $price;\n }", "public function getProductsCostTotal()\n {\n return $this->getProducts()->sum('price');\n }", "public function count_by_categories()\n\t{\n\t\t$prefix = $this->db->dbprefix;\n\n\t\t$sql = \"SELECT category, COUNT(1) as count FROM {$prefix}news_articles, {$prefix}news_categories\n\t\t\t\t\t\tWHERE {$prefix}news_articles.category_id = {$prefix}news_categories.id GROUP BY {$prefix}news_articles.category_id\";\n\n\t\t$query = $this->db->query($sql);\n\n\t\tif ($query->num_rows())\n\t\t{\n\t\t\treturn $query->result();\n\t\t}\n\n\t\treturn false;\n\t}", "public function NumeroCategorias(){\n $numero_categorias = Categorie::count();\n return $numero_categorias;\n }", "function countTotal() {\n $dbr = wfGetDB( DB_SLAVE );\n $count = 0;\n $s = $dbr->selectRow(\n 'Comments',\n array( 'COUNT(*) AS CommentCount' ),\n array( 'Comment_Page_ID' => $this->id ),\n __METHOD__\n );\n if ( $s !== false ) {\n $count = $s->CommentCount;\n }\n return $count;\n }", "function countActiveProducts($id){\n\t\t$result = $this->CategoriesProduct->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'CategoriesProduct.category_id' => $id,\n\t\t\t\t'Product.active' => true\n\t\t\t),\n\t\t\t'contain' => array('Product')\n\t\t));\n\n\t\treturn $result;\n\t}", "public function count() {\n\t\treturn $this->field('Cart.order_item_count', $this->cartConditions());\n\t}" ]
[ "0.82010645", "0.78043646", "0.77213633", "0.74560225", "0.7402817", "0.7397205", "0.7323023", "0.72739375", "0.724297", "0.72369087", "0.7207884", "0.7184305", "0.71752745", "0.7145684", "0.7135345", "0.7100862", "0.7065881", "0.7061516", "0.7048361", "0.6997831", "0.69963574", "0.69938993", "0.69428927", "0.69426054", "0.6926675", "0.6881735", "0.6878139", "0.6878139", "0.68723136", "0.6850274", "0.6817532", "0.67886674", "0.6772687", "0.676708", "0.676426", "0.676169", "0.6748801", "0.67361397", "0.6735637", "0.67249805", "0.67136383", "0.6708571", "0.6644561", "0.66396093", "0.6614475", "0.6611974", "0.6593947", "0.6582988", "0.6575164", "0.6575164", "0.65701604", "0.6557365", "0.65423745", "0.65412587", "0.6539522", "0.6536723", "0.6519852", "0.6441249", "0.64385104", "0.6438486", "0.6416239", "0.6408898", "0.6401222", "0.6383666", "0.6376417", "0.6373569", "0.6373569", "0.6373569", "0.6367314", "0.6366069", "0.6351786", "0.63445866", "0.63443506", "0.63343406", "0.63270503", "0.6324186", "0.632355", "0.63223934", "0.6317181", "0.631005", "0.63058263", "0.62847954", "0.62819016", "0.6279757", "0.6278154", "0.6276609", "0.62708545", "0.62679505", "0.6266955", "0.6255025", "0.62305933", "0.62294155", "0.62176466", "0.6216068", "0.6211153", "0.6198544", "0.61948717", "0.619461", "0.61939365", "0.6187774" ]
0.66220737
44
/////////////////////////////////////////////////////////////////////// Load background images
public static function loadBackgroundImages() { $dir = scandir('../img/bgs'); $bg_images = array(); foreach ($dir as $file) { if ($file != "." && $file != "..") { if (file_exists("../img/bgs/" . $file)) { $currFileExt = pathinfo("../img/bgs/" . $file, 4); if ($currFileExt == "jpg" || $currFileExt == "png" || $currFileExt == "gif" || $currFileExt == "jpeg" || $currFileExt == "bmp") { $bg_images[] = $file; } } } } $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1; $max_bgs_per_page = 9; $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page; $slice = array_slice($bg_images, $offset, $max_bgs_per_page); $counter = 0; $middleClass = ""; foreach ($slice as $bg) { $counter++; if ($counter == 1) { ?><div class="cs-product-row"><?php } if ($counter == 2) { $middleClass = "cs-prd-middle"; } else { $middleClass = ""; } ?> <?php $bg_index = self::parseInt($bg); ?> <div class="cs-product pad-bot thumb_za_pozadini <?php echo $middleClass; ?>" index_za_pozadina_e="<?php echo $bg_index; ?>"> <img src="img/bgs/<?php echo $bg ?>" width="97" height="126" data-bgname="<?php echo $bg ?>" class="cs-main-bg" /> </div> <?php if ($counter == 3) { ?></div><?php $counter = 0; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_background_image()\n {\n }", "function _captcha_show_gd_img_get_backgrounds()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$images = array();\n\t\t$_path = $this->path_background;\n\t\t\n\t\tif ( $_dir = @opendir( $_path ) )\n\t\t{\n\t\t\twhile( false !== ( $_file = @readdir( $_dir ) ) )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#\\.(gif|jpeg|jpg|png)$#i\", $_file ) )\n\t\t\t\t{\n\t\t\t\t\t$images[] = $_path . '/' . $_file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $images;\n\t}", "public function disable_lazyload_background_images() {\r\n\t\treturn false;\r\n\t}", "function background_image()\n {\n }", "public static function loadFilterImages() {\n $dir = scandir('../img/effects');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/effects/\" . $file)) {\n $currFileExt = pathinfo(\"../img/effects/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n echo json_encode($slice);\n }", "function bgimg($img){\n\treturn \"background: url('\".$img.\"'); background-size: cover; background-position: 0 50%;\";\n}", "public function setBackgroundImage($url);", "protected function searchBackgroundImage() {\n\t\t$resources = FALSE;\n\n\t\tif (isset($this->settings['mode']) && $this->settings['mode'] == 'directory' && trim($this->settings['directory']) !== '') {\n\t\t\t// Get background image from a directory\n\t\t\t$resources = $this->searchBackgroundImageInDirectory();\n\t\t}\n\n\t\tif (!isset($this->settings['mode']) || $this->settings['mode'] == 'rootline') {\n\t\t\t// Get background image from a rootline\n\t\t\t$resources = $this->searchBackgroundImageInRootline();\n\n\t\t}\n\n\t\tif ($resources == FALSE || !($resources instanceof Tx_Extbase_Persistence_ObjectStorage && $resources->current() instanceof Tx_Supersized_Domain_Model_Resource)) {\n\t\t\t$this->setDefaultBackgroundImage();\n\t\t}\n\n\t\treturn $resources;\n\t}", "function cucina_retina_backgrounds(){\n\t$is_retina = (bool) get_theme_mod( 'background_size' );\n\tif ( $is_retina ) {\n\t\t$image = get_background_image();\n\t\tif ( ! $image ){\n\t\t\treturn;\n\t\t}\n\n\t\t$metadata = getimagesize( $image );\n\t\tif ( ! is_array( $metadata ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$width = $metadata[0];\n\t\t$height = $metadata[1];\n\t\tprintf( '<style>body{ background-size: %dpx %dpx; }</style>', $width/2, $height/2 );\n\t}\n}", "function background_img($link){\n\t\t\t\techo \"<style> body{background: url(\". $link. \");\n\t\t\t\t\t\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t\t\t\t\t\tbackground-size: cover;\n\t\t\t\t\t\t\t\t\t} </style>\";\n\t\t\t}", "private static function background($im, int $width, int $height) {\n $path = __DIR__ . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'bgs' . DIRECTORY_SEPARATOR;\n $dir = dir($path);\n\n $bgs = [];\n while (false !== ($file = $dir->read())) {\n if ('.' != $file[0] && substr($file, -4) == '.jpg') {\n $bgs[] = $path . $file;\n }\n }\n $dir->close();\n\n $gb = $bgs[array_rand($bgs)];\n\n list($w, $h) = @getimagesize($gb);\n // Resample\n $bgImage = @imagecreatefromjpeg($gb);\n @imagecopyresampled($im, $bgImage, 0, 0, 0, 0, $width, $height, $w, $h);\n }", "function bethel_get_default_background_args() {\n\treturn array ('default-color' => '#f5f5f5',\n\t\t\t\t 'default-image' => get_stylesheet_directory_uri().'/images/background.jpg',\n\t\t\t\t 'default-repeat' => 'repeat'\n\t );\n}", "private function set_background_color()\n {\n imagecolorallocate(\n $this->img,\n L_BACKGROUND_COLOR_R,\n L_BACKGROUND_COLOR_G,\n L_BACKGROUND_COLOR_B\n );\n }", "public function loadResources() {}", "function getBackground() {return $this->readBackground();}", "private function loadImages(): void\n {\n if (count($this->images) == 1) {\n $this->addMeta('image', $this->images[0]);\n\n return;\n }\n\n foreach ($this->images as $number => $url) {\n $this->addMeta(\"image{$number}\", $url);\n }\n }", "function _custom_header_background_just_in_time()\n {\n }", "function readBackground() {return $this->_background;}", "public function ajax_background_add()\n {\n }", "function PREFIX_responsive_background( $images = false ) {\n\tif ( ! $images ) {\n\t\treturn false;\n\t}\n\n\treturn htmlentities( json_encode( array( 'source' => $images ) ) );\n}", "function _custom_background_cb()\n {\n }", "protected function loadRegisteredSprites() {}", "function inject_css(){\n $group_id=bp_get_current_group_id();\n if(empty($group_id))\n return;\n $image=bgclite_get_image($group_id);\n \n if(empty($image)|| apply_filters('bp_group_customizer_iwilldo_it_myself',false))\n return;\n ?>\n <style type=\"text/css\">\n body.is-single-group{\n background:url(<?php echo $image;?>) center top fixed no-repeat,url(\"http://sill-web.de/gzc/wp-content/themes/yoo_master2_wp/css/navy_blue.png\") repeat;\n }\n </style> \n <?php\n\n }", "function wprt_background_css( $bg ) {\n\t// Define vars\n\t$css = '';\n\t$bg_style = $bg .'_style';\n\n\tif ( $bg_img = wprt_get_mod( $bg, null ) ) {\n\t\t$css .= 'background-image: url('. esc_url( $bg_img ). ');';\n\t}\n\n\tif ( $bg_style = wprt_get_mod( $bg_style ) ) {\n\t\tif ( 'fixed' == $bg_style ) {\n\t\t\t$css .= ' background-position: center center; background-repeat: no-repeat; background-attachment: fixed; background-size: cover;';\n\t\t} elseif ( 'fixed-top' == $bg_style ) {\n\t\t\t$css .= ' background-position: center top; background-repeat: no-repeat; background-attachment: fixed; background-size: cover;';\n\t\t} elseif ( 'fixed-bottom' == $bg_style ) {\n\t\t\t$css .= ' background-position: center bottom; background-repeat: no-repeat; background-attachment: fixed; background-size: cover;';\n\t\t} elseif ( 'cover' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: no-repeat; background-position: center center; background-size: cover;';\n\t\t} elseif ( 'center-top' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: no-repeat; background-position: center top;';\n\t\t} elseif ( 'repeat' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: repeat;';\n\t\t} elseif ( 'repeat-x' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: repeat-x;';\n\t\t} elseif ( 'repeat-y' == $bg_style ) {\n\t\t\t$css .= ' background-repeat: repeat-y;';\n\t\t}\n\t}\n\n\treturn esc_attr( $css );\n}", "protected function loadImage()\n {\n if (!is_resource($this->tmpImage)) {\n $create = $this->createFunctionName;\n $this->tmpImage = $create($this->filePath);\n imagesavealpha($this->tmpImage, true);\n }\n }", "function p2_body_class_background_image( $classes ) {\n\t$image = get_option( 'p2_background_image' );\n\n\tif ( empty( $image ) || 'none' == $image )\n\t\treturn $classes;\n\n\t$classes[] = esc_attr( 'p2-background-image-' . $image );\n\n\treturn $classes;\n}", "public function load_assets() {}", "protected function loadImages() {\r\n $this->images = new \\App\\Table\\ImagesTable(App::getInstance()->getDb());\r\n }", "public function getBackgroundImage()\r\n {\r\n $orientation = $this->getOrientation();\r\n $backgroundImage = '';\r\n /** @var $helperImage Mage_XmlConnect_Helper_Image */\r\n $helperImage = Mage::helper('xmlconnect/image');\r\n\r\n switch ($orientation) {\r\n case Mage_XmlConnect_Helper_Ipad::ORIENTATION_LANDSCAPE:\r\n $configPath = 'conf/body/backgroundIpadLandscapeImage';\r\n $imageUrlOrig = $this->getData($configPath);\r\n if ($imageUrlOrig) {\r\n $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_WIDTH;\r\n $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_LANDSCAPE_BACKGROUND_HEIGHT;\r\n $backgroundImage = $helperImage->getCustomSizeImageUrl($imageUrlOrig, $width, $height);\r\n } else {\r\n $backgroundImage = $this->getPreviewImagesUrl('ipad/background_home_landscape.jpg');\r\n }\r\n break;\r\n case Mage_XmlConnect_Helper_Ipad::ORIENTATION_PORTRAIT:\r\n $configPath = 'conf/body/backgroundIpadPortraitImage';\r\n $imageUrlOrig = $this->getData($configPath);\r\n if ($imageUrlOrig) {\r\n $width = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_WIDTH;\r\n $height = Mage_XmlConnect_Helper_Ipad::PREVIEW_PORTRAIT_BACKGROUND_HEIGHT;\r\n $backgroundImage = $helperImage->getCustomSizeImageUrl($imageUrlOrig, $width, $height);\r\n } else {\r\n $backgroundImage = $this->getPreviewImagesUrl('ipad/background_portrait.jpg');\r\n }\r\n break;\r\n default:\r\n Mage::throwException(\r\n Mage::helper('xmlconnect')->__('Wrong Ipad background image orientation has been specified: \"%s\".', $orientation)\r\n );\r\n break;\r\n }\r\n return $backgroundImage;\r\n }", "public function get_url_background_pion(){ return $this->_url_background_pion;}", "protected function image_create($background = null)\r\n {\r\n // Check for GD2 support\r\n if ( ! \\function_exists('imagegd2') ) \\Core::show_500(\\__('captcha.requires_GD2'));\r\n\r\n // Create a new image (black)\r\n static::$image = \\imagecreatetruecolor(static::$config['width'], static::$config['height']);\r\n\r\n // Use a background image\r\n if ( !empty($background) )\r\n {\r\n /*\r\n // Create the image using the right function for the filetype\r\n $function = '\\\\imagecreatefrom' . static::image_type($filename);\r\n static::$background_image = $function($background);\r\n\r\n // Resize the image if needed\r\n if ( \\imagesx(static::background_image) !== static::$config['width'] || \\imagesy(static::background_image) !== static::$config['height'] )\r\n {\r\n \\imagecopyresampled(static::image, static::background_image, 0, 0, 0, 0, static::$config['width'], static::$config['height'], \\imagesx(static::background_image), \\imagesy(static::background_image));\r\n }\r\n\r\n // Free up resources\r\n \\imagedestroy(static::background_image);\r\n */\r\n }\r\n }", "function loadImage()\n\t{\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t$this->ImageStream = @imagecreatefromgif($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->ImageStream = @imagecreatefromjpeg($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->ImageStream = @imagecreatefrompng($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\t}", "public function get_default_header_images()\n {\n }", "public function load_assets() {\n\t\twponion_load_core_assets( $this->option( 'assets' ) );\n\t}", "public function getBgImage(){\r\n return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_BG_IMAGE,ScopeInterface::SCOPE_WEBSITE);\r\n }", "function getBackgroundRepeat() {return $this->readBackgroundRepeat();}", "function load_icons() {\n themify_get_icon( 'ti-import' );\n themify_get_icon( 'ti-export' );\n Themify_Enqueue_Assets::loadIcons();\n }", "function get_background() {\r\n return $this->db->get($this->table);\r\n\t}", "function remove_custom_background()\n {\n }", "function get_background($page_id){\n\n\t$custom_meta = get_post_custom($page_id);\n\t\n\tif(isset($custom_meta['lumen_page_background']) && isset($custom_meta['lumen_page_background'][0]) && $page_id != \"default\"){\n\t\t$background = unserialize($custom_meta['lumen_page_background'][0]);\t\n\t\tif($background['background-color'] == \"\" && $background['background-image'] == \"\") {\n\t\t\t$background = ot_get_option('lumen_site_default_background');\n\t\t}\n\t}\telse {\n\t\t$background = ot_get_option('lumen_site_default_background');\n\t}\n\t\n\t$background_image = \"\";\n\tif(isset($background['background-image'])){\n\t\t$background_image = $background['background-image'];\n\t\tif(strlen($background_image) > 0) {\n\t\t\t$background_image = 'url('.$background_image.')';\n\t\t}\n\t}\n\t\n\t$output = \"\";\n\t$background_repeat = false;\n\t\n\tif(isset($background['background-color'])){ $output .= $background['background-color'].\" \"; }\n\t$output .= $background_image.\" \";\n\tif(isset($background['background-repeat'])){ \n\t\t$output .= $background['background-repeat'].\" \"; \n\t\tif($background['background-repeat'] == \"repeat\"){\n\t\t\t$background_repeat = true;\t\t\n\t\t} \n\t}\n\tif(isset($background['background-attachment'])){ $output .= $background['background-attachment'].\" \"; }\n\tif(isset($background['background-position'])){ $output .= $background['background-position'].\" \"; }\n\t\n\tif(strlen(trim($output)) > 0 && $background_repeat) { \n\t\treturn 'background: '.$output.'; background-size: inherit!important;'; \n\t}else{\n\t\treturn 'background: '.$output; \n\t}\n\t\n\treturn \"\";\n}", "function featuredBG($size = 'full', $pos_x = 'center', $pos_y = 'center', $repeat = 'no-repeat'){\n $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $size );\n $url = $thumb['0'];\n echo 'style=\"background: url('. $url .')'. $pos_x .' '. $pos_y .' ' . $repeat .'\"';\n}", "public static function theme_images() {\r\n add_image_size('slideshow-980', 980, 420, true);\r\n add_image_size('slideshow-1200', 1180, 550, true);\r\n add_image_size('slideshow-1560', 1540, 550, true);\r\n add_image_size('slideshow-720', 600, 550, true);\r\n add_image_size('grid-thumbnail', 370, 270, true);\r\n add_image_size('icon-60', 60, 60, true);\r\n add_image_size('icon-100', 100, 100, true);\r\n add_image_size('icon-40', 40, 40, true);\r\n }", "function wp_load_image($file)\n {\n }", "public function all()\n {\n $backgrounds = Cache::rememberForever('backgrounds', function () {\n return DB::table('backgrounds')->lists('path');\n });\n\n return $backgrounds;\n }", "function readBackgroundRepeat() {return $this->_backgroundrepeat;}", "function wp_preload_resources()\n {\n }", "function _load_remote_featured_patterns()\n {\n }", "function plugin_header_image() {\n\t\t$post_type = get_current_screen()->post_type;\n\n\t\tif ( 'lumo_slide' != $post_type )\n\t\t\treturn;\n?>\n\t\t\t <style type=\"text/css\">\n\t\t\t\t.icon32.icon32-posts-lumo_slide {\n\t\t\t\t background: url(<?php echo plugins_url('/images/projection-screen-32x32.png', __FILE__); ?>) !important;\n\t\t\t\t}\n\t\t\t </style>\n<?php\n\t}", "function getBackgroundPosition() {return $this->readBackgroundPosition();}", "function gcb_custom_background() {\r\n\tadd_custom_background( apply_filters( 'gcb_args' , 'gcb_do_theme_background' ) );\t\r\n}", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "function rotateBg() {\r\n\tglobal $backgrounds, $bgImage, $i;\r\n\t$c = count($backgrounds);\r\n\tif ($c==0) return;\r\n\t$r = random($c);\r\n\tif ($backgrounds[$r]==''&&$i<10) {\r\n\t\t$i++;\r\n\t\trotateBg();\r\n\t} elseif ($i>=10) {\r\n\t\tif (!$bgImage||$bgImage=='') {\r\n\t\t\t$bgImage='bg_lock.gif';\r\n\t\t} else {\r\n\t\t\t$bgImage=$bgImage;\r\n\t\t}\r\n\t} else {\r\n\t\t$bgImage = $backgrounds[$r];\r\n\t};\r\n\treturn $bgImage;\r\n}", "function image_src($id, $size = 'full', $background_image = false, $height = false) {\n if ($image = wp_get_attachment_image_src($id, $size, true)) {\n return $background_image ? 'background-image: url('.$image[0].');' . ($height?'height:'.$image[2].'px':'') : $image[0];\n }\n}", "public function addBackgroundImage($id, Request $request)\n {\n $this->validate($request, [\n 'background' => 'required|mimes:jpg,jpeg,png,bmp'\n ]);\n \n $file = $request->file('background');\n $name = time() . $file->getClientOriginalName();\n $file->move($this->backgroundsBaseDir, $name);\n\n //Find the photo session\n $photosession = PhotoSession::findOrFail($id);\n $photosession->background_image_path = $this->backgroundsBaseDir . '/' . $name;\n $photosession->background_image_path_thumbnail = sprintf(\"%s/tn-%s\", $this->backgroundsBaseDir, $name);\n\n Image::make($photosession->background_image_path)\n ->fit(400)\n ->save($photosession->background_image_path_thumbnail); // save() is an Image Intervention method, not Laravels.\n\n $photosession->save();\n\n }", "protected function _load_image()\n {\n if ( ! is_resource($this->_image))\n {\n // Gets create function\n $create = $this->_create_function;\n\n // Open the temporary image\n $this->_image = $create($this->file);\n\n // Preserve transparency when saving\n imagesavealpha($this->_image, TRUE);\n }\n }", "function readBackgroundPosition() {return $this->_backgroundposition;}", "protected function combineImages() {}", "function gs_image_markup_responsive_background( $attributes, $image = null ) {\n\n\tif ( isset( $attributes['src'] ) ) {\n\t\t$attributes['data-src'] = $attributes['src'];\n\t\t$attributes['src'] = ''; //could add default small image or a base64 encoded small image here\n\t}\n\tif ( isset( $attributes['srcset'] ) ) {\n\t\t$attributes['data-srcset'] = $attributes['srcset'];\n\t\t$attributes['srcset'] = '';\n\t}\n\tif ( $image ) { //mainly for IE 11 support\n\t\t$attributes['data-fallback'] = wp_get_attachment_image_url( $image->ID, 'large' );\n\t}\n\n\treturn $attributes;\n\n}", "function LoadGif($imgname)\n{\n $im = @imagecreatefromgif($imgname);\n\n /* See if it failed */\n if(!$im)\n {\n /* Create a blank image */\n $im = imagecreatetruecolor (96, 96);\n $bgc = imagecolorallocate ($im, 255, 255, 255);\n $tc = imagecolorallocate ($im, 0, 0, 0);\n\n imagefilledrectangle ($im, 0, 0, 96, 96, $bgc);\n\n /* Output an error message */\n imagestring ($im, 1, 5, 5, 'Mapler.me failed.', $tc);\n imagestring ($im, 1, 5, 20, $imgname, $tc);\n }\n\n return $im;\n}", "function get_media_background_picture_srcs( $attachment_xs_id, $attachment_sm_id, $img_size_prefix ) {\n\t$bg_images = array();\n\n\tif ( $attachment_sm_id ) {\n\t\t$bg_images = array_merge(\n\t\t\t$bg_images,\n\t\t\tarray(\n\t\t\t\t'xl' => get_attachment_src_by_size( $attachment_sm_id, $img_size_prefix . '-xl' ),\n\t\t\t\t'lg' => get_attachment_src_by_size( $attachment_sm_id, $img_size_prefix . '-lg' ),\n\t\t\t\t'md' => get_attachment_src_by_size( $attachment_sm_id, $img_size_prefix . '-md' ),\n\t\t\t\t'sm' => get_attachment_src_by_size( $attachment_sm_id, $img_size_prefix . '-sm' )\n\t\t\t)\n\t\t);\n\n\t\t// Try to get a fallback -xs image if needed\n\t\tif ( !$attachment_xs_id ) {\n\t\t\t$bg_images = array_merge(\n\t\t\t\t$bg_images,\n\t\t\t\tarray( 'xs' => get_attachment_src_by_size( $attachment_sm_id, $img_size_prefix ) )\n\t\t\t);\n\t\t}\n\n\t\t// Remove duplicate image sizes, in case an old image isn't pre-cropped\n\t\t$bg_images = array_unique( $bg_images );\n\n\t\t// Use the largest-available image as the fallback <img>\n\t\t$bg_images['fallback'] = reset( $bg_images );\n\t}\n\tif ( $attachment_xs_id ) {\n\t\t$bg_images = array_merge(\n\t\t\t$bg_images,\n\t\t\tarray( 'xs' => get_attachment_src_by_size( $attachment_xs_id, $img_size_prefix ) )\n\t\t);\n\t}\n\n\t// Strip out false-y values (in case an attachment failed to return somewhere)\n\t$bg_images = array_filter( $bg_images );\n\n\treturn $bg_images;\n}", "function image_src($id, $size = 'full', $background_image = false, $height = false) {\n if ($image = wp_get_attachment_image_src($id, $size, true)) {\n return $background_image ? 'background-image: url('.$image[0].');' . ($height?'min-height:'.$image[2].'px':'') : $image[0];\n }\n}", "public function Images()\n {\n $pngLeftTop = $this->objFromFixture('Image', 'pngLeftTop');\n $pngLeftTop->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngLeftTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightTop = $this->objFromFixture('Image', 'pngRightTop');\n $pngRightTop->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightTop->VerticalSliceBottomRightColor = '0000ff';\n $pngRightTop->HorizontalSliceTopLeftColor = 'ff0000';\n $pngRightTop->HorizontalSliceBottomRightColor = 'ffff00';\n\n $pngRightBottom = $this->objFromFixture('Image', 'pngRightBottom');\n $pngRightBottom->VerticalSliceTopLeftColor = 'ffff00';\n $pngRightBottom->VerticalSliceBottomRightColor = '0000ff';\n $pngRightBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngRightBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n $pngLeftBottom = $this->objFromFixture('Image', 'pngLeftBottom');\n $pngLeftBottom->VerticalSliceTopLeftColor = 'ff0000';\n $pngLeftBottom->VerticalSliceBottomRightColor = '00ff00';\n $pngLeftBottom->HorizontalSliceTopLeftColor = '00ff00';\n $pngLeftBottom->HorizontalSliceBottomRightColor = '0000ff';\n\n return array($pngLeftTop, $pngRightTop, $pngRightBottom, $pngLeftBottom);\n }", "function gcb_do_theme_background() {\r\n\t\r\n\t$defaults = array(\r\n\t\t'default_img' => genesis_get_option( 'cb_default' , GCB_SETTINGS_FIELD ),\r\n\t\t'bgimage' => get_background_image(),\r\n\t\t'bgcolor' => get_background_color(),\r\n\t);\r\n\t$defaults = apply_filters( 'gcb_defaults' , $defaults );\r\n\textract( $defaults , EXTR_SKIP );\r\n\r\n\t// begin output\r\n\t$output = \"<style type='text/css'>\\n\";\r\n\r\n\tif ( ( defined( 'CHILD_THEME_NAME' ) ) && ( CHILD_THEME_NAME == 'AgentPress Theme' ) )\r\n\t\t$important = ' !important';\r\n\telse\r\n\t\t$important = '';\r\n\t\r\n\tif( !empty( $bgimage ) ) {\r\n\t\t$bg_styles = 'background-image: url(\\'' . get_theme_mod( 'background_image' , '' ) . '\\')' . $important . ';'\r\n\t\t. ' background-repeat: ' . get_theme_mod( 'background_repeat' , 'repeat' ) . $important . ';'\r\n\t\t. ' background-position: top ' . get_theme_mod( 'background_position_x' , 'left' ) . $important . ';' . 'background-attachment: '. get_theme_mod( 'background_attachment' , 'scroll' );\r\n\t\t\r\n\t\t\r\n\t\t$output .= \"body { \" . $bg_styles . \" } \\n\";\r\n\t} \r\n\t\r\n\tif( !empty( $bgcolor ) ) {\r\n\t\t$output .= \"body { background-color: #\" . $bgcolor . $important . \"; } \\n\";\r\n\t}\r\n\t\r\n\t// for child themes to set a default bg img\r\n\tif( !empty( $default_img ) && empty( $bgimage ) ) {\r\n\t\t$output .= \"body { background: url('\" . gcb_setting_url( $default_img ) . \"')\" . $important . \"; } \\n\";\r\n\t}\r\n\t$output .= \"</style>\";\r\n\t\r\n\techo apply_filters( 'gcb_output' , $output , $bgimage , $bgcolor );\r\n\treturn $output;\r\n}", "protected function loadCss() {}", "function kickstart_background_callback() {\n if ( ! get_background_color() ) {\n return;\n }\n printf( '<style>body { background-color: #%s; }</style>' . \"\\n\", get_background_color() );\n}", "function wpbm_slider_images(){\n global $wpdb;\n include( 'inc/admin/wpbm-slider-image.php' );\n die();\n }", "function image() {\n echo json_encode(array('element' => '<img src=\"msbienvenuebackground.png\" alt=\"Welcome\">'));\n exit;\n }", "private function build_background($c1, $c2, $icon, $size){\n\t\t// Create initial image\n\t\t$image = imagecreatetruecolor(450, 19);\n\t\t// Build gradient\n\t\t$this->build_gradient($image, 0, 0, 19, 450, $this->hex2rgb($c1), $this->hex2rgb($c2));\n\t\t// Save alpha\n\t\timagealphablending($image,true);\n\t\t// Add background scanlines\n\t\t$scanlines = imagecreatefrompng(dirname(__file__).\"/scanlines.png\");\n\t\timagealphablending($scanlines,true);\n\t\timagecopy($image, $scanlines, 0, 0, 0, 0, 450, 19);\n\t\t// Add icon\n\t\t$favicon = imagecreatefrompng(dirname(__file__).\"/ico/\".$icon);\n\t\timagealphablending($favicon,true);\n\t\timagecopy($image, $favicon, 4, 1, 0, 0, $size, $size);\n\t\t// Add shine\n\t\t$scanlines = imagecreatefrompng(dirname(__file__).\"/shine.png\");\n\t\timagealphablending($scanlines,true);\n\t\timagecopy($image, $scanlines, 0, 0, 0, 0, 450, 19);\n\t\treturn $image;\n\t}", "public function load_front_resources() {\n\t\t\tglobal $post;\n\n\t\t\t$amz_db = new Amz_Db();\n\t\t\t$tables = $amz_db->find_all( AMZ_TABLES_TABLE );\n\n\t\t\tif ( $tables ) {\n\n\t\t\t\tforeach ( $tables as $table ) {\n\t\t\t\t\tif ( has_shortcode( $post->post_content, 'amztable_' . $table->table_id ) ) {\n\t\t\t\t\t\twp_enqueue_script( 'data-tables', '/wp-content/plugins/amz-affiliate/js/vendor/data-tables.js', 'jquery' );\n\t\t\t\t\t\twp_enqueue_script( 'amz-table', '/wp-content/plugins/amz-affiliate/js/amz-tables.js', 'jquery' );\n\t\t\t\t\t\twp_enqueue_style( 'data-tables-styles', '/wp-content/plugins/amz-affiliate/css/vendor/data-tables.css' );\n\t\t\t\t\t\twp_enqueue_style( 'amz-tables-styles', '/wp-content/plugins/amz-affiliate/css/amz-tables.css' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "function modshrink_s_register_custom_background() {\n\t$args = array(\n\t\t'default-color' => 'ffffff',\n\t\t'default-image' => '',\n\t);\n\n\t$args = apply_filters( 'modshrink_s_custom_background_args', $args );\n\n\tif ( function_exists( 'wp_get_theme' ) ) {\n\t\tadd_theme_support( 'custom-background', $args );\n\t} else {\n\t\tdefine( 'BACKGROUND_COLOR', $args['default-color'] );\n\t\tif ( ! empty( $args['default-image'] ) )\n\t\t\tdefine( 'BACKGROUND_IMAGE', $args['default-image'] );\n\t\tadd_custom_background();\n\t}\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 }", "protected function loadAssets()\n {\n }", "public function loadAppAssets() {\n\t\tadd_action( 'wp_loaded', function () {\n\t\t\t/** EnqueueScritps instance. Don't remove it. Used in included file. */\n\t\t\t$assets = Container::make( EnqueueScripts::class );\n\t\t\tinclude_once( MWW_PATH . '/app/Support/assets.php' );\n\t\t} );\n\t}", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "protected function loadStylesheets() {}", "public static function edit_image()\n{\n\n\n\t/*\n\t* Change Background\n\t*/\n\n\t/*\n\t* Change other setting\n\t*/\n}", "function voyage_mikado_design_styles() {\n\n $preload_background_styles = array();\n\n if(voyage_mikado_options()->getOptionValue('preload_pattern_image') !== \"\") {\n $preload_background_styles['background-image'] = 'url('.voyage_mikado_options()->getOptionValue('preload_pattern_image').') !important';\n } else {\n $preload_background_styles['background-image'] = 'url('.esc_url(MIKADO_ASSETS_ROOT.\"/img/preload_pattern.png\").') !important';\n }\n\n echo voyage_mikado_dynamic_css('.mkdf-preload-background', $preload_background_styles);\n\n if(voyage_mikado_options()->getOptionValue('google_fonts')) {\n $font_family = voyage_mikado_options()->getOptionValue('google_fonts');\n if(voyage_mikado_is_font_option_valid($font_family)) {\n echo voyage_mikado_dynamic_css('body', array('font-family' => voyage_mikado_get_font_option_val($font_family)));\n }\n }\n\n if(voyage_mikado_options()->getOptionValue('first_color') !== \"\") {\n $color_selector = array(\n\t\t\t\t'a',\n\t\t\t\t'h1 a:hover',\n\t\t\t\t'h2 a:hover',\n\t\t\t\t'h3 a:hover',\n\t\t\t\t'h4 a:hover',\n\t\t\t\t'h5 a:hover',\n\t\t\t\t'h6 a:hover',\n\t\t\t\t'p a',\n\t\t\t\t'.mkdf-pagination li.active span',\n\t\t\t\t'.mkdf-like.liked',\n\t\t\t\t'aside.mkdf-sidebar .widget .mkdf-blog-list-holder.mkdf-image-in-box h6.mkdf-item-title a:hover',\n\t\t\t\t'aside.mkdf-sidebar .widget ul li a:hover',\n\t\t\t\t'aside.mkdf-sidebar .widget.widget_categories li:hover a',\n\t\t\t\t'aside.mkdf-sidebar .widget.widget_nav_menu ul.menu li a:hover',\n\t\t\t\t'aside.mkdf-sidebar .widget.widget_nav_menu .current-menu-item>a',\n\t\t\t\t'#ui-datepicker-div .ui-datepicker-title',\n\t\t\t\t'.mkdf-main-menu ul .mkdf-menu-featured-icon',\n\t\t\t\t'.mkdf-drop-down .wide .second .inner>ul>li>a:hover',\n\t\t\t\t'.mkdf-drop-down .wide .second .inner ul li.sub .flexslider ul li a:hover',\n\t\t\t\t'.mkdf-drop-down .wide .second ul li .flexslider ul li a:hover',\n\t\t\t\t'.mkdf-drop-down .wide .second .inner ul li.sub .flexslider.widget_flexslider .menu_recent_post_text a:hover',\n\t\t\t\t'.mkdf-mobile-header .mkdf-mobile-nav a:hover',\n\t\t\t\t'.mkdf-mobile-header .mkdf-mobile-nav h4:hover',\n\t\t\t\t'.mkdf-mobile-header .mkdf-mobile-menu-opener a:hover',\n\t\t\t\t'.mkdf-page-header .mkdf-sticky-header .mkdf-main-menu>ul>li.mkdf-active-item>a:hover',\n\t\t\t\t'.mkdf-page-header .mkdf-sticky-header .mkdf-main-menu>ul>li:hover>a',\n\t\t\t\t'.mkdf-page-header .mkdf-sticky-header .mkdf-main-menu>ul>li>a:hover',\n\t\t\t\t'.mkdf-page-header .mkdf-sticky-header .mkdf-search-opener:hover',\n\t\t\t\t'.mkdf-page-header .mkdf-sticky-header .mkdf-side-menu-button-opener:hover',\n\t\t\t\t'body:not(.mkdf-menu-item-first-level-bg-color) .mkdf-page-header .mkdf-sticky-header .mkdf-main-menu>ul>li:hover>a',\n\t\t\t\t'body:not(.mkdf-menu-item-first-level-bg-color) .mkdf-page-header .mkdf-sticky-header .mkdf-main-menu>ul>li>a:hover',\n\t\t\t\t'.mkdf-page-header .mkdf-search-opener:hover',\n\t\t\t\t'.mkdf-side-menu-button-opener:hover',\n\t\t\t\t'.mkdf-counter-holder .mkdf-counter-icon',\n\t\t\t\t'.mkdf-message .mkdf-message-inner a.mkdf-close i:hover',\n\t\t\t\t'.mkdf-ordered-list ol>li:before',\n\t\t\t\t'.mkdf-icon-list-item .mkdf-icon-list-icon-holder-inner .font_elegant',\n\t\t\t\t'.mkdf-icon-list-item .mkdf-icon-list-icon-holder-inner i',\n\t\t\t\t'.mkdf-blog-slider-holder .mkdf-bs-item-date',\n\t\t\t\t'.mkdf-blog-slider-holder .mkdf-bs-item-bottom-section .mkdf-bs-item-author a:hover',\n\t\t\t\t'.mkdf-blog-slider-holder .mkdf-bs-item-bottom-section .mkdf-bs-item-categories a:hover',\n\t\t\t\t'.mkdf-blog-slider-holder .owl-next:hover',\n\t\t\t\t'.mkdf-blog-slider-holder .owl-prev:hover',\n\t\t\t\t'.mkdf-accordion-holder .mkdf-title-holder.ui-state-active',\n\t\t\t\t'.mkdf-accordion-holder .mkdf-title-holder.ui-state-hover',\n\t\t\t\t'.mkdf-accordion-holder.mkdf-boxed .mkdf-title-holder.ui-state-active',\n\t\t\t\t'.mkdf-accordion-holder.mkdf-boxed .mkdf-title-holder.ui-state-hover',\n\t\t\t\t'.mkdf-blog-list-holder .mkdf-item-info-section>div>a:hover',\n\t\t\t\t'.mkdf-blog-list-holder.mkdf-grid-type-2 .mkdf-post-item-author-holder a:hover',\n\t\t\t\t'.mkdf-blog-list-holder.mkdf-masonry .mkdf-post-item-author-holder a:hover',\n\t\t\t\t'.mkdf-blog-list-holder.mkdf-image-in-box h5.mkdf-item-title a:hover',\n\t\t\t\t'.mkdf-btn.mkdf-btn-outline',\n\t\t\t\t'.post-password-form input.mkdf-btn-outline[type=submit]',\n\t\t\t\t'.woocommerce .mkdf-btn-outline.button',\n\t\t\t\t'input.mkdf-btn-outline.wpcf7-form-control.wpcf7-submit',\n\t\t\t\t'.mkdf-dropcaps',\n\t\t\t\t'.mkdf-iwt.mkdf-iwt-left-from-title .mkdf-iwt-icon-title-holder',\n\t\t\t\t'.mkdf-social-share-holder.mkdf-list li a:hover',\n\t\t\t\t'.mkdf-info-item-inner:hover h6',\n\t\t\t\t'.mkdf-icon-progress-bar .mkdf-ipb-active',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-masonry .format-quote .mkdf-post-content .mkdf-post-title a:hover',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-masonry .format-quote .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-masonry .format-link .mkdf-post-content .mkdf-post-title a:hover',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-masonry .format-link .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-date-on-side .format-link .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-date-on-side .format-quote .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-split-column article.format-link h3.mkdf-post-title a:hover',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-split-column article.format-link .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-split-column article.format-quote .mkdf-post-title h3 a:hover',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-standard .format-quote .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-standard .format-link .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-type-split-column article.format-quote .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-single.mkdf-blog-standard .format-quote .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-single.mkdf-blog-standard .format-link .mkdf-post-mark',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-single.mkdf-blog-standard article.format-link .mkdf-category a:hover',\n\t\t\t\t'.mkdf-blog-holder.mkdf-blog-single.mkdf-blog-standard article.format-quote .mkdf-category a:hover',\n\t\t\t\t'.mkdf-blog-holder article.sticky .mkdf-post-title a',\n\t\t\t\t'.mkdf-filter-blog-holder li.mkdf-active',\n\t\t\t\t'article .mkdf-category',\n\t\t\t\t'article .mkdf-category span.icon_tags',\n\t\t\t\t'.mejs-controls .mejs-button button:hover',\n\t\t\t\t'.woocommerce-pagination .page-numbers li a:hover',\n\t\t\t\t'.woocommerce-pagination .page-numbers li span.current',\n\t\t\t\t'.woocommerce-pagination .page-numbers li span.current:hover',\n\t\t\t\t'.woocommerce-pagination .page-numbers li span:hover',\n\t\t\t\t'.mkdf-woocommerce-page .select2-results .select2-highlighted',\n\t\t\t\t'.mkdf-woocommerce-page ul.products .product .added_to_cart',\n\t\t\t\t'.woocommerce ul.products .product .added_to_cart',\n\t\t\t\t'.mkdf-woocommerce-page ul.products .product .added_to_cart:hover',\n\t\t\t\t'.woocommerce ul.products .product .added_to_cart:hover',\n\t\t\t\t'.mkdf-woocommerce-page ul.products .add_to_cart_button',\n\t\t\t\t'.woocommerce ul.products .add_to_cart_button',\n\t\t\t\t'.mkdf-woocommerce-page .star-rating:before',\n\t\t\t\t'.woocommerce .star-rating:before',\n\t\t\t\t'.mkdf-woocommerce-page .star-rating span:before',\n\t\t\t\t'.woocommerce .star-rating span:before',\n\t\t\t\t'.mkdf-woocommerce-with-sidebar aside.mkdf-sidebar .widget.widget_product_categories ul.product-categories li:hover a',\n\t\t\t\t'.mkdf-shopping-cart-dropdown ul li a:hover',\n\t\t\t\t'.mkdf-shopping-cart-dropdown .mkdf-item-info-holder .mkdf-item-left a:hover',\n\t\t\t\t'.mkdf-shopping-cart-dropdown .mkdf-item-info-holder .mkdf-item-right .remove:hover',\n\t\t\t\t'.mkdf-shopping-cart-dropdown span.mkdf-total span',\n\t\t\t\t'.mkdf-shopping-cart-dropdown span.mkdf-quantity',\n\t\t\t\t'.woocommerce-cart .woocommerce form:not(.woocommerce-shipping-calculator) .product-name a:hover',\n\t\t\t\t'.woocommerce-cart .woocommerce .cart-collaterals .mkdf-shipping-calculator .woocommerce-shipping-calculator>p a:hover',\n\t\t\t\t'.mkdf-tour-item-label.mkdf-tour-item-label-skin2',\n\t\t\t\t'.mkdf-tours-standard-item .mkdf-tours-price-with-discount .mkdf-tours-item-price',\n\t\t\t\t'.mkdf-tours-list-item .mkdf-tours-price-with-discount .mkdf-tours-item-price',\n\t\t\t\t'.mkdf-tour-cover-boxes-holder span.mkdf-tours-item-discount-price.mkdf-tours-item-price',\n\t\t\t\t'.mkdf-tour-type-list-holder li a:hover',\n\t\t\t\t'.mkdf-tours-top-reviews-carousel-holder .mkdf-tours-top-reviews-item-title a:hover',\n\t\t\t\t'.mkdf-tours-top-reviews-carousel-holder .mkdf-tour-reviews-criteria-holder .mkdf-tour-reviews-rating-holder',\n\t\t\t\t'.mkdf-tour-item-single-holder article .mkdf-tour-item-price-holder .mkdf-tours-price-with-discount .mkdf-tours-item-price',\n\t\t\t\t'.mkdf-tour-item-single-holder article .mkdf-tour-main-info-holder li:hover .col6.mkdf-info',\n\t\t\t\t'.mkdf-tour-item-single-holder article .mkdf-tour-main-info-holder li.mkdf-tours-unchecked-attributes .mkdf-tour-main-info-attr:before',\n\t\t\t\t'.mkdf-tours-booking-form-holder .mkdf-tour-message-danger'\n );\n\n $color_important_selector = array(\n\t\t\t\t'.mkdf-icon-list-item a:hover .mkdf-icon-list-text',\n\t\t\t\t'.mkdf-btn.mkdf-btn-hover-outline:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'.post-password-form input[type=submit]:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'.woocommerce .button:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'input.mkdf-btn-hover-outline.wpcf7-form-control.wpcf7-submit:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'.mkdf-btn.mkdf-btn-hover-white:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'.post-password-form input.mkdf-btn-hover-white[type=submit]:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'.woocommerce .mkdf-btn-hover-white.button:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'input.mkdf-btn-hover-white.wpcf7-form-control.wpcf7-submit:not(.mkdf-btn-custom-hover-color):hover',\n\t\t\t\t'.mkdf-tours-list-holder .mkdf-tour-list-filter-item.mkdf-tour-list-current-filter a'\n );\n\n $background_color_selector = array(\n\t\t\t\t'.mkdf-st-loader .pulse',\n\t\t\t\t'.mkdf-st-loader .double_pulse .double-bounce1',\n\t\t\t\t'.mkdf-st-loader .double_pulse .double-bounce2',\n\t\t\t\t'.mkdf-st-loader .cube',\n\t\t\t\t'.mkdf-st-loader .rotating_cubes .cube1',\n\t\t\t\t'.mkdf-st-loader .rotating_cubes .cube2',\n\t\t\t\t'.mkdf-st-loader .stripes>div',\n\t\t\t\t'.mkdf-st-loader .wave>div',\n\t\t\t\t'.mkdf-st-loader .two_rotating_circles .dot1',\n\t\t\t\t'.mkdf-st-loader .two_rotating_circles .dot2',\n\t\t\t\t'.mkdf-st-loader .five_rotating_circles .container1>div',\n\t\t\t\t'.mkdf-st-loader .five_rotating_circles .container2>div',\n\t\t\t\t'.mkdf-st-loader .five_rotating_circles .container3>div',\n\t\t\t\t'.mkdf-st-loader .atom .ball-1:before',\n\t\t\t\t'.mkdf-st-loader .atom .ball-2:before',\n\t\t\t\t'.mkdf-st-loader .atom .ball-3:before',\n\t\t\t\t'.mkdf-st-loader .atom .ball-4:before',\n\t\t\t\t'.mkdf-st-loader .clock .ball:before',\n\t\t\t\t'.mkdf-st-loader .mitosis .ball',\n\t\t\t\t'.mkdf-st-loader .lines .line1',\n\t\t\t\t'.mkdf-st-loader .lines .line2',\n\t\t\t\t'.mkdf-st-loader .lines .line3',\n\t\t\t\t'.mkdf-st-loader .lines .line4',\n\t\t\t\t'.mkdf-st-loader .fussion .ball',\n\t\t\t\t'.mkdf-st-loader .fussion .ball-1',\n\t\t\t\t'.mkdf-st-loader .fussion .ball-2',\n\t\t\t\t'.mkdf-st-loader .fussion .ball-3',\n\t\t\t\t'.mkdf-st-loader .fussion .ball-4',\n\t\t\t\t'.mkdf-st-loader .wave_circles .ball',\n\t\t\t\t'.mkdf-st-loader .pulse_circles .ball',\n\t\t\t\t'.mkdf-carousel-pagination .owl-page.active span',\n\t\t\t\t'aside.mkdf-sidebar .widget.widget_product_tag_cloud .tagcloud a',\n\t\t\t\t'aside.mkdf-sidebar .widget.widget_tag_cloud .tagcloud a',\n\t\t\t\t'#ui-datepicker-div table.ui-datepicker-calendar thead',\n\t\t\t\t'footer .mkdf-footer-top-holder .widget.widget_product_tag_cloud .tagcloud a',\n\t\t\t\t'footer .mkdf-footer-top-holder .widget.widget_tag_cloud .tagcloud a',\n\t\t\t\t'.mkdf-team.main-info-below-image .mkdf-icon-element',\n\t\t\t\t'.mkdf-icon-shortcode.circle',\n\t\t\t\t'.mkdf-icon-shortcode.square',\n\t\t\t\t'.mkdf-testimonials.owl-carousel .owl-dots .owl-dot.active span',\n\t\t\t\t'.mkdf-price-table .mkdf-price-table-inner .mkdf-pt-label-holder .mkdf-pt-label-inner',\n\t\t\t\t'.mkdf-price-table.mkdf-pt-active .mkdf-price-table-inner',\n\t\t\t\t'.mkdf-pie-chart-doughnut-holder .mkdf-pie-legend ul li .mkdf-pie-color-holder',\n\t\t\t\t'.mkdf-pie-chart-pie-holder .mkdf-pie-legend ul li .mkdf-pie-color-holder',\n\t\t\t\t'.mkdf-tabs .mkdf-tabs-nav .mkdf-tab-line',\n\t\t\t\t'.mkdf-btn.mkdf-btn-solid',\n\t\t\t\t'.post-password-form input[type=submit]',\n\t\t\t\t'.woocommerce .button',\n\t\t\t\t'input.wpcf7-form-control.wpcf7-submit',\n\t\t\t\t'.mkdf-dropcaps.mkdf-circle',\n\t\t\t\t'.mkdf-dropcaps.mkdf-square',\n\t\t\t\t'.mkdf-comparision-pricing-tables-holder .mkdf-cpt-table .mkdf-cpt-table-btn a',\n\t\t\t\t'.mkdf-vertical-progress-bar-holder .mkdf-vpb-active-bar',\n\t\t\t\t'.mkdf-weather-widget-holder .mkdf-date-format',\n\t\t\t\t'.widget_mkdf_call_to_action_button .mkdf-call-to-action-button',\n\t\t\t\t'.mkdf-blog-date-on-side .mkdf-date-format',\n\t\t\t\t'.single .mkdf-single-tags-holder .mkdf-tags a',\n\t\t\t\t'.mejs-controls .mejs-time-rail .mejs-time-current:after',\n\t\t\t\t'.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current',\n\t\t\t\t'.mejs-controls .mejs-time-rail .mejs-time-current',\n\t\t\t\t'.mkdf-woocommerce-page .woocommerce-info',\n\t\t\t\t'.mkdf-woocommerce-page .mkdf-onsale',\n\t\t\t\t'.mkdf-woocommerce-page .mkdf-out-of-stock',\n\t\t\t\t'.woocommerce .mkdf-onsale',\n\t\t\t\t'.woocommerce .mkdf-out-of-stock',\n\t\t\t\t'.single-product .mkdf-tabs.mkdf-horizontal .mkdf-tab-line',\n\t\t\t\t'.mkdf-woocommerce-with-sidebar aside.mkdf-sidebar .widget.widget_price_filter .ui-slider .ui-slider-handle',\n\t\t\t\t'.mkdf-shopping-cart-outer .mkdf-shopping-cart-header .mkdf-header-cart .mkdf-cart-count',\n\t\t\t\t'.mkdf-tour-item-label.mkdf-tour-item-label-skin1',\n\t\t\t\t'.mkdf-search-ordering-holder .mkdf-search-ordering-list .mkdf-tab-line',\n\t\t\t\t'.mkdf-membership-dashboard-nav .mkdf-tab-line',\n\t\t\t\t'.mkdf-content-inner>.mkdf-container .mkdf-login-register-content .mkdf-tab-line'\n );\n\n $background_color_important_selector = array(\n \t'.mkdf-woocommerce-page .price_slider_amount button.button',\n\t\t\t\t'.woocommerce .price_slider_amount button.button',\n\t\t\t\t'.mkdf-tours-booking-form-holder input[type=submit]:disabled:hover'\n );\n\n $border_color_selector = array(\n\t\t\t\t'.mkdf-st-loader .pulse_circles .ball',\n\t\t\t\t'aside.mkdf-sidebar .widget.widget_product_tag_cloud .tagcloud a',\n\t\t\t\t'aside.mkdf-sidebar .widget.widget_tag_cloud .tagcloud a',\n\t\t\t\t'footer .mkdf-footer-top-holder .widget.widget_product_tag_cloud .tagcloud a',\n\t\t\t\t'footer .mkdf-footer-top-holder .widget.widget_tag_cloud .tagcloud a',\n\t\t\t\t'.mkdf-team.main-info-below-image .mkdf-icon-element',\n\t\t\t\t'.mkdf-btn.mkdf-btn-solid',\n\t\t\t\t'.post-password-form input[type=submit]',\n\t\t\t\t'.woocommerce .button',\n\t\t\t\t'input.wpcf7-form-control.wpcf7-submit',\n\t\t\t\t'.mkdf-btn.mkdf-btn-outline',\n\t\t\t\t'.post-password-form input.mkdf-btn-outline[type=submit]',\n\t\t\t\t'.woocommerce .mkdf-btn-outline.button',\n\t\t\t\t'input.mkdf-btn-outline.wpcf7-form-control.wpcf7-submit',\n\t\t\t\t'.single .mkdf-single-tags-holder .mkdf-tags a',\n\t\t\t\t'.mkdf-woocommerce-page .price_slider_amount button.button',\n\t\t\t\t'.woocommerce .price_slider_amount button.button',\n\t\t\t\t'.woocommerce-cart .woocommerce form:not(.woocommerce-shipping-calculator) .actions .coupon input[type=text]:focus'\n );\n\n $border_top_color_selector = array(\n '.mkdf-progress-bar .mkdf-progress-number-wrapper.mkdf-floating .mkdf-down-arrow'\n );\n\n $border_bottom_color_selector = array(\n );\n\n $border_left_color_selector = array(\n );\n\n $border_color_important_selector = array(\n\t\t\t\t'.mkdf-btn.mkdf-btn-hover-outline:not(.mkdf-btn-custom-border-hover):hover',\n\t\t\t\t'.post-password-form input[type=submit]:not(.mkdf-btn-custom-border-hover):hover',\n\t\t\t\t'.woocommerce .button:not(.mkdf-btn-custom-border-hover):hover',\n\t\t\t\t'input.mkdf-btn-hover-outline.wpcf7-form-control.wpcf7-submit:not(.mkdf-btn-custom-border-hover):hover'\n );\n\n $stroke_selector = array(\n \t'.mkdf-plane-holder .st0',\n \t'.mkdf-plane-holder .st1'\n \t);\n\n\t\t\t$first_color = voyage_mikado_options()->getOptionValue('first_color');\n\n echo voyage_mikado_dynamic_css($color_selector, array('color' => $first_color));\n echo voyage_mikado_dynamic_css($color_important_selector, array('color' => $first_color.'!important'));\n echo voyage_mikado_dynamic_css('::selection', array('background' => $first_color));\n echo voyage_mikado_dynamic_css('::-moz-selection', array('background' => $first_color));\n echo voyage_mikado_dynamic_css($background_color_selector, array('background-color' => $first_color));\n echo voyage_mikado_dynamic_css($background_color_important_selector, array('background-color' => $first_color.'!important'));\n echo voyage_mikado_dynamic_css($border_color_selector, array('border-color' => $first_color));\n echo voyage_mikado_dynamic_css($border_color_important_selector, array('border-color' => $first_color.'!important'));\n echo voyage_mikado_dynamic_css($border_top_color_selector, array('border-top-color' => $first_color));\n echo voyage_mikado_dynamic_css($border_bottom_color_selector, array('border-bottom-color' => $first_color));\n echo voyage_mikado_dynamic_css($border_left_color_selector, array('border-left-color' => $first_color));\n echo voyage_mikado_dynamic_css($stroke_selector, array('stroke' => $first_color));\n }\n\n if(voyage_mikado_options()->getOptionValue('second_color') !== \"\") {\n $color_selector = array(\n\t\t\t\t'#ui-datepicker-div a',\n\t\t\t\t'.mkdf-icon-list-item .mkdf-icon-list-icon-holder-inner',\n\t\t\t\t'.mkdf-image-gallery .mkdf-image-gallery-grid .mkdf-image-gallery-hover a.mkdf-gallery-link',\n\t\t\t\t'.mkdf-woocommerce-page ul.products .product .mkdf-woo-product-image-holder .add_to_cart_button',\n\t\t\t\t'.mkdf-woocommerce-page ul.products .product .mkdf-woo-product-image-holder .product_type_simple',\n\t\t\t\t'.woocommerce ul.products .product .mkdf-woo-product-image-holder .add_to_cart_button',\n\t\t\t\t'.woocommerce ul.products .product .mkdf-woo-product-image-holder .product_type_simple',\n\t\t\t\t'.mkdf-woocommerce-page .price',\n\t\t\t\t'.woocommerce .price',\n\t\t\t\t'.mkdf-woocommerce-page .price ins',\n\t\t\t\t'.woocommerce .price ins',\n\t\t\t\t'.single-product .mkdf-single-product-summary .price',\n\t\t\t\t'.mkdf-woocommerce-with-sidebar aside.mkdf-sidebar .widget .product_list_widget li .mkdf-woo-product-widget-content .amount',\n\t\t\t\t'.mkdf-woocommerce-with-sidebar aside.mkdf-sidebar .widget .product_list_widget li .mkdf-woo-product-widget-content ins',\n\t\t\t\t'.mkdf-tours-price-holder',\n\t\t\t\t'.mkdf-tours-list-item .mkdf-tours-price-with-discount .mkdf-tours-item-discount-price.mkdf-tours-item-price',\n\t\t\t\t'.mkdf-tour-item-single-holder article .mkdf-tour-item-price-holder .mkdf-tours-item-discount-price.mkdf-tours-item-price',\n\t\t\t\t'.mkdf-tour-item-single-holder article .mkdf-tour-item-price-holder .mkdf-tour-item-price',\n\t\t\t\t'.mkdf-tour-item-single-holder article .mkdf-tour-main-info-holder li.mkdf-tours-checked-attributes .mkdf-tour-main-info-attr:before',\n\t\t\t\t'.mkdf-tour-reviews-display-wrapper .mkdf-tour-reviews-average-rating',\n\t\t\t\t'.mkdf-tours-booking-form-holder .mkdf-tour-message-success',\n\t\t\t\t'.mkdf-tours-my-booking-item .mkdf-tours-info-items .mkdf-tours-booking-price',\n\t\t\t\t'.mkdf-tours-search-main-filters-holder label:before',\n\t\t\t\t'.mkdf-tours-checkout-content-inner .mkdf-tours-info-holder .mkdf-tours-booking-price',\n\t\t\t\t'.mkdf-tours-checkout-content-inner h6'\n );\n\n $color_important_selector = array(\n \t'.mkdf-woocommerce-page ul.products .product .mkdf-woo-product-image-holder a:hover',\n \t'.woocommerce ul.products .product .mkdf-woo-product-image-holder a:hover',\n \t'.mkdf-tours-standard-item .mkdf-tours-item-discount-price.mkdf-tours-item-price'\n );\n\n $background_color_selector = array(\n\t\t\t\t'.mkdf-membership-response-holder .mkdf-membership-response.mkdf-membership-message-succes',\n\t\t\t\t'aside.mkdf-sidebar .widget .searchform input[type=submit]',\n\t\t\t\t'.mkdf-login-register-content ul li.ui-state-active',\n\t\t\t\t'.mkdf-top-bar .mkdf-top-bar-widget-inner .mkdf-search-opener',\n\t\t\t\t'.mkdf-progress-bar .mkdf-progress-content-outer .mkdf-progress-content',\n\t\t\t\t'.mkdf-tour-item-single-holder .mkdf-tour-item-section .mkdf-route-id',\n\t\t\t\t'.mkdf-tour-item-single-holder .mkdf-tour-item-section span.mkdf-line-between-icons-inner',\n\t\t\t\t'.mkdf-tour-reviews-display-wrapper .mkdf-tour-reviews-display-right .mkdf-tour-reviews-bar-holder .mkdf-tour-reviews-bar-progress',\n\t\t\t\t'.tt-suggestion.tt-cursor',\n\t\t\t\t'.tt-suggestion:hover',\n\t\t\t\t'.mkdf-search-ordering-holder .mkdf-tours-search-view-list li.mkdf-tours-search-view-item-active>a',\n\t\t\t\t'.mkdf-search-ordering-holder .mkdf-tours-search-view-list li>a:hover'\n );\n\n $background_color_important_selector = array(\n \t'#ui-datepicker-div .ui-datepicker-today',\n \t'.mkdf-shopping-cart-dropdown .mkdf-cart-bottom .mkdf-btns-holder .mkdf-btn.mkdf-btn-small.view-cart'\n );\n\n $border_color_selector = array(\n );\n\n $border_color_important_selector = array(\n \t'.mkdf-shopping-cart-dropdown .mkdf-cart-bottom .mkdf-btns-holder .mkdf-btn.mkdf-btn-small.view-cart'\n );\n\n\t\t\t$second_color = voyage_mikado_options()->getOptionValue('second_color');\n\n echo voyage_mikado_dynamic_css($color_selector, array('color' => $second_color));\n echo voyage_mikado_dynamic_css($color_important_selector, array('color' => $second_color.'!important'));\n echo voyage_mikado_dynamic_css('::selection', array('background' => $second_color));\n echo voyage_mikado_dynamic_css('::-moz-selection', array('background' => $second_color));\n echo voyage_mikado_dynamic_css($background_color_selector, array('background-color' => $second_color));\n echo voyage_mikado_dynamic_css($background_color_important_selector, array('background-color' => $second_color.'!important'));\n echo voyage_mikado_dynamic_css($border_color_selector, array('border-color' => $second_color));\n echo voyage_mikado_dynamic_css($border_color_important_selector, array('border-color' => $second_color.'!important'));\n }\n\n if(voyage_mikado_options()->getOptionValue('page_background_color')) {\n $background_color_selector = array(\n '.mkdf-wrapper-inner',\n '.mkdf-content',\n '.mkdf-content-inner > .mkdf-container'\n );\n echo voyage_mikado_dynamic_css($background_color_selector, array('background-color' => voyage_mikado_options()->getOptionValue('page_background_color')));\n }\n\n if(voyage_mikado_options()->getOptionValue('selection_color')) {\n echo voyage_mikado_dynamic_css('::selection', array('background' => voyage_mikado_options()->getOptionValue('selection_color')));\n echo voyage_mikado_dynamic_css('::-moz-selection', array('background' => voyage_mikado_options()->getOptionValue('selection_color')));\n }\n\n $boxed_background_style = array();\n if(voyage_mikado_options()->getOptionValue('page_background_color_in_box')) {\n $boxed_background_style['background-color'] = voyage_mikado_options()->getOptionValue('page_background_color_in_box');\n }\n\n if(voyage_mikado_options()->getOptionValue('boxed_background_image')) {\n $boxed_background_style['background-image'] = 'url('.esc_url(voyage_mikado_options()->getOptionValue('boxed_background_image')).')';\n $boxed_background_style['background-position'] = 'center 0px';\n $boxed_background_style['background-repeat'] = 'no-repeat';\n }\n\n if(voyage_mikado_options()->getOptionValue('boxed_pattern_background_image')) {\n $boxed_background_style['background-image'] = 'url('.esc_url(voyage_mikado_options()->getOptionValue('boxed_pattern_background_image')).')';\n $boxed_background_style['background-position'] = '0px 0px';\n $boxed_background_style['background-repeat'] = 'repeat';\n }\n\n if(voyage_mikado_options()->getOptionValue('boxed_background_image_attachment')) {\n $boxed_background_style['background-attachment'] = (voyage_mikado_options()->getOptionValue('boxed_background_image_attachment'));\n }\n\n echo voyage_mikado_dynamic_css('.mkdf-boxed .mkdf-wrapper', $boxed_background_style);\n }", "protected function init() {\n\t\t$this->load_image_sizes();\n\n\t\t// Set image size to WP\n\t\t$this->add_image_sizes();\n\t}", "function get_custom_bg_for_user_profile() \r\n\t{\r\n\t\tglobal $xoouserultra;\r\n\t\t\r\n\t\t$site_url = site_url().\"/\";\r\n\t\t\r\n\t\t$html = '';\r\n\t\t$img = get_option('uultra_default_profile_bg');\r\n\t\t\r\n\t\t$path_f = $xoouserultra->get_option('media_uploading_folder');\t\t\t\t\t\t\r\n\t\t$target_path = $site_url.$path_f.'/custom_profile_bg/'.$img;\r\n\t\t\t\t\r\n\t\tif ($img!=\"\") \r\n\t\t{\t\t\t\r\n\t\t\t\r\n\t\t\t$html .= $target_path;\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $html;\r\n\t\r\n\t}", "function banner_images_init() {\n\n\t$args = array(\n\n\t\t'label' => 'Banner Image',\n\n\t\t'public' => true,\n\n\t\t'show_ui' => true,\n\n\t\t'capability_type' => 'post',\n\n\t\t'hierarchical' => false,\n\n\t\t'rewrite' => array('slug' => 'banner'),\n\n\t\t'query_var' => true,\n\n\t\t'menu_icon' => 'dashicons-format-gallery',\n\n\t\t'supports' => array(\n\n\t\t\t'title', \n\n\t\t\t'thumbnail',\n\n\t\t)\n\n\t);\n\n\tregister_post_type( 'banner', $args );\n\n}", "public function load_assets() {\n\t\t\t//only load styles and js when needed\n\t\t\tif ( $this->is_edit_page() ) {\n\t\t\t\t//styles\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\twp_enqueue_style( 'wm-options-panel-white-label' );\n\t\t\t\tif ( ! wm_option( 'branding-panel-logo' ) && ! wm_option( 'branding-panel-no-logo' ) )\n\t\t\t\t\twp_enqueue_style( 'wm-options-panel-branded' );\n\t\t\t\twp_enqueue_style( 'color-picker' );\n\n\t\t\t\t//scripts\n\t\t\t\twp_enqueue_script( 'jquery-ui-core' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-tabs' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-datepicker' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-slider' );\n\t\t\t\twp_enqueue_script( 'thickbox' );\n\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t\twp_enqueue_script( 'wm-options-panel' );\n\t\t\t\twp_enqueue_script( 'color-picker' );\n\t\t\t}\n\t\t}", "protected function loadImageResource()\n {\n if(empty($this->resource))\n {\n if(($this->worker === NULL || $this->worker === $this::WORKER_IMAGICK) && self::imagickAvailable())\n {\n $this->resource = $this->createImagick($this->image);\n }\n elseif(($this->worker === NULL || $this->worker === $this::WORKER_GD) && self::gdAvailable())\n {\n $this->resource = $this->getGdResource($this->image);\n }\n else\n {\n throw new Exception('Required extensions missing, extension GD or Imagick is required');\n }\n }\n }", "public function define_background_logo($logo,$repeat)\r\n\t\t{\r\n\t\t\t$this->c_background_logo = $logo;\r\n\t\t\t$this->c_background_repeat = $repeat;\r\n\t\t}", "public static function onLoad() {\n\t\tF3::$global['BGCOLOR']='FFF';\n\t\tF3::$global['FGTRANS']=32;\n\t\tF3::$global['IBLOCKS']=4;\n\t\tF3::$global['IPIXELS']=64;\n\t\tF3::$global['HEADERS']=array();\n\t\tF3::$global['SITEMAP']=array();\n\t}", "public static function update_background( $input ) {\n global $canvys;\n return array(\n 'source' => cv_filter( $input['source'], array_merge( array_keys( $canvys['bg_patterns'] ), array( 'custom' ) ), 'gplaypattern' ),\n 'color' => cv_filter( $input['color'], 'hex' ),\n 'image' => cv_filter( $input['image'], 'url' ),\n 'style' => cv_filter( $input['style'], array( 'cover', 'tile' ) ),\n 'repeat' => cv_filter( $input['repeat'], array_keys( $canvys['bg_repeat_options'] ) ),\n 'position' => cv_filter( $input['position'], array_keys( $canvys['bg_position_options'] ) ),\n 'preset_attachment' => cv_filter( $input['preset_attachment'], array( 'scroll', 'fixed' ) ),\n 'custom_attachment' => cv_filter( $input['custom_attachment'], array( 'scroll', 'fixed' ) ),\n );\n }", "function load_theme_image_cache($db, $site, $true_theme, $true_lang)\n{\n global $THEME_IMAGES_CACHE, $THEME_IMAGES_SMART_CACHE_LOAD, $SMART_CACHE;\n\n if ($THEME_IMAGES_SMART_CACHE_LOAD == 0) {\n $THEME_IMAGES_CACHE[$site] = $SMART_CACHE->get('theme_images_' . $true_theme . '_' . $true_lang);\n if (is_null($THEME_IMAGES_CACHE[$site])) {\n $THEME_IMAGES_CACHE[$site] = array();\n }\n } elseif ($THEME_IMAGES_SMART_CACHE_LOAD == 1) {\n $test = $db->query_select('theme_images', array('id', 'path'), array('theme' => $true_theme, 'lang' => $true_lang));\n $THEME_IMAGES_CACHE[$site] = collapse_2d_complexity('id', 'path', $test);\n }\n\n $THEME_IMAGES_SMART_CACHE_LOAD++;\n}", "private function lazyLoad(): void\n\t{\n\t\tif (empty($this->_resource)) {\n\t\t\tif ($this->_cache && !$this->isCacheExpired()) {\n\t\t\t\t$this->_cacheSkip = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$resource = $this->getImageResource($this->_imagePath, $this->_extension);\n\t\t\t$this->_resource = $resource;\n\t\t}\n\t}", "function timeless_backstretch_js() {\n\t//* or if it is the homepage and background video is enabled in customizer\n\tif ( ! is_home() && equity_get_custom_field( '_equity_disable_single_post_background' ) == true )\n\t\treturn;\n\n\t$background_url = equity_get_custom_field( '_equity_single_post_background' );\n\n\t// use default if no background image set\n\tif ( ! $background_url || is_home() && 'image' === get_theme_mod( 'homepage_background_option', 'image' ) ) {\n\t\t$background_url = get_theme_mod( 'default_background_image', get_stylesheet_directory_uri() . '/images/bkg-default.jpg' );\n\t}\n\t?>\n\t\n\t<script>jQuery.backstretch(\"<?php echo $background_url; ?>\");</script>\n\t<?php\n}", "function fanwood_custom_background_callback() {\n\n\t/* Get the background image. */\n\t$image = get_background_image();\n\n\t/* If there's an image, just call the normal WordPress callback. We won't do anything here. */\n\tif ( !empty( $image ) ) {\n\t\t_custom_background_cb();\n\t\treturn;\n\t}\n\n\t/* Get the background color. */\n\t$color = get_background_color();\n\n\t/* If no background color, return. */\n\tif ( empty( $color ) )\n\t\treturn;\n\n\t/* Use 'background' instead of 'background-color'. */\n\t$style = \"background: #{$color};\";\n\n?>\n<style type=\"text/css\">body.custom-background { <?php echo trim( $style ); ?> }</style>\n<?php\n\n}", "function theme_header_background()\n{\n $headerBg = get_theme_option('Header Background');\n if ($headerBg) {\n $storage = Zend_Registry::get('storage');\n $headerBg = $storage->getUri($storage->getPathByType($headerBg, 'theme_uploads'));\n return '<style type=\"text/css\" media=\"screen\">header {'\n . 'background:transparent url(\"' . $headerBg . '\") center left no-repeat;'\n . '}</style>';\n }\n}", "function cavatar_load() {\n\t\\Zotlabs\\Extend\\Hook::register('create_channel_photo', 'addon/cavatar/cavatar.php', 'cavatar_channel_photo');\n}", "private function getImageIntoCss(): void\n {\n preg_match_all(self::REGEX_IMAGE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $sImgPath = PH7_PATH_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n $sImgUrl = PH7_URL_ROOT . $this->sBaseUrl . $aHit[1][$i] . $aHit[2][$i];\n\n if ($this->isDataUriEligible($sImgPath)) {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . Optimization::dataUri($sImgPath, $this->oFile) . ')',\n $this->sContents\n );\n } else {\n $this->sContents = str_replace(\n $aHit[0][$i],\n 'url(' . $sImgUrl . ')',\n $this->sContents\n );\n }\n }\n }", "function backgroundToImg($htmlContent)\n{\n $regex = '/background-image[ ]{0,}:[ ]{0,}url\\([\\'\"]{0,}(.*?)[\\'\"]{0,}\\)/';\n $htmlContent = str_get_html($htmlContent);\n\n foreach ($htmlContent->find('*') as $element) {\n if (preg_match($regex, $element->style, $matches) > 0) {\n $element->outertext = '<img style=\"display:block;\" src=\"' . $matches[1] . '\" />';\n }\n }\n\n return $htmlContent;\n}", "protected function getValidBackgroundImage(array $configValues)\n\t{\n\t\t$bgImage = !empty($configValues['bg_image']) ? $configValues['bg_image'] : null;\n\n\t\t// The background images is augmented to a string with the pattern\n\t\t// \"[assets-Folder]::[path/image.ext] so we have to convert the asset\n\t\t// by finding the relative public path\n\t\tif (!empty($bgImage)) {\n\t\t\t// If there is more than one image pick the first as the background\n\t\t\tif (is_array($bgImage))\n\t\t\t\t$bgImage = $bgImage[0];\n\n\t\t\t$bgImage = Asset::find($bgImage);\n\t\t}\n\n\t\treturn $bgImage;\n\t}", "protected function _do_background($r, $g, $b, $opacity)\n {\n $this->_load_image();\n\n // Convert an opacity range of 0-100 to 127-0\n $opacity = round(abs(($opacity * 127 / 100) - 127));\n\n // Create a new background\n $background = $this->_create($this->width, $this->height);\n\n // Allocate the color\n $color = imagecolorallocatealpha($background, $r, $g, $b, $opacity);\n\n // Fill the image with white\n imagefilledrectangle($background, 0, 0, $this->width, $this->height, $color);\n\n // Alpha blending must be enabled on the background!\n imagealphablending($background, TRUE);\n\n // Copy the image onto a white background to remove all transparency\n if (imagecopy($background, $this->_image, 0, 0, 0, 0, $this->width, $this->height))\n {\n // Swap the new image for the old one\n imagedestroy($this->_image);\n $this->_image = $background;\n }\n }", "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 get_uploaded_header_images()\n {\n }", "function init() {\r\n $this->load_upcss();\r\n }", "function load($filename)\n {\n $image_info = getimagesize($filename);\n $this->image_type = $image_info[2];\n //crea la imagen JPEG.\n if( $this->image_type == IMAGETYPE_JPEG ) \n {\n $this->image = imagecreatefromjpeg($filename);\n } \n //crea la imagen GIF.\n elseif( $this->image_type == IMAGETYPE_GIF ) \n {\n $this->image = imagecreatefromgif($filename);\n } \n //Crea la imagen PNG\n elseif( $this->image_type == IMAGETYPE_PNG ) \n {\n $this->image = imagecreatefrompng($filename);\n }\n }", "protected function _preload() {\n }" ]
[ "0.7112916", "0.70450956", "0.66364455", "0.65244246", "0.6285328", "0.6258714", "0.6213515", "0.60697585", "0.6044611", "0.5965043", "0.5903245", "0.5897445", "0.5887693", "0.5850463", "0.5773511", "0.56341195", "0.56041133", "0.5596392", "0.55842763", "0.5557801", "0.5511458", "0.5480808", "0.5477229", "0.54727256", "0.5462086", "0.5457541", "0.5421294", "0.54196346", "0.5388688", "0.5384551", "0.5375012", "0.53630114", "0.5353371", "0.5332099", "0.53236616", "0.532351", "0.52960426", "0.5261335", "0.52572536", "0.52379864", "0.52323735", "0.52299666", "0.52168536", "0.5207317", "0.5202295", "0.5202129", "0.52018315", "0.5195795", "0.5190901", "0.51663744", "0.51545453", "0.5127288", "0.5122461", "0.51179504", "0.5111009", "0.5077112", "0.5061197", "0.5042955", "0.5028122", "0.5026054", "0.5022778", "0.49952257", "0.49931663", "0.499085", "0.49691102", "0.49666098", "0.49574006", "0.4949618", "0.4943521", "0.4939945", "0.49370235", "0.49306166", "0.493009", "0.49243462", "0.49197412", "0.4919443", "0.4909988", "0.49079046", "0.49012628", "0.49009392", "0.48885795", "0.48823464", "0.48814446", "0.48747897", "0.48679745", "0.4860063", "0.4859289", "0.4858849", "0.48516634", "0.48469388", "0.48422608", "0.4842169", "0.4841416", "0.48413146", "0.48373473", "0.4832797", "0.48313007", "0.48271453", "0.48271018", "0.48180902" ]
0.7271041
0
/////////////////////////////////////////////////////////////////////// get number of pages with background images
public static function getBgsNumpages() { $dir = scandir('../img/bgs'); $bg_images = array(); foreach ($dir as $file) { if ($file != "." && $file != "..") { if (file_exists("../img/bgs/" . $file)) { $currFileExt = pathinfo("../img/bgs/" . $file, 4); if ($currFileExt == "jpg" || $currFileExt == "png" || $currFileExt == "gif" || $currFileExt == "jpeg" || $currFileExt == "bmp") { $bg_images[] = $file; } } } } $max_bgs_per_page = 9; echo ceil(count($bg_images) / $max_bgs_per_page) < 1 ? 1 : ceil(count($bg_images) / $max_bgs_per_page); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getEffectsNumPages() {\n $dir = scandir('../img/effects');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/bgs/\" . $file)) {\n $currFileExt = pathinfo(\"../img/bgs/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $max_bgs_per_page = 9;\n echo ceil(count($bg_images) / $max_bgs_per_page) < 1 ? 1 : ceil(count($bg_images) / $max_bgs_per_page);\n }", "function get_page_count() {\n global $connexion, $config;\n $nb_images = $connexion->query('SELECT COUNT(id) FROM image')->fetchColumn();\n $nb_pages = ceil($nb_images / $config['nb_pictures_page']);\n return $nb_pages;\n}", "public function count_homepage_photos(){\n $sql=\"SELECT COUNT(*) FROM photos WHERE img_navigacija_id=2\";\n $result=self::$connect->query($sql);\n while($row=$result->fetch(PDO::FETCH_NUM)){\n return $row[0];\n }\n }", "public function numOfPages(): int;", "public function countPages() {\n\t\t$splitContent = explode(\"<!-- pagebreak -->\", $this->content);\t\t\n\t\treturn count($splitContent);\n\t}", "public function getPageNumbers();", "public function getNumberOfImages()\n {\n return $this->resource->getNumberImages();\n }", "public function getPagesCount()\n {\n \treturn count($this->_pages);\n }", "function getNumPages(){\n\t\treturn $this->numPages;\n\t}", "public function getPageNumber();", "public function getPageNumber();", "public function getNbPages(): int;", "private function getNbPages($nbItems)\n\t{\n\t\t$nbPictures = $this->picturesModel->getNbPictures();\n\t\t$nbPages = ceil($nbPictures / $nbItems);\n\t\treturn $nbPages;\n\t}", "function getPageCount() {\n return $this->helper->getPageCount();\n }", "function getPageCount() {\n return $this->helper->getPageCount();\n }", "public function getNbPages(){\n $db = $this -> init();\n \n $selectCount = $db ->query('Select COUNT(*) as nb_posts from posts') or die(print_r($db->errorInfo()));\n $count = $selectCount->fetch();\n return $count['nb_posts']/5;\n }", "public function get_nb_pictures(){\n $return = array();\n $sql = sprintf(\"SELECT count(*) FROM miki_album_picture WHERE id_album = %d\",\n mysql_real_escape_string($this->id));\n $result = mysql_query($sql);\n $row = mysql_fetch_array($result);\n return $row[0];\n }", "private function getNumberOfPages()\n {\n // Get the first page and then extract the total number of courses\n $this->domParser->load_file(self::COURSE_CATALOGUE);\n $lastPageUrl = $this->domParser->find('li[class=\"pager-last\"] a',0)->href;\n return (int)substr($lastPageUrl,strrpos($lastPageUrl,'=')+1);\n }", "public function numPages() {\n $links = $this->_document->links('self');\n return $links[0]->totalpages;\n }", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "public function numOfPages(): int\n {\n return count($this->repository);\n }", "public static function loadBackgroundImages() {\n $dir = scandir('../img/bgs');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/bgs/\" . $file)) {\n $currFileExt = pathinfo(\"../img/bgs/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n\n $counter = 0;\n $middleClass = \"\";\n foreach ($slice as $bg) {\n $counter++;\n if ($counter == 1) {\n ?><div class=\"cs-product-row\"><?php\n }\n if ($counter == 2) {\n $middleClass = \"cs-prd-middle\";\n }\n else {\n $middleClass = \"\";\n }\n ?>\n <?php $bg_index = self::parseInt($bg); ?>\n <div class=\"cs-product pad-bot thumb_za_pozadini <?php echo $middleClass; ?>\"\n index_za_pozadina_e=\"<?php echo $bg_index; ?>\"> \n\n <img src=\"img/bgs/<?php echo $bg ?>\" width=\"97\" height=\"126\" data-bgname=\"<?php echo $bg ?>\" class=\"cs-main-bg\" />\n </div>\n <?php\n if ($counter == 3) {\n ?></div><?php\n $counter = 0;\n }\n }\n }", "function getPagesCounter()\n\t{\n\t\t// Initialize variables\n\t\t$html = null;\n\t\tif ($this->get('pages.total') > 1) {\n\t\t\t$html .= JText::sprintf('JPAGE_CURRENT_OF_TOTAL', $this->get('pages.current'), $this->get('pages.total'));\n\t\t}\n\t\treturn $html;\n\t}", "public function countTemporyImages(){\n $count = $this->_tableGw->select()->count();\n return $count;\n }", "public function getPageCount() \r\n { \r\n }", "public function count()\n\t{\n\t\treturn count($this->_pages);\n\t}", "function cucina_retina_backgrounds(){\n\t$is_retina = (bool) get_theme_mod( 'background_size' );\n\tif ( $is_retina ) {\n\t\t$image = get_background_image();\n\t\tif ( ! $image ){\n\t\t\treturn;\n\t\t}\n\n\t\t$metadata = getimagesize( $image );\n\t\tif ( ! is_array( $metadata ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$width = $metadata[0];\n\t\t$height = $metadata[1];\n\t\tprintf( '<style>body{ background-size: %dpx %dpx; }</style>', $width/2, $height/2 );\n\t}\n}", "function numPages() {\n\t\treturn ceil($this->rows / $this->rpp);\n\t}", "public function getPageNumber() {}", "public function getPageNumber() {}", "function how_many_photos($data)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT spotlight_post_id FROM gv_spotlight_post_image WHERE (spotlight_image_block = 0) AND spotlight_post_id = ' . $data;\r\n\t\t$result = mysql_query($query, $db) or die(mysql_error($db));\r\n\t\t\r\n\t\tif(mysql_num_rows($result) > 0)\r\n\t\t{\r\n\t\t\t$number_of_images = mysql_num_rows($result);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\t$number_of_images = 0;\r\n\t\t}\r\n\t\treturn $number_of_images;\r\n\t}", "function get_page_count($conditions_array=array())\n\t{\n\t\t$this->db->where($conditions_array);\n\t\treturn $this->db->count_all_results('red_diy_pages');\n\t}", "function get_object_count()\r\n {\r\n return $this->get_browser()->count_photo_gallery_publications($this->get_condition());\r\n }", "public function getNumPages()\n {\n return $this->numPages;\n }", "public function currentStartCount(){\n\t\t$multiplier = $this->paged- 1;\n\t\treturn $multiplier * $this->posts_per_page;\n\t}", "public function count()\n {\n return count($this->pages);\n }", "public function pageCount() {\r\n\t\tif ($this->__pageItems > 0) {\r\n\t\t\t$intReturn = ceil(count($this->collection) / $this->__pageItems);\r\n\t\t} else {\r\n\t\t\t$intReturn = 1;\r\n\t\t}\r\n\r\n\t\treturn $intReturn;\r\n\t}", "public function PageCount_PDF()\n {\n //absolute path for file\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n $pageCount = 0;\n if (file_exists($f)) {\n require_once('lib/fpdf/fpdf.php');\n require_once('lib/fpdi/fpdi.php');\n $pdf = new FPDI();\n $pageCount = $pdf->setSourceFile($f); // returns page count\n }\n\n return $pageCount;\n }", "private function _count_page()\n {\n $count_career = $this->core_model->count('career');\n return ceil($count_career / 4);\n }", "public function getPageNumber() {\n\t\treturn (int)++self::$pageNumber;\n\t}", "function countPages(){\n return $this->db->count_all('page_attributes');\n }", "public function count()\n {\n return $this->getImages()->count();\n }", "public function get_count_pages() : int {\n\t\treturn ceil(count($this->posts) / $this->posts_per_page);\n\t}", "function get_gallery_count()\n {\n $settings = C_NextGen_Settings::get_instance();\n $count = $settings->get('gallery_count', FALSE);\n if (!$count) {\n $count = M_NextGen_Admin::update_gallery_count_setting();\n }\n return $count;\n }", "public function getPage_count() {\n return $this->page_count;\n }", "public function getPageCount()\n\t{\n\t\tif($this->pageCount === null)\n\t\t{\n\t\t\t$this->pageCount = $this->getCounts()[$this->getFolderId()] / $this->itemsPerPage;\n\t\t}\n\t\t\n\t\treturn $this->pageCount;\n\t}", "public function pagecount()\n {\n // Pretty easy: Return number of pages in this wiki\n return Page::all()->count();\n }", "public function countPages() {\n\t\t$count = intval($this->rows / $this->rowsPerPage);\n\n\t\tif ($this->rows % $this->rowsPerPage > 0) {\n\t\t\t$count++;\n\t\t}\n\t\treturn $count;\n\t}", "function get_images($file){\r\n $h1count = preg_match_all('/(<img)\\s (src=\"([a-zA-Z0-9\\.;:\\/\\?&=_|\\r|\\n]{1,})\")/isxmU',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[3]);\r\n array_push($res,count($patterns[3]));\r\n return $res;\r\n}", "public function number_of_pages(){\n $cantidad= $this->total_amount / $this->amount_per_page;\n if(is_int($cantidad)){\n return $cantidad;\n }\n else{\n $cantidad_int= intval($cantidad);\n if($cantidad_int > $cantidad){\n return $cantidad_int;\n }\n else{\n return $cantidad_int + 1;\n }\n }\n }", "public function getImagesCount()\n {\n return $this->imagesCount;\n }", "private function getNumPages() {\n\n return $this->rowCount / $this->limit;\n }", "function getPageCount() { return $this->m_pageCount; }", "function get_num_wiki_pages()\n{\n $value = get_value_newer_than('num_wiki_pages', time() - 60 * 60 * 24);\n\n if (is_null($value)) {\n $_value = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'COUNT(*)');\n if (!($_value > 0)) {\n $_value = 0;\n }\n $value = strval($_value);\n set_value('num_wiki_pages', $value);\n }\n\n return intval($value);\n}", "public function getImageCount( $text )\n\t{\n\t\t$count = 0;\n\t\tpreg_match_all( '#<img([^>]+?)?>#i', $text, $matches );\n\t\t\n\t\tforeach( $matches[1] as $id => $match )\n\t\t{\n\t\t\tif ( ! stristr( $match, 'class=\"bbc_emoticon\"' ) )\n\t\t\t{\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $count;\n\t}", "public function getPagesCount()\n\t{\n\t\treturn $this->pagesCount;\n\t}", "public function current_page_count() {\n\t\t$paging = $this->paging();\n\t\treturn max(0, min($paging->length, $paging->items - ($paging->page - 1) * $paging->length));\n\t}", "function getNumberOfPages(){\n $numberOfPages = $this->get('schema:numberOfPages');\n return $numberOfPages;\n }", "private function getSpecNoImageCount(){\n\t\t$cnt = 0;\n\t\tif($this->collid){\n\t\t\t$sql = 'SELECT count(o.occid) AS cnt '.\n\t\t\t\t'FROM omoccurrences o LEFT JOIN images i ON o.occid = i.occid '.\n\t\t\t\t'WHERE o.collid = '.$this->collid.' AND i.imgid IS NULL ';\n\t\t\t$rs = $this->conn->query($sql);\n\t\t\twhile($r = $rs->fetch_object()){\n\t\t\t\t$cnt = $r->cnt;\n\t\t\t}\n\t\t\t$rs->free();\n\t\t}\n\t\treturn $cnt;\n\t}", "function get_all_pagina_web_count()\r\n {\r\n $pagina_web = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `pagina_web`\r\n \")->row_array();\r\n\r\n return $pagina_web['count'];\r\n }", "function numberOfPages()\n\t\t{\n\t\t\tif($this->recordCount == -1)\n\t\t\t\treturn -1;\n\n\t\t\tif($this->recordCount == 0)\n\t\t\t\treturn 1;\n\n\t\t\treturn ceil($this->recordCount / $this->range);\n\t\t}", "public function getNombrePages() \r\n\t{\r\n\t\tvar_dump($this->_db);\r\n\t\treturn ceil(count($this->_db)/self::NOMBRE_PAR_PAGE);\r\n\t\t\r\n\t\t//return $aBiere[$nPage-1];\r\n\t}", "function totalpages(){\n \tglobal $numofVideos;\n \treturn ceil(countallvideos() / $numofVideos);\n }", "public static function alm_filters_get_page_num(){\n\t \t$pg = (isset($_GET['pg'])) ? $_GET['pg'] : 1;\n\t \treturn $pg;\n \t}", "public function numberOfPages(): int\n {\n return $this->number_of_pages;\n }", "function getPageNumber($aUrlParams)\n {\t \n\t if(empty($aUrlParams)) return \"\";\n\t \n\t else if(is_string($aUrlParams))\n\t \t$aUrlParams = explode(\"/\",$aUrlParams);\n\t \t\n\t for($i=0;$i<count($aUrlParams); $i++)\n\t {\n\t \t\tif($aUrlParams[$i]==\"page\")\n\t \t\t{\n\t \t\t if(isset($aUrlParams[$i+1]))\n\t \t\t \t\treturn $aUrlParams[$i+1];\n\t \t\t else return 1;\t\t \t\n\t \t\t}\n\t }\n\t return 0;\n }", "public function getNbPages()\n {\n return $this->nbPages;\n }", "public function getPageNo()\n\t{\n\t\treturn ($this->page == 0) ? 1 : $this->page;\n\t}", "function getnumpages($tid)\n{\n $nops = mysql_fetch_array(mysql_query(\"SELECT COUNT(*) FROM ibwf_posts WHERE tid='\".$tid.\"'\"));\n $nops = $nops[0]+1; //where did the 1 come from? the topic text, duh!\n $nopg = ceil($nops/5); //5 is the posts to show in each page\n return $nopg;\n}", "function getTotalPages()\n{\n include('connecter.php');\n if($con)\n {\n $nbr = $con->query('SELECT COUNT(*) AS nbre_total FROM invite');\n $resultat = $nbr->fetch();\n return $resultat['nbre_total'];\n }\n return -1;\n \n}", "public function get_count() {\n\t\tglobal $wpdb;\n\t\t$count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM {$wpdb->prefix}posts WHERE post_type=%s AND post_excerpt='' \", 'attachment' )); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Query is safe, see above.\n\t\treturn $count;\n\t}", "function _getAllPageNumbers($current_page, $last_page)\n{\n $page_ix = 1;\n $pages = array();\n while($page_ix <= $last_page){\n if($page_ix == $current_page){\n $pages[$page_ix] = 'current';\n } else {\n $pages[$page_ix] = $page_ix;\n } \n $page_ix++;\n }\n return $pages;\n}", "function get_page_count($url) { \n \n $conn = get_conn();\n \n if (mysqli_connect_errno($conn)) { \n echo \"Failed to connect to MySQL: \" + mysqli_connect_error();\n }\n \n \n $res = $conn->query(\"SELECT count FROM click WHERE url = '\" . mysql_escape_string($url) . \"'\" );\n \n if ($res === false) { \n trigger_error(\"Error running SQL: \" . $conn->error, E_USER_ERROR);\n }\n else { \n $arr = $res->fetch_all(MYSQL_ASSOC);\n }\n \n // returns an array of results, we only want the first one\n return $arr[0];\n}", "function count_pictures() {\n global $connexion, $config;\n $nb_images = $connexion->query('SELECT COUNT(id) FROM image')->fetchColumn();\n return $nb_images;\n}", "function GetPageCount()\n\t{\n\t\t$countElements = $this->GetAllCount ();\n\t\t$pageCount = floor ( ($countElements - 1) / $this->m_limit ) + 1;\n\t\t\n\t\treturn $pageCount;\n\t}", "public function execNumberOfPages(){\n\t\t$pdf = escapeshellarg($this->getPdfPath());\n\n\t\t$pages = exec(\"pdfinfo $pdf | awk '/Pages/ {print \\$2}'\");\n\t\tif (!is_numeric($pages))\n\t\t\tthrow new \\Exception(\"pdfinfo returned '$pages' on $pdf (maybe apt-get install poppler-utils?)\");\n\t\telse\n\t\t\t$this->save(array(\"pocet_stran\" => $pages));\n\t}", "function getPDFPages($document)\n {\n $cmd = \"pdfinfo.exe\"; // Windows\n\n // Parse entire output\n // Surround with double quotes if file name has spaces\n exec(\"$cmd \\\"$document\\\"\", $output);\n\n // Iterate through lines\n $pagecount = 0;\n foreach($output as $op)\n {\n // Extract the number\n if(preg_match(\"/Pages:\\s*(\\d+)/i\", $op, $matches) === 1)\n {\n $pagecount = intval($matches[1]);\n break;\n }\n }\n\n return $pagecount;\n }", "function getPDFPages($document)\n {\n $cmd = \"pdfinfo.exe\"; // Windows\n\n // Parse entire output\n // Surround with double quotes if file name has spaces\n exec(\"$cmd \\\"$document\\\"\", $output);\n\n // Iterate through lines\n $pagecount = 0;\n foreach($output as $op)\n {\n // Extract the number\n if(preg_match(\"/Pages:\\s*(\\d+)/i\", $op, $matches) === 1)\n {\n $pagecount = intval($matches[1]);\n break;\n }\n }\n\n return $pagecount;\n }", "public function getSupportedNrOfImages() {\r\n\t\treturn $this->nrOfImages;\r\n\t}", "public function getPage()\n\t{\n\t\t$articlesPerPage = 3;\n\n\t\t$req = $this->db->query('SELECT COUNT(*) AS totalArticles FROM articles');\n\n\t\t$result = $req->fetch();\n\t\t$numberOfArticles = $result['totalArticles'];\n\n\t\t$numberOfPages = ceil($numberOfArticles / $articlesPerPage) ;\n\n\t\treturn $numberOfPages;\n\n\t}", "public function getNombrePages() \r\n\t{\r\n\t\treturn ceil(count($this->_bieres)/self::NOMBRE_PAR_PAGE);\r\n\t}", "function numero_paginas($post_por_pagina, $conexion, $count) {\n $numero_paginas = ceil($count / $post_por_pagina);\n return $numero_paginas;\n}", "public function getPageNr(){\n\t\tif(isset($_GET['p'])){\n\t\t\treturn $_GET['p'];\n\t\t}else{\n\t\t\treturn 1;\n\t\t}\n\t}", "public function getUnprocSpecNoImage(){\n\t\t$cnt = 0;\n\t\tif($this->collid){\n\t\t\t$sql = 'SELECT count(o.occid) AS cnt '.\n\t\t\t\t'FROM omoccurrences o LEFT JOIN images i ON o.occid = i.occid '.\n\t\t\t\t'WHERE (o.collid = '.$this->collid.') AND (i.imgid IS NULL) AND (o.processingstatus = \"unprocessed\") ';\n\t\t\t$rs = $this->conn->query($sql);\n\t\t\twhile($r = $rs->fetch_object()){\n\t\t\t\t$cnt = $r->cnt;\n\t\t\t}\n\t\t\t$rs->free();\n\t\t}\n\t\treturn $cnt;\n\t}", "public function getPageCount()\n {\n return $this->pageCount;\n }", "public function page_count() {\n if ($this->paginating) {\n return ceil($this->row_count() / $this->rpp);\n } else {\n return $this->row_count() ? 1 : 0;\n }\n }", "public function count()\n {\n return $this->backgroundCheck\n ->count();\n }", "public function pages_with_bhl()\n {\n if(isset($this->pages_with_bhl)) return $this->pages_with_bhl;\n $this->pages_with_bhl = 0;\n \n $result = $this->mysqli_slave->query(\"SELECT COUNT(DISTINCT(tc.id)) count FROM taxon_concepts tc JOIN taxon_concept_names tcn ON (tc.id=tcn.taxon_concept_id) JOIN page_names pn ON (tcn.name_id=pn.name_id) WHERE tc.published=1 AND tc.supercedure_id=0\");\n if($result && $row=$result->fetch_assoc()) $this->pages_with_bhl = $row['count'];\n return $this->pages_with_bhl;\n }", "function GetPhotoUploadCount(){\r\n\t$directory = \"./images/\";\r\n\t$filecount = 0;\r\n\t$files = glob($directory . \"4mw*.jpg\");\r\n\tif ($files){\r\n \t\t$filecount = count($files);\r\n\t}\r\n\techo $filecount;\r\n}", "public function PageCount_DOCX()\n {\n $pageCount = 0;\n\n $zip = new ZipArchive();\n\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n\n if ($zip->open($f) === true) {\n if (($index = $zip->locateName('docProps/app.xml')) !== false) {\n $data = $zip->getFromIndex($index);\n $zip->close();\n $xml = new SimpleXMLElement($data);\n $pageCount = $xml->Pages;\n }\n }\n\n return intval($pageCount);\n }", "public function getPageCount() {\n return $this->pageCount;\n }", "public function pages()\n\t{\n\t\treturn ceil($this->_count_total / $this->config['total_items']);\n\t}", "public function totalPages(): int\n {\n return Arr::get($this->meta, 'last_page', 1);\n }", "public function getCurrentPageNumber(): int;", "function PageCount ( )\n{\n $RC = $this->RecordCount();\n if ( $this->_PageSize > 0 ) {\n if ( ($RC <= 0) || ($this->_PageCount <= 0) ) {\n $this->_PageCount = (int)(($RC+$this->_PageSize-1)/$this->_PageSize);\n }\n } else {\n $this->_PageCount = $RC > 0 ? 1 : 0;\n }\n return $this->_PageCount;\n}", "function page_total(){\r\n $num_users = $this->reg->db->getRow('SELECT COUNT(id)\r\n FROM system__content\r\n WHERE user_id = ?', array($_SESSION['SYSTEM']['USER_ID']));\r\n\r\n // calculate total pages\r\n $pages = floor($num_users[0]/30);\r\n if($num_users[0]%30)\r\n $pages++;\r\n\r\n return $pages;\r\n }", "public function numLinks();", "public function totalPage();", "function get_page_number() {\n if ( get_query_var('paged') ) {\n print ' | ' . __( 'Page ' , 'full-foto') . get_query_var('paged');\n }\n}", "function _onlinepdf_jpgsize($pdfinfo, $dpi) {\r\n $pagesize = explode('x',str_replace(' ', '',strstr(substr(implode(preg_grep(\"/^Page size.*/\", $pdfinfo)),10), 'pts', true)));\r\n if (is_numeric($pagesize[0]) && is_numeric($pagesize[1]) && $pagesize[0] > 0 && $pagesize[1] > 0)\r\n {\r\n $pagesize[0] = round(($pagesize[0]/72) * $dpi);\r\n $pagesize[1] = round(($pagesize[1]/72) * $dpi);\r\n return $pagesize;\r\n }\r\n else {\r\n return false;\r\n }\r\n}" ]
[ "0.759347", "0.6974738", "0.64280003", "0.63865596", "0.63166934", "0.6260303", "0.62110525", "0.62036335", "0.6170265", "0.61560524", "0.61560524", "0.61333334", "0.6123017", "0.6089655", "0.6089655", "0.6073505", "0.6055145", "0.60304326", "0.6019904", "0.6006525", "0.5980232", "0.59798014", "0.59515285", "0.5940695", "0.59318775", "0.59200776", "0.59171486", "0.5893674", "0.58892876", "0.58892876", "0.5835885", "0.5833363", "0.58094764", "0.58082616", "0.5807875", "0.58078456", "0.5800946", "0.5794251", "0.57826155", "0.578216", "0.5781574", "0.5779858", "0.57701486", "0.57643765", "0.57632655", "0.57530165", "0.5734557", "0.57308155", "0.5709586", "0.5704676", "0.568902", "0.568492", "0.5678337", "0.5656314", "0.5650091", "0.56352395", "0.5633716", "0.56326944", "0.5631092", "0.5620312", "0.5616334", "0.5572101", "0.55623764", "0.55618477", "0.5561831", "0.55564344", "0.5545303", "0.55434865", "0.5534661", "0.5533504", "0.55318695", "0.5531613", "0.5507127", "0.5506783", "0.5503363", "0.5498455", "0.5489422", "0.5489422", "0.5486752", "0.5484186", "0.54808974", "0.5471915", "0.5468113", "0.54616255", "0.54591066", "0.5451366", "0.5451141", "0.5432694", "0.54301333", "0.5426474", "0.5414395", "0.5402515", "0.53956735", "0.5392096", "0.5389814", "0.53869945", "0.53863573", "0.5370507", "0.53702056", "0.5365029" ]
0.69552636
2
/////////////////////////////////////////////////////////////////////// Load filter images
public static function loadFilterImages() { $dir = scandir('../img/effects'); $bg_images = array(); foreach ($dir as $file) { if ($file != "." && $file != "..") { if (file_exists("../img/effects/" . $file)) { $currFileExt = pathinfo("../img/effects/" . $file, 4); if ($currFileExt == "jpg" || $currFileExt == "png" || $currFileExt == "gif" || $currFileExt == "jpeg" || $currFileExt == "bmp") { $bg_images[] = $file; } } } } $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1; $max_bgs_per_page = 9; $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page; $slice = array_slice($bg_images, $offset, $max_bgs_per_page); echo json_encode($slice); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addFilter($_image, $filter, $param1, $param2, $param3)\n {\n \n //se o filtro estiver no array de filtros simples\n if(array_key_exists($filter,self::$_simpleFilters))\n {\n imagefilter($_image, self::$_simpleFilters[$filter]);\n return $_image;\n }\n //verifico se o filtro e do array de customizados\n elseif(in_array($filter,self::$_customFilters))\n {\n //verifico que tipo de filtro e esse\n switch ($filter)\n {\n case \"sharpen\":\n require_once \"Custom/Sharpen.php\"; //Efeito Sharpen\n //arumando as propriedades para que nao ocorra nehum tipo de erro durante a execucao\n $param1 = (($param1 > 200 || $param1 < 50)?50:$param1);\n $param2 = (($param2 > 1 || $param2 < 0.5)?0.5:$param2);\n $param3 = (($param3 > 5 || $param3 < 0)?0:$param3);\n\n //instanciando a classe do Sharpen\n $sharpen = new Sharpen;\n $_image = $sharpen->addSharpen($_image, $param1, $param2, $param3);\n return $_image;\n break;\n\n case \"noise\":\n require_once \"Custom/Noise.php\"; //Efeito Noise\n //instanciando a classe de noise\n $noise = new Noise;\n $_image = $noise->addNoise($_image);\n return $_image;\n break;\n\n case \"scatter\":\n require_once \"Custom/Scatter.php\"; //Efeito Scatter\n //instanciando a classe de scatter\n $scatter = new Scatter;\n $_image = $scatter->addScatter($_image);\n return $_image;\n break;\n\n case \"pixelate\":\n require_once \"Custom/Pixelate.php\"; //Efeito Pixelate\n //instanciando a classe de pixelate\n $pixelate = new Pixelate;\n $_image = $pixelate->addPixelate($_image);\n return $_image;\n break;\n\n case \"interlace\":\n require_once \"Custom/Interlace.php\"; //Efeito Interlace\n //instanciando a classe de interlace\n $interlace = new Interlace;\n $_image = $interlace->addInterlace($_image);\n return $_image;\n break;\n\n case \"screen\":\n require_once \"Custom/Screen.php\"; //Efeito Screen\n //instanciando a classe de Screen\n $screen = new Screen;\n $_image = $screen->addScreen($_image);\n return $_image;\n break;\n }\n }\n //se o filtro estiver no array de filtros simples\n elseif(array_key_exists($filter,self::$_advancedFilters))\n {\n //verifico se o filtro recebe mais de um parametro\n if($filter == 'colorize')\n {\n imagefilter($_image, self::$_advancedFilters[$filter], $param1, $param2, $param3);\n return $_image;\n }\n\n //caso contrario\n else\n {\n imagefilter($_image, self::$_advancedFilters[$filter], $param1);\n return $_image;\n }\n }\n //se nao existir entao sera lancada uma excessao\n else\n {\n throw new Exception(\"Filtro inexistente - Absent filter\");\n return false;\n }\n }", "function image_filter($im, $name){\n\tif($im && imagefilter($im, IMG_FILTER_NEGATE)){\n\t\timagepng($im, '../upload/filter/effect_invert/'. $name);\n\t}\n\tif($im && imagefilter($im, IMG_FILTER_GRAYSCALE)){\n\t\timagepng($im, '../upload/filter/effect_grayscale/'. $name);\n\t}\n\tif($im && imagefilter($im, IMG_FILTER_BRIGHTNESS, 20)){\n\t\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t}\n\tif($im && imagefilter($im, IMG_FILTER_CONTRAST, 20)){\n\t\timagepng($im, '../upload/filter/effect_contrast/'. $name);\n\t}\n\t\n\t\t\n\tif($im && imagefilter($im, IMG_FILTER_COLORIZE, 255, 0, 0)){\n\t\timagepng($im, '../upload/filter/effect_color_red/'. $name);\n\t}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0)){\n\t\timagepng($im, '../upload/filter/effect_color_green/'. $name);\n\t}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_COLORIZE, 0, 0, 255)){\n\t\timagepng($im, '../upload/filter/effect_color_blue/'. $name);\n\t}\n\t\n\t\n\t\n\t//if($im && imagefilter($im, IMG_FILTER_EDGEDETECT, 20)){\n\t//\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t//}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_EMBOSS)){\n\t\timagepng($im, '../upload/filter/effect_emboss/'. $name);\n\t}\n\t\n\tif($im && imagefilter($im, IMG_FILTER_GAUSSIAN_BLUR)){\n\t\timagepng($im, '../upload/filter/effect_gaussian_blue/'. $name);\n\t}\n\t\n\t//if($im && imagefilter($im, IMG_FILTER_SELECTIVE_BLUR, 20)){\n\t//\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t//}\n\n\tif($im && imagefilter($im, IMG_FILTER_MEAN_REMOVAL, 20)){\n\t\timagepng($im, '../upload/filter/effect_mean_remove/'. $name);\n\t}\n\n\tif($im && imagefilter($im, IMG_FILTER_SMOOTH, 1)){\n\t\timagepng($im, '../upload/filter/effect_smooth/'. $name);\n\t}\n\n\tif($im && imagefilter($im, IMG_FILTER_PIXELATE, 3, TRUE)){\n\t\timagepng($im, '../upload/filter/effect_brightness/'. $name);\n\t}\n}", "private function loadFilters()\n {\n require __DIR__.'/filters.php';\n }", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "function filter(){\r\n\t$images = new ImageCollection();\r\n\t\r\n\tif( isset($_GET['city']) || isset($_GET['country']) ) {\r\n\t\t$city = 0;\t\t\r\n\t\tif( isset($_GET['city']) && !empty($_GET['city']) ) {\r\n\t\t\t$city = $_GET['city'];\r\n\t\t}\r\n\t\t$country = \"ZZZ\";\r\n\t\tif( isset($_GET['country']) && !empty($_GET['country']) ) {\r\n\t\t\t$country = $_GET['country'];\r\n\t\t}\r\n\t\t\r\n\t\t$images->loadCollection();\r\n\t\t\t\t\r\n\t\tif($city > 0 && $country == \"ZZZ\") { //if city set\r\n\t\t\t$images->loadCollectionByCity($city);\r\n\t\t}\r\n\t\telseif($city == 0 && $country != \"ZZZ\") { //if country set\r\n\t\t\t$images->loadCollectionByCountry($country);\r\n\t\t}\r\n\t\telseif($city > 0 && $country != \"ZZZ\") { //if country and city set\r\n\t\t\t$images->loadCollectionByCityAndCountry($city, $country);\r\n\t\t}\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telseif( isset($_GET['search']) ) {\r\n\t\t$search = $_GET['search'];\r\n\t\t$images->loadCollectionBySearch($search);\r\n\t\t\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n\telse {\r\n\t\t$images->loadCollection();\r\n\t\t\r\n\t\toutputImages($images);\r\n\t}\r\n}", "function kses_init_filters()\n {\n }", "protected function loadImages() {\r\n $this->images = new \\App\\Table\\ImagesTable(App::getInstance()->getDb());\r\n }", "private function filters() {\n\n\n\t}", "public function filterLoad($asset) {}", "abstract public function prepareFilters();", "protected function combineImages() {}", "function loadFossils($data){\n\n \t//using the data from the filter we create the where statement for querying the database\n \t$where = [];\n \t$i = 0;\n \t\n \tif ($data['genus'] != \"-1\"){\n \t\t$where[$i] = \"genus = '\" . $data['genus'].\"'\";\n\t\t\t$i += 1;\n \t}\n\n /*\n \t$where[$i] = \"age_min = \" . $data['age_min'];\n $i += 1;\n\n $where[$i] = \"age_max = \" . $data['age_max'];\n $i += 1;*/\n\n $where[$i] = $this->age_criteria($data[\"age_min\"], $data[\"age_max\"]);\n $i += 1;\n \n\n \tif ($data['collector'] != \"-1\"){\n \t\t$where[$i] = \"collector = '\" . $data['collector'].\"'\";\n \t\t$i += 1;\n \t}\n\n $where_string = \"\";\n\n if ($i != 0)\n {\n \tfor ($j=0; $j<$i-1; $j++)\n \t{\n \t\t\t$where_string .= $where[$j] . \" AND \";\n \t}\n \t\n $where_string .= $where[$i-1]; \n }\n else {\n $where_string = \" 1\";\n }\n\n $query=NULL;\n\n \t//Now we look at the projects_master table to give us the data_table foreach project\n if($data['project']==\"-1\"){\n $query = $this->db->query('SELECT id, name, image, blurb, data_table, image_table FROM projects_master');\n }\n\n \t$return = array();\n \n \tif($query->num_rows() > 0) {\n \t\tforeach($query->result_array() as $row)\n \t\t{\n \t\t\t//we retrieve the data from each fossil from each project\n \t\t\t$query2 = $this->db->query('SELECT data_id, image_id, genus, species, age, country, place, collector, lat, lng FROM ' . $row[\"data_table\"].' WHERE '.$where_string.' and lat!=\"0\" and lng!=\"0\"');\n\n //return $query2->result_array(); \n $image_table = $row['image_table'];\n\t\t\t\t//if($query2->num_rows>0){\n\t\t\t //$return[] = $query2->result_array();\n\t\t\t\t//}\n foreach ($query2->result_array() as $row)\n {\n //$temp = $this->geocode($row['country'].' '.$row['place']);\n \n /*if ($temp != false) {\n $row['lattitude'] = $temp[0];\n $row['longitude'] = $temp[1];\n \n }*/\n\n $query3 = $this->db->query(\"SELECT image_url FROM \".$image_table.\" WHERE image_id=\".$row[\"image_id\"]);\n\n \n if($query3->num_rows() > 0) {\n foreach ($query3->result() as $u) {\n $row['url'] = $u->image_url;\n }\n }\n //return $row;\n if ($row['lat'] != \"\") {\n $return[] = $row; \n }\n }\t\t\n \t\t}\n //return the data\n return $return;\n \t}\n }", "public function prepareLocalImages($images) {\n\t\t$requestParams = $this->getRequest()->getParams();\n $filter_fields = array('filename','size', 'status'); \n if( !empty($requestParams['order_by']) && in_array($requestParams['order_by'], $filter_fields)) {\n $order_by = $requestParams['order_by'];\n if(isset($requestParams['dir']) && $requestParams['dir']=='desc') { \n $this->order_dir = 'desc';\n }else {\n $this->order_dir = 'asc';\n }\n } else {\n $order_by = '' ;\n }\n $this->order_by = $order_by;\n \n if($order_by == 'size') { \n usort($images, array(\"Imagerecycle_Imagerecycle_Block_Images\",\"cmpSize\") ); \n }else if($order_by == 'status') {\n usort($images, array(\"Imagerecycle_Imagerecycle_Block_Images\",\"cmpStatus\")); \n }else if($order_by == 'filename' && $this->order_dir == 'desc') {\n usort($images, array(\"Imagerecycle_Imagerecycle_Block_Images\",\"cmpNameDesc\")); \n } \n \n $start = ($this->page - 1) * $this->limit;\n $result = array_slice($images, $start, $this->limit);\n \n return $result;\n }", "private function loadImages(): void\n {\n if (count($this->images) == 1) {\n $this->addMeta('image', $this->images[0]);\n\n return;\n }\n\n foreach ($this->images as $number => $url) {\n $this->addMeta(\"image{$number}\", $url);\n }\n }", "function loadImage()\n\t{\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t$this->ImageStream = @imagecreatefromgif($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->ImageStream = @imagecreatefromjpeg($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->ImageStream = @imagecreatefrompng($this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\t}", "function add_filters()\n {\n }", "function applyFilter($filter)\n {\n if (count($this->error) == 0)\n {\n // split up filter name and filter configuration\n $filterInfos = explode('-',$filter);\n eval(\"\\$temp = new \".$filterInfos[0].\" (\\$this->imgSrc,\\$filterInfos);\");\n if ($temp->dest !== false)\n {\n // filter was applied\n // $filterUsed[] = $filterItem['value'];\n $this->imgSrc = $temp->dest;\n return true;\n }\n else\n {\n // filter was not applied, save filter errors\n foreach($temp->error as $error)\n {\n $this->error[] = $filterInfos[0].': '.$error;\n }\n return false;\n }\n }\n }", "public function setImagesets()\n {\n $this->_imagesets = [];\n try {\n $pnmain = $this->_qobject->getPNMainTable();\n $type = $this->_image->getImageParams('type');\n if ($type == 'rgb') {\n $model = $this->_image->getImageParams('R_model');\n } else {\n $model = $this->_image->getImageParams('in_model');\n }\n\n if (!$model || $model == null) {\n return $this->mylogger->logMessage(\"Model for the parameter 'run_id' is not defined.\", $this, 'warning',\n false);\n }\n $runs = $pnmain->{$model}()\n ->where('found', 'y')\n ->distinct('run_id')\n ->pluck('run_id')\n ->toArray();\n\n if (!$runs || $runs == null || empty($runs)) {\n return $this->mylogger->logMessage(\"No results.\", $this, 'warning', false);\n }\n\n// $old_base_file_names = array_column($this->_oldresults, 'OutImage');\n\n foreach ($runs as $run_id) {\n $run_id = ($run_id == null || !$run_id) ? \"-1\" : $run_id;\n\n $base_file_name = $this->pngName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'), $run_id);\n\n $full_file_name = MyFunctions::pathslash($this->_getOutDir()) . $base_file_name;\n\n $outimages = $this->_setOutimages($full_file_name);\n if (empty($outimages)) {\n continue;\n }\n\n $metadata = [\n 'type' => $type,\n 'run_id' => $run_id,\n 'OutImage' => $base_file_name,\n \"rgb_cube\" => ($type == 'rgb') ? $this->getRGBcubeName($this->_qobject->getIdPNMain(),\n $this->_image->getImageParams('name_out'),\n $run_id) : null,\n \"out_images\" => $outimages,\n ];\n\n\n// if (in_array($base_file_name, $old_base_file_names)) {\n// continue;\n// }\n\n $rgb_components = $this->_getRGBComponents($pnmain, $run_id);\n\n if ($rgb_components) {\n $this->_imagesets[$run_id] = array_merge($metadata, $rgb_components);\n } else {\n $this->mylogger->logMessage(\"Missing fits image(s).\", $this, 'warning', false);\n }\n }\n } catch (\\Exception $e) {\n $this->_imagesets = [];\n return $this->mylogger->logMessage(\"Problem with setting imagesets: \" . $e . \".\", $this, 'warning', false);\n }\n if (empty($this->_imagesets)) {\n return false;\n }\n return true;\n\n }", "private function parse_images($category) {\n\t\t$image_list = array();\n\t\t$relpath = \"images/$category\";\n\n\t\tforeach (glob($this->root . \"/$relpath/*\") as $image) {\n\t\t\tif (preg_match(self::IMAGE_FILTER, $image)) {\n\t\t\t\t// We got a valid image, now lets make it into a relative path.\n\t\t\t\tpreg_match(\"/(projects\\/\" . $this->id .\"\\/images.+)/\", $image, $matches);\n\t\t\t\tarray_push($image_list, $matches[1]);\n\t\t\t}\n\t\t}\n\n\t\treturn $image_list;\n\t}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "function applyFilter( &$resource, $filter_name='', $options=array())\n {\n if (Image_Filter::loadFilter($filter_name)){\n $class = 'Image_Filter_'.$filter_name;\n call_user_func(array($class,'applyFilter'), $resource, $options);\n return true;\n }\n return false;\n }", "function applyFilterOnResource( &$resource, $filter_name='', $options=array())\n {\n if (Image_Filter::loadFilter($filter_name)){\n $class = 'Image_Filter_'.$filter_name;\n call_user_func(array($class,'applyFilterOnResource'), $resource, $options);\n }\n }", "public function getImageArray();", "protected static function filtes()\n {\n /*\n * The filters fetches are transported\n * to router Bus calls\n **/\n }", "function getImageFiles() {\n $path = dirname(__FILE__) . \"/img\";\n $images = array();\n $folder = opendir($path);\n while (false !== ($filename = readdir($folder))) {\n if ($filename != \"ajax-loader.gif\") {\n $parts = serendipity_parseFileName($filename);\n $img_data = serendipity_getimagesize($path . '/' . $filename);\n if (!isset($img_data['noimage'])) {\n // Curly braces are just a different syntax of associative array assignment\n $images[$filename] = array('fname'=>$filename, 'width'=>$img_data[0], 'height'=>$img_data[1]);\n }\n }\n }\n closedir($folder);\n ksort($images);\n return $images;\n }", "function loadImages($user_id = 0){\n\t\tglobal $tsUser;\n\t\t//\n\t\tif(empty($user_id)) $user_id = $tsUser->uid;\n\t\t$images = $this->fetch_array($this->select(\"u_fotos\",\"*\",\"f_user = $user_id\",\"\",\"\"));\n\t\t//\n\t\treturn $images;\n\t}", "public static function data_images() {\n\t\tif ( empty( self::$images ) ) {\n\t\t\tself::$images = glob( dirname( dirname( __FILE__ ) ) . '/images/*' );\n\t\t}\n\n\t\treturn self::$images;\n\t}", "public static function FindUnusedImages()\n {\n }", "abstract protected function getFilters();", "protected function getLiipImagine_Filter_ManagerService()\n {\n $this->services['liip_imagine.filter.manager'] = $instance = new \\Liip\\ImagineBundle\\Imagine\\Filter\\FilterManager($this->get('liip_imagine.filter.configuration'), $this->get('liip_imagine'), $this->get('liip_imagine.binary.mime_type_guesser'));\n\n $instance->addLoader('relative_resize', $this->get('liip_imagine.filter.loader.relative_resize'));\n $instance->addLoader('resize', $this->get('liip_imagine.filter.loader.resize'));\n $instance->addLoader('thumbnail', $this->get('liip_imagine.filter.loader.thumbnail'));\n $instance->addLoader('crop', $this->get('liip_imagine.filter.loader.crop'));\n $instance->addLoader('grayscale', $this->get('liip_imagine.filter.loader.grayscale'));\n $instance->addLoader('paste', $this->get('liip_imagine.filter.loader.paste'));\n $instance->addLoader('watermark', $this->get('liip_imagine.filter.loader.watermark'));\n $instance->addLoader('background', $this->get('liip_imagine.filter.loader.background'));\n $instance->addLoader('strip', $this->get('liip_imagine.filter.loader.strip'));\n $instance->addLoader('scale', $this->get('liip_imagine.filter.loader.scale'));\n $instance->addLoader('upscale', $this->get('liip_imagine.filter.loader.upscale'));\n $instance->addLoader('downscale', $this->get('liip_imagine.filter.loader.downscale'));\n $instance->addLoader('auto_rotate', $this->get('liip_imagine.filter.loader.auto_rotate'));\n $instance->addLoader('rotate', $this->get('liip_imagine.filter.loader.rotate'));\n $instance->addLoader('flip', $this->get('liip_imagine.filter.loader.flip'));\n $instance->addLoader('interlace', $this->get('liip_imagine.filter.loader.interlace'));\n $instance->addPostProcessor('jpegoptim', $this->get('liip_imagine.filter.post_processor.jpegoptim'));\n $instance->addPostProcessor('optipng', $this->get('liip_imagine.filter.post_processor.optipng'));\n $instance->addPostProcessor('pngquant', $this->get('liip_imagine.filter.post_processor.pngquant'));\n $instance->addPostProcessor('mozjpeg', $this->get('liip_imagine.filter.post_processor.mozjpeg'));\n\n return $instance;\n }", "function vcex_image_filter_class( $filter = '' ) {\n\tif ( function_exists( 'wpex_image_filter_class' ) ) {\n\t\treturn wpex_image_filter_class( $filter );\n\t}\n}", "function get_uploaded_header_images()\n {\n }", "function _findimages(&$data){\n global $conf;\n $files = array();\n\n // http URLs are supposed to be media RSS feeds\n if(preg_match('/^https?:\\/\\//i',$data['ns'])){\n $files = $this->_loadRSS($data['ns']);\n $data['_single'] = false;\n }else{\n $dir = utf8_encodeFN(str_replace(':','/',$data['ns']));\n // all possible images for the given namespace (or a single image)\n if(is_file($conf['mediadir'].'/'.$dir)){\n require_once(DOKU_INC.'inc/JpegMeta.php');\n $files[] = array(\n 'id' => $data['ns'],\n 'isimg' => preg_match('/\\.(jpe?g|gif|png)$/',$dir),\n 'file' => basename($dir),\n 'mtime' => filemtime($conf['mediadir'].'/'.$dir),\n 'meta' => new JpegMeta($conf['mediadir'].'/'.$dir)\n );\n $data['_single'] = true;\n }else{\n $depth = $data['recursive'] ? 0 : 1;\n search($files,\n $conf['mediadir'],\n 'search_media',\n array('depth'=>$depth),\n $dir);\n $data['_single'] = false;\n }\n }\n\n // done, yet?\n $len = count($files);\n if(!$len) return $files;\n if($data['single']) return $files;\n\n // filter images\n for($i=0; $i<$len; $i++){\n if(!$files[$i]['isimg']){\n unset($files[$i]); // this is faster, because RE was done before\n }elseif($data['filter']){\n if(!preg_match($data['filter'],noNS($files[$i]['id']))) unset($files[$i]);\n }\n }\n if($len<1) return $files;\n\n // random?\n if($data['random']){\n shuffle($files);\n }else{\n // sort?\n if($data['sort'] == 'date'){\n usort($files,array($this,'_datesort'));\n }elseif($data['sort'] == 'mod'){\n usort($files,array($this,'_modsort'));\n }elseif($data['sort'] == 'title'){\n usort($files,array($this,'_titlesort'));\n }\n\n // reverse?\n if($data['reverse']) $files = array_reverse($files);\n }\n\n // limits and offsets?\n if($data['offset']) $files = array_slice($files,$data['offset']);\n if($data['limit']) $files = array_slice($files,0,$data['limit']);\n\n return $files;\n }", "public function loadImage($name,$type,$size,$status){\n\t\t$images = array();\n $resourceR = $this->getCoreRead('imagerecycle/images');\n\t\t$where = \"\";\t\t\n\t\t//Path condition\n\n\t\tif(count($this->allowedPath) != 0){\n\t\t\t$i = 0; \t\t\t\n\t\t\tforeach($this->allowedPath as $path){\n\t\t\t\tif(!$path) return $images;\n\t\t\t\t$i++;\n\t\t\t\t$where .= ($i == 1)? \" WHERE file LIKE CONCAT(\".$resourceR->quote($path).\",'%')\" :\" OR file LIKE CONCAT(\".$resourceR->quote($path).\",'%')\";\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t$sql = \"(SELECT * FROM `{$resourceR->tableName}`\".$where.\") AS tbl\";\n\t\t}\t\t\n\t\t$where1 = \" WHERE tbl.id > 0\";\n\t\t\t\t\n\t\tif($name){\n\t\t\t$where1 .= \" AND tbl.file LIKE CONCAT('%',\".$resourceR->quote($name).\",'%')\";\n\t\t}\n\t\tif($type){ \n\t\t\t$where1 .= \" AND tbl.ext LIKE CONCAT('%',\".$resourceR->quote($type).\")\"; \n\t\t}\n\t\t\t\n\t\tif($status == \"opt\") $where1 .= \" AND tbl.extension = '1'\";\n\t\telse if($status == \"unopt\") $where1 .= \" AND tbl.extension = ''\";\t\t\n $sqll = \"SELECT * FROM \".$sql .$where1;\n $images = $resourceR->fetchAssoc($sqll); \n\t\t$this->totalImages = count($images);\n\t\t$numberOfPage = $this->totalImages / $this->limit;\n $totalPages = is_int($numberOfPage) ? $numberOfPage : (floor($numberOfPage) + 1);\n if ($this->page > $totalPages)\n $this->page = $totalPages;\n $this->pagination = $this->buildPager($this->totalImages);\n $images = $this->prepareLocalImages($images);\n return $images;\n\t}", "abstract public function filters();", "function &driver($filter, $options = array())\n {\n $obj =& FactoryPattern::factory('Image_Filter', $filter, dirname(__FILE__), array($options));\n return $obj;\n }", "protected static function loadFiltersData()\n {\n self::$filtersData = (array) $GLOBALS['TSFE']->fe_user->getKey('ses', 'filters');\n }", "public function Images() {\n\t\treturn new ArrayList(array_filter([$this->Image()]));\n\t}", "public function getInputFilter(){\n\t\t/*\n\t\t * validate data:\n\t\t * -id\n\t\t * -svg1\n\t\t * -image1\n\t\t * -svg2\n\t\t * -image2\n\t\t * -svg3\n\t\t * -image3\n\t\t **/\n\n\t\tif(!$this->inputFilter){\n\t\t\t$inputFilter = new InputFilter();\n\n\t\t\t//id\n $inputFilter->add(array(\n 'name' => 'id',\n 'required' => true,\n 'filters' => array(\n array('name' => 'Int'),\n ),\n ));\n\n\n\t\t}\n\t}", "function bethel_remove_filter_from_gallery_images ($edit) {\n remove_filter ('wp_get_attachment_image_attributes', 'bethel_filter_image_attributes_for_gallery', 10, 2);\n remove_filter ('wp_get_attachment_link', 'bethel_filter_attachment_link_for_gallery', 10, 6);\n return $edit;\n}", "public function get_uploaded_header_images()\n {\n }", "public function getFilterImage($identifier)\n {\n $filterId = Yii::$app->storage->getFilterId($identifier);\n return $this->hasOne(self::class, ['file_id' => 'file_id'])->andWhere(['filter_id' => $filterId]);\n }", "public function load()\n\t{\n\t\t$this->options = apply_filters($this->filterName, get_option($this->filterName));\n\t}", "public function loadResources() {}", "protected function _load_image()\n {\n if ( ! is_resource($this->_image))\n {\n // Gets create function\n $create = $this->_create_function;\n\n // Open the temporary image\n $this->_image = $create($this->file);\n\n // Preserve transparency when saving\n imagesavealpha($this->_image, TRUE);\n }\n }", "public function filtering();", "public static function loadBackgroundImages() {\n $dir = scandir('../img/bgs');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/bgs/\" . $file)) {\n $currFileExt = pathinfo(\"../img/bgs/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $curr_page = isset($_POST['curr_page']) ? intval($_POST['curr_page']) : 1;\n $max_bgs_per_page = 9;\n $offset = $curr_page * $max_bgs_per_page - $max_bgs_per_page;\n $slice = array_slice($bg_images, $offset, $max_bgs_per_page);\n\n $counter = 0;\n $middleClass = \"\";\n foreach ($slice as $bg) {\n $counter++;\n if ($counter == 1) {\n ?><div class=\"cs-product-row\"><?php\n }\n if ($counter == 2) {\n $middleClass = \"cs-prd-middle\";\n }\n else {\n $middleClass = \"\";\n }\n ?>\n <?php $bg_index = self::parseInt($bg); ?>\n <div class=\"cs-product pad-bot thumb_za_pozadini <?php echo $middleClass; ?>\"\n index_za_pozadina_e=\"<?php echo $bg_index; ?>\"> \n\n <img src=\"img/bgs/<?php echo $bg ?>\" width=\"97\" height=\"126\" data-bgname=\"<?php echo $bg ?>\" class=\"cs-main-bg\" />\n </div>\n <?php\n if ($counter == 3) {\n ?></div><?php\n $counter = 0;\n }\n }\n }", "public function indexAction()\n {\n $paginator = $this->get('knp_paginator');\n $request = $this->getRequest();\n $session = $request->getSession();\n $qb = $this->getDoctrine()->getManager()\n ->getRepository('BlogBundle:Image')->getQueryBuilderForFilter();\n $query = $qb->getQuery();\n $filterForm = $this->createForm(new ImageFilterType(), new ImageFilterModel($request));\n $formHandler = new ImageFilterHandler($filterForm, $request, $qb);\n\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'reset') {\n $session->remove('ImageControllerFilter');\n }\n\n if ($request->getMethod() == 'POST' && $request->get('filter_action') == 'filter') {\n if ($formHandler->process()) {\n $query = $formHandler->getQuery();\n $session->set('ImageControllerFilter', $request);\n }\n }\n\n if ($request->getMethod() == 'GET') {\n if ($session->has('ImageControllerFilter')) {\n $filterForm = $this->createForm(\n new ImageFilterType(),\n new ImageFilterModel($session->get('ImageControllerFilter'))\n );\n $formHandler = new ImageFilterHandler($filterForm, $session->get('ImageControllerFilter'), $qb);\n if ($formHandler->process()) {\n $query = $formHandler->getQuery();\n }\n }\n }\n $filterForm = $formHandler->getFilter();\n\n $pagination = $paginator->paginate(\n $query,\n $request->get('page', 1),\n 12\n );\n\n return array(\n 'upload_url' => $this->container->getParameter('blog.upload_url'),\n 'pagination' => $pagination,\n 'filterForm' => $filterForm->createView(),\n );\n }", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "protected function loadImage()\n {\n if (!is_resource($this->tmpImage)) {\n $create = $this->createFunctionName;\n $this->tmpImage = $create($this->filePath);\n imagesavealpha($this->tmpImage, true);\n }\n }", "function _captcha_show_gd_img_get_backgrounds()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$images = array();\n\t\t$_path = $this->path_background;\n\t\t\n\t\tif ( $_dir = @opendir( $_path ) )\n\t\t{\n\t\t\twhile( false !== ( $_file = @readdir( $_dir ) ) )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#\\.(gif|jpeg|jpg|png)$#i\", $_file ) )\n\t\t\t\t{\n\t\t\t\t\t$images[] = $_path . '/' . $_file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $images;\n\t}", "public function register_filters() {\n\n\t\t}", "public function findAllByAvatarFileNameAnywhere($filter)\n {\n return $this->createQueryBuilder('u')\n ->andWhere('u.avatarFileName LIKE :filter')\n ->setParameter('filter','%'.$filter.'%')\n ->addOrderBy('u.totalAmountOfCreatedObjects','DESC')\n ->getQuery()\n ->execute();\n }", "public function __construct() {\n\n add_filter( 'wp_handle_upload_prefilter', array( $this, 'process_image' ) );\n }", "function LoadFilter($type, $name)\n {\n $this->_smarty->load_filter($type, $name);\n }", "function import_osimages(){\n\t\techo $this->Azure->importOSImages();\n\t}", "public function loadFilter($type, $name)\n {\n $this->sm->loadFilter($type, $name);\n }", "protected function getGetImgResourceHookObjects() {}", "protected function processImage() {}", "function _dotgo_filter_prepare() {\n\n}", "public function loadDefaultImages($field_name)\n {\n if (sfContext::hasInstance())\n {\n return;\n }\n \n print(\"trying to load default images\\n\");\n \n foreach (array('jpg', 'jpeg', 'gif', 'png') as $extension)\n {\n $filename = $this->getImageNameStem($field_name) . '.' . $extension;\n $save_path = 'web/' . $this->getImagePath();\n \n $file_to_load = 'data/images/' . get_class($this->getInvoker()) . '/' . $filename;\n $file_to_save = $save_path . $filename;\n \n// print(\"checking for $file_to_load\\n\");\n \n if (file_exists($file_to_load))\n {\n print('Found ' . $file_to_load . \"... \");\n if (!file_exists($save_path))\n {\n $cmd = \"mkdir -p \" . $save_path;\n shell_exec($cmd);\n print(\"created \" . $save_path . \"\\n\");\n }\n \n if (is_writable($save_path))\n {\n copy($file_to_load, $file_to_save);\n $this->getInvoker()->{$field_name . '_image'} = $filename;\n $this->getInvoker()->save();\n print(\"copied\\n\");\n }\n else\n {\n print(\"Don't have permission to copy to $file_to_save\\n\");\n }\n }\n }\n }", "private function loadFilters() {\n\n // buscando usuários\n $companyId = $this->Session->read('CompanyLoggedIn.Company.id');\n $params = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n 'CompaniesUser.user_id'\n ),\n 'conditions' => array(\n 'CompaniesUser.status' => 'ACTIVE'\n )\n )\n );\n $userIds = $this->Utility->urlRequestToGetData('companies', 'list', $params);\n if (!empty($userIds) && empty($userIds ['status'])) {\n $_SESSION ['addOffer'] ['userIds'] = $userIds;\n\n // conta público alvo\n $this->offerFilters ['target'] = count($userIds);\n\n // busca os filtros\n foreach ($this->offerFilters as $key => $value) {\n if ($key == 'gender') {\n $Paramsgenero = array(\n 'CompaniesUser' => array(\n 'fields' => array(\n \"COUNT(User.id) AS count\",\n \"User.gender AS filter\"\n ),\n 'group' => array(\n \"User.gender\"\n ),\n 'order' => array(\n 'COUNT(User.id)' => 'DESC'\n )\n ),\n 'User' => array()\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $Paramsgenero);\n } else if ($key == 'age_group') {\n // busca faixa etária\n $query = \"SELECT\n\t\t\t\t\t SUM(IF(age < 20,1,0)) AS '{$this->ageGroupRangeKeys['0_20']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 20 AND 29,1,0)) AS '{$this->ageGroupRangeKeys['20_29']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 30 AND 39,1,0)) AS '{$this->ageGroupRangeKeys['30_39']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 40 AND 49,1,0)) AS '{$this->ageGroupRangeKeys['40_49']}',\n\t\t\t\t\t SUM(IF(age BETWEEN 50 AND 59,1,0)) AS '{$this->ageGroupRangeKeys['50_59']}',\n\t\t\t\t\t SUM(IF(age >=60, 1, 0)) AS '{$this->ageGroupRangeKeys['60_120']}',\n\t\t\t\t\t SUM(IF(age IS NULL, 1, 0)) AS '{$this->ageGroupRangeKeys['empty']}'\n\t\t\t\t\t\tFROM (SELECT YEAR(CURDATE())-YEAR(birthday) AS age FROM facebook_profiles) AS derived\";\n\n $filterParams = array(\n 'FacebookProfile' => array(\n 'query' => $query\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'query', $filterParams);\n } else {\n $filterParams = array(\n 'FacebookProfile' => array(\n 'fields' => array(\n \"COUNT(FacebookProfile.{$key}) AS count\",\n \"FacebookProfile.{$key} AS filter\"\n ),\n 'conditions' => array(\n 'FacebookProfile.user_id' => $userIds\n ),\n 'group' => array(\n \"FacebookProfile.{$key}\"\n ),\n 'order' => array(\n \"FacebookProfile.{$key}\" => 'ASC'\n )\n )\n );\n $filter = $this->Utility->urlRequestToGetData('users', 'all', $filterParams);\n }\n if (!empty($filter) && empty($filter ['status'])) {\n $this->offerFilters [$key] = $this->formatOfferFilters($filter);\n }\n }\n return $this->offerFilters;\n } else {\n $this->Session->setFlash('Houve um problema para carregar os filtros. Tente novamente.');\n }\n }", "private static function _getFilter() {}", "abstract public function describeImages(ImageFilter $images);", "public function setImages(){\n\t\t// imagen destacada\n $this->thumbail_img = $this->getThumbnailImg();\n // imagenes\n $this->images = $this->getImages();\n\t}", "function loadImage($filename) {\n $image = false;\n $imageInfo = getimagesize($filename);\n $imageType = '';\n $imageType = $imageInfo[2];\n if( $imageType == IMAGETYPE_JPEG ) {\n $image = imagecreatefromjpeg($filename);\n } elseif( $imageType == IMAGETYPE_GIF ) {\n $image = imagecreatefromgif($filename);\n } elseif( $imageType == IMAGETYPE_PNG ) {\n $image = imagecreatefrompng($filename);\n }\n return $image ? array('image' => $image, 'imgType' => $imageType, 'imageInfo' => $imageInfo) : array();\n}", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "public function setImageFilter($filter)\n {\n $this->imageFilter = $filter;\n return $this;\n }", "function filter_load() {\r\n\t\tadd_action( current_filter(), array( $this, 'setup_vars' ), 20 );\r\n\t\tadd_action( 'restrict_manage_posts', array( $this, 'get_select' ) );\r\n\t\tadd_filter( \"manage_taxonomies_for_{$this->post_type}_columns\", array( $this, 'add_columns' ) );\r\n\t}", "public function processImages()\n {\n // Start by scanning for any new images\n Mage::getModel('udder_deflate/scan')->findImages();\n\n // Then compress the list of images in the queue\n Mage::getModel('udder_deflate/compress')->compressAll();\n\n return $this;\n }", "public function filterLoad(AssetInterface $asset)\n {\n\n }", "public function syncImages() {\r\n\r\n /** @var Mage_Catalog_Helper_Product_Flat $helper */\r\n $process = Mage::helper('catalog/product_flat')->getProcess();\r\n $status = $process->getStatus();\r\n $process->setStatus(Mage_Index_Model_Process::STATUS_RUNNING);\r\n\r\n // Fetch attribute set id by attribute set name\r\n /** @var $collection Mage_Catalog_Model_Resource_Product_Collection */\r\n $attributeSetId = Mage::getModel('eav/entity_attribute_set')\r\n ->load('Oodji', 'attribute_set_name')\r\n ->getAttributeSetId();\r\n\r\n $website = Mage::getResourceModel('core/website_collection')\r\n ->addFieldToFilter('code', 'oodji')\r\n ->getFirstItem();\r\n\r\n $storeId = Mage::app()->getStore(Mage::app()->getWebsite($website)->getDefaultGroup()->getDefaultStoreId())->getId();\r\n\r\n // Load product model collection filtered by attribute set id\r\n $products = Mage::getResourceModel('catalog/product_collection')\r\n ->setStoreId($storeId)\r\n ->addAttributeToSelect('name')\r\n ->addAttributeToSelect('sku')\r\n ->addAttributeToFilter('type_id', 'configurable')\r\n ->addFieldToFilter('attribute_set_id', $attributeSetId)\r\n ->addFieldToFilter('status', 2);\r\n\r\n $process->setStatus($status);\r\n\r\n // Process your product collection as per your bussiness logic\r\n /** @var Agere_PhotoGrabber_Helper_Grabber $grab */\r\n $grab = Mage::helper('photoGrabber/grabber');\r\n\r\n foreach($products as $product){\r\n $grab->searchProduct($product->getSku());\r\n }\r\n }", "public static function initialize() {\r\n\t\t// The filters are only useful for front-end posts/pages; exit if in the admin section\r\n\t\tif ( is_admin() )\r\n\t\t\treturn;\r\n\r\n\t\tadd_filter( 'mla_gallery_attributes', 'MLAMultiSearchExample::mla_gallery_attributes', 10, 1 );\r\n\t\tadd_filter( 'mla_gallery_query_arguments', 'MLAMultiSearchExample::mla_gallery_query_arguments', 10, 1 );\r\n\t}", "function wp_load_image($file)\n {\n }", "function get_images($file){\r\n $h1count = preg_match_all('/(<img)\\s (src=\"([a-zA-Z0-9\\.;:\\/\\?&=_|\\r|\\n]{1,})\")/isxmU',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[3]);\r\n array_push($res,count($patterns[3]));\r\n return $res;\r\n}", "public function getImageFilter()\n {\n return $this->imageFilter;\n }", "public function getImages(){\n $images =[];\n $files=[];\n $imageDir=opendir(IMAGES_DIR);\n while(false !==($file=readdir($imageDir))){\n // $imageDirから一行ずつ読み込んで,$fileに入れて行く そんでそれがfalseにならない限り回し続ける\n if($file === '.'||$file =='..'){\n // カレントディレクトリやルートディレクトリを飛ばして回す\n continue;\n }\n $files[]=$file;\n //thumnailは imagesdirに存在するのかな\n if(file_exists(THUMBNAIL_DIR.'/'.$file)){\n $images[]=basename(THUMBNAIL_DIR).'/'.$file;\n } else{\n $images[]=basename(IMAGES_DIR).'/'.$file;\n }\n }\n array_multisort($files,SORT_DESC,$images);\n // 逆向き順に$filesに入っているimagesをそr・せよ\n return $images;\n}", "function getImagesDamCat($limitImages=0) {\n\t $content.=$this->beginGallery($this->cObj->data['uid'],$limitImages);\n\t \n\t // add image\n $list= str_replace('tx_dam_cat_', '',$this->config['startingpointdamcat']);\n\n $listRecursive = $this->getRecursiveDamCat($list,$this->config['recursivedamcat']);\n $listArray = explode(',',$listRecursive);\n $files = Array();\n\t\tforeach($listArray as $cat) {\n\t\t\t\t\t\t\n\t\t\t// add images from categories\n\t\t\t$fields = 'tx_dam.uid,tx_dam.title,tx_dam.description,tx_dam.file_name,tx_dam.file_path';\n\t\t\t$tables = 'tx_dam,tx_dam_mm_cat';\n\t\t\t$temp_where = 'tx_dam.deleted = 0 AND tx_dam.hidden=0 AND tx_dam_mm_cat.uid_foreign='.$cat.' AND tx_dam_mm_cat.uid_local=tx_dam.uid';\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($fields, $tables, $temp_where);\n\t\t\t\n while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n $files[$row['uid']] = $row; # just add the image to an array\n\t\t\t}\n\t\t}\n\t\t\n if ($limitImages>0) {\n $files = $this->getSlicedRandomArray($files,0,$limitImages);\n }\t\n \n\t\t// add the image for real\n\t\tforeach ($files as $key=>$row) {\n $path = $row['file_path'].$row['file_name'];\n\n // add element to slideshow\n $content.=$this->addImage(\n\t\t $path,\n $row['title'], \n $row['description'], \n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\t\n }\t\t\t\n \n \n $content.=$this->endGallery();\n return $content;\n }", "function loadData ($image,$mime) {\r\n if ( in_array($mime,$this->types) ) {\r\n $this->source=imagecreatefromstring($image);\r\n $this->sourceWidth=imagesx($this->source);\r\n $this->sourceHeight=imagesy($this->source);\r\n $this->sourceMime=$mime;\r\n $this->initThumb();\r\n return true;\r\n } else {\r\n trigger_error('Image MIME type '.$mime.' not supported');\r\n return false;\r\n }\r\n }", "protected function loadImageResource()\n {\n if(empty($this->resource))\n {\n if(($this->worker === NULL || $this->worker === $this::WORKER_IMAGICK) && self::imagickAvailable())\n {\n $this->resource = $this->createImagick($this->image);\n }\n elseif(($this->worker === NULL || $this->worker === $this::WORKER_GD) && self::gdAvailable())\n {\n $this->resource = $this->getGdResource($this->image);\n }\n else\n {\n throw new Exception('Required extensions missing, extension GD or Imagick is required');\n }\n }\n }", "function get_init_filters($filtros = array(), $valores = array()){\n $res = array();\n foreach ($filtros as $filtro){\n $res[$filtro] = get_cfilter($filtro, $valores);\n }\n return $res;\n}", "function init_all($id, $parameter_data = NULL) {\n //initialize filters\n $this->init_filter($id, false);\n\n //initialize icons to the empty set\n $this->icons = array();\n }", "function rs_duotonefilters_init(){\n\n\tnew RsDuotoneFiltersBase();\n\t\n}", "function get_image($names, $images=array(), $options=array()){\n\tglobal $FUNCTION_ROOT, $get_imagex;\n\textract($options);\n\t//2013-05-01: much at names as array until complete\n\tif(is_array($names)){\n\t\t$name=current($names); //string\n\t\tforeach($names as $n=>$v){\n\t\t\tunset($names[$n]);\n\t\t\tbreak;\n\t\t}\n\t}else{\n\t\t$name=$names;\n\t\t$names=array();//empty it\n\t}\n\tif(!isset($targetReplace))$targetReplace=' ';\n\tif(!strlen($name))return;\n\t\n\tif(!$return)$return=($get_imagex['return'] ? $get_imagex['return'] : 'multi');\n\t\n\tif(!$precedence)$precedence=array('png','jpg','jpeg','gif','svg');\n\tif(!$regexFilter)$regexFilter='[^-a-z0-9_]+';\n\tif($appendage=='_')$appendage='(_(.+))*';\n\n\tif(is_string($images)){\n\t\tif($a=$get_imagex['locations'][$images]){\n\t\t\t$images=$a;\n\t\t}else{\n\t\t\t$images=$get_imagex['locations'][$images]=get_file_assets($images,array('positiveFilters'=>'\\.(jpg|gif|png|svg)$',));\n\t\t}\n\t}\n\tif(@empty($images))return;\n\n\tif($externalImageFunction){\n\t\t//Added 2008-10-31 - this allows an external function to process, it must globalize $get_image - with nodes of name (case-sensitive), width, and height. The source returned must be the actual path to the image plus name\n\t\treturn $externalImageFunction($names, $images, $options);\n\t}\t\n\t\n\tif(!($normalize===false))$normalize=(is_bool($normalize) ? '/[^-a-zA-Z0-9]/' : $normalize);\n\tif($normalize)$name=preg_replace($normalize,'',strtolower($name));\n\n\t\n\t//don't forget about this\n\t$appendage; //normally (_(.+))*\n\tif(!$appendageIndex)$appendageIndex=2;\n\t\n\tforeach($precedence as $ext){\n\t\t//handle special characters\n\t\t$str=str_replace('+','\\+',$name);\n\t\t$str=str_replace('.','\\.',$str);\n\t\t\n\t\t$nameRegex='/^'.$str.$appendage.'\\.'.$ext.'$/i';\n\t\tforeach($images as $n=>$v){\n\t\t\tif($debug)prn(\"nameRegex=$nameRegex\\ntargetReplace=$targetReplace\\nresult=\".preg_replace('/'.$targetReplace.'/','',$n));\n\t\t\tif(!preg_match($nameRegex,preg_replace('/'.$targetReplace.'/','',$n),$m))continue;\n\t\t\tif($debug)error_alert('match');\n\t\t\t//note what we use for the key - we switch to case-sensitive\n\t\t\t$get_image[$v['name']]=$v;\n\t\t\t$get_image[$v['name']]['length']=strlen($v['name']);\n\t\t\tif(strlen($m[$appendageIndex]))$get_image[$v['name']]['description']=$m[$appendageIndex];\n\t\t}\n\t}\n\tif($debug)error_alert(look);\n\tif(count($get_image)){\n\t\tif(!function_exists('subkey_sort'))require($FUNCTION_ROOT.'/function_array_subkey_sort_v300.php');\n\t\t$get_image=subkey_sort($get_image,'length');\n\t\t//return methods here\n\t\tif($return=='multi'){\n\t\t\treturn $get_image;\n\t\t}else if($return=='string'){\n\t\t\t$get_imagex['params']=current($get_image);\n\t\t\t$a=current($get_image);\n\t\t\treturn $a['name'];\n\t\t}else if($return=='array'){\n\t\t\treturn current($get_image);\n\t\t}else exit('improper return method for get_image v2.30');\n\t}\n\t\n\t//2013-05-01: call function recursively with next names present\n\tif(count($names))return get_image($names, $images, $options);\n}", "function bethel_add_filter_to_gallery_images ($style) {\n add_filter ('wp_get_attachment_image_attributes', 'bethel_filter_image_attributes_for_gallery', 10, 2);\n add_filter ('wp_get_attachment_link', 'bethel_filter_attachment_link_for_gallery', 10, 6);\n return $style;\n}", "function xh_fetchFilter($filter_name)\r\n\t{\r\n\t}", "public function getImages($type=''){\n \n $imagetypes = array(\"image/png\",\"image/jpeg\", \"image/gif\");\n $dir = self::IMAGEPATH;\n\n // array to hold return value\n $retval = array();\n\n // add trailing slash if missing\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n // full server path to directory\n $fulldir = \"{$_SERVER['DOCUMENT_ROOT']}/$dir\";\n\n $d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\");\n while(false !== ($entry = $d->read())) {\n // skip hidden files\n if($entry[0] == \".\") continue;\n\n \n // check for image files\n $f = escapeshellarg(\"$fulldir$entry\");\n \n \n \n if((!$type)||(strpos(' '.$entry, $type)))\n $retval[] = $entry;\n \n \n }\n $d->close();\n\n return $retval;\n }", "public function filter_attachment_image_src($image): array{\n\t\t$oss_image = [\n\t\t\t$this->resize_image($image[0], $image[1], $image[2]),\n\t\t\t$image[1],\n\t\t\t$image[2],\n\t\t];\n\n\t\treturn $oss_image;\n\t}", "public function index(Request $request, ImageFilter $filter)\n {\n return $this->collection(\n $this->model\n ->filter($filter)\n ->paginate( $this->perPageCount($request) )\n );\n }", "public function jpegFileModifier()\n {\n return $this->fileFilter(\n 'images.jpg',\n $this->createPath('public/img'),\n new GlobAsset($this->createPath('assets/img/*.jpg')),\n $this->filters['jpg']\n );\n }", "public function getImagesFromBatch() {\n\t\t$images = array();\n\t\t$images = icms_core_Filesystem::getFileList(ALBUM_UPLOAD_ROOT.'batch/', '', array('gif', 'jpg', 'png'));\n\t\t$ret = array();\n\t\tforeach(array_keys($images) as $i ) {\n\t\t\t$ret[$i] = $images[$i];\n\t\t}\n\t\treturn $ret;\n\t}", "function load_data()\n \t{\n \t\t\n \t\t$return=parent::load_data();\t\n \t\t$this->images_array=t3lib_div::trimExplode(',',$this->images);\n \t\t$this->teaserImagesArray=t3lib_div::trimExplode(',',$this->teaserimages);\n \t\treturn $return;\n \t}", "function imageProcessor($text)\r\n {\r\n $this->images = array();\r\n // если включена обработка пробелов в путях картинок\r\n if ($this->feed['params']['image_space_on']) {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n } else {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"\\s](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n }\r\n return $text;\r\n }", "protected function initFilterFields(): void\n {\n $this->filterSliderFields = $this->filterSliderFields();\n $this->filterNumericFields = $this->filterNumericFields();\n $this->filterDropdownFields = $this->filterDropdownFields();\n }", "function GetImages(){\n\t\t$this->MediaType = 'image/jpeg';\n\t\t$this->SetFileName();\n\t\treturn $this->get();\n\t}", "public function firstParty()\n {\n $images = [];\n\n foreach ((new Finder())->in($this->path)->directories()->sortByName() as $directory) {\n /* @var $directory \\Symfony\\Component\\Finder\\SplFileInfo */\n $images[] = new Image($this->getImageName($directory, $this->name), $directory->getRealPath());\n }\n\n return $images;\n }", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();" ]
[ "0.6393928", "0.62254095", "0.6221049", "0.59474915", "0.5925864", "0.58376104", "0.58333474", "0.57603294", "0.5747043", "0.5700138", "0.56835365", "0.5663423", "0.5642942", "0.5636832", "0.5601619", "0.55926204", "0.5569385", "0.55532074", "0.5515226", "0.5499478", "0.5487089", "0.54662985", "0.54470253", "0.54462236", "0.54302895", "0.5421949", "0.5419304", "0.54162043", "0.5401731", "0.53644925", "0.53493285", "0.5346045", "0.5339859", "0.53372335", "0.53243715", "0.53225964", "0.5319291", "0.5306261", "0.5295994", "0.5285633", "0.528201", "0.5280468", "0.52782893", "0.5271573", "0.52715725", "0.526812", "0.5252109", "0.5240315", "0.52395934", "0.5237317", "0.52125204", "0.5187797", "0.51796734", "0.5172279", "0.51637435", "0.51630205", "0.51442707", "0.5138218", "0.51354927", "0.51316804", "0.5124146", "0.5122284", "0.51188874", "0.5117677", "0.5101383", "0.50891876", "0.50721985", "0.5069183", "0.50656193", "0.5055354", "0.50443274", "0.50330347", "0.50329596", "0.50305736", "0.5028384", "0.50262237", "0.502534", "0.5023219", "0.50198525", "0.501912", "0.5013729", "0.50096697", "0.50042915", "0.50023454", "0.49964154", "0.499608", "0.4987564", "0.49864915", "0.49838382", "0.4979132", "0.4975232", "0.49679303", "0.49674818", "0.49652925", "0.4963558", "0.49613672", "0.49607238", "0.49607238", "0.49607238", "0.49607238" ]
0.7335104
0
/////////////////////////////////////////////////////////////////////// get number of pages with effect images
public static function getEffectsNumPages() { $dir = scandir('../img/effects'); $bg_images = array(); foreach ($dir as $file) { if ($file != "." && $file != "..") { if (file_exists("../img/bgs/" . $file)) { $currFileExt = pathinfo("../img/bgs/" . $file, 4); if ($currFileExt == "jpg" || $currFileExt == "png" || $currFileExt == "gif" || $currFileExt == "jpeg" || $currFileExt == "bmp") { $bg_images[] = $file; } } } } $max_bgs_per_page = 9; echo ceil(count($bg_images) / $max_bgs_per_page) < 1 ? 1 : ceil(count($bg_images) / $max_bgs_per_page); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_page_count() {\n global $connexion, $config;\n $nb_images = $connexion->query('SELECT COUNT(id) FROM image')->fetchColumn();\n $nb_pages = ceil($nb_images / $config['nb_pictures_page']);\n return $nb_pages;\n}", "public function numOfPages(): int;", "public function getPageNumber();", "public function getPageNumber();", "public function getPageNumbers();", "public function getPageCount() \r\n { \r\n }", "function get_object_count()\r\n {\r\n return $this->get_browser()->count_photo_gallery_publications($this->get_condition());\r\n }", "private function _count_page()\n {\n $count_career = $this->core_model->count('career');\n return ceil($count_career / 4);\n }", "public function getPagesCount()\n {\n \treturn count($this->_pages);\n }", "function getPageCount() {\n return $this->helper->getPageCount();\n }", "function getPageCount() {\n return $this->helper->getPageCount();\n }", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "public function numPages() {\n $links = $this->_document->links('self');\n return $links[0]->totalpages;\n }", "public function count_homepage_photos(){\n $sql=\"SELECT COUNT(*) FROM photos WHERE img_navigacija_id=2\";\n $result=self::$connect->query($sql);\n while($row=$result->fetch(PDO::FETCH_NUM)){\n return $row[0];\n }\n }", "public function getNbPages(): int;", "public function getPageNumber() {}", "public function getPageNumber() {}", "public function getNumberOfImages()\n {\n return $this->resource->getNumberImages();\n }", "function getNumPages(){\n\t\treturn $this->numPages;\n\t}", "function how_many_photos($data)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT spotlight_post_id FROM gv_spotlight_post_image WHERE (spotlight_image_block = 0) AND spotlight_post_id = ' . $data;\r\n\t\t$result = mysql_query($query, $db) or die(mysql_error($db));\r\n\t\t\r\n\t\tif(mysql_num_rows($result) > 0)\r\n\t\t{\r\n\t\t\t$number_of_images = mysql_num_rows($result);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\t$number_of_images = 0;\r\n\t\t}\r\n\t\treturn $number_of_images;\r\n\t}", "public function get_nb_pictures(){\n $return = array();\n $sql = sprintf(\"SELECT count(*) FROM miki_album_picture WHERE id_album = %d\",\n mysql_real_escape_string($this->id));\n $result = mysql_query($sql);\n $row = mysql_fetch_array($result);\n return $row[0];\n }", "function get_page_count($conditions_array=array())\n\t{\n\t\t$this->db->where($conditions_array);\n\t\treturn $this->db->count_all_results('red_diy_pages');\n\t}", "public function getNbPages(){\n $db = $this -> init();\n \n $selectCount = $db ->query('Select COUNT(*) as nb_posts from posts') or die(print_r($db->errorInfo()));\n $count = $selectCount->fetch();\n return $count['nb_posts']/5;\n }", "public function pageCount() {\r\n\t\tif ($this->__pageItems > 0) {\r\n\t\t\t$intReturn = ceil(count($this->collection) / $this->__pageItems);\r\n\t\t} else {\r\n\t\t\t$intReturn = 1;\r\n\t\t}\r\n\r\n\t\treturn $intReturn;\r\n\t}", "public function count()\n {\n return $this->getImages()->count();\n }", "public function numOfPages(): int\n {\n return count($this->repository);\n }", "function get_gallery_count()\n {\n $settings = C_NextGen_Settings::get_instance();\n $count = $settings->get('gallery_count', FALSE);\n if (!$count) {\n $count = M_NextGen_Admin::update_gallery_count_setting();\n }\n return $count;\n }", "public function count()\n\t{\n\t\treturn count($this->_pages);\n\t}", "public function number_of_pages(){\n $cantidad= $this->total_amount / $this->amount_per_page;\n if(is_int($cantidad)){\n return $cantidad;\n }\n else{\n $cantidad_int= intval($cantidad);\n if($cantidad_int > $cantidad){\n return $cantidad_int;\n }\n else{\n return $cantidad_int + 1;\n }\n }\n }", "function getnumpages($tid)\n{\n $nops = mysql_fetch_array(mysql_query(\"SELECT COUNT(*) FROM ibwf_posts WHERE tid='\".$tid.\"'\"));\n $nops = $nops[0]+1; //where did the 1 come from? the topic text, duh!\n $nopg = ceil($nops/5); //5 is the posts to show in each page\n return $nopg;\n}", "function countPages(){\n return $this->db->count_all('page_attributes');\n }", "public function count()\n {\n return count($this->pages);\n }", "function totalpages(){\n \tglobal $numofVideos;\n \treturn ceil(countallvideos() / $numofVideos);\n }", "public static function getBgsNumpages() {\n $dir = scandir('../img/bgs');\n $bg_images = array();\n foreach ($dir as $file) {\n if ($file != \".\" && $file != \"..\") {\n if (file_exists(\"../img/bgs/\" . $file)) {\n $currFileExt = pathinfo(\"../img/bgs/\" . $file, 4);\n if ($currFileExt == \"jpg\" || $currFileExt == \"png\" || $currFileExt == \"gif\" || $currFileExt == \"jpeg\" || $currFileExt == \"bmp\") {\n $bg_images[] = $file;\n }\n }\n }\n }\n $max_bgs_per_page = 9;\n echo ceil(count($bg_images) / $max_bgs_per_page) < 1 ? 1 : ceil(count($bg_images) / $max_bgs_per_page);\n }", "public function pagecount()\n {\n // Pretty easy: Return number of pages in this wiki\n return Page::all()->count();\n }", "private function getNumberOfPages()\n {\n // Get the first page and then extract the total number of courses\n $this->domParser->load_file(self::COURSE_CATALOGUE);\n $lastPageUrl = $this->domParser->find('li[class=\"pager-last\"] a',0)->href;\n return (int)substr($lastPageUrl,strrpos($lastPageUrl,'=')+1);\n }", "public function countTemporyImages(){\n $count = $this->_tableGw->select()->count();\n return $count;\n }", "private function getNbPages($nbItems)\n\t{\n\t\t$nbPictures = $this->picturesModel->getNbPictures();\n\t\t$nbPages = ceil($nbPictures / $nbItems);\n\t\treturn $nbPages;\n\t}", "function count_pictures() {\n global $connexion, $config;\n $nb_images = $connexion->query('SELECT COUNT(id) FROM image')->fetchColumn();\n return $nb_images;\n}", "function getEventCount($per_page){\n\t\t//return ceil($count / $per_page); \n\t\treturn 3;\n\t}", "function getPageCount() { return $this->m_pageCount; }", "public function getPage()\n\t{\n\t\t$articlesPerPage = 3;\n\n\t\t$req = $this->db->query('SELECT COUNT(*) AS totalArticles FROM articles');\n\n\t\t$result = $req->fetch();\n\t\t$numberOfArticles = $result['totalArticles'];\n\n\t\t$numberOfPages = ceil($numberOfArticles / $articlesPerPage) ;\n\n\t\treturn $numberOfPages;\n\n\t}", "public function getPageCount()\n\t{\n\t\tif($this->pageCount === null)\n\t\t{\n\t\t\t$this->pageCount = $this->getCounts()[$this->getFolderId()] / $this->itemsPerPage;\n\t\t}\n\t\t\n\t\treturn $this->pageCount;\n\t}", "public function countPages() {\n\t\t$splitContent = explode(\"<!-- pagebreak -->\", $this->content);\t\t\n\t\treturn count($splitContent);\n\t}", "function numPages() {\n\t\treturn ceil($this->rows / $this->rpp);\n\t}", "public function totalPage();", "function getPagesCounter()\n\t{\n\t\t// Initialize variables\n\t\t$html = null;\n\t\tif ($this->get('pages.total') > 1) {\n\t\t\t$html .= JText::sprintf('JPAGE_CURRENT_OF_TOTAL', $this->get('pages.current'), $this->get('pages.total'));\n\t\t}\n\t\treturn $html;\n\t}", "function get_num_wiki_pages()\n{\n $value = get_value_newer_than('num_wiki_pages', time() - 60 * 60 * 24);\n\n if (is_null($value)) {\n $_value = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'COUNT(*)');\n if (!($_value > 0)) {\n $_value = 0;\n }\n $value = strval($_value);\n set_value('num_wiki_pages', $value);\n }\n\n return intval($value);\n}", "private function getSpecNoImageCount(){\n\t\t$cnt = 0;\n\t\tif($this->collid){\n\t\t\t$sql = 'SELECT count(o.occid) AS cnt '.\n\t\t\t\t'FROM omoccurrences o LEFT JOIN images i ON o.occid = i.occid '.\n\t\t\t\t'WHERE o.collid = '.$this->collid.' AND i.imgid IS NULL ';\n\t\t\t$rs = $this->conn->query($sql);\n\t\t\twhile($r = $rs->fetch_object()){\n\t\t\t\t$cnt = $r->cnt;\n\t\t\t}\n\t\t\t$rs->free();\n\t\t}\n\t\treturn $cnt;\n\t}", "function obtener_cantidad_post($post_por_pagina, $conexion) {\n $inicio = (pagina_actual() > 1) ? pagina_actual() * $post_por_pagina - $post_por_pagina : 0;\n $sentencia = $conexion->prepare(\"SELECT COUNT(idImg) FROM imagenes ORDER BY idImg DESC\");\n $sentencia->execute();\n return $sentencia->fetchAll();\n}", "public static function alm_filters_get_page_num(){\n\t \t$pg = (isset($_GET['pg'])) ? $_GET['pg'] : 1;\n\t \treturn $pg;\n \t}", "public function getPage_count() {\n return $this->page_count;\n }", "function total_images_uploaded() {\n\tglobal $dB;\n\t$uploaded_qry = $dB->query_fetch_single(\"SELECT count(*) as total FROM chv_images;\");\n\treturn $uploaded_qry[\"total\"];\n}", "function theme_views_slideshow_thumbnailhover_image_count($vss_id, $view, $options) {\n $attributes['class'] = 'views_slideshow_thumbnailhover_image_count views_slideshow_image_count';\n $attributes['id'] = \"views_slideshow_thumbnailhover_image_count_\" . $vss_id;\n $attributes = drupal_attributes($attributes);\n\n $counter = '<span class=\"num\">1</span> ' . t('of') .' <span class=\"total\">1</span>';\n\n return \"<div$attributes>$counter</div>\";\n}", "private function getNumPages() {\n\n return $this->rowCount / $this->limit;\n }", "public function getPageNumber() {\n\t\treturn (int)++self::$pageNumber;\n\t}", "public function files_num();", "public function getNumberOfAspects();", "function GetPageCount()\n\t{\n\t\t$countElements = $this->GetAllCount ();\n\t\t$pageCount = floor ( ($countElements - 1) / $this->m_limit ) + 1;\n\t\t\n\t\treturn $pageCount;\n\t}", "public function get_count_pages() : int {\n\t\treturn ceil(count($this->posts) / $this->posts_per_page);\n\t}", "public function pageCount()\n {\n return $this->setRightOperand(PVar::PAGE_COUNT);\n }", "public function pages()\n\t{\n\t\treturn ceil($this->_count_total / $this->config['total_items']);\n\t}", "function count_gallery()\n{\n\trequire_once('../conf/config.php');\n\t//Connect to mysql server\n\t$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);\n\tif(!$link)\n\t{\n\t\tdie('Failed to connect to server: ' . mysql_error());\n\t}\n\t//Select database\n\t$db = mysql_select_db(DB_DATABASE);\n\tif(!$db)\n\t{\n\t\tdie(\"Unable to select database\");\n\t}\n\t//\n\t$query=\"select count(*) cnt from gallery\";\n\t$result = mysql_query($query) or die(\"<b>A fatal MySQL error occured</b>.\\n<br />Query: \" . $query . \"<br />\\nError: (\" . mysql_errno() . \") \" . mysql_error());\n\twhile ($row = mysql_fetch_assoc($result))\n\t{\n\t\textract($row);\n\t}\n\treturn $cnt;\n}", "public function getImagesCount()\n {\n return $this->imagesCount;\n }", "public function countPages() {\n\t\t$count = intval($this->rows / $this->rowsPerPage);\n\n\t\tif ($this->rows % $this->rowsPerPage > 0) {\n\t\t\t$count++;\n\t\t}\n\t\treturn $count;\n\t}", "public function numFotos(){\n\n\t\t\t$sentencia = \"SELECT count(*) AS total FROM fotos\";\n\t\t\t$total= $this->db->query($sentencia)->row()->total; // converir fila y total\n\t\t\t\t\t\t\n\t\t\treturn intval($total); // asegurarnos que sea entero\n\n\t\t}", "public function currentStartCount(){\n\t\t$multiplier = $this->paged- 1;\n\t\treturn $multiplier * $this->posts_per_page;\n\t}", "public function numLinks();", "function getPDFPages($document)\n {\n $cmd = \"pdfinfo.exe\"; // Windows\n\n // Parse entire output\n // Surround with double quotes if file name has spaces\n exec(\"$cmd \\\"$document\\\"\", $output);\n\n // Iterate through lines\n $pagecount = 0;\n foreach($output as $op)\n {\n // Extract the number\n if(preg_match(\"/Pages:\\s*(\\d+)/i\", $op, $matches) === 1)\n {\n $pagecount = intval($matches[1]);\n break;\n }\n }\n\n return $pagecount;\n }", "function getPDFPages($document)\n {\n $cmd = \"pdfinfo.exe\"; // Windows\n\n // Parse entire output\n // Surround with double quotes if file name has spaces\n exec(\"$cmd \\\"$document\\\"\", $output);\n\n // Iterate through lines\n $pagecount = 0;\n foreach($output as $op)\n {\n // Extract the number\n if(preg_match(\"/Pages:\\s*(\\d+)/i\", $op, $matches) === 1)\n {\n $pagecount = intval($matches[1]);\n break;\n }\n }\n\n return $pagecount;\n }", "function get_object_count()\r\n {\r\n return $this->get_browser()->count_profile_publications($this->get_condition());\r\n }", "function getTotalPages()\n{\n include('connecter.php');\n if($con)\n {\n $nbr = $con->query('SELECT COUNT(*) AS nbre_total FROM invite');\n $resultat = $nbr->fetch();\n return $resultat['nbre_total'];\n }\n return -1;\n \n}", "function numberOfPages()\n\t\t{\n\t\t\tif($this->recordCount == -1)\n\t\t\t\treturn -1;\n\n\t\t\tif($this->recordCount == 0)\n\t\t\t\treturn 1;\n\n\t\t\treturn ceil($this->recordCount / $this->range);\n\t\t}", "public function getImageCount( $text )\n\t{\n\t\t$count = 0;\n\t\tpreg_match_all( '#<img([^>]+?)?>#i', $text, $matches );\n\t\t\n\t\tforeach( $matches[1] as $id => $match )\n\t\t{\n\t\t\tif ( ! stristr( $match, 'class=\"bbc_emoticon\"' ) )\n\t\t\t{\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $count;\n\t}", "function GetPhotoUploadCount(){\r\n\t$directory = \"./images/\";\r\n\t$filecount = 0;\r\n\t$files = glob($directory . \"4mw*.jpg\");\r\n\tif ($files){\r\n \t\t$filecount = count($files);\r\n\t}\r\n\techo $filecount;\r\n}", "public function getPageNo(\\SetaPDF_Core_Document $document) {}", "function itemCount(){\r\n\t\tif( $this->_itemCount === null ){\r\n\t\t\tglobal $database;\r\n\t\t\t\r\n\t\t\t$gid = $this->id;\r\n\t\t\t$database->setQuery(\"SELECT COUNT(1) FROM #__rsgallery2_files WHERE gallery_id='$gid' AND published = '1'\");\r\n\t\t\t$this->_itemCount = $database->loadResult();\r\n\t\t}\r\n\t\treturn $this->_itemCount;\r\n\t}", "public function PageCount_PDF()\n {\n //absolute path for file\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n $pageCount = 0;\n if (file_exists($f)) {\n require_once('lib/fpdf/fpdf.php');\n require_once('lib/fpdi/fpdi.php');\n $pdf = new FPDI();\n $pageCount = $pdf->setSourceFile($f); // returns page count\n }\n\n return $pageCount;\n }", "public function getPageNr(){\n\t\tif(isset($_GET['p'])){\n\t\t\treturn $_GET['p'];\n\t\t}else{\n\t\t\treturn 1;\n\t\t}\n\t}", "function get_page_count($url) { \n \n $conn = get_conn();\n \n if (mysqli_connect_errno($conn)) { \n echo \"Failed to connect to MySQL: \" + mysqli_connect_error();\n }\n \n \n $res = $conn->query(\"SELECT count FROM click WHERE url = '\" . mysql_escape_string($url) . \"'\" );\n \n if ($res === false) { \n trigger_error(\"Error running SQL: \" . $conn->error, E_USER_ERROR);\n }\n else { \n $arr = $res->fetch_all(MYSQL_ASSOC);\n }\n \n // returns an array of results, we only want the first one\n return $arr[0];\n}", "function getNumberOfPages(){\n $numberOfPages = $this->get('schema:numberOfPages');\n return $numberOfPages;\n }", "public function execNumberOfPages(){\n\t\t$pdf = escapeshellarg($this->getPdfPath());\n\n\t\t$pages = exec(\"pdfinfo $pdf | awk '/Pages/ {print \\$2}'\");\n\t\tif (!is_numeric($pages))\n\t\t\tthrow new \\Exception(\"pdfinfo returned '$pages' on $pdf (maybe apt-get install poppler-utils?)\");\n\t\telse\n\t\t\t$this->save(array(\"pocet_stran\" => $pages));\n\t}", "function PageCount ( )\n{\n $RC = $this->RecordCount();\n if ( $this->_PageSize > 0 ) {\n if ( ($RC <= 0) || ($this->_PageCount <= 0) ) {\n $this->_PageCount = (int)(($RC+$this->_PageSize-1)/$this->_PageSize);\n }\n } else {\n $this->_PageCount = $RC > 0 ? 1 : 0;\n }\n return $this->_PageCount;\n}", "public function getPageHits()\n\t{\n\t\treturn $this->pageHits;\n\t}", "public function pageCount()\n {\n return ($this->dbConnection->query('SELECT * FROM todos')->rowCount()/$this->numRecords);\n\n }", "public function getNumPages()\n {\n return $this->numPages;\n }", "public function count()\n {\n return $this->pager->count();\n }", "function numero_paginas($post_por_pagina, $conexion, $count) {\n $numero_paginas = ceil($count / $post_por_pagina);\n return $numero_paginas;\n}", "private function count(): float\n\t{\n\t\t$q = $this->db->query('SELECT COUNT(id) AS number FROM post');\n\t\t$number = $q->fetch();\n\t\t\n\t\t$pageNumber = $number['number'] / \\Config::NB_POSTS_PER_PAGE;\n\t\t\n\t\treturn ceil($pageNumber);\n\t}", "function getPageNumber($aUrlParams)\n {\t \n\t if(empty($aUrlParams)) return \"\";\n\t \n\t else if(is_string($aUrlParams))\n\t \t$aUrlParams = explode(\"/\",$aUrlParams);\n\t \t\n\t for($i=0;$i<count($aUrlParams); $i++)\n\t {\n\t \t\tif($aUrlParams[$i]==\"page\")\n\t \t\t{\n\t \t\t if(isset($aUrlParams[$i+1]))\n\t \t\t \t\treturn $aUrlParams[$i+1];\n\t \t\t else return 1;\t\t \t\n\t \t\t}\n\t }\n\t return 0;\n }", "function number_of_elements() {\n return count($this->page_object);\n }", "public function PageCount_DOCX()\n {\n $pageCount = 0;\n\n $zip = new ZipArchive();\n\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n\n if ($zip->open($f) === true) {\n if (($index = $zip->locateName('docProps/app.xml')) !== false) {\n $data = $zip->getFromIndex($index);\n $zip->close();\n $xml = new SimpleXMLElement($data);\n $pageCount = $xml->Pages;\n }\n }\n\n return intval($pageCount);\n }", "public function getUnprocSpecNoImage(){\n\t\t$cnt = 0;\n\t\tif($this->collid){\n\t\t\t$sql = 'SELECT count(o.occid) AS cnt '.\n\t\t\t\t'FROM omoccurrences o LEFT JOIN images i ON o.occid = i.occid '.\n\t\t\t\t'WHERE (o.collid = '.$this->collid.') AND (i.imgid IS NULL) AND (o.processingstatus = \"unprocessed\") ';\n\t\t\t$rs = $this->conn->query($sql);\n\t\t\twhile($r = $rs->fetch_object()){\n\t\t\t\t$cnt = $r->cnt;\n\t\t\t}\n\t\t\t$rs->free();\n\t\t}\n\t\treturn $cnt;\n\t}", "public function getPageCount()\n {\n return $this->pageCount;\n }", "function get_all_slide_count()\r\n {\r\n $slide = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `slide`\r\n \")->row_array();\r\n\r\n return $slide['count'];\r\n }", "protected function imageCount()\n\t{\n\t\t$this->score += $this->store['image_count'] * $this->config->data()['imageCount'];\n\t}", "function get_all_pagina_web_count()\r\n {\r\n $pagina_web = $this->db->query(\"\r\n SELECT\r\n count(*) as count\r\n\r\n FROM\r\n `pagina_web`\r\n \")->row_array();\r\n\r\n return $pagina_web['count'];\r\n }", "public function page_count() {\n if ($this->paginating) {\n return ceil($this->row_count() / $this->rpp);\n } else {\n return $this->row_count() ? 1 : 0;\n }\n }", "public function get_count() {\n\t\tglobal $wpdb;\n\t\t$count = $wpdb->get_var( $wpdb->prepare( \"SELECT COUNT(*) FROM {$wpdb->prefix}posts WHERE post_type=%s AND post_excerpt='' \", 'attachment' )); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Query is safe, see above.\n\t\treturn $count;\n\t}", "function get_images($file){\r\n $h1count = preg_match_all('/(<img)\\s (src=\"([a-zA-Z0-9\\.;:\\/\\?&=_|\\r|\\n]{1,})\")/isxmU',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[3]);\r\n array_push($res,count($patterns[3]));\r\n return $res;\r\n}" ]
[ "0.7511876", "0.6687339", "0.65935946", "0.65935946", "0.6548419", "0.6490648", "0.6467559", "0.63953197", "0.6363755", "0.6362878", "0.6362878", "0.6351505", "0.63401836", "0.63002276", "0.62988055", "0.62848926", "0.62848926", "0.6284278", "0.62774885", "0.6248097", "0.6238196", "0.62315685", "0.6229033", "0.62167764", "0.621123", "0.61987084", "0.61979866", "0.6194058", "0.6192335", "0.6190467", "0.6160012", "0.61341", "0.6101513", "0.61007506", "0.60712516", "0.6065628", "0.6053796", "0.60431033", "0.60421", "0.60335195", "0.60333407", "0.6022216", "0.601777", "0.60112256", "0.60040665", "0.6002626", "0.60015756", "0.5994237", "0.59901255", "0.5984712", "0.59695244", "0.5959578", "0.59516555", "0.5947606", "0.594465", "0.59368443", "0.59256744", "0.5922321", "0.59012866", "0.5897425", "0.588821", "0.58808184", "0.5875946", "0.58693177", "0.58651847", "0.5864247", "0.5862548", "0.5861447", "0.5859336", "0.5859336", "0.58554685", "0.58425725", "0.5841473", "0.58239156", "0.5816332", "0.58050025", "0.57834554", "0.5782849", "0.5778435", "0.5777214", "0.5775226", "0.5762308", "0.57619524", "0.5761665", "0.5759766", "0.57454854", "0.5739781", "0.57235473", "0.57190317", "0.57156855", "0.5702212", "0.5701302", "0.569778", "0.56845224", "0.5684164", "0.5676192", "0.56724447", "0.5671945", "0.5666187", "0.5658146" ]
0.8249625
0
///////////////////////////////////////////////////////////////////////// Get dress type by product id
public static function GetDressTypeByID($productID = null) { $category_dress_type_id = Db_Actions::DbSelectRow("SELECT category_dress_type_id FROM cscart_products WHERE product_id=$productID"); if (!isset($category_dress_type_id->empty_result)) { return $category_dress_type_id->category_dress_type_id; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductType();", "public function getProductType()\n {\n }", "public function getProduct_type () {\n\t$preValue = $this->preGetValue(\"product_type\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_type;\n\treturn $data;\n}", "function project_type($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select type_name from manage_property_type where ptype='$id'\"));\n\treturn $name['type_name'];\n\t}", "public function getProductTypeInfo($ptId)\n\t{\n\t\t$sql = \"SELECT * FROM `#__storefront_product_types` WHERE `ptId` = \" . $this->_db->quote($ptId);\n\n\t\t$this->_db->setQuery($sql);\n\t\t$res = $this->_db->loadAssoc();\n\t\treturn $res;\n\t}", "public function getType()\n {\n \n $tipos = \n\n $TypeOfProduct = TypeOfProduct::find($this->type_id); \n\n return $TypeOfProduct->description;\n }", "public function show($id)\n {\n return ProductType::findOrFail($id);\n }", "public static function get_product_type($id)\n {\n if (!$product = wc_get_product($id)) {\n return false;\n }\n return $product->product_type;\n }", "public static function getPurchaseable(string $type, mixed $id) : mixed\n {\n return Product::findOrFail($id);\n }", "private function selectItemType($id)\n {\n $tables = array(\"desktops\" => \"DS\", \"laptops\" => \"LP\"); //this array stores the names of the tables in database\n\n $prefix = substr($id, 0, 2); //all of the product types have unique prefix\n\n return array_search($prefix, $tables);\n }", "public static function getProductTypeId()\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\n\t\tswitch ($input->getCmd('view'))\n\t\t{\n\t\t\tcase 'product':\n\t\t\t\t$model = new GazebosModelProduct;\n\t\t\t\t$id = $model->getItem()->type_id;\n\t\t\t\tbreak;\n\t\t\tcase 'producttype':\n\t\t\t\t$id = $input->getInt('id');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $id;\n\t}", "public function show($productType_id, $id)\n {\n //\n }", "public static function getProductType($unique_id,$merchant_id)\n {\n $query = \"SELECT `type` FROM `jet_product` WHERE `merchant_id`='\".$merchant_id.\"' and `variant_id`='\".$unique_id.\"' LIMIT 0,1\";\n $data = self::sqlRecords($query,'one','select');\n \n if(isset($data['type']) && !empty($data['type'])) {\n return $data['type'];\n } else {\n return false;\n }\n }", "function get_sample_type_info($sample_type_id, $term) { \r\n\t\tglobal $db;\r\n\t\t$query = \"SELECT * from sample_types WHERE sample_type_id='\".$sample_type_id.\"'\";\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t$row = $result->fetch_array();\r\n\t\treturn $row[$term];\r\n\t}", "public function getProductType()\n {\n return Zend_Json::encode($this->escapeHtml($this->getProduct()->getTypeId()));\n }", "private function getType($id) {\n \n $this->loadTypes();\n \n foreach ($this->types as $type) {\n \n if ($type->getId() === $id) return $type;\n }\n \n return NULL;\n }", "private function getType($product)\n { \n $productTypes = $product->types;\n\n if(!$productTypes->isEmpty())\n {\n $typeName=NULL;\n\n foreach ($productTypes as $productType) {\n\n $typeName .= $productType->type_name . \"+\";\n }\n\n return trim($typeName,\"+\");\n\n }\n else\n {\n return NULL;\n }\n }", "public function getTargetType($type) {\n $retObj = array();\n switch ($type) {\n case 'Brand':\n $retObj[] = new ProductBrand($this->targetData);\n $retObj[] = new ProductBrand();\n \n return $retObj;\n break;\n case 'Condition':\n $retObj[] = new ProductCanonicalCondition($this->targetData);\n $retObj[] = new ProductCanonicalCondition();\n \n return $retObj;\n break;\n case 'Category':\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1', $this->targetData);\n $retObj[] = new ProductBiddingCategory('BIDDING_CATEGORY_L1');\n \n return $retObj;\n break;\n case 'Channel':\n $retObj[] = new ProductChannel($this->targetData);\n $retObj[] = new ProductChannel();\n \n return $retObj;\n break;\n case 'Item ID':\n $retObj[] = new ProductOfferId($this->targetData);\n $retObj[] = new ProductOfferId();\n \n return $retObj;\n break;\n case 'Product type':\n $retObj[] = new ProductType('PRODUCT_TYPE_L1', $this->targetData);\n $retObj[] = new ProductType('PRODUCT_TYPE_L1');\n \n return $retObj;\n break;\n case 'Channel exclusivity':\n $retObj[] = new ProductChannelExclusivity($this->targetData);\n $retObj[] = new ProductChannelExclusivity();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_0':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_1':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_2':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_3':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n case 'CUSTOM_ATTRIBUTE_4':\n $retObj[] = new ProductCustomAttribute($type, $this->targetData);\n $retObj[] = new ProductCustomAttribute($type);\n $retObj[] = new ProductCustomAttribute();\n \n return $retObj;\n break;\n \n default:\n break;\n }\n }", "function getProductTypes(){\n\t\t$id = $_GET['id'];\n\t\t$elem_id = $_GET['elem_id'];\n\t\t$wc = $this->getWc($id);\n\t\t$types = array();\n\t\tforeach ($wc as $k=>$v){\n\t\t\t$types[$v['ptid']] = true;\n\t\t}\n\t\tif ($elem_id){\n\t\t\t$elem = $this->getWc($id, $elem_id);\n\t\t\tunset($types[$elem['ptid']]);\n\t\t}\n\t\t$sql = \"SELECT id, name FROM product_types WHERE visible > 0 AND id NOT IN ('\".implode(\"', '\", array_keys($types)).\"')\";\n\t\t$rows = sql_getRows($sql, true);\n\t\treturn $rows;\n\t}", "public static function getProductTypeForProduct(int $productId): int\n {\n if ($productId === 0) {\n return 0;\n }\n\n if (isset(self::$productTypeForProduct[$productId])) {\n return self::$productTypeForProduct[$productId];\n }\n\n self::$productTypeForProduct[$productId] = (int)BackendUtility::getRecord(\n ProductRepository::TABLE_NAME,\n $productId,\n 'product_type'\n )['product_type'] ?? 0;\n\n return self::$productTypeForProduct[$productId];\n }", "public function find($id)\n {\n\n $sql = \"SELECT product.*, brand.name AS brand_name, type.name AS type_name, category.name AS category_name\n FROM product\n JOIN brand ON product.brand_id = brand.id \n JOIN type ON product.type_id = type.id \n JOIN category ON product.category_id = category.id \n WHERE product.id = $id \";\n\n $pdo = Database::getPDO();\n $stmt = $pdo->query($sql);\n\n $product = $stmt->fetchObject(self::class);\n return $product;\n }", "public function getPriceTypes() {\n\t\t$db = JFactory::getDBO();\n\n\t\t// Create a new query object.\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->select($db->quoteName(array('a.id', 'a.name')));\n\t\t$query->from($db->quoteName('#__gtpihpssurvey_ref_price_types', 'a'));\n\t\t\n\t\t//echo nl2br(str_replace('#__','pihps_',$query));\n\t\t$db->setQuery($query);\n\t\treturn $db->loadObjectList('id');\n\t}", "public function get_type()\n {\n return self::$_id;\n }", "public function get_equipment_type();", "public function getTypeSlugByID ($id_type = '') {\n $this->connection->where('id_type', $id_type);\n $result = $this->connection->select('slug', 'types');\n\n if ($result && $result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n return $row['slug'];\n }\n }\n else {\n return NULL;\n }\n }", "public function show($id)\n {\n $prodCat = r_product_type::with('rProductType')\n ->get();\n\n return new JsonResource($prodCat->where('PRODT_ID',$id));\n }", "public function getProductType() {\n return $this->item->getProductType();\n }", "public function getTypes(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_types\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}", "public function get_type();", "public function productType()\n {\n return $this->belongsTo(\\App\\Models\\ProductType::class, \"product_type_id\", \"id\");\n }", "function getQuestionType($question_id) \n\t{\n\t\tglobal $ilDB;\n\t\tif ($question_id < 1) return -1;\n\t\t$result = $ilDB->queryF(\"SELECT type_tag FROM svy_question, svy_qtype WHERE svy_question.question_id = %s AND \" .\n\t\t\t\"svy_question.questiontype_fi = svy_qtype.questiontype_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($question_id)\n\t\t);\n\t\tif ($result->numRows() == 1) \n\t\t{\n\t\t\t$data = $ilDB->fetchAssoc($result);\n\t\t\treturn $data[\"type_tag\"];\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\t}", "protected function get_type_from_id($id)\n\t{\n\t\treturn $this->types->get($id);\n\t}", "function get_products_id_name($product_type) {\r\n $params[0] = array(\"name\" => \":product_type\", \"value\" => &$product_type);\r\n return $this->DBObject->readCursor(\"product_actions.get_products_id_name(:product_type)\", $params);\r\n }", "public static function get($id) {\n // Set the predefined list that can be mapped\n self::$types = [\n 0 => 'Légkondícionáló',\n 1 => 'WC',\n 2 => 'Napelem',\n 3 => 'Kert',\n ];\n\n return (isset(self::$types[$id])) ? self::$types[$id] : ' - ';\n }", "public function retrieveProductTypeByName($name)\n {\n if (isset($this->_productTypeModels[$name])) {\n return $this->_productTypeModels[$name];\n }\n return null;\n }", "public static function getType($id){\n\t\t$output = PDOModel::getSQL(\"piece_style\", \"*\", \"`id` = \" . $id);\n\t\treturn(self::convertObjToPiece($output));\n\t}", "function getTypeName($id){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_id={$id}\", 'type_name');\n}", "function get_by_type( $type_id )\n {\n $this->db->where('type_id', $type_id);\n $this->db->limit(1);\n return $this->db->get('card_types')->row();\n }", "public function get($typeId);", "public function findDevoirType($id,$type)\n\t{\n\t\t$qb = $this->_em->createQueryBuilder();\n\t\n\t\t$qb->select('d')\n\t\t->from('ProjetCoursBundle:Devoir', 'd')\n\t\t->where('d.enseignement = :id')\n\t\t->setParameter('id', $id)\n\t\t->join('d.type', 't')\n\t\t->andWhere('t.nom = :type')\n\t\t->setParameter('type', $type)\n\t\t;\n\t\n\t\n\t\treturn $qb->getQuery()\n\t\t->getResult();\n\t}", "public function getAdType($id)\n {\n $query = \"SELECT ALL FROM adv_type WHERE id = $id\";\n return $this->getQueryData($query, $this->getConnection());\n }", "function get_type_name_by_id_custom1($type,$type_id='',$field='name')\n \t{ $type1='surgery'; //table field name\n \t return $this->db->get_where($type,array($type1.'_id'=>$type_id))->row()->$field; \n \t}", "function get_shipping_type($shipping_profile_id)\n\t{\n\t\t$shipping_profile_id = mysql_escape_string($shipping_profile_id);\n\t\t$sql = \"SELECT shipping_type FROM nm_partner_shipping_profile WHERE shipping_profile_id = $shipping_profile_id\";\n\t\t$result = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($sql);\n\t\treturn end(end($result));\n\t}", "private function get_type() {\n\n\t}", "function get_type_name_by_id_custom($type,$type_id='',$field='name')\n\t{\t$type1='comp_type'; //table field name\n\t\treturn\t$this->db->get_where($type,array($type1.'_id'=>$type_id))->row()->$field;\t\n\t}", "abstract protected function get_typeid();", "public function fetchFieldTypeFromID($id){\n\t\t\treturn Symphony::Database()->fetchVar('type', 0, \"SELECT `type` FROM `tbl_fields` WHERE `id` = '$id' LIMIT 1\");\n\t\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 }", "function find_product($globillnet_id) {\n\n global $db;\n\n $product_id = null;\n $products = $db->get_products_list();\n\n foreach ($products as $product) {\n if (isset($product['globillnet_id']) && $product['globillnet_id']==$globillnet_id) {\n $product_id = $product['product_id'];\n break;\n }\n }\n\n $result = ( $product_id ) ? $product_id : false ;\n\n return $result;\n }", "public function getTypeIDBySlug ($slug = '') {\n $this->connection->where('slug', $slug);\n $result = $this->connection->select('id_type', 'types');\n\n if ($result && $result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) {\n return $row['id_type'];\n }\n }\n else {\n return NULL;\n }\n }", "public function show($id)\n\t{\n\t\t$product_type = $this->product_type->findOrFail($id);\n\n\t\treturn View::make('scaffolds.product_types.show', compact('product_type'));\n\t}", "function getProductType($cat_id,$subcat_id){\n $productType_info= ProductType::find()\n ->where(['cat_id' => $cat_id,'subcat_id'=>$subcat_id])\n ->asArray()\n ->one();\n unset($productType_info['id']); unset( $productType_info['cat_id']); unset( $productType_info['subcat_id']); unset( $productType_info['site_id']);\n if($productType_info['special_upc']){\n $productType_info['special_upc']=explode(',', $productType_info['special_upc']);\n }\n if($productType_info['product_type']){\n $productType_info['product_type']=explode(',', $productType_info['product_type']);\n }\n return $productType_info;\n\n }", "function getProduct($product_id)\n{\n $var = getDataArray(\"select * from Product_with_catogory WHERE product_id =\" . $product_id);\n if (count($var) > 0)\n return $var[0];\n else\n return null;\n}", "public function getProductById(int $id);", "public function getSingleProduct($id){\r\n\r\n\t$query = \"SELECT p.*,c.catName,b.brandName\r\nFROM tbl_product as p,tbl_category as c, tbl_brand as b\r\nWHERE p.catId = c.catId AND p.brandId = b.brandId AND p.productId = '$id'\";\r\n\t$result = $this->db->select($query);\r\n\treturn $result;\r\n}", "public function show($id)\n {\n return $this->type->findOrFail($id);\n }", "public function get_location_type_by_id($p_typeid)\n {\n if (is_numeric($p_typeid) && $p_typeid > 0)\n {\n return $this->retrieve('SELECT * FROM isys_obj_type WHERE isys_obj_type__id = ' . $this->convert_sql_id($p_typeid) . ' AND isys_obj_type__container <> 0;');\n } // if\n\n return null;\n }", "public static function getProductTypeTitle($id = null)\n\t{\n\t\tif (is_null($id))\n\t\t{\n\t\t\t$id = self::getProductTypeId();\n\t\t}\n\n\t\tif (!isset(self::$productTypes[$id]))\n\t\t{\n\t\t\t$result = JFactory::getDbo()->setQuery('SELECT title FROM #__gazebos_producttypes WHERE id = ' . $id)->loadObject();\n\t\t\tself::$productTypes[$id] = $result->title;\n\t\t}\n\n\t\treturn self::$productTypes[$id];\n\t}", "function getResourceTypeName($id){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_id='$id'\", 'type_name');\n}", "function get_booktype($id)\n {\n return $this->db->get_where('booktypes',array('id'=>$id))->row_array();\n }", "function getResourceTypeId($name){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_name='$name'\", 'type_id');\n}", "function getProductNameProductType($parent_admin_id,$DbConnection)\n {\n\t$final_product_type_list=array();\n\t$query_product_type = \"SELECT name FROM product_type USE INDEX(pte_aid_status) WHERE account_id='$parent_admin_id' AND status=1\";\n\t$result_query = mysql_query($query_product_type,$DbConnection);\n\twhile($row=mysql_fetch_object($result_query))\n\t{\t\t\n\t\t$final_product_type_list[]=$row->name;\n\t\t\n\t}\n\treturn $final_product_type_list;\n }", "function gethair_type1($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud -> sql(\"select *, COUNT(hair_type) from pigs_tbl where hair_type='1' \");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['COUNT(hair_type)'];\n\t}\n\n\t$crud->disconnect();\n}", "public function get_hot_product_list($product_id=\"\",$type=\"\")\n\t{\n\t\t\n\t\t$result= $this->db->update('deals',array('deal_feature' => $type),array(\"deal_id\" => $product_id));\n\t\treturn 1;\n\t}", "function backup_migrate_crud_get_item($type, $id) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->item($id);\n }\n}", "function get_product($product_id){\n\t\t\n\t\treturn $this->_make_api_call($product_id,'products');\n\t}", "public function getDrumTypeTable() {\n return $this->param['tblDrumType'];\n }", "function tep_get_products_sale_code($product_id) {\n\t$product_query = tep_db_query(\"select products_model from \".TABLE_PRODUCTS.\" where products_id =\".(int)$product_id );\n\tif (tep_db_num_rows($product_query)) {\n\t\t$product = tep_db_fetch_array($product_query);\n\t\treturn $product['products_model'];\n\t} else {\n\t\treturn false;\n\t}\n}", "public function getFeaturedProduct(){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE type = '1' ORDER BY pid DESC LIMIT 4\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "public function getProduct($id)\n {\n }", "function getResourceTypeIdFromResource($id){\n return sqlSelectOne(\"SELECT * FROM resources WHERE resource_id='$id'\", 'resource_type');\n}", "public function getProduct();", "public function product1(){\r\n\t\t$sql =\"SELECT * FROM `products`,`manufactures`,`protypes` WHERE manufactures.manu_ID = products.manu_ID AND protypes.type_ID = products.type_ID\";\r\n\t\t$result = self::$conn->query($sql);\r\n\t\treturn $this->getData($result);\r\n\t}", "public function get_item_type() {\n $query = $this->db->get('item_type');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "function edd_get_product_to_duplicate($id) {\n\tglobal $wpdb;\n\n\t$post = $wpdb->get_results( \"SELECT * FROM $wpdb->posts WHERE ID=$id\" );\n\tif ( isset( $post->post_type ) && $post->post_type == \"revision\" ){\n\t\t$id = $post->post_parent;\n\t\t$post = $wpdb->get_results( \"SELECT * FROM $wpdb->posts WHERE ID=$id\" );\n\t}\n\treturn $post[0];\n}", "public function getProdById($id){\n\t\t$pid = $this->fm->validation($id);\n\t\t$pid = mysqli_real_escape_string($this->db->link, $pid);\n\t\t$sql = \"SELECT * FROM tbl_product WHERE pid = '$pid' \";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "protected function _get_card_type($id)\n\t{\n\t\treturn model('card_type')->get_info_rule(array(\n\t\t\t'id' => $id,\n\t\t\t'status' => 1,\n\t\t));\n\t}", "public function productdata($prod_id)\n {\n $prodname = $this->Dbmodel->getproduct($prod_id); \n return $prodname;\n }", "public function getproductdetail($prod_id)\n {\n $product = $this->Dbmodel->getproductdata($prod_id); \n return $product;\n }", "function get_request_type($id_request_type){\n $this->db->where('id', $id_request_type);\n $query = $this->db->get('type_request');\n return($query->result());\n }", "public function getKind()\n {\n\t\t$select = $this->_db->select();\n \t$select->from(\"catalog__data_list_property\",\"name\")->where(\"id_property=?\",$this->type_id);\n \t$rs=$this->_db->fetchCol($select);\n \tif(!empty($rs))return $rs[0];\n\t\telse return \"\";\n }", "public function getTypeFacture_id()\n {\n return $this->typeFacture_id;\n }", "function getDataType($connection, $idDataType){\n\t$query = \"SELECT * FROM tDataType WHERE idDataType =\".$idDataType;\n\treturn fetchRowFromDBOnID($connection, $query, $idDataType, \"DataType\");\n}", "function getType() ;", "function getType() ;", "function getType() ;", "function lb_get_merchant_brand_of_product($product_id, $type = 'merchant') {\n if('merchant' == $type) {\n $terms = get_the_terms( $product_id, 'pa_merchant');\n } elseif('brand' == $type) {\n $terms = get_the_terms( $product_id, 'pa_brand');\n } else {\n return false;\n }\n \n error_log('lb_get_merchant_brand_of_product - terms (' . $type . ' for product ID ' . $product_id . '): ' . print_r($terms, true));\n \n $slug = $terms[0]->slug;\n \n // If there is a merchant slug, get the corresponding merchant post.\n // If there is no merchant slug, return false.\n if(!empty($slug)) {\n if('merchant' == $type) {\n $post = lb_get_post_by_slug($slug, 'butiker');\n } elseif('brand' == $type) {\n $post = lb_get_post_by_slug($slug, 'varumarken');\n } else {\n return false;\n }\n } else {\n return false;\n }\n \n error_log('lb_get_merchant_brand_of_product - post: ' . print_r($post, true));\n \n // If no merchant post was found for the merchant slug, return false.\n if(empty($post)) {\n return false;\n }\n\n return $post[0];\n}", "function getTipo($id) {\n\t\t$stm = DB::prepare ( \"SELECT tipo FROM fornecedor WHERE id = :id\" );\n\t\t$stm->bindParam ( ':id', $id, PDO::PARAM_INT );\n\t\t$stm->execute ();\n\t\t$tipo = $stm->fetch ( PDO::FETCH_ASSOC );\n\t\treturn $tipo ['tipo'] == 1 ? 1 : 0;\n\t}", "public function getProductById($id){\n $query = $this->db->get_where('product',array('id' => $id));\n return $query->row(); \n }", "protected function _getProductTypeModel()\n\t{\n\t\treturn $this->getModelFromCache('Brivium_Store_Model_ProductType');\n\t}", "static function getById($id)\n {\n global $objDatabase;\n\n if (!$id) return NULL;\n $arrSql = \\Text::getSqlSnippets(\n '`product`.`id`', FRONTEND_LANG_ID, 'Shop',\n array(\n 'name' => self::TEXT_NAME,\n 'short' => self::TEXT_SHORT,\n 'long' => self::TEXT_LONG,\n 'keys' => self::TEXT_KEYS,\n 'code' => self::TEXT_CODE,\n 'uri' => self::TEXT_URI,\n )\n );\n $query = \"\n SELECT `product`.`id`, `product`.`category_id`,\n `product`.`ord`, `product`.`active`, `product`.`weight`,\n `product`.`picture`,\n `product`.`normalprice`, `product`.`resellerprice`,\n `product`.`discountprice`, `product`.`discount_active`,\n `product`.`stock`, `product`.`stock_visible`,\n `product`.`distribution`,\n `product`.`date_start`, `product`.`date_end`,\n `product`.`manufacturer_id`,\n `product`.`b2b`, `product`.`b2c`,\n `product`.`vat_id`,\n `product`.`flags`,\n `product`.`usergroup_ids`,\n `product`.`group_id`, `product`.`article_id`, \n `product`.`minimum_order_quantity`, \".\n $arrSql['field'].\"\n FROM `\".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products` AS `product`\".\n $arrSql['join'].\"\n WHERE `product`.`id`=$id\";\n $objResult = $objDatabase->Execute($query);\n if (!$objResult) return self::errorHandler();\n if ($objResult->RecordCount() != 1) return false;\n $id = $objResult->fields['id'];\n $strCode = $objResult->fields['code'];\n if ($strCode === null) {\n $strCode = \\Text::getById($id, 'Shop', self::TEXT_CODE)->content();\n }\n $strName = $objResult->fields['name'];\n if ($strName === null) {\n $strName = \\Text::getById($id, 'Shop', self::TEXT_NAME)->content();\n }\n $strShort = $objResult->fields['short'];\n if ($strShort === null) {\n $strShort = \\Text::getById($id, 'Shop', self::TEXT_SHORT)->content();\n }\n $strLong = $objResult->fields['long'];\n if ($strLong === null) {\n $strLong = \\Text::getById($id, 'Shop', self::TEXT_LONG)->content();\n }\n $strUri = $objResult->fields['uri'];\n if ($strUri === null) {\n $strUri = \\Text::getById($id, 'Shop', self::TEXT_URI)->content();\n }\n $strKeys = $objResult->fields['keys'];\n if ($strKeys === null) {\n $strKeys = \\Text::getById($id, 'Shop', self::TEXT_KEYS)->content();\n }\n $objProduct = new Product(\n $strCode,\n $objResult->fields['category_id'],\n $strName,\n $objResult->fields['distribution'],\n $objResult->fields['normalprice'],\n $objResult->fields['active'],\n $objResult->fields['ord'],\n $objResult->fields['weight'],\n $objResult->fields['id']\n );\n $objProduct->pictures = $objResult->fields['picture'];\n $objProduct->resellerprice = floatval($objResult->fields['resellerprice']);\n $objProduct->short = $strShort;\n $objProduct->long = $strLong;\n $objProduct->stock($objResult->fields['stock']);\n $objProduct->stock_visible($objResult->fields['stock_visible']);\n $objProduct->discountprice = floatval($objResult->fields['discountprice']);\n $objProduct->discount_active($objResult->fields['discount_active']);\n $objProduct->b2b($objResult->fields['b2b']);\n $objProduct->b2c($objResult->fields['b2c']);\n $objProduct->date_start($objResult->fields['date_start']);\n $objProduct->date_end($objResult->fields['date_end']);\n $objProduct->manufacturer_id = $objResult->fields['manufacturer_id'];\n $objProduct->uri = $strUri;\n $objProduct->vat_id = $objResult->fields['vat_id'];\n $objProduct->flags = $objResult->fields['flags'];\n $objProduct->usergroup_ids = $objResult->fields['usergroup_ids'];\n $objProduct->group_id = $objResult->fields['group_id'];\n $objProduct->article_id = $objResult->fields['article_id'];\n $objProduct->keywords = $strKeys;\n $objProduct->minimum_order_quantity = $objResult->fields['minimum_order_quantity'];\n // Fetch the Product Attribute relations\n $objProduct->arrRelations =\n Attributes::getRelationArray($objProduct->id);\n//die(\"dfhreh: \".$objProduct->category_id());\n return $objProduct;\n }", "function getDbTypeID($connect, $type_name)\n {\n $type_id = \"\";\n $sql = \"SELECT ID FROM qpkg_type WHERE Name LIKE '$type_name'\";\n $result = mysqli_query($connect, $sql);\n while ($row = mysqli_fetch_array($result)) {\n $type_id = $row['ID'];\n }\n \n\t\treturn $type_id;\n }", "public static function getTaxbyProductID($productid) {\r\n \r\n $dq = Doctrine_Query::create ()->select('s.tax_id as tax_id, s.name as name, s.percentage as percentage')->from ( 'Products p' )\r\n ->leftJoin('p.Taxes s')\r\n ->where('product_id = ?', $productid);\r\n $tax = $dq->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n return isset($tax[0]) ? $tax[0] : null;\r\n }", "public function index($id = null){\n if($id == null){\n $productTypes = ProductType::all(); \n } else {\n $productTypes = ProductType::find($id);\n }\n return $productTypes;\n }", "public static function getTypeName($id){\n return Types::findOne($id);\n }", "public function getProduct( $id ) {\n\t\treturn $this->requester->request('GET', $this->url . '/' . $id);\n\t}", "public function get_type(): string;", "function getAllMaterialTypeById($id){\n\n\t$result = mysqli_query(dbConnection(),\"select *from item_types where id= '$id'\");\n\treturn $result;\n}", "public function read($id) {\n return $this->product->find($id);\n\t}" ]
[ "0.7453759", "0.69906604", "0.67866784", "0.65888214", "0.6587682", "0.6511979", "0.6503158", "0.6491178", "0.64238894", "0.6414557", "0.64011276", "0.63666785", "0.63503695", "0.6309984", "0.63068414", "0.62736684", "0.62623", "0.622652", "0.6197643", "0.61783797", "0.615799", "0.61474705", "0.6144282", "0.6142261", "0.6128539", "0.609251", "0.6067895", "0.60492957", "0.6032308", "0.6032277", "0.6031261", "0.60157377", "0.60089713", "0.60058296", "0.6003774", "0.59952176", "0.5974278", "0.5973454", "0.5959834", "0.59519064", "0.59408784", "0.5936256", "0.59291774", "0.59243613", "0.59039116", "0.5889222", "0.5881965", "0.58784604", "0.5876859", "0.58726025", "0.58692575", "0.58670324", "0.5856772", "0.584942", "0.58490527", "0.5848844", "0.5846353", "0.5846146", "0.5835428", "0.5827436", "0.5824929", "0.58222884", "0.58176094", "0.5815978", "0.5815458", "0.58088917", "0.58044916", "0.5799822", "0.5797977", "0.57844645", "0.57673854", "0.5763825", "0.5755912", "0.5754193", "0.5746265", "0.57417136", "0.5736067", "0.5718991", "0.5717498", "0.5716351", "0.57108855", "0.57056", "0.5703344", "0.5703227", "0.57023484", "0.57018405", "0.57006794", "0.5698256", "0.56954306", "0.568876", "0.56886584", "0.56822425", "0.5680182", "0.56799704", "0.5675692", "0.5672956", "0.5668954", "0.5667323", "0.5667314", "0.56646264" ]
0.75321233
0
/////////////////////////////////////////////////////////////////////// Load recent products
public static function loadRecentProducts($curr_page = 1) { $recent_products = $_SESSION['recently_viewed_products']; $model_type = $_POST['model_type']; switch ($model_type) { case "girl": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=260"); break; case "boy": Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=261"); break; default: Db_Actions::DbSelect("SELECT * FROM cscart_products_categories WHERE category_id=260"); break; } $products_ids = Db_Actions::DbGetResults(); if (!isset($products_ids->empty_result)) { $allowed_products = array(); foreach ($products_ids as $id) { array_push($allowed_products, $id->product_id); } } //First get the products ids from the selected category $product_data = array(); if (!empty($recent_products)) { foreach ($recent_products as $product) { if (in_array($product, $allowed_products)) { $product_data[] = array('product_id' => $product, 'product_name' => self::getProductName($product), 'product_image_url' => $root_url . self::getProductImage($product), 'product_price' => self::getProductPrice($product), 'category_dress_type_id' => $product->category_dress_type_id, 'subcategory_dress_type_id' => $product->subcategory_dress_type_id); } } //display the products $max_products_per_page = 9; $offset = $curr_page * $max_products_per_page - $max_products_per_page; $slice = array_slice($product_data, $offset, $max_products_per_page); $counter = 0; foreach ($slice as $product_item) { $counter++; if ($counter == 1) { ?><div class="cs-product-row"><?php } ?> <div class="cs-product <?php if ($counter == 2) echo 'cs-prd-middle'; ?>" product_id="<?php echo $product_item['product_id'] ?>" product_title="<?php echo $product_item['product_name'] ?>" product_price="<?php echo $product_item['product_price'] ?>" category_ids="<?php echo $product_item['category_id'] ?>" category_dress_type_id="<?php echo $product_item['category_dress_type_id'] ?>" subcategory_dress_type_id="<?php echo $product_item['subcategory_dress_type_id'] ?>"> <img src="<?php echo $product_item['product_image_url'] ?>" width="97" height="126" alt="dress" product_title="<?php echo $product_item['product_name'] ?>" class="cs-main-product-image" draggable="false" category_dress_type_id="<?php echo $product_item['category_dress_type_id'] ?>" subcategory_dress_type_id="<?php echo $product_item['subcategory_dress_type_id'] ?>" /> <h3 class="cs-product-title"><?php echo substr($product_item['product_name'], 0, 14) ?></h3> <h4 class="cs-price">$<?php echo number_format($product_item['product_price'], 2) ?></h4> <div class="cs-variations"> <?php //self::getProductColorVariations($product_item['product_id']); ?> </div> </div> <?php if ($counter == 3) { ?></div><?php $counter = 0; } } } else { echo "<h4 class='empty-result'>Nothing found.</h4>"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function recentProducts(){\n $recent = Product::find()\n ->where(['>=','actual_date',time()]) // show before actual_date\n ->orderBy(['created_at'=>SORT_DESC, 'updated_at'=>SORT_DESC])\n ->limit( self::SHOW_NUMBER_OF_FOOTER_PRODUCT)\n ->all();\n return $recent;\n }", "public static function loadProductsNew()\n {\n $ret = array();\n $sql = \"select * from products ORDER BY DayAdd DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n array_push($ret, $p);\n }\n\n return $ret;\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}", "public function displayNewProducts()\n {\n $time = Carbon::now()->subDays(config('site.products.new.age', 114));\n\n $data = $this->with(['reviews', 'brand'])->where('created_at', '>=', $time)->take(15)->get();\n\n// $data = $this->with(['reviews', 'brand'])->take(15)->get();\n\n return $data->sortByDesc(function ($p) {\n return $p->created_at;\n });\n }", "function kia_recent_products( $args ) {\n\n if ( storefront_is_woocommerce_activated() ) {\n\n $args = apply_filters( 'storefront_recent_products_args', array(\n 'limit' \t\t\t=> 4,\n 'columns' \t\t\t=> 4,\n 'title'\t\t\t\t=> __( 'New In', 'storefront' ),\n ) );\n\n echo '<div class=\"box\" aria-label=\"Recent Products\">';\n\n do_action( 'storefront_homepage_before_recent_products' );\n echo '<div class=\"box-header\"><h2 class=\"box-title\">'. wp_kses_post( $args['title'] ) .'</h2></div>';\n\n do_action( 'storefront_homepage_after_recent_products_title' );\n echo '<div class=\"box-content\">';\n echo storefront_do_shortcode( 'recent_products', array(\n 'per_page' => intval( $args['limit'] ),\n 'columns' => intval( $args['columns'] ),\n ) );\n echo '</div>';\n\n do_action( 'storefront_homepage_after_recent_products' );\n\n echo '</div>';\n }\n }", "private function ml_load_prev()\n\t{\n\t\tif ($this->prod_nums)\n\t\t{\n\t\t\t$prods = array();\n\t\t\tfor ($new_prod_num = 0, $prod_count = count($this->prod_nums); $new_prod_num < $prod_count; ++$new_prod_num)\n\t\t\t{\n\t\t\t\t$old_prod_num = $this->prod_nums[$new_prod_num];\n\t\t\t\t$account = product::create_from_post($old_prod_num);\n\t\t\t\t$prods[] = $account;\n\t\t\t}\n\t\t\tcgi::add_js_var('prods', $prods);\n\t\t}\n\t}", "function find_recent_product_added($limit){\n global $db;\n $sql = \" SELECT p.id,p.name,p.keywords,p.sale_price,p.media_id,c.name AS categorie,\";\n $sql .= \"m.file_name AS image FROM products p\";\n $sql .= \" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .= \" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .= \" ORDER BY p.id DESC LIMIT \".$db->escape((int)$limit);\n return find_by_sql($sql);\n }", "function get_latest_products () {\n require(ROOT_PATH . \"inc/db.php\");\n try {\n $results = $db->query (\"SELECT pname, price, image, description, cname\n FROM categories, products\n WHERE products.category_id = categories.id\n ORDER BY date_added DESC\n LIMIT 4\");\n } catch (PDOException $e) {\n echo \"error selecting products\" . $e;\n }\n $products_array = $results->fetchAll (PDO::FETCH_ASSOC);\n return $products_array;\n}", "public function loadPreviousItems()\n {\n //first get it out of db.\n if ($orderId = $this->_order->check_cart($this->_auth->id)) {\n $order = $this->_order->get_order($orderId);\n $this->_items = unserialize($order['items']); \n $this->_shipping = array();\n $this->_shippingCost = array();\n $this->_salesTax = array();\n $this->_total = 0;\n $this->persist();\n }\n }", "function get_recent_items($num = 10)\n{\n return get_db()->getTable('Item')->findBy(array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "function setwood_recent_products( $args ) {\n\n if ( is_woocommerce_activated() ) {\n\n $args = apply_filters( 'setwood_recent_products_args', array(\n 'limit' \t\t\t=> 4,\n 'columns' \t\t\t=> 4,\n 'title'\t\t\t\t=> __( 'New In', 'setwood' ),\n ) );\n\n echo '<section class=\"setwood-product-section setwood-recent-products\">';\n\n do_action( 'setwood_homepage_before_recent_products' );\n\n echo '<h2 class=\"section-title\">' . wp_kses_post( $args['title'] ) . '</h2>';\n\n do_action( 'setwood_homepage_after_recent_products_title' );\n\n echo setwood_do_shortcode( 'recent_products', array(\n 'per_page' => intval( $args['limit'] ),\n 'columns' => intval( $args['columns'] ),\n ) );\n\n do_action( 'setwood_homepage_after_recent_products' );\n\n echo '</section>';\n }\n }", "public function get_latest_products()\n\t{\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name')->from('product, category, brand')->where(\"product.product_status = 1 AND product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product.product_balance > 0\")->order_by(\"created\", 'DESC');\n\t\t$query = $this->db->get('',8);\n\t\t\n\t\treturn $query;\n\t}", "function apptivo_recent_products($per_page=8,$orderby='date',$order='desc')\n{\n\twp_reset_query();\n\t$args = array(\n\t\t'post_type'\t=> 'item',\n\t\t'post_status' => 'publish',\t \n\t\t'posts_per_page' => $per_page,\n\t\t'orderby' => $orderby,\n\t\t'order' => $order,\n\t 'meta_key' \t=> '_apptivo_sale_price',\n\t\t'meta_query' => array(\n\tarray('key' => '_apptivo_enabled','value' => 'yes','compare' => '=','type' => 'CHAR')\n\t)\n\t);\n\n\tquery_posts($args);\n}", "public static function loadProductsView()\n {\n $ret = array();\n $sql = \"select * from products ORDER BY NView DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n $tinyDes = $row[\"TinyDes\"];\n $fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n $quantity = $row[\"Quantity\"];\n $catId = $row[\"CatID\"];\n $view = $row[\"NView\"];\n $dayAdd = $row[\"DayAdd\"];\n $classify = $row[\"Classify\"];\n\n $p = new Products($proId, $proName, $tinyDes, $fullDes, $price, $quantity, $catId, $view, $dayAdd, $classify);\n array_push($ret, $p);\n }\n\n return $ret;\n }", "public function getLatestProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table ORDER BY added LIMIT 4;\";\n $product = $this->db->executeFetchAll($sql);\n return $product;\n }", "function get_recent_collections($num = 10)\n{\n return get_records('Collection', array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "function getNewestProducts()\n {\n $sql = self::$connection->prepare(\"SELECT * FROM products ORDER BY created_at DESC LIMIT 3\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "public function getNewProducts(){\n\t\t// get the products\n\t\t$products = $this->getProducts();\n\n\t\t$newProducts = [];\n\n\t\t// extract the 3 lastest sold items\n\t\tfor($i=0 ; $i < 3 ; $i++){\n\t\t\tarray_push($newProducts, array_pop($products));\n\t\t}\n\n\t\treturn $newProducts;\n\t}", "function recent_items($count = 10)\n{\n $items = get_recent_items($count);\n if ($items) {\n $html = '';\n foreach ($items as $item) {\n $html .= get_view()->partial('items/single.php', array('item' => $item));\n release_object($item);\n }\n } else {\n $html = '<p>' . __('No recent items available.') . '</p>';\n }\n return $html;\n}", "public function findLatest()\n {\n return $this->productRepository->getLatest();\n }", "public static function loadProductsTopSale()\n {\n $ret = array();\n $sql = \"select p.ProID,p.ProName,p.Price, SUM(od.quantity) from products p,orderdetails od \n\t\t\t\twhere p.ProID = od.ProId\n\t\t\t\tGROUP BY p.ProID\n\t\t\t\tORDER BY od.quantity DESC limit 0,10\";\n $list = DataProviderMain::execQuery($sql);\n\n while ($row = mysqli_fetch_array($list)) {\n $proId = $row[\"ProID\"];\n $proName = $row[\"ProName\"];\n //$tinyDes = $row[\"TinyDes\"];\n //$fullDes = $row[\"FullDes\"];\n $price = $row[\"Price\"];\n //$quantity = $row[\"Quantity\"];\n //$catId = $row[\"CatID\"];\n //$view = $row[\"NView\"];\n //$dayAdd = $row[\"DayAdd\"];\n //$classify =$row[\"Classify\"];\n\n $p = new Products($proId, $proName, '', '', $price, '', '', '', '', '');\n array_push($ret, $p);\n }\n\n return $ret;\n }", "public function load_products() {\n\t\t$this->get_products_posts();\n\t\tif ( $this->posts !== null ) {\n\t\t\tforeach ( $this->posts as $ps_post ) {\n\t\t\t\t$this->add( new ShowcaseProduct( $ps_post ) );\n\t\t\t}\n\t\t}\n\t}", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "protected function get_more_products() {\n $more_products = array();\n $trnst = get_transient( $this->token . \"-more-a\" );\n //** If we do not have cache ( transient ), do request to get the list of all available products */\n if( !$trnst || !is_array( $trnst ) ) {\n $target_url = $this->api_url . 'products.json';\n $request = wp_remote_get( $target_url, array( 'sslverify' => false ) );\n if( is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) != 200 ) {\n $this->error = $request;\n return $more_products;\n } else {\n $response = wp_remote_retrieve_body( $request );\n $response = @json_decode( $response, true );\n if( empty( $response ) || !is_array( $response ) ) {\n return $more_products;\n } else {\n $locale = get_locale();\n $products = !empty( $response[ $locale ][ 'products' ] ) ? \n $response[ $locale ][ 'products' ] : ( !empty( $response[ 'en_US' ][ 'products' ] ) ? $response[ 'en_US' ][ 'products' ] : false );\n if( empty( $products ) || !is_array( $products ) ) {\n return $more_products;\n }\n foreach( $products as $product ) {\n $product = wp_parse_args( $product, array(\n 'name' => '',\n 'description' => '',\n 'icon' => '',\n 'url' => '',\n 'type' => 'plugin',\n 'product_id' => '',\n 'referrer' => false,\n 'requires' => false,\n 'tested' => false,\n 'order' => 10,\n ) );\n if( !empty( $product[ 'referrer' ] ) ) {\n $product[ 'referrer' ] = !is_array( $product[ 'referrer' ] ) ? explode( ',', $product[ 'referrer' ] ) : $product[ 'referrer' ];\n if( in_array( $this->slug, $product[ 'referrer' ] ) ) {\n $more_products[] = $product;\n }\n }\n }\n //** Sort the list */\n usort($more_products, function( $a,$b ) {\n if ( $a['order'] == $b['order'] ) {\n return 0;\n }\n return ( $a['order'] < $b['order'] ) ? -1 : 1;\n });\n //** Set transient for one day */\n set_transient( $this->token . \"-more\", $more_products, (60 * 60 * 24) );\n }\n }\n } else {\n $more_products = $trnst;\n }\n \n //** Determine if plugin from the list is already installed and activated */\n //** There is not check condition for 'theme' */\n if( !empty( $more_products ) ) {\n $reference_list = $this->get_product_reference_list();\n foreach( $more_products as $k => $product ) {\n if( $this->slug == $product[ 'product_id' ] ) {\n unset( $more_products[ $k ] );\n continue;\n }\n if( !empty( $reference_list ) && is_array( $reference_list ) ) {\n foreach( $reference_list as $reference ) {\n if( $reference[ 'product_id' ] == $product[ 'product_id' ] ) {\n unset( $more_products[ $k ] );\n }\n }\n }\n }\n }\n //echo \"<pre>\"; print_r( $more_products ); echo \"</pre>\"; die();\n return $more_products;\n }", "public function getNewProduct(){\n\t\t$sql = \"SELECT * FROM tbl_product ORDER BY pid DESC LIMIT 4\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "public function load_more_promoted_products()\n {\n post_method();\n $offset = clean_number($this->input->post('offset', true));\n $promoted_products = get_promoted_products($offset, $this->promoted_products_limit);\n\n $data_json = array(\n 'result' => 0,\n 'html_content' => \"\",\n 'offset' => $offset + $this->promoted_products_limit,\n 'hide_button' => 0,\n );\n $html_content = \"\";\n if (!empty($promoted_products)) {\n foreach ($promoted_products as $product) {\n $vars = array('product' => $product, 'promoted_badge' => false);\n $html_content .= '<div class=\"col-6 col-sm-6 col-md-4 col-lg-3 col-product\">' . $this->load->view(\"product/_product_item\", $vars, true) . '</div>';\n }\n $data_json['result'] = 1;\n $data_json['html_content'] = $html_content;\n if ($offset + $this->promoted_products_limit >= get_promoted_products_count()) {\n $data_json['hide_button'] = 1;\n }\n }\n echo json_encode($data_json);\n }", "public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}", "function tep_cache_xsell_products($auto_expire = false, $refresh = false) {\n global $HTTP_GET_VARS, $language, $languages_id;\n\n $cache_output = '';\n\n if (isset($HTTP_GET_VARS['products_id']) && is_numeric($HTTP_GET_VARS['products_id'])) {\n if (($refresh == true) || !read_cache($cache_output, 'xsell_products-' . $language . '.cache' . $HTTP_GET_VARS['products_id'], $auto_expire)) {\n ob_start();\n include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);\n $cache_output = ob_get_contents();\n ob_end_clean();\n write_cache($cache_output, 'xsell_products-' . $language . '.cache' . $HTTP_GET_VARS['products_id']);\n }\n }\n\n return $cache_output;\n }", "public function getNewProducts(){\r\n\t\treturn $this->query(\"SELECT * FROM beer WHERE is_new = '1'\");\r\n\t}", "function get_recent_files($num = 10)\n{\n return get_records('File', array('sort_field' => 'added', 'sort_dir' => 'd'), $num);\n}", "function get_temp_products() {\r\n return $this->DBObject->readCursor(\"product_actions.get_temp_products\", null);\r\n }", "public function ProductsNew()\n {\n return DB::table('products')->orderBy('created_at','desc')->get();\n }", "function load_product_info()\n {\n if (self::get_total_number_of_courses() > 0) {\n //cycle through course(s), load productInfo if available\n foreach ($this->courses as $key => $course) {\n $this->courses[$key] = array_merge($course,$this->get_product_info($course['course_id']));\n foreach ($course['modules'] as $module){\n $course['modules'][$module['module_id']]['product_info'] = $this->get_product_info($module['module_id']);\n }\n }\n }\n }", "function find_recent_sale_added($limit){\n global $db;\n $sql = \"SELECT s.id,s.qty,s.price,s.date,p.name\";\n $sql .= \" FROM sales s\";\n $sql .= \" LEFT JOIN products p ON s.product_id = p.id\";\n $sql .= \" ORDER BY s.date DESC LIMIT \".$db->escape((int)$limit);\n return find_by_sql($sql);\n}", "public function swc_recent_product_args( $args ) {\n\t\t$title \t\t\t\t\t= get_theme_mod( 'swc_homepage_recent_products_title', __( 'Recent Products', 'storefront-woocommerce-customiser' ) );\n\t\t$columns \t\t\t\t= get_theme_mod( 'swc_homepage_recent_products_columns', '4' );\n\t\t$limit \t\t\t\t\t= get_theme_mod( 'swc_homepage_recent_products_limit', '4' );\n\n\t\t$args['title']\t\t\t= $title;\n\t\t$args['columns'] \t\t= $columns;\n\t\t$args['limit'] \t\t\t= $limit;\n\n\t\treturn $args;\n\t}", "public function Magento_Latest_Products_Widget(){\r\n\t\t// Settings\r\n\t\t$widget_ops = array('classname' => 'Magento-Latest-Products-Widget', 'description' => __('Shows the latest products in your Magento store.', 'pronamic-magento-plugin'));\r\n\r\n\t\t// Widget control settings. \r\n\t\t$control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'magento_latest_products');\r\n\t\t\r\n\t\t// Create the widget.\r\n\t\t$this->WP_Widget('magento_latest_products', __('Magento Latest Products', 'pronamic-magento-plugin'), $widget_ops, $control_ops);\r\n\t}", "function getMostViewedProducts($nbProductsShown) {\r\n global $tableProducts;\r\n\r\n $dbc = connection();\r\n $dbc->quote($tableProducts);\r\n\r\n //On récupère les produits les plus vus si ils n'ont pas expiré\r\n //On récupère aussi les liens vers leurs images et on les organise par leur nombre de vues\r\n $req = 'SELECT DISTINCT p.id AS idProduct, p.title as productTitle, p.short_desc, MIN(m.src) AS mediaSource,'\r\n . ' m.isImage, p.view_count, p.is_frontpage '\r\n . 'FROM products AS p '\r\n . 'INNER JOIN products_has_medias AS pm ON p.id = pm.id_products '\r\n . 'INNER JOIN medias AS m ON pm.id_medias = m.id '\r\n . 'WHERE m.isImage = 1 '\r\n . 'AND NOW() > availability_date '\r\n . 'AND NOW() < expiration_date '\r\n . 'GROUP BY p.title '\r\n . 'ORDER BY view_count DESC '\r\n . 'LIMIT ' . $nbProductsShown;\r\n\r\n $requPrep = $dbc->prepare($req); // on prépare notre requête\r\n $requPrep->execute();\r\n $data = $requPrep->fetchAll(PDO::FETCH_OBJ);\r\n $requPrep->closeCursor();\r\n\r\n return $data;\r\n}", "private function product_batch()\n\t{\n\t\t// add call to trigger datagrab here\n\t\t//file_get_contents(ee()->config->item('base_url') . '?ACT=25&id=9');\n\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\t\t$update_count = ee()->sync_db->count_all_results('products');\n\n\t\tif($update_count > 0)\n\t\t{\t\n\t\t\t// create curl resource \n\t $ch = curl_init(); \n\n\t // set url \n\t curl_setopt($ch, CURLOPT_URL, ee()->config->item('base_url') . '?ACT=25&id=' . ee()->config->item('integration_product_import_id')); \n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); \n\t curl_setopt($ch, CURLOPT_TIMEOUT, 300); \n\t curl_exec($ch); \n\t curl_close($ch);\n \t}\n\t}", "public function getViewedProducts_List () {\n global $app;\n $_items = array();\n $viewedProductsIDs = isset($_SESSION[$this->_listKey_Recent]) ? $_SESSION[$this->_listKey_Recent] : array();\n foreach ($viewedProductsIDs as $productID) {\n $_items[] = $this->getProductByID($productID);\n }\n $dataList = $app->getDB()->getDataListFromArray($_items);\n return $dataList;\n }", "function newItems(){\n\t\t\t\t$sql = 'SELECT *\n\t\t\t\tFROM product\n\t\t\t\tORDER BY product.product_id DESC\n\t\t\t\tLIMIT 5' \n\t\t\t\t;\n\t\t\t\t$Q = $this-> db-> query($sql);\n\t\t\t\tforeach ($Q-> result_array() as $row){\n\t\t\t\t}\n\t\t\t\treturn $Q;\n\t\t\t\t}", "public function bestProductsAction()\n\t{\n $this->checkShopToken();\n\t\t\n\t\t$config = EasymarketingConfig::getInstance();\n \n $limit = Shopware()->Front()->Request()->getParam('limit');\n $most_sold_since = Shopware()->Front()->Request()->getParam('most_sold_since');\n $most_sold_since_date = date('Y-m-d H:i:s', $most_sold_since);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t$pids = Shopware()->Db()->fetchAll(\"SELECT sacro.articleID AS id, (SELECT SUM(od.quantity) FROM s_order_details od WHERE od.articleID = sacro.articleID AND od.modus = 0) as sales\n\t\t\t\t\t\t\t\t\t\t\t\tFROM s_articles_categories_ro sacro \n INNER JOIN s_order_details od ON sacro.articleID = od.articleID\n \t\t\t\t\t\t\t\tINNER JOIN s_order o ON od.orderID = o.id\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN s_articles sa ON od.articleID = sa.id\n WHERE o.ordertime > '\".$most_sold_since_date.\"' AND sa.active = 1 AND (sacro.categoryID = '\".$config->getRootCategoryID().\"' OR sacro.parentCategoryID = '\".$config->getRootCategoryID().\"')\n GROUP BY sacro.articleID\n \t\t\t\t\t\t\t\tORDER BY SUM(od.quantity) DESC\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \".$limit);\n\t\t\t\t\t\t\t\t\t\t\t\n $i = 0;\n\t\t\n\t\t$productsdata = array();\n\t\t\n\t\tif(count($pids) > 0)\n\t\t{\n\t\t\tforeach ($pids as $key => $val)\n\t\t\t{\n\t\t\t\t$productsdata[$i] = array('id' => $val['id'], 'sales' => (int)$val['sales']);\n\t\t\t\t$i++;\n\t\t\t} \n\t\t} else {\n\t\t\t$test_product_id = Shopware()->Db()->fetchOne(\"SELECT sacro.articleID AS id FROM s_articles_categories_ro sacro LEFT JOIN s_articles sa ON sa.id = sacro.articleID WHERE sa.active = 1 AND (sacro.categoryID = '\".$config->getRootCategoryID().\"' OR sacro.parentCategoryID = '\".$config->getRootCategoryID().\"') GROUP BY sacro.articleID ORDER BY sacro.articleID LIMIT 1\");\n\t\t\t$productsdata[0] = array('id' => $test_product_id['id'], 'sales' => 0);\n\t\t}\n\t\t\n $jsondata = array(\n 'limit' => $limit,\n 'most_sold_since' => $most_sold_since,\n 'products' => $productsdata\n );\n \n\t\t$this->printOutput($jsondata);\n }", "public function get_all_product_information () {\n $this->json_source_file = file_get_contents(\"products.json\");\n $this->json_source_array = json_decode($this->json_source_file,true);\n\n }", "public function getItems()\n\t{\n\t\t// Connect db\n\t\t\t$db\t\t\t\t\t\t\t\t\t= $this->getDbo();\n\t\t\t$query\t\t\t\t\t\t\t\t= $db->getQuery(true);\n\t\t\t$user\t\t\t\t \t\t\t\t= & JFactory::getUser();\n\n\t\t$query->select('tm.*');\n\t\t$query->from('#__jereverseauction_products AS tm');\n\t\t$query->where('tm.user_id = '.$user->id);\n\t\t$db->setQuery($query);\n\t\t$product\t\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\tif ($error = $db->getErrorMsg()) {\n\t\t\tthrow new Exception($error);\n\t\t}\n\t\tif( empty($user->id) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PLEASE_LOGIN'));\n\t\t}else if( empty($product) ) {\n\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_FOUND'));\n\t\t} else {\n\t\t\t$query->where('tm.published = 1 || tm.published = 0');\n\t\t\t$query->order('tm.id');\n\n\t\t\t// Join over the categories.\n\t\t\t$query->select( 'cat.title AS category_title' );\n\t\t\t$query->join( 'LEFT', '#__categories AS cat ON cat.id = tm.catid' );\n\n\t\t\t$query->select( 'com.id as comm_id' );\n\t\t\t$query->join( 'LEFT', '#__jereverseauction_commission AS com ON com.prod_id = tm.id' );\n\n\t\t\t$products\t\t\t\t\t\t\t\t= $db->loadObjectList();\n\n\t\t\tif( empty( $products )) {\n\t\t\t\tJError::raiseNotice(404, JText::_('COM_JEREVERSE_AUCTION_ERROR_PRODUCTS_NOT_PUBLISHED'));\n\t\t\t}\n\n\t\t\t$this->_total\t\t\t\t\t\t= count($products);\n\n\t\t\tif ($this->getState('limit') > 0) {\n\t\t\t\t$this->_data\t\t\t\t\t= array_splice($products, $this->getState('limitstart'), $this->getState('limit'));\n\t\t\t} else {\n\t\t\t\t$this->_data\t\t\t\t\t= $products;\n\t\t\t}\n\n\t\t\treturn $this->_data;\n\t\t}\n\t}", "function get_products() {\n\tif (file_exists(\"./database/products\")) {\n\t\t$fp = fopen(\"./database/products\", \"r\");\n\t\tif (flock($fp, LOCK_SH)) { // acquière un verrou exclusif\n\t\t\t$file_products = file_get_contents(\"./database/products\");\n\t\t\tfflush($fp); // libère le contenu avant d'enlever le verrou\n\t\t\tflock($fp, LOCK_UN); // Enlève le verrou\n\t\t} else {\n\t\t\techo \"Impossible de verrouiller le fichier !\";\n\t\t}\n\t\tfclose($fp);\n\t\treturn unserialize($file_products);\n\t}\n}", "function getRecentChanges()\r\n\t{\r\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\r\n\t\t$changes = ilWikiPage::getRecentChanges(\"wpg\", $this->wiki_id);\r\n\t\t$this->setDefaultOrderField(\"date\");\r\n\t\t$this->setDefaultOrderDirection(\"desc\");\r\n\t\t$this->setData($changes);\r\n\t}", "function getOfferSpecial2() {\n\t$db =& JFactory::getDBO();\n\t$query = \"SELECT p.*, pf.file_url FROM\n\t\t#__cp_category c JOIN \n\t\t(#__cp_products p JOIN\n\t\t#__cp_product_files pf ON pf.product_id = p.product_id)\n\t\tON c.category_id=p.category_id \n\t\tWHERE p.`featured` = 1 AND p.`published` = 1 \".getWhere().\" GROUP BY p.product_id\";\n\n\t$db->setQuery($query);\n\t$rows = $db->loadObjectList();\n\treturn $rows;\n}", "public function getFeaturedProduct(){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE type = '1' ORDER BY pid DESC LIMIT 4\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "public function track_product_view_always() {\n\n\t\t\tglobal $post;\n\n\t\t\tif ( empty( $_COOKIE['woocommerce_recently_viewed'] ) ) { // @codingStandardsIgnoreLine.\n\t\t\t\t$viewed_products = array();\n\t\t\t} else {\n\t\t\t\t$viewed_products = wp_parse_id_list( (array) explode( '|', wp_unslash( $_COOKIE['woocommerce_recently_viewed'] ) ) ); // @codingStandardsIgnoreLine.\n\t\t\t}\n\n\t\t\t// Unset if already in viewed products list.\n\t\t\t$keys = array_flip( $viewed_products );\n\n\t\t\tif ( isset( $keys[ $post->ID ] ) ) {\n\t\t\t\tunset( $viewed_products[ $keys[ $post->ID ] ] );\n\t\t\t}\n\n\t\t\t$viewed_products[] = $post->ID;\n\n\t\t\tif ( count( $viewed_products ) > 21 ) {\n\t\t\t\tarray_shift( $viewed_products );\n\t\t\t}\n\n\t\t\t// Store for session only.\n\t\t\twc_setcookie( 'woocommerce_recently_viewed', implode( '|', $viewed_products ) );\n\n\t\t}", "public function get_recent($limit = 3){\n\t\t$limit = (int) $limit;\n\t\t//$this->set_published();\n\t\t$this->db->limit($limit);\n\t\treturn parent::get();\n\t}", "function get_recent_orders(){\n\t $orders = $this->Order->get_recent_orders();\n\t if($this->params['requested']){\n\t return $orders;\n\t }else{\n\t $this->set('orders', $orders);\n\t }\n \n\t}", "function getProducts()\n {\n // Check the registry to see if our Tienda class has been overridden\n if ( !class_exists('Tienda') ) \n JLoader::register( \"Tienda\", JPATH_ADMINISTRATOR.\"/components/com_tienda/defines.php\" );\n \n // load the config class\n Tienda::load( 'Tienda', 'defines' );\n \n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n \tJModel::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/models' );\n\n \t$user = JFactory::getUser();\n \t\n // get the model\n \t$model = JModel::getInstance( 'OrderItems', 'TiendaModel' );\n $model->setState( 'limit', $this->params->get( 'max_number', '5') );\n $model->setState( 'filter_userid', $user->id );\n $model->setState( 'order', 'created_date' );\n $model->setState( 'direction', 'DESC' );\n \n $query = $model->getQuery();\n $query->select( \"MAX(o.order_id) AS order_id\" );\n $query->select( \"MAX(o.created_date) AS created_date\" );\n \n if ($this->params->get('display_downloads_only'))\n {\n $query->join('LEFT', '#__tienda_productfiles AS files ON tbl.product_id = files.product_id');\n $query->where( \"files.productfile_id IS NOT NULL\" );\n }\n \n $query->group('tbl.product_id');\n $model->setQuery( $query );\n \n $router = Tienda::getClass('TiendaHelperRoute', 'helpers.route');\n $product = Tienda::getClass('TiendaHelperProduct', 'helpers.product');\n \tif ($items = $model->getList())\n \t{\n \t foreach ($items as $item)\n \t {\n \t $category = null;\n if ($categories = $product->getCategories( $item->product_id ))\n {\n $category = $categories[0];\n } \n \t $item->link = $router->product( $item->product_id, $category ); \n \t }\n \t}\n \t\n \treturn $items;\n }", "public static function retrieveRecentNews() {\n return R::findAll( 'news' , ' ORDER BY date_added DESC LIMIT 10 ' );\n }", "function ciniki_merchandise_web_productLoad($ciniki, $tnid, $args) {\n \n $strsql = \"SELECT ciniki_merchandise.id, \"\n . \"ciniki_merchandise.uuid, \"\n . \"ciniki_merchandise.name, \"\n . \"ciniki_merchandise.permalink, \"\n . \"ciniki_merchandise.flags, \"\n . \"ciniki_merchandise.primary_image_id, \"\n . \"'' AS primary_image_caption, \"\n . \"ciniki_merchandise.synopsis, \"\n . \"ciniki_merchandise.description \"\n . \"FROM ciniki_merchandise \"\n . \"WHERE ciniki_merchandise.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n if( isset($args['permalink']) && $args['permalink'] != '' ) {\n $strsql .= \"AND ciniki_merchandise.permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \";\n } elseif( isset($args['id']) && $args['id'] > 0 ) {\n $strsql .= \"AND ciniki_merchandise.id = '\" . ciniki_core_dbQuote($ciniki, $args['id']) . \"' \";\n } else {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.27', 'msg'=>'No product specified'));\n }\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.merchandise', 'product');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.28', 'msg'=>'Product not found', 'err'=>$rc['err']));\n }\n if( !isset($rc['product']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.merchandise.29', 'msg'=>'Unable to find Product'));\n }\n $product = $rc['product'];\n\n //\n // Get the images\n //\n if( isset($args['images']) && $args['images'] == 'yes' ) {\n $strsql = \"SELECT id, \"\n . \"name AS title, \"\n . \"permalink, \"\n . \"flags, \"\n . \"image_id, \"\n . \"description \"\n . \"FROM ciniki_merchandise_images \"\n . \"WHERE product_id = '\" . ciniki_core_dbQuote($ciniki, $product['id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.merchandise', array(\n array('container'=>'images', 'fname'=>'id', 'fields'=>array('id', 'title', 'permalink', 'flags', 'image_id', 'description')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['images']) ) {\n $product['images'] = $rc['images'];\n } else {\n $product['images'] = array();\n }\n if( $product['primary_image_id'] > 0 ) {\n $found = 'no';\n foreach($product['images'] as $image) {\n if( $image['image_id'] == $product['primary_image_id'] ) {\n $found = 'yes';\n }\n }\n if( $found == 'no' ) {\n array_unshift($product['images'], array('title'=>'', 'flags'=>1, 'permalink'=>$product['uuid'], 'image_id'=>$product['primary_image_id'], 'description'=>''));\n }\n }\n }\n\n return array('stat'=>'ok', 'product'=>$product);\n}", "public function getRecentlyViewedItems()\n\t{\n\t\t$recentlyViewed = new Zend_Session_Namespace('recentlyViewed'); // Creating a new session with namespace\n\t\tif(!empty($recentlyViewed->recentlyViewedObject))\n\t\t{\t\n\t\t\techo '<div class=\"recentviewd\"><label id=\"recentviewtext\">Recently viewed</label><ul>';\n\t\t\t$rvSize = 0;\n\t\t\tif(sizeof($recentlyViewed->recentlyViewedObject) > 3)\n\t\t\t\t$rvSize = 3;\n\t\t\telse\n\t\t\t\t$rvSize = sizeof($recentlyViewed->recentlyViewedObject);\n\t\t\t\n\t\t\t$menuName = '';\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tfor($i=0;$i<$rvSize;$i++)\n\t\t\t{\n\t\t\t\t$pagesplit = explode(\"!@#\",$recentlyViewed->recentlyViewedObject[$i]);\n\t\t\t\t$pagesplitName = $pagesplit[0]; \n\t\t\t\t$pagesplitLink = $pagesplit[1];\n\n\t\t\t\t/* Instead of url - display menu name for each list item*/\n\t\t\t\tif($pagesplitName != 'dashboard' && $pagesplitName != 'welcome' && $pagesplitName != 'viewsettings')\n\t\t\t\t{\n\t\t\t\t\t$selectQuery1 = \"select m.menuName from main_menu m where m.url = '/\".$pagesplitName.\"'\";\n\t\t\t\t\t$db = Zend_Db_Table::getDefaultAdapter();\n\t\t\t\t\t$sql=$db->query($selectQuery1);\n\t\t\t\t\t$resultarray = $sql->fetchAll();\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($resultarray))\n\t\t\t\t\t\t$menuName = ucfirst($resultarray[0]['menuName']);\n\t\t\t\t\telse $menuName = ucfirst($pagesplitName);\n\t\t\t\t}\n\t\t\t\telse $menuName = ucfirst($pagesplitName);\n\t\t\t\t/* Display of add, edit or view in each list item */\n\t\t\t\t$urldata = explode(\"/\",$pagesplitLink);\n\t\t\t\tif(isset($urldata[3]))\n\t\t\t\t{\n\t\t\t\t\tif($urldata[3] == 'add')\n\t\t\t\t\t\t$menuName .= '-Add';\n\t\t\t\t\telse if($urldata[3] == 'edit')\n\t\t\t\t\t\t$menuName .= '-Edit';\n\t\t\t\t\telse if($urldata[3] == 'view')\n\t\t\t\t\t\t$menuName .= '-View';\n\t\t\t\t\telse if($urldata[3] == 'viewsettings')\n\t\t\t\t\t\t$menuName = 'Settings';\n\t\t\t\t\telse if($urldata[3] == 'viewprofile')\n\t\t\t\t\t\t$menuName = 'Profile';\n\t\t\t\t\telse if($urldata[3] == 'changepassword')\n\t\t\t\t\t\t$menuName = 'Change password';\n\t\t\t\t}\t\t\t\t\t\t\t \n\t\t\t\techo '<li><span id=\"redirectlink\" onclick =\"redirecttolink(\\''.$pagesplitLink.'\\',\"\");\">'.$menuName.'</span><a href=\"javascript:void(0);\" onClick=\"closetab(this,\\''.$pagesplitName.'\\',\\''.$pagesplitLink.'\\')\"></a></li>';\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t} \n\t\t$tmpPageLink = explode(\"/\",$_SERVER['REQUEST_URI']); \n\t\t$pageName = $tmpPageLink[2];\n\t\t$pageLink = $_SERVER['REQUEST_URI'];\n\t\t$a= 'index';\n\t\t\n\t\tif(isset($recentlyViewed->recentlyViewedObject))\n\t\t{\n\t\t\t\n\t\t\tif(sizeof($recentlyViewed->recentlyViewedObject) > 3 && $pageLink != BASE_URL && !in_array($pageName.\"!@#\".$pageLink, $recentlyViewed->recentlyViewedObject))\n\t\t\t{\n\t\t\t\tarray_shift($recentlyViewed->recentlyViewedObject);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tif($pageName != 'public')\n\t\t\t{\n\t\t\t\tif(!in_array($pageName.\"!@#\".$pageLink, $recentlyViewed->recentlyViewedObject))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif($pageLink != BASE_URL)\n\t\t\t\t\t{\n\t\t\t\t\t\tarray_push($recentlyViewed->recentlyViewedObject,$pageName.\"!@#\".$pageLink);\n\t\t\t\t\t}\n\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$recentlyViewed->recentlyViewedObject = array();\n\t\t\t\n\t\t\tif($pageLink != BASE_URL && !in_array($pageName.\"!@#\".$pageLink, $recentlyViewed->recentlyViewedObject)) \n\t\t\t\tarray_push($recentlyViewed->recentlyViewedObject,$pageName.\"!@#\".$pageLink);\n\t\t\t\n\t\t}\n\t\t\n\n\t\techo '</ul></div>';\n\t}", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function findNewProd()\r\n {\r\n $query = $this->getEntityManager()\r\n ->createQuery(\"select m from CondorsTnMallBundle:Produit m ORDER BY m.datecreation DESC \")\r\n ->setMaxResults(5);\r\n\r\n return $query->getResult();\r\n\r\n }", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function getProductTopList($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n DB::enableQueryLog();\n // execute\n $dbQuery = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('products', 'order_lines.product_id', '=', 'products.id')\n ->join('categories', 'products.category_id', '=', 'categories.id')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->join('units', 'products.default_unit_id', 'units.id')\n ->select(DB::raw('products.id, products.name, categories.name as category, count(*), sum(quantity) as sums, units.unit, round(avg(order_lines.price/order_lines.quantity), 0) as avg_price, round((cast(count(case when order_lines.is_available then 1 end) as float)/count(*) *100)::numeric, 2) as availability'))\n ->where('orders.created_at', '>=', $query['startDate'])\n ->where('orders.created_at', '<=', $query['endDate'])\n ->groupBy('products.id')\n ->groupBy('categories.name')\n ->groupBy('units.unit')\n ->orderByRaw('count desc, products.name asc')\n ->limit(5);\n\n\n $product = $dbQuery\n ->get();\n\n for($i=0; $i<count($product); $i++) {\n $countData = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('products', 'order_lines.product_id', '=', 'products.id')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->join('units', 'products.default_unit_id', 'units.id')\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('products.id', '=', $product[$i]->id)\n ->count();\n if($countData) {\n $prevData = DB::connection('virtual_market')\n ->table('order_lines')\n ->join('products', 'order_lines.product_id', '=', 'products.id')\n ->join('orders', 'order_lines.order_id', '=', 'orders.id')\n ->join('units', 'products.default_unit_id', 'units.id')\n ->select(DB::raw('count(*), sum(quantity) as sums, round(avg(order_lines.price/order_lines.quantity), 0) as avg_price, round((cast(count(case when order_lines.is_available then 1 end) as float)/count(*) *100)::numeric, 2) as availability'))\n ->where('orders.created_at', '>=', $prevPeriod['startDate'])\n ->where('orders.created_at', '<=', $prevPeriod['endDate'])\n ->where('products.id', '=', $product[$i]->id)\n ->get();\n } else {\n $prevData = array();\n }\n if(count($prevData) != 0) {\n $product[$i]->sum_change = (string) ($product[$i]->sums - $prevData[0]->sums);\n $product[$i]->price_change = (string) ($product[$i]->avg_price - $prevData[0]->avg_price);\n $product[$i]->availability_change = (string) ($product[$i]->availability - $prevData[0]->availability);\n } else {\n $product[$i]->sum_change = (string) 0;\n $product[$i]->price_change = (string) 0;\n $product[$i]->availability_change = (string) 0;\n }\n }\n\n $data = array();\n $data['product'] = $product;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "private function viewedItems($params)\n {\n $productsViewed = (isset($params['cookie']->viewed) && !empty($params['cookie']->viewed)) ? array_slice(array_reverse(explode(',', $params['cookie']->viewed)), 0, Configuration::get('CAPTURELEADSXAVIER_NBR')) : array();\n\n if (count($productsViewed)) {\n $defaultCover = Language::getIsoById($params['cookie']->id_lang).'-default';\n $productIds = implode(',', array_map('intval', $productsViewed));\n // toDo: Should really delete the image from the query as it is no longer used.\n $productsImages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('\n\t\t\tSELECT MAX(image_shop.id_image) id_image, p.id_product, p.price, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite\n\t\t\tFROM '._DB_PREFIX_.'product p\n\t\t\t'.Shop::addSqlAssociation('product', 'p').'\n\t\t\tLEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').')\n\t\t\tLEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'.\n Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'\n\t\t\tLEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = image_shop.id_image AND il.id_lang = '.(int)($params['cookie']->id_lang).')\n\t\t\tLEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').')\n\t\t\tWHERE p.id_product IN ('.$productIds.')\n\t\t\tAND pl.id_lang = '.(int)($params['cookie']->id_lang).'\n\t\t\tAND cl.id_lang = '.(int)($params['cookie']->id_lang).'\n\t\t\tGROUP BY product_shop.id_product'\n );\n\n $productsImagesArray = array();\n foreach ($productsImages as $pi) {\n $productsImagesArray[$pi['id_product']] = $pi;\n }\n\n $productsViewedObj = array();\n foreach ($productsViewed as $productViewed) {\n $obj = (object)'Product';\n if (!isset($productsImagesArray[$productViewed]) || (!$obj->active = $productsImagesArray[$productViewed]['active'])) {\n continue;\n } else {\n $obj->id = (int)($productsImagesArray[$productViewed]['id_product']);\n $obj->id_image = (int)$productsImagesArray[$productViewed]['id_image'];\n // I'm sure there are more accurate values with tax already applied butt for now this should do the trick.\n $obj->price = number_format((float)$productsImagesArray[$productViewed]['price'], 2, '.', '');\n $obj->cover = (int)($productsImagesArray[$productViewed]['id_product']).'-'.(int)($productsImagesArray[$productViewed]['id_image']);\n $obj->legend = $productsImagesArray[$productViewed]['legend'];\n $obj->name = $productsImagesArray[$productViewed]['name'];\n $obj->description_short = $productsImagesArray[$productViewed]['description_short'];\n $obj->link_rewrite = $productsImagesArray[$productViewed]['link_rewrite'];\n $obj->category_rewrite = $productsImagesArray[$productViewed]['category_rewrite'];\n // $obj is not a real product so it cannot be used as argument for getProductLink()\n $obj->product_link = $this->context->link->getProductLink($obj->id, $obj->link_rewrite, $obj->category_rewrite);\n\n if (!isset($obj->cover) || !$productsImagesArray[$productViewed]['id_image']) {\n $obj->cover = $defaultCover;\n $obj->legend = '';\n }\n $productsViewedObj[] = $obj;\n }\n }\n\n if (!count($productsViewedObj)) {\n return;\n }\n\n $this->smarty->assign(array(\n 'message_txt' => $this->displayName,\n 'productsViewedObj' => $productsViewedObj,\n 'mediumSize' => Image::getSize('medium'),\n 'postURL' => $this->context->link->getModuleLInk($this->name, \"newslettercaptureleads\")\n ));\n\n return $this->display(__FILE__, 'column.tpl');\n }\n }", "function findFeaturedProducts($count) {\n $sql = \"select * from product where is_featured=1 order by entered_date limit $count\";\n $command = $this->db->prepare($sql);\n $command->execute();\n $result = $command->fetchAll();\n $command->closeCursor();\n return $result;\n }", "function getProducts(){\r\n\r\n\t$products = false;\r\n\t$pList = simplexml_load_file('data/productList.xml');\r\n\tif( isset( $pList->product ) ){\r\n\t\t$products = array();\r\n\t\tforeach ($pList->product as $p) {\r\n\t\t\t$cur = array();\r\n\t\t\t\r\n\t\t\t$cur['id'] \t\t\t= (string)$p->id;\r\n\t\t\t$cur['name'] \t\t= (string)$p->name;\r\n\t\t\t$cur['category'] \t= (string)$p->category;\r\n\t\t\t$cur['price'] \t\t= (string)$p->price;\r\n\t\t\t$cur['quantity'] \t= (string)$p->quantity;\r\n\t\t\t$cur['offer'] \t\t= (string)$p->offer;\r\n\t\t\t$cur['picture'] \t= (string)$p->picture;\r\n\t\t\t$cur['date'] \t\t= (string)$p->date;\r\n\t\t\t$cur['userId'] \t\t= (string)$p->userId;\r\n\t\t\t$cur['status'] \t\t= (string)$p->status;\r\n\r\n\t\t\t$products[] = $cur;\r\n\t\t\tunset($cur);\r\n\t\t}\t\r\n\t}\r\n\t\r\n\treturn $products;\r\n}", "public static function fetch_products(Vendor $vendor)\n {\n // Return cached products if possible\n// $cache_file = $vendor->get_cache_file('products.json');\n// if (false !== ($response = CacheFileHelper::load($cache_file, 6000))) {\n// return $response;\n// }\n\n $initial_url = $vendor->url(\"/admin/api/2019-04/products.json\");\n\n $query_url = \"\";\n $products = [];\n $max_iterations = 5;\n do {\n $max_iterations --;\n try {\n $response = CurlHelper::exec($initial_url . $query_url);\n if (!$response || empty($response))\n break;\n\n if (!is_array($response) || empty($response) || !array_key_exists('products', $response))\n break;\n\n $response = $response['products'];\n if (!count($response))\n break;\n\n $last_id = last($response)['id'];\n $query_url = \"?since_id=$last_id\";\n $products = array_merge($products, $response);\n } catch (\\Exception $error) {\n error_log($error->getMessage());\n break;\n }\n } while ($max_iterations > 0);\n\n // Cache all results\n// file_put_contents(base_path($cache_file), json_encode($products, JSON_PRETTY_PRINT));\n\n return $products;\n }", "public function index()\n {\n return Product::latest()->paginate(15);\n }", "public function displayAjaxFeedProducts()\n {\n $productFeed = new ProductFeed();\n $store = (int) Tools::getValue('store', 0);\n $start = (int) Tools::getValue('start', 0);\n $rows = Tools::getValue('rows', 'all');\n $includeVariations = (bool) Tools::getValue('include_variations', false);\n\n $this->ajaxRenderJson($productFeed->get($store, $start, $rows, $includeVariations));\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function all_products()\n\t{\n\t\t$data['product_list']=$this->tbl_product->get_all_product();\n\t\t$data['page']='All Products';\n\t\tif (!$this->input->is_ajax_request()) {\n\t\t\t$view = 'admin/collection/admin_all_product_list';\n\t\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t\t}else{\n\n\t\t}\n\t\t\n\t}", "function getProducts()\n {\n $ret = array();\n foreach ($this->getItems() as $item)\n if ($item->item_type == 'product')\n if ($pr = $item->tryLoadProduct())\n $ret[] = $pr;\n return $ret;\n }", "function thrive_dashboard_get_products()\n{\n $products = array();\n $products = apply_filters('thrive_dashboard_installed_products', $products);\n\n return $products;\n}", "private function _getAlsoSold2(){\n $data['also_sold_products'] = null;\n $also_sold = $this->model_catalog_product->GetAlsoSoldProducts($this->request->get['product_id']);\n foreach ($also_sold as $result) {\n if ($result['image']) {\n $image = $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_related_width'), $this->config->get($this->config->get('config_theme') . '_image_related_height'));\n } else {\n $image = $this->model_tool_image->resize('placeholder.png', $this->config->get($this->config->get('config_theme') . '_image_related_width'), $this->config->get($this->config->get('config_theme') . '_image_related_height'));\n }\n\n if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {\n $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\n } else {\n $price = false;\n }\n\n if ((float)$result['special']) {\n $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\n } else {\n $special = false;\n }\n\n if ($this->config->get('config_tax')) {\n $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']);\n } else {\n $tax = false;\n }\n\n if ($this->config->get('config_review_status')) {\n $rating = (int)$result['rating'];\n } else {\n $rating = false;\n }\n\n $data['also_sold_products'][] = array(\n 'product_id' => $result['product_id'],\n 'thumb' => $image,\n 'name' => $result['name'],\n 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',\n 'price' => $price,\n 'special' => $special,\n 'tax' => $tax,\n 'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,\n 'rating' => $rating,\n 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'].'&selfref=also')\n );\n }\n\n }", "public function all_products()\n\t{\n\t\t$data['product_list']=$this->tbl_product->get_all_product();\n\t\t$data['page']='All Products';\n\t\t$view = 'Admin/collection/admin_all_product_list';\n\t\techo Modules::run('Template/admin_template', $view, $data);\t\n\t}", "public function all_products() \n\t{\n\t\tif($this->input->is_ajax_request()) \n\t\t{\n\t\t\techo json_encode($this->products->get_all());\n\t\t} else {\n\t\t\tredirect('cms/products', 'refresh');\n\t\t}\n\t}", "public function index()\n {\n return Product::latest()->paginate(20);\n }", "function edd_pup_get_all_downloads(){\r\n\r\n\t$products = get_transient( 'edd_pup_all_downloads' );\r\n\r\n\tif ( false === $products ) {\r\n\t\t$products = array();\r\n\t\t$downloads = get_posts(\tarray( 'post_type' => 'download', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' ) );\r\n\t\tif ( !empty( $downloads ) ) {\r\n\t\t foreach ( $downloads as $download ) {\r\n\r\n\t\t $products[ $download->ID ] = $download->post_title;\r\n\r\n\t\t }\r\n\t\t}\r\n\r\n\t\tset_transient( 'edd_pup_all_downloads', $products, 60 );\r\n\t}\r\n\r\n\treturn $products;\r\n}", "public function getProductTopList($query)\n {\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n DB::enableQueryLog();\n // execute\n $query = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->select(DB::raw('products.id, products.name, count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy('products.id')\n ->orderByRaw('sums desc, products.name asc')\n ->limit(5);\n\n $product = $query\n ->get();\n\n for($i=0; $i<count($product); $i++) {\n $countData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('products.id', '=', $product[$i]->id)\n ->count();\n if($countData) {\n $prevData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('products.id', '=', $product[$i]->id)\n ->get();\n } else {\n $prevData = array();\n }\n if(count($prevData) != 0) {\n $product[$i]->count_change = (string) ($product[$i]->count - $prevData[0]->count);\n $product[$i]->sum_change = (string) ($product[$i]->sums - $prevData[0]->sums);\n $product[$i]->value_change = (string) ($product[$i]->value - $prevData[0]->value);\n } else {\n $product[$i]->count_change = (string) 0;\n $product[$i]->sum_change = (string) 0;\n $product[$i]->value_change = (string) 0;\n }\n }\n\n $data = array();\n $data['product'] = $product;\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]);\n }", "function getRecents() {\n\t\t$link = getDbConnect();\n\t\t$preparedStatement = $link->prepare(\"SELECT * FROM urls ORDER BY id DESC LIMIT 30;\");\n\t\t$preparedStatement->execute(array());\n\t\treturn parseFullResults($preparedStatement->fetchAll());\n\t}", "public function get_articles_latest_coming_data( )\n {\n $field = \"*\";\n \n $orderby = \" ArticleId DESC \";\n $result = $this->db->select( $field, TBL_ARTICLE, ' `DeleteFlag` = 0 AND `ArticleStatus` = 2', $orderby , '2');\n return $result;\n }", "function load($product_id){\n\t\t$result = $this->db->get_one(\n\t\t\t'product_name, image, description, price',\n\t\t\t'tb_products',\n\t\t\t'product_id = '.$product_id\n\t\t);\n\n\t\tif(count($result)){\n\t\t\t$this->product_id = $product_id;\n\t\t\t$this->product_name = $result['product_name'];\n\t\t\t$this->image = $result['image'];\n\t\t\t$this->description = $result['description'];\n\t\t\t$this->price = $result['price'];\n\t\t}\n\n\t\treturn $result;\n\t}", "public function getActiveCartProducts();", "private function initialiseProductListCollection()\n {\n $numberOfProductsToShow = $this->helper->getNumberOfProductsToShow();\n if ($numberOfProductsToShow) {\n $this->productCollection\n ->addAttributeToSelect('*')\n ->addAttributeToFilter(InstallData::PRODUCT_LIST_ATTRIBUTE, 1)\n ->setPageSize($numberOfProductsToShow)\n ->load();\n } else {\n $this->productCollection\n ->addFieldToFilter('entity_id', 0)\n ->load();\n }\n }", "public function onProductsLoaded(EntityLoadedEvent $event)\n {\n\n $httpClient = HttpClient::create();\n $response = $httpClient->request('GET', 'http://webcode.me');\n $statusCode = $response->getStatusCode();\n die($statusCode);\n }", "public function getLatestAcer(){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE brandId='8' ORDER BY pid DESC LIMIT 1\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}", "function get_static_products() {\r\n return $this->DBObject->readCursor(\"product_actions.get_static_products\", null);\r\n }", "public function fetchAll()\r\n {\r\n \t// get from mem if available\r\n \t$memcache = new \\Memcached();\r\n \t$memcache->addServer('localhost', 11211);\r\n \t$key = md5(catalogProductList::MEMCACHED_FETCH_ALL);\r\n \t$cache_data = $memcache->get($key);\r\n \tif ($cache_data) {\r\n \t\t$this->log->addInfo('cache hit', array(\"key\" => $key));\r\n \t\t$this->data = $cache_data;\r\n \t} else {\r\n\t\t\t$this->data = $this->client->catalogProductList($this->sessionid);\r\n\t\t\t$memcache->set($key, $this->data, 60*1);\r\n \t}\r\n }", "public function getLoadedProductCollection() {\r\n return $this->getProducts();\r\n }", "function LoadProduct($orderid) {\n\t$proids = array();\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"orderproduct\",array('id','orderid','proid','number','price','returnnow','modlcharge'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$idobj = $factory->getIdentityObject()->field('orderid')->eq($orderid);\n\t$order_pro = $finder->find($idobj);\n\n\t$factory = \\woo\\mapper\\PersistenceFactory::getFactory(\"product\",array('id','classid','length','width','think','unitlen','unitwid','unitthi','unit','sharp','note'));\n\t$finder = new \\woo\\mapper\\DomainObjectAssembler($factory);\n\t$pro = $order_pro->next();\n\t$i = 0;\n\t$data = array();\n\twhile($pro){\n\t\t$data[$i][0] = $i+1;\n\t\t$idobj = $factory->getIdentityObject()->field('id')->eq($pro->getProid());\n\t\t$collection = $finder->find($idobj);\n\t\t$product = $collection->current();\n\t\t$data[$i][1] = $product->getSize();\n\t\t$data[$i][2] = $pro->getNumber();\n\t\t$price = $pro->getPrice()-$pro->getReturnnow();\n\t\t$data[$i][3] = sprintf(\"%.2f\",$price);\n\t\t$data[$i][4] = sprintf(\"%.2f\",$price*$data[$i][2]);\n\t\t$i++;\n\t\t$pro = $order_pro->next();\n\t}\n\treturn $data;\n}", "public function relatedProducts (){\n #reviews...\n $product= Product::with('reviews')\n ->whereIndumentariaId($this->indumentaria->id)\n ->where('id', '!=', $this->id)\n ->where('status', Product::PUBLISHED)\n ->latest()\n ->limit(6)\n ->get();\n return $product;\n }", "public function load_stocks() {\n\t\t\t$res = $this->Restaurant_model->loading_stocks();\n\t\t\techo $res;\n\t\t}", "public function history_product($product_id = null) {\n\t\t$this->Sell->Product->recursive = -1;\n\t\t$this->set('products', $this->Sell->Product->find('all'));\n\t\t$this->set('years', $this->Sell->Year->find('list',array('fields'=>'Year.year,Year.year')));\n\t\t\n\t\t\n\t\t$product = null;\n\t\t$this->Sell->Product->id = $product_id;\n\t\tif (!$this->Sell->Product->exists()) {\n\t\t\t$p = $this->Sell->Product->find('first');\n\t\t\t$product_id = $p['Product']['id'];\n\t\t\tif(!$product_id) {\n\t\t\t\t$this->Session->setFlash(__('Cadastre um produto antes de continuar'));\n\t\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\t\treturn;\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t\n\t\t//checando ano\n\t\t$year = null;\n\t\tif(isset($this->request->query['year']))\n\t\t\t$year = $this->request->query['year'];\n\t\telse {\n\t\t\t$y = $this->Sell->Year->find('first',array('order'=>'Year.year DESC'));\n\t\t\tif(isset($y['Year']['year']) && $y['Year']['year'])\n\t\t\t\t$year = $y['Year']['year'];\n\t\t\tif($year) {\n\t\t\t\t$this->redirect(array('controller'=>'sells','action'=>'history_product',$product_id,'?' => array('year' => $year)));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(!$year) {\n\t\t\t$this->Session->setFlash(__('Cadastre um ano antes de continuar'));\n\t\t\t$this->redirect(array('controller'=>'years','action'=>'index'));\n\t\t\treturn;\n\t\t}\n\n\t\t//construindo dados\n\t\t$product = $this->Sell->Product->read(null, $product_id);\n\n\t\t$sells = $this->Sell->find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'Sell.product_id' => $product_id,\n\t\t\t\t\t\t'Year.year' => $year\n\t\t\t\t),\n\t\t\t\t'order' => 'Year.year DESC'\n\t\t));\n\n\t\t$this->Sell->Month->recursive = -1;\n\t\t$months = $this->Sell->Month->find('all');\n\n\t\t$graph = array(\n\t\t\t\t'title' => \"Vendas de {$product['Product']['name']} por Mês - {$year}\",\n\t\t\t\t'label_x' => 'mês',\n\t\t\t\t'label_y' => 'unidades',\n\t\t\t\t'axis_y' => array(\n\t\t\t\t\t\t'model' => 'Month',\n\t\t\t\t\t\t'field' => 'name',\n\t\t\t\t\t\t'data' => $months\n\t\t\t\t),\n\t\t\t\t'axis_x' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'label' => $product['Product']['name'],\n\t\t\t\t\t\t\t\t'model' => 'Sell',\n\t\t\t\t\t\t\t\t'field' => 'quantity',\n\t\t\t\t\t\t\t\t'data' => $sells\n\t\t\t\t\t\t)\n\t\t\t\t),\n\t\t);\n\t\t$this->set(compact('graph','year','product'));\n\t}", "abstract public function fetchLatest($timestamp = null);", "public function getPopularProducts(){\n\t\t//open popular items file\n\t\t$file = fopen($this->file, \"r\");\n\t\t\n\t\t// assign it into $items variable\n\t\t$string = fgets($file);\n\n\t\t// item id's into items property\n\t\t$this->items = explode(\",\", $string);\n\n\t\t// Close the file\n\t\tfclose($file);\n\n\n\t\t// Instanciate model selection class\n\t\t$select = new SelectionDB;\n\n\t\t// Query 5 products from database\n\t\treturn $select->selectProduct($this->items);\n\n\n\t}", "private function exportProducts(){\n Product::initStore($this->store_settings->store_name, config('shopify.api_key'), $this->store_settings->access_token);\n $products_count = Product::count();\n $products_per_page = 250;\n $number_of_pages = ceil($products_count/$products_per_page);\n $all_products = [];\n $products = [];\n //to init start time\n ShopifyApiThrottle::init();\n for( $page = 1; $page <= $number_of_pages; $page++ ){\n //wait for some time so it doesn't reach throttle point\n if( $page > 1 ){ ShopifyApiThrottle::wait(); }\n\n $products = Product::all([\n 'limit' => $products_per_page,\n 'page' => $page\n ]);\n if($products)\n $all_products = array_merge($all_products, $products);\n //to re-init start time\n ShopifyApiThrottle::init();\n }\n return $all_products;\n }", "public function get_popular_products()\n\t{\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name')->from('product, category, brand')->where(\"product.product_status = 1 AND product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product.featured = 1\")->order_by(\"clicks\", 'DESC');\n\t\t$query = $this->db->get('',4);\n\t\t\n\t\treturn $query;\n\t}", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "private function load($id = null) {\n\n if (!is_null($id)) {\n\n return $this->search->getProduct($id);\n\n }\n\n return $this->search->getProducts($this->filters);\n\n }", "public function getActiveProducts() {\n $stmt = $this->db->prepare(\"select * from product where is_active = 1 order by id desc;\");\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "function getFeatureProducts(){\n \n $itemonpage = !empty($_GET['per_page'])?$_GET['per_page']:3;\n $page = !empty($_GET['page'])?$_GET['page']:1;\n $offset= ($page-1)*$itemonpage;\n\n $numberPage = ceil(30/$itemonpage);\n \n $sql = self::$connection->prepare(\"SELECT * FROM products limit \".$itemonpage.\" offset \".$offset);\n \n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n include \"link.php\";\n return $items; //return an array\n }", "public function featured() {\n\n $this->checkPlugin();\n\n if ( $_SERVER['REQUEST_METHOD'] === 'GET' ){\n //get featured products\n $limit = 0;\n\n if (isset($this->request->get['limit']) && ctype_digit($this->request->get['limit']) && $this->request->get['limit'] > 0) {\n $limit = $this->request->get['limit'];\n }\n\n $this->getFeaturedProducts($limit);\n }\n }" ]
[ "0.7353199", "0.699965", "0.6773255", "0.6658708", "0.64643353", "0.64540076", "0.6416648", "0.6397319", "0.6326751", "0.6268139", "0.62666285", "0.6247166", "0.62352383", "0.6222945", "0.61797196", "0.6127044", "0.6123586", "0.6121242", "0.6108207", "0.61059994", "0.5989057", "0.5968103", "0.5961563", "0.592894", "0.5909447", "0.5904105", "0.5885614", "0.58691335", "0.5862157", "0.58583426", "0.5824241", "0.57900554", "0.5772161", "0.57587224", "0.57490635", "0.5739518", "0.5713462", "0.56882864", "0.568046", "0.5678193", "0.56632674", "0.56131935", "0.5612306", "0.55858284", "0.55758226", "0.5575778", "0.5555932", "0.55466944", "0.5541754", "0.55353314", "0.55187625", "0.5509696", "0.5497785", "0.54919946", "0.5486858", "0.548226", "0.5479618", "0.5479405", "0.5473076", "0.5470694", "0.5460917", "0.5460892", "0.54516715", "0.5450818", "0.54503286", "0.54496", "0.5445587", "0.54428995", "0.5440748", "0.5432684", "0.5427586", "0.5422103", "0.54219204", "0.54217035", "0.5421461", "0.54086727", "0.54018706", "0.540179", "0.54008627", "0.5393375", "0.5386931", "0.5379131", "0.53724664", "0.53580815", "0.5356731", "0.5356311", "0.5355869", "0.53496265", "0.5341356", "0.5339868", "0.53398657", "0.5326168", "0.5322661", "0.5315518", "0.5308232", "0.5307215", "0.5303432", "0.5300694", "0.5296675", "0.52949595" ]
0.6911543
2
//////////////////////////////////////////////////////// Get product color variations
public static function getProductColorVariations($productID) { Db_Actions::DbSelect("SELECT * FROM cscart_product_color_variations WHERE product_id=$productID ORDER BY id DESC"); $data = Db_Actions::DbGetResults(); if (!isset($data->empty_result)) { $counter = 1; $product_data = array(); foreach ($data as $product) { if ($counter <= 3) { $product_data[] = array('product_id' => $product->color_product_id, 'product_name' => self::getProductName($product->color_product_id), 'product_image_url' => $root_url . self::getProductImage($product->color_product_id), 'product_price' => self::getProductPrice($product->color_product_id), 'category_dress_type_id' => self::getCategoryDressTypeID($product->color_product_id), 'subcategory_dress_type_id' => self::getSubCategoryDressTypeID($product->color_product_id), 'color' => $product->color_variation ); } $counter++; } foreach ($product_data as $variation) { ?><a href="#" class="cs-varr <?php echo $variation['color'] ?>" product_id="<?php echo $variation['product_id'] ?>" product_title="<?php echo $variation['product_name'] ?>" product_price="<?php echo $variation['product_price'] ?>" category_dress_type_id="<?php echo $variation['category_dress_type_id'] ?>" subcategory_dress_type_id="<?php echo $variation['subcategory_dress_type_id'] ?>" img_url="<?php echo $variation['product_image_url'] ?>" ><img src="img/product-images/variation-<?php echo $variation['color'] ?>.png" width="14" height="13" /></a><?php } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorList() {\n $colorArr = (new \\yii\\db\\Query())\n ->select(['color'])\n ->from('product_variation')\n ->where(['!=', 'color', ''])\n ->groupBy(['color'])\n ->all();\n return $colorArr;\n }", "public function getProductColors()\n {\n return $this->hasMany(ProductColors::class, ['color_id' => 'id']);\n }", "public static function get_style_variations()\n {\n }", "private function getColors(): array\n {\n $colors = $this->website->getConfiguration()->getColors();\n $choices = [];\n foreach ($colors as $color) {\n if ($color->getCategory() === \"background\" && $color->getIsActive()) {\n $choices[$color->getAdminName()] = $color->getSlug();\n $this->colors[$color->getSlug()] = $color->getColor();\n }\n }\n return $choices;\n }", "public function testProductGetVariants()\n {\n $product = $this->find('product', 1);\n \n $variants = $product->getVariants();\n \n $productColor = $this->find('productColor', 1);\n $productSize = $this->find('productSize', 1);\n \n $this->assertTrue(\n $variants[$productSize->getId()][$productColor->getId()]\n );\n }", "public function getAlternateColorSpace() {}", "public function getAlternateColorSpace() {}", "public function getAlternateColorSpace() {}", "function getProductColoursAsJSArray( $product_id ) {\n\t\t\tif ( $product_id > 0 ) {\n\t\t\t\t$sql = \"SELECT d.id, d.name, d.pantone, d.`rgb` FROM colour_colour_details d\n \t JOIN shop_product_colour pc ON pc.colour_id = d.id\n \tWHERE pc.product_id =\" . $product_id . \"\n\tand published = 1\n \torder by d.id \";\n\t\t\t\t$s = ' [';\n\t\t\t\t$result = mysql_query( $sql );\n\t\t\t\twhile ( $row = mysql_fetch_array( $result ) ) {\n\t\t\t\t\t$s .= \"[\" . $row['id'] . \",'\" . $row['name'] . \"','\" . $row['pantone'] . \"','#\" . $row['rgb'] . \"'],\";\n\t\t\t\t}\n\t\t\t\t// knock final comma\n\t\t\t\t$s = substr( $s, 0, strlen( $s ) - 1 );\n\t\t\t\t// add closing bracket, but only if we found some items\n\t\t\t\tif ( trim( $s ) != '' ) {\n\t\t\t\t\t$s .= ']';\n\t\t\t\t} else {\n\t\t\t\t\t$s .= '[]';\n\t\t\t\t}\n\t\t\t\treturn $s;\n\t\t\t} else {\n\t\t\t\treturn '[]';\n\t\t\t}\n\t\t}", "public function getVariation()\n {\n return $this->db->get($this->product_variant);\n }", "public function prod_var(){\n\t \n\t$color = $_GET['color'];\n\t$style = $_GET['style'];\t\n\t\n\t$this->data['prod_arr'] = $this->product_model->get_product_detail($style);\t\n\t$this->data['size'] = $this->product_model->get_size($style,$color);\n\t$this->data['prod_attr'] = $this->product_model->get_prod_attributes($style);\n\t$this->data['color'] = $this->product_model->get_color($style);\n\t\n\t$count = sizeof($this->data['color']);\n\t$count_size = sizeof($this->data['size']);\n\t$this->data['count_color'] = $count;\n\t$this->data['color_compare'] = $color;\n\tif(isset($_GET[\"size\"]))\n\t{\n\t\t$this->data['size_compare'] = $size;\n\t}\n\t$this->data['count_size'] = $count_size;\n\tif(isset($this->data[\"size\"]))\n\t{\n\t\techo json_encode($this->data[\"size\"]);\t\n\t}\n\t\n}", "public function get_product_variations() : array {\n\t\tpreg_match( '/skuProducts=\\[(.*?)\\];/si', $this->request, $matches );\n\t\tif ( empty( $matches[1] ) ) {\n\t\t\treturn [ 'variations' => [] ];\n\t\t}\n\n\t\treturn [ 'variations' => json_decode( sprintf( '[%s]', $matches[1] ), true ) ];\n\t}", "public function getProductAttributesGroups()\n {\n $colors = array();\n $groups = array();\n $combinations = array();\n\n $attributes_groups = $this->product->getAttributesGroups($this->context->language->id);\n\n if (is_array($attributes_groups) && $attributes_groups) {\n foreach ($attributes_groups as $row) {\n // Color management\n if (isset($row['is_color_group'])\n && $row['is_color_group']\n && (isset($row['attribute_color']) && $row['attribute_color'])\n || (file_exists(_PS_COL_IMG_DIR_ . $row['id_attribute'] . '.jpg'))) {\n $colors[$row['id_attribute']]['value'] = $row['attribute_color'];\n $colors[$row['id_attribute']]['name'] = $row['attribute_name'];\n if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) {\n $colors[$row['id_attribute']]['attributes_quantity'] = 0;\n }\n $colors[$row['id_attribute']]['attributes_quantity'] += (int)$row['quantity'];\n }\n if (!isset($groups[$row['id_attribute_group']])) {\n $groups[$row['id_attribute_group']] = array(\n 'group_name' => $row['group_name'],\n 'name' => $row['public_group_name'],\n 'group_type' => $row['group_type'],\n 'default' => -1,\n );\n }\n\n $attr_g = $row['id_attribute_group'];\n $groups[$attr_g]['attributes'][$row['id_attribute']] = $row['attribute_name'];\n if ($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) {\n $groups[$row['id_attribute_group']]['default'] = (int)$row['id_attribute'];\n }\n if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) {\n $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0;\n }\n $r_attr = $row['id_attribute_group'];\n $groups[$r_attr]['attributes_quantity'][$row['id_attribute']] += (int)$row['quantity'];\n\n $combinations[$row['id_product_attribute']]['attributes'][] = (int)$row['id_attribute'];\n\n //calculate full price for combination\n $priceDisplay = Product::getTaxCalculationMethod(0); //(int)$this->context->cookie->id_customer\n if (!$priceDisplay || $priceDisplay == 2) {\n $combination_price = $this->product->getPrice(true, $row['id_product_attribute']);\n } else {\n $combination_price = $this->product->getPrice(false, $row['id_product_attribute']);\n }\n $combinations[$row['id_product_attribute']]['price'] = $this->formatPrice($combination_price);\n $combinations[$row['id_product_attribute']]['float_price'] = $combination_price;\n $combinations[$row['id_product_attribute']]['quantity'] = (int)$row['quantity'];\n $combinations[$row['id_product_attribute']]['minimal_quantity'] = (int)$row['minimal_quantity'];\n }\n\n // wash attributes list (if some attributes are unavailables and if allowed to wash it)\n if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock)\n && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) {\n foreach ($groups as &$group) {\n foreach ($group['attributes_quantity'] as $key => &$quantity) {\n if ($quantity <= 0) {\n unset($group['attributes'][$key]);\n }\n }\n }\n\n foreach ($colors as $key => $color) {\n if ($color['attributes_quantity'] <= 0) {\n unset($colors[$key]);\n }\n }\n }\n foreach ($combinations as $id_product_attribute => $comb) {\n $attribute_list = '';\n foreach ($comb['attributes'] as $id_attribute) {\n $attribute_list .= '\\'' . (int)$id_attribute . '\\',';\n }\n $attribute_list = rtrim($attribute_list, ',');\n $combinations[$id_product_attribute]['list'] = $attribute_list;\n }\n }\n\n return array(\n 'groups' => $groups,\n 'colors' => (count($colors)) ? $colors : false,\n 'combinations' => $combinations\n );\n }", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "public function getColorComponents() {}", "function fn_product_variations_convert_to_configurable_product($product_id)\n{\n $auth = array();\n\n $product = fn_get_product_data($product_id, $auth);\n $languages = Languages::getAll();\n $product_options = fn_get_product_options($product_id, CART_LANGUAGE, true);\n $product_row = db_get_row('SELECT * FROM ?:products WHERE product_id = ?i', $product_id);\n $product_variation_ids = db_get_fields('SELECT product_id FROM ?:products WHERE parent_product_id = ?i', $product_id);\n $product_exceptions = fn_get_product_exceptions($product_id);\n\n foreach ($product_variation_ids as $product_variation_id) {\n fn_delete_product($product_variation_id);\n }\n\n $options_ids = array();\n $inventory_combinations = db_get_array('SELECT * FROM ?:product_options_inventory WHERE product_id = ?i', $product_id);\n $index = 0;\n\n foreach ($inventory_combinations as $item) {\n $index++;\n $selected_options = array();\n $parts = array_chunk(explode('_', $item['combination']), 2);\n\n foreach ($parts as $part) {\n $selected_options[$part[0]] = $part[1];\n }\n\n $combination = fn_product_variations_get_variation_by_selected_options(\n $product,\n $product_options,\n $selected_options,\n $index\n );\n\n if (!empty($item['product_code'])) {\n $combination['code'] = $item['product_code'];\n }\n\n if (!empty($item['amount'])) {\n $combination['amount'] = $item['amount'];\n }\n\n $is_allow = true;\n\n if ($product_row['exceptions_type'] == 'F') {\n foreach ($product_exceptions as $exception) {\n\n foreach ($exception['combination'] as $option_id => &$variant_id) {\n if ($variant_id == OPTION_EXCEPTION_VARIANT_ANY || $variant_id == OPTION_EXCEPTION_VARIANT_NOTHING) {\n $variant_id = isset($combination['selected_options'][$option_id]) ? $combination['selected_options'][$option_id] : null;\n }\n }\n unset($variant_id);\n\n if ($exception['combination'] == $combination['selected_options']) {\n $is_allow = false;\n break;\n }\n }\n } elseif ($product_row['exceptions_type'] == 'A') {\n $is_allow = false;\n\n foreach ($product_exceptions as $exception) {\n\n foreach ($exception['combination'] as $option_id => &$variant_id) {\n if ($variant_id == OPTION_EXCEPTION_VARIANT_ANY) {\n $variant_id = isset($combination['selected_options'][$option_id]) ? $combination['selected_options'][$option_id] : null;\n }\n }\n unset($variant_id);\n\n if ($exception['combination'] == $combination['selected_options']) {\n $is_allow = true;\n break;\n }\n }\n }\n\n if (!$is_allow) {\n continue;\n }\n\n $variation_id = fn_product_variations_save_variation($product_row, $combination, $languages);\n\n $image = fn_get_image_pairs($item['combination_hash'], 'product_option', 'M', true, true);\n\n if ($image) {\n $detailed = $icons = array();\n $pair_data = array(\n 'type' => 'M'\n );\n\n if (!empty($image['icon'])) {\n $tmp_name = fn_create_temp_file();\n Storage::instance('images')->export($image['icon']['relative_path'], $tmp_name);\n $name = fn_basename($image['icon']['image_path']);\n\n $icons[$image['pair_id']] = array(\n 'path' => $tmp_name,\n 'size' => filesize($tmp_name),\n 'error' => 0,\n 'name' => $name\n );\n\n $pair_data['image_alt'] = empty($image['icon']['alt']) ? '' : $image['icon']['alt'];\n }\n\n if (!empty($image['detailed'])) {\n $tmp_name = fn_create_temp_file();\n Storage::instance('images')->export($image['detailed']['relative_path'], $tmp_name);\n $name = fn_basename($image['detailed']['image_path']);\n\n $detailed[$image['pair_id']] = array(\n 'path' => $tmp_name,\n 'size' => filesize($tmp_name),\n 'error' => 0,\n 'name' => $name\n );\n\n $pair_data['detailed_alt'] = empty($image['detailed']['alt']) ? '' : $image['detailed']['alt'];\n }\n\n $pairs_data = array(\n $image['pair_id'] => $pair_data\n );\n\n fn_update_image_pairs($icons, $detailed, $pairs_data, $variation_id, 'product');\n }\n }\n\n if (!empty($selected_options)) {\n $options_ids = array_keys($selected_options);\n }\n\n db_query(\n 'UPDATE ?:products SET product_type = ?s, variation_options = ?s WHERE product_id = ?i',\n ProductManager::PRODUCT_TYPE_CONFIGURABLE, json_encode(array_values($options_ids)), $product_id\n );\n\n fn_delete_product_option_combinations($product_id);\n db_query('DELETE FROM ?:product_options_exceptions WHERE product_id = ?i', $product_id);\n}", "public function getVariation()\r\n {\r\n return array();\r\n }", "public function productAssets()\n {\n $variations = ProductVariation::with('stocks')->get();\n $assets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->base_price;\n });\n\n $opAssets = $variations->sum(function ($variant) {\n return $variant->stockCount() * $variant->price;\n });\n\n return [\n 'assets' => $assets,\n 'op_asset' => $opAssets\n ];\n }", "function filter_woocommerce_rest_prepare_product_object( $response, $object, $request ) {\n if( empty( $response->data ) ) {\n return $response;\n }\n\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n // Loop through the attributes on current product\n $attributes = $response->data['attributes'];\n foreach($attributes as $attrkey => $attribute) {\n\n /* ########################################################\n - Adding new swatch key to attribute response for color attributes,\n which holds the hex code for each swatch color option\n ######################################################## */\n // Get an array of attributes whose attribute type is color\n $color_type_attribute_taxonomies = array_filter($attribute_taxonomies, function($attribute_taxonomy) {\n return $attribute_taxonomy->attribute_type == 'color';\n });\n // Loop through the color type attributes\n foreach($color_type_attribute_taxonomies as $tax_object) {\n //Check if current attribute is a color type attribute\n if ($attribute['id'] == $tax_object->attribute_id) {\n // Get current attribute's options\n $options = $response->data['attributes'][$attrkey]['options'];\n // Get current attribute's terms\n $color_terms = get_terms('pa_' . $tax_object->attribute_name);\n foreach( $options as $option ) {\n foreach($color_terms as $term) {\n if ($term->name == $option) {\n // Add a new swatch with hex value for each color option\n $response->data['attributes'][$attrkey]['swatches'][$option] = get_term_meta( $term->term_id, 'product_attribute_color', true);\n }\n }\n }\n }\n }\n\n /* ########################################################\n - Adding attribute taxonomy to the attribute response\n - Adding attribute identifier to the attribute response\n - Adding more detailed option data to the attribute options response\n ######################################################## */\n foreach($attribute_taxonomies as $attribute_taxonomy) {\n if ($attribute['id'] == $attribute_taxonomy->attribute_id) {\n\n /* Add slug to current attribute response */\n $response->data['attributes'][$attrkey]['taxonomy'] = ('pa_' . $attribute_taxonomy->attribute_name);\n\n /* Add attribute identifier to current attribute response */\n $response->data['attributes'][$attrkey]['slug'] = $attribute_taxonomy->attribute_name;\n\n /* Replace default options data with detailed options data for current attribute */\n $options = $response->data['attributes'][$attrkey]['options'];\n $new_options = array();\n $attribute_terms = get_terms('pa_' . $attribute_taxonomy->attribute_name);\n\n foreach( $options as $option ) {\n foreach($attribute_terms as $attribute_term) {\n if ($attribute_term->name == $option) {\n $new_options[] = (object) [\n 'id' => $attribute_term->term_id,\n 'name' => $attribute_term->name,\n 'slug' => $attribute_term->slug,\n 'taxonomy' => $attribute_term->taxonomy,\n 'description' => $attribute_term->description,\n 'count' => $attribute_term->count\n ];\n }\n }\n }\n $response->data['attributes'][$attrkey]['options'] = $new_options;\n }\n }\n }\n\n /* ########################################################\n - Replacing Variation IDs with Variation details\n ######################################################## */\n\n // Get the current product object\n $variation_ids = $response->data['variations'];\n\n $detailed_variations = array_map(function($variation_id) {\n $variation = wc_get_product($variation_id);\n return (object) [\n 'variation_id' => $variation->get_id(),\n 'image_url' => wp_get_attachment_url($variation->get_image_id()),\n 'variation_regular_price' => $variation->get_regular_price(),\n 'variation_sale_price' => $variation->get_sale_price(),\n 'attributes' => $variation->get_attributes(),\n 'is_on_sale' => $variation->is_on_sale()\n ];\n }, $variation_ids);\n\n $response->data['variations'] = $detailed_variations;\n\n\n /* ########################################################\n - Get ALL Variation attributes for a product\n ######################################################## */\n if ($response->data['type'] == 'variable') {\n $variation_attributes = wc_get_product($response->data['id'])->get_variation_attributes();\n $variation_attributes = array_map(function($attribute) {\n return (array_values($attribute));\n }, $variation_attributes);\n $response->data['variation_attributes'] = $variation_attributes;\n }\n\n\n\n /* Return new response */\n return $response;\n}", "function getAllProductVariantOptions(Request $request) {\n $collectionName = $request->query->get('collectionName');\n $arr = [];\n $em = $this->getDoctrine()->getManager();\n $products = [];\n if(strpos($collectionName, ';') !== false) {\n $collectionArray = explode(';', $collectionName);\n foreach ($collectionArray as $collectionName) {\n $collection = $em->getRepository('App:ProductTypes')->findOneBy(['name' => $collectionName]);\n $products[] = $em->getRepository('App:Products')->findBy(['type' => $collection]);\n }\n } else {\n $collection = $em->getRepository('App:ProductTypes')->findOneBy(['name' => $collectionName]);\n $products = $em->getRepository('App:Products')->findBy(['type' => $collection]);\n\n if (!$collection) {\n $brand = $em->getRepository('App:Brands')->findOneBy(['name' => $collectionName]);\n $products = $em->getRepository('App:Products')->findBy(['brand' => $brand]);\n }\n }\n\n $colorsArr = [];\n $sizeArr = [];\n $brandArr = [];\n\n foreach ($products as $product) {\n if(is_array($product)) {\n foreach ($product as $item) {\n if ($item->getSize()) {\n $sizeArr[] = $item->getSize()->getSize();\n }\n\n if($item->getColor()) {\n $colorsArr[] = $item->getColor()->getName();\n }\n\n if ($item->getBrand()) {\n $brandArr[] = $item->getBrand()->getName();\n }\n }\n } else {\n if ($product->getSize()) {\n $sizeArr[] = $product->getSize()->getSize();\n }\n\n if($product->getColor()) {\n $colorsArr[] = $product->getColor()->getName();\n }\n\n if ($product->getBrand()) {\n $brandArr[] = $product->getBrand()->getName();\n }\n }\n }\n\n $arr['colors'] = array_unique($colorsArr);\n $arr['sizes'] = array_unique($sizeArr);\n $arr['brands'] = array_unique($brandArr);\n\n return new JsonResponse($arr);\n }", "public static function get_attribution_product_fields($product)\n {\n $list = array();\n if ($product['type'] == \"variable\" and count($product['variations']) > 0) {\n foreach ($product['attributes'] as $attribute) {\n\n // If Attribute Not User For Variation\n if ($attribute['variation'] === false) {\n continue;\n }\n\n // Get Basic Detail\n $list[wc_attribute_taxonomy_name($attribute['slug'])] = array(\n 'name' => $attribute['name'],\n 'options' => array()\n );\n $options = array();\n foreach ($attribute['terms'] as $term_key => $term) {\n\n // Check Term in Variables Product\n $exist = false;\n foreach ($product['variations'] as $variations_product) {\n $in_stock = $variations_product['in_stock'];\n $stock_quantity = $variations_product['stock_quantity'];\n if ($in_stock === true) {\n foreach ($variations_product['attributes'] as $variations_product_attribute) {\n if ($term['slug'] == $variations_product_attribute['option']) {\n $exist = true;\n break;\n }\n }\n }\n }\n if ($exist === true) {\n $options[$term['slug']] = $term['name'];\n }\n }\n $list[wc_attribute_taxonomy_name($attribute['slug'])]['options'] = $options;\n }\n }\n\n /**\n * [pa_color] => Array\n * (\n * [name] => رنگ\n * [options] => Array\n * (\n * [blue] => آبی\n * [red] => قرمز\n * )\n * )\n * [pa_size] => Array\n * (\n * [name] => سایز\n * [options] => Array\n * (\n * [l] => L\n */\n return $list;\n }", "private function _getProductvariantsList($product) {\n\n $productvariantsList = array();\n $linkHelper = new Helper\\HtmlLinkHelper();\n $spanHelper = new Helper\\HtmlSpanHelper();\n\n /* @var $productvariant Entity\\ProductEntity */\n foreach ($product->getChilderen() as $productvariant) {\n\n $categoryId = $productvariant->getProductCategories()->first()->getCategory()->getId();\n\n $name = $productvariant->getCurrentTranslation()->getName();\n\n // render link\n $liString = $linkHelper->getHtml(\n $name,\n $this->url()->fromRoute('home/default', array(\n 'controller' => 'product',\n 'action' => 'form',\n 'param' => 'product',\n 'value' => $productvariant->getId(),\n 'param2' => 'category',\n 'value2' => $categoryId\n )),\n $name,\n 'pane-navi-link productvariant',\n array(\n 'data-pane-title' => '',\n 'data-delete-url' => $this->url()->fromRoute('home/default', array(\n 'controller' => 'product',\n 'action' => 'delete',\n 'param' => 'product',\n 'value' => $productvariant->getId()\n ))\n ),\n null\n );\n\n// $liString .= $spanHelper->getHtml(\n// '',\n// 'edit',\n// array(\n// 'data-form-url' => $this->url()->fromRoute('home/default', array(\n// 'controller' => 'product',\n// 'action' => 'form',\n// 'param' => 'product',\n// 'value' => $productvariant->getId()\n// ))\n// )\n// );\n\n $productvariantsList[] = $liString;\n }\n\n return $productvariantsList;\n }", "public function color()\n {\n $color = $this->customer->color;\n\n $r = substr($color, 1, 2);\n $g = substr($color, 3, 2);\n $b = substr($color, 5, 2);\n $luma = (float)0.2126 * hexdec($r)\n + 0.7152 * hexdec($g)\n + 0.0722 * hexdec($b);\n\n return ['color' => $this->customer->color, 'luma' => $luma];\n }", "public function test_get_style_variations_returns_all_variations() {\n\t\t// Switch to a child theme.\n\t\tswitch_theme( 'block-theme-child' );\n\t\twp_set_current_user( self::$administrator_id );\n\n\t\t$actual_settings = WP_Theme_JSON_Resolver::get_style_variations();\n\t\t$expected_settings = array(\n\t\t\tarray(\n\t\t\t\t'version' => 2,\n\t\t\t\t'title' => 'variation-b',\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'blocks' => array(\n\t\t\t\t\t\t'core/post-title' => array(\n\t\t\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t\t\t'palette' => array(\n\t\t\t\t\t\t\t\t\t'theme' => array(\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t'slug' => 'dark',\n\t\t\t\t\t\t\t\t\t\t\t'name' => 'Dark',\n\t\t\t\t\t\t\t\t\t\t\t'color' => '#010101',\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'version' => 2,\n\t\t\t\t'title' => 'Block theme variation',\n\t\t\t\t'settings' => array(\n\t\t\t\t\t'color' => array(\n\t\t\t\t\t\t'palette' => array(\n\t\t\t\t\t\t\t'theme' => array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'slug' => 'foreground',\n\t\t\t\t\t\t\t\t\t'name' => 'Foreground',\n\t\t\t\t\t\t\t\t\t'color' => '#3F67C6',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'styles' => array(\n\t\t\t\t\t'blocks' => array(\n\t\t\t\t\t\t'core/post-title' => array(\n\t\t\t\t\t\t\t'typography' => array(\n\t\t\t\t\t\t\t\t'fontWeight' => '700',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\twp_recursive_ksort( $actual_settings );\n\t\twp_recursive_ksort( $expected_settings );\n\n\t\t$this->assertSame(\n\t\t\t$expected_settings,\n\t\t\t$actual_settings\n\t\t);\n\t}", "public function getCssCustomProduct()\n {\n return Mage::getStoreConfig('splitprice/split_price_presentation/css_product');\n }", "public function variations()\n {\n return $this->hasMany(ProductVariation::class);\n }", "public function getColor()\n {\n $La_Color = null;\n\n switch($this->i_Colormode)\n {\n case self::SVNHUE_COLORMODE_HUE:\n $La_Color['hue'] = $this->a_State['hue'];\n $La_Color['sat'] = $this->a_State['sat'];\n break;\n\n case self::SVNHUE_COLORMODE_CT:\n $La_Color['ct'] = $this->a_State['ct'];\n break;\n\n case self::SVNHUE_COLORMODE_XY:\n $La_Color['xy'] = $this->a_State['xy'];\n break;\n } /* switch */\n\n return($La_Color);\n\n }", "public function getColor()\n {\n return self::QUALITY_MAP[$this->qualityID]['color'];\n }", "function estore_woocommerce_category_color_css(){\n\n\t$categories = get_terms( 'product_cat', array( 'hide_empty' => false ) );\n\n\t//print_r($categories);\n\n\t$cat_color_css = '';\n\tforeach($categories as $category){\n\t\t$cat_color = get_theme_mod( 'estore_woocommerce_category_color_'.$category->term_id );\n\t\t$hover_color = estore_darkcolor($cat_color, -20);\n\t\t$cat_id = $category->term_id;\n\t\tif(!empty($cat_color)) {\n\t\t\t$cat_color_css .= '\n\n\t\t\t/* Border Color */\n\t\t\t.widget-collection .estore-cat-color_'.$cat_id.' .cart-wishlist-btn a.added_to_cart:hover::after, .widget-collection .estore-cat-color_'.$cat_id.' .cart-wishlist-btn a.added_to_cart::after, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .products-img .products-hover-wrapper .products-hover-block a:hover, .widget-collection .estore-cat-color_'.$cat_id.' .cart-wishlist-btn a i, .estore-cat-color_'.$cat_id.' .hot-product-content-wrapper .hot-img {border-color: '.$cat_color.'}\n\t\t\t/* Background Color */\n\t\t\t .widget-collection .estore-cat-color_'.$cat_id.' .cart-wishlist-btn a.added_to_cart:hover::after, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .products-img .products-hover-wrapper .products-hover-block a:hover, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .yith-wcwl-add-to-wishlist .add_to_wishlist.button.alt, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse a, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse a,.product-collection.estore-cat-color_'.$cat_id.' .page-title::after,.estore-cat-color_'.$cat_id.' .hot-content-wrapper .single_add_to_wishlist, .widget-collection .estore-cat-color_'.$cat_id.' .cart-wishlist-btn a i:hover, .estore-cat-color_'.$cat_id.' .hot-product-title, .widget-collection .estore-cat-color_'.$cat_id.' .page-title::after{background: '.$cat_color.'}\n\t\t\t/* Color */\n\t\t\t.estore-cat-color_'.$cat_id.' .hot-content-wrapper .hot-title a:hover, .estore-cat-color_'.$cat_id.' .hot-product-content-wrapper .hot-img .cart-price-wrapper .added_to_cart:hover, .widget-collection .estore-cat-color_'.$cat_id.' .cart-wishlist-btn a.added_to_cart::after, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .price ins, .estore-cat-color_'.$cat_id.' .product-list-wrap .product-list-block .product-list-content .price ins, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .products-title a:hover, .woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .star-rating, .estore-cat-color_'.$cat_id.' .view-all a:hover, .estore-cat-color_'.$cat_id.' .hot-product-content-wrapper .hot-img .cart-price-wrapper .add_to_cart_button:hover, .widget-collection .estore-cat-color_'.$cat_id.' .cart-wishlist-btn a i, .estore-cat-color_'.$cat_id.' .product-list-wrap .product-list-block .product-list-content .product-list-title a:hover, .estore-cat-color_'.$cat_id.' .hot-content-wrapper .star-rating, .estore-cat-color_'.$cat_id.' .sorting-form-wrapper a, .estore-cat-color_'.$cat_id.' .section-title-wrapper .section-title-block .page-title a:hover{color:'.$cat_color.'}\n\n\t\t\t/*hover */\n\t\t\t.estore-cat-color_'.$cat_id.' .hot-content-wrapper .single_add_to_wishlist:hover,\n\t\t\t.woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .yith-wcwl-add-to-wishlist .add_to_wishlist.button.alt:hover,\n\t\t\t.woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistexistsbrowse a:hover,\n\t\t\t.woocommerce-page .estore-cat-color_'.$cat_id.' ul.products li.product .yith-wcwl-add-to-wishlist .yith-wcwl-wishlistaddedbrowse a:hover{\n\t\t\t\tbackground: '.$hover_color.'\n\t\t\t}\n\t\t\t';\n\t\t}\n\t}\n\n\tif( !empty( $cat_color_css ) ) {\n\t?>\n\t\t<!-- WooCommerce Category Color --><style type=\"text/css\"><?php echo $cat_color_css; ?></style>\n\t<?php\n\t}\n}", "function get_woocommerce_product_list() {\n\t$full_product_list = array();\n\t$products = new WP_Query( array(\n\t\t'post_type' => array( 'product', 'product_variation' ),\n\t\t'posts_per_page' => - 1,\n\t\t'product_cat' => 'learn',\n\t) );\n\n\t$products = $products->posts;\n\n\tforeach ( $products as $index => $product ) {\n\t\t$theid = $product->ID;\n\n\t\t// its a variable product\n\t\tif ( $product->post_type == 'product_variation' ) {\n\t\t\t$parent_id = wp_get_post_parent_id( $theid );\n\t\t\t$sku = get_post_meta( $theid, '_sku', true );\n\t\t\t$thetitle = get_the_title( $parent_id );\n\n\t\t\t// ****** Some error checking for product database *******\n\t\t\t// check if variation sku is set\n\t\t\tif ( $sku == '' ) {\n\t\t\t\tif ( $parent_id == 0 ) {\n\t\t\t\t\t// Remove unexpected orphaned variations.. set to auto-draft\n\t\t\t\t} else {\n\t\t\t\t\t// there's no sku for this variation > copy parent sku to variation sku\n\t\t\t\t\t// & remove the parent sku so the parent check below triggers\n\t\t\t\t\t$sku = get_post_meta( $parent_id, '_sku', true );\n\t\t\t\t\tif ( function_exists( 'add_to_debug' ) ) {\n\t\t\t\t\t\tadd_to_debug( 'empty sku id=' . $theid . 'parent=' . $parent_id . 'setting sku to ' . $sku );\n\t\t\t\t\t}\n\t\t\t\t\tupdate_post_meta( $theid, '_sku', $sku );\n\t\t\t\t\tupdate_post_meta( $parent_id, '_sku', '' );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// ****************** end error checking *****************\n\n\t\t\t// its a simple product\n\t\t} else {\n\t\t\t$thetitle = $product->post_title;\n\t\t}\n\t\t// add product to array but don't add the parent of product variations\n\t\t$full_product_list[ $theid ] = $thetitle;\n\t}\n\n\treturn $full_product_list;\n}", "public function getColor3()\n {\n $sql = \"SELECT color_hex\n FROM site_color where site_color_id = 3\";\n\n $statement = $this->_dbh->prepare($sql);\n\n// $statement->bindParam(':color3', $color3);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getPaletteColors($id){\n $palette = Palette::find($id);\n return $palette -> colors;\n }", "public static function get_product_color( \\WC_Product $product ) {\n\n\t\t$color_value = '';\n\t\t$color_attribute = self::get_product_color_attribute( $product );\n\n\t\tif ( ! empty( $color_attribute ) ) {\n\t\t\t$color_value = $product->get_attribute( $color_attribute );\n\t\t}\n\n\t\tif ( empty( $color_value ) && $product->is_type( 'variation' ) ) {\n\t\t\t$parent_product = wc_get_product( $product->get_parent_id() );\n\t\t\t$color_value = $parent_product instanceof \\WC_Product ? self::get_product_color( $parent_product ) : '';\n\t\t}\n\n\t\treturn $color_value;\n\t}", "public function getColor2()\n {\n $sql = \"SELECT color_hex\n FROM site_color where site_color_id = 2\";\n\n $statement = $this->_dbh->prepare($sql);\n\n// $statement->bindParam(':color2', $color2);\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getColorList()\n {\n return $this->colorList;\n }", "public function getColors()\n\t{\n\t\treturn [\n\t\t\t'AliceBlue',\n\t\t\t'AntiqueWhite',\n\t\t\t'Aqua',\n\t\t\t'Aquamarine',\n\t\t\t'Azure',\n\t\t\t'Beige',\n\t\t\t'Bisque',\n\t\t\t'Black',\n\t\t\t'BlanchedAlmond',\n\t\t\t'Blue',\n\t\t\t'BlueViolet',\n\t\t\t'Brown',\n\t\t\t'BurlyWood',\n\t\t\t'CadetBlue',\n\t\t\t'Chartreuse',\n\t\t\t'Chocolate',\n\t\t\t'Coral',\n\t\t\t'CornflowerBlue',\n\t\t\t'Cornsilk',\n\t\t\t'Crimson',\n\t\t\t'Cyan',\n\t\t\t'DarkBlue',\n\t\t\t'DarkCyan',\n\t\t\t'DarkGoldenRod',\n\t\t\t'DarkGray',\n\t\t\t'DarkGreen',\n\t\t\t'DarkKhaki',\n\t\t\t'DarkMagenta',\n\t\t\t'DarkOliveGreen',\n\t\t\t'Darkorange',\n\t\t\t'DarkOrchid',\n\t\t\t'DarkRed',\n\t\t\t'DarkSalmon',\n\t\t\t'DarkSeaGreen',\n\t\t\t'DarkSlateBlue',\n\t\t\t'DarkSlateGray',\n\t\t\t'DarkTurquoise',\n\t\t\t'DarkViolet',\n\t\t\t'DeepPink',\n\t\t\t'DeepSkyBlue',\n\t\t\t'DimGray',\n\t\t\t'DodgerBlue',\n\t\t\t'FireBrick',\n\t\t\t'FloralWhite',\n\t\t\t'ForestGreen',\n\t\t\t'Fuchsia',\n\t\t\t'Gainsboro',\n\t\t\t'GhostWhite',\n\t\t\t'Gold',\n\t\t\t'GoldenRod',\n\t\t\t'Gray',\n\t\t\t'Green',\n\t\t\t'GreenYellow',\n\t\t\t'HoneyDew',\n\t\t\t'HotPink',\n\t\t\t'IndianRed',\n\t\t\t'Indigo',\n\t\t\t'Ivory',\n\t\t\t'Khaki',\n\t\t\t'Lavender',\n\t\t\t'LavenderBlush',\n\t\t\t'LawnGreen',\n\t\t\t'LemonChiffon',\n\t\t\t'LightBlue',\n\t\t\t'LightCoral',\n\t\t\t'LightCyan',\n\t\t\t'LightGoldenRodYellow',\n\t\t\t'LightGreen',\n\t\t\t'LightGrey',\n\t\t\t'LightPink',\n\t\t\t'LightSalmon',\n\t\t\t'LightSeaGreen',\n\t\t\t'LightSkyBlue',\n\t\t\t'LightSlateGray',\n\t\t\t'LightSteelBlue',\n\t\t\t'LightYellow',\n\t\t\t'Lime',\n\t\t\t'LimeGreen',\n\t\t\t'Linen',\n\t\t\t'Magenta',\n\t\t\t'Maroon',\n\t\t\t'MediumAquaMarine',\n\t\t\t'MediumBlue',\n\t\t\t'MediumOrchid',\n\t\t\t'MediumPurple',\n\t\t\t'MediumSeaGreen',\n\t\t\t'MediumSlateBlue',\n\t\t\t'MediumSpringGreen',\n\t\t\t'MediumTurquoise',\n\t\t\t'MediumVioletRed',\n\t\t\t'MidnightBlue',\n\t\t\t'MintCream',\n\t\t\t'MistyRose',\n\t\t\t'Moccasin',\n\t\t\t'NavajoWhite',\n\t\t\t'Navy',\n\t\t\t'OldLace',\n\t\t\t'Olive',\n\t\t\t'OliveDrab',\n\t\t\t'Orange',\n\t\t\t'OrangeRed',\n\t\t\t'Orchid',\n\t\t\t'PaleGoldenRod',\n\t\t\t'PaleGreen',\n\t\t\t'PaleTurquoise',\n\t\t\t'PaleVioletRed',\n\t\t\t'PapayaWhip',\n\t\t\t'PeachPuff',\n\t\t\t'Peru',\n\t\t\t'Pink',\n\t\t\t'Plum',\n\t\t\t'PowderBlue',\n\t\t\t'Purple',\n\t\t\t'Red',\n\t\t\t'RosyBrown',\n\t\t\t'RoyalBlue',\n\t\t\t'SaddleBrown',\n\t\t\t'Salmon',\n\t\t\t'SandyBrown',\n\t\t\t'SeaGreen',\n\t\t\t'SeaShell',\n\t\t\t'Sienna',\n\t\t\t'Silver',\n\t\t\t'SkyBlue',\n\t\t\t'SlateBlue',\n\t\t\t'SlateGray',\n\t\t\t'Snow',\n\t\t\t'SpringGreen',\n\t\t\t'SteelBlue',\n\t\t\t'Tan',\n\t\t\t'Teal',\n\t\t\t'Thistle',\n\t\t\t'Tomato',\n\t\t\t'Turquoise',\n\t\t\t'Violet',\n\t\t\t'Wheat',\n\t\t\t'White',\n\t\t\t'WhiteSmoke',\n\t\t\t'Yellow',\n\t\t\t'YellowGreen',\n\t\t];\n\t}", "public function post_rating_colors()\n\t{\n\t\t\n\t\t$query = $this->db->query(\"SELECT `average`, `color` FROM `post_rating_colors`\");\n\t\t\n\t\t// echo $this->db->last_query();\n\t\t// print_r($query->result_array()\t);\n\t\t// die();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$all_colors = array();\n\t\t\tforeach ($query->result_array() as $value) {\n\t\t\t\t$all_colors[$value['average']] = $value['color'];\n\t\t\t}\n\t\t\treturn $all_colors;\n\t\t}\n\t}", "function fn_product_variations_get_variation_by_selected_options($product, $product_options, $selected_options, $index = 0)\n{\n /** @var ProductManager $product_manager */\n $product_manager = Tygh::$app['addons.product_variations.product.manager'];\n\n $name_part = array($product['product']);\n $variation_code = $product_manager->getVariationCode($product['product_id'], $selected_options);\n $options = array();\n\n foreach ($selected_options as $option_id => $variant_id) {\n $option_id = (int) $option_id;\n $variant_id = (int) $variant_id;\n\n $option = $product_options[$option_id];\n $option['value'] = $variant_id;\n\n $variant = $product_options[$option_id]['variants'][$variant_id];\n\n $name_part[] = $option['option_name'] . ': ' .$variant['variant_name'];\n $options[$option_id] = $option;\n }\n\n $combination = array(\n 'name' => implode(', ', $name_part),\n 'price' => $product['price'],\n 'list_price' => $product['list_price'],\n 'weight' => $product['weight'],\n 'amount' => empty($product['amount']) ? 1 : $product['amount'],\n 'code' => !empty($product['product_code']) ? $product['product_code'] . $index : '',\n 'options' => $options,\n 'selected_options' => $selected_options,\n 'variation' => $variation_code\n );\n\n return $combination;\n}", "public function getColorSpace() {}", "public function getColorSpace() {}", "public function single_product_product_variations_custom_output() {\n\t\t\tif ( ! defined( 'CFVSW_VER' ) && class_exists( 'woocommerce' ) && is_product() && astra_get_option( 'single-product-select-variations' ) ) {\n\t\t\t\tadd_filter( 'woocommerce_dropdown_variation_attribute_options_html', array( $this, 'single_product_variations_custom_html' ), 999, 2 );\n\t\t\t}\n\t\t}", "public function get_first_variation_image( $retProd ) {\n\n $images = array( 'large' => array(), 'small' => array() );\n\n if ( isset($retProd['Variations'], $retProd['Variations']['TotalVariations'], $retProd['Variations']['Item']) ) {\n $total = (int)$retProd['Variations']['TotalVariations'];\n \n $variations = array();\n if ($total <= 1 || isset($retProd['Variations']['Item']['ASIN'])) { // --fix 2015.03.19\n $variations[] = $retProd['Variations']['Item'];\n } else {\n $variations = (array) $retProd['Variations']['Item'];\n }\n \n // Loop through the variation\n foreach ($variations as $variation_item) {\n \n $images = $this->build_images_data( $variation_item );\n if ( !empty($images['large']) ) {\n return $images;\n }\n } // end foreach\n }\n return $images;\n }", "public static function get_product_color_attribute( \\WC_Product $product ) {\n\n\t\tif ( $product->is_type( 'variation' ) ) {\n\n\t\t\t// get the attribute from the parent\n\t\t\t$product = wc_get_product( $product->get_parent_id() );\n\t\t}\n\n\t\t$attribute_name = '';\n\n\t\tif ( $product ) {\n\n\t\t\t$meta_value = $product->get_meta( self::COLOR_ATTRIBUTE_META_KEY );\n\n\t\t\t// check if an attribute with that name exists\n\t\t\tif ( self::product_has_attribute( $product, $meta_value ) ) {\n\t\t\t\t$attribute_name = $meta_value;\n\t\t\t}\n\n\t\t\tif ( empty( $attribute_name ) ) {\n\t\t\t\t// try to find a matching attribute\n\t\t\t\tforeach ( self::get_available_product_attributes( $product ) as $slug => $attribute ) {\n\n\t\t\t\t\tif ( stripos( $attribute->get_name(), 'color' ) !== false || stripos( $attribute->get_name(), 'colour' ) !== false ) {\n\t\t\t\t\t\t$attribute_name = $slug;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $attribute_name;\n\t}", "function get_ColorLovers_Palette($hex, $route, $num) {\n //update to request and process more plalettes to make sure we always returns palattes of 5-colors.\n $client = new GuzzleHttp\\Client();\n\n $url = \"http://www.colourlovers.com/api/palettes/top?hex=\".urlencode($hex).\"&format=json&sortBy=asc&numResults=\".urlencode($num);\n $headers = array('ACCEPT' => 'application/json');\n\n $response = $client->get($url);\n $data = $response->json();\n\n\n $all_palettes = array();\n array_push($all_palettes, array(\"resource_location\"=>$route));\n foreach ($data as $color) {\n if (count($color['colors']) == 5) {\n $palette = array(\n \"palette\"=>$color['colors'],\n \"source_url\"=>$color['url'],\n \"source_api_url\"=>$color['apiUrl'],\n );\n array_push($all_palettes, $palette);\n }\n }\n return $all_palettes;\n $hex = null;\n \n}", "public function getColors()\n {\n return $this->colors;\n }", "function client_portal_get_theme_colors_gutenberg() {\n\n\t// Grab our ACF theme colors.\n\t$colors = client_portal_get_theme_colors();\n\n\tif ( ! $colors ) {\n\t\treturn array();\n\t}\n\n\tforeach ( $colors as $key => $color ) {\n\t\t$gutenberg_colors[] = array(\n\t\t\t'name' => esc_html( $key ),\n\t\t\t'slug' => sanitize_title( $key ),\n\t\t\t'color' => esc_attr( $color ),\n\t\t);\n\t}\n\n\treturn $gutenberg_colors;\n}", "public function getCssCustomProduct()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_presentation/css_product', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "public function getVariationSpecifics()\n {\n return $this->variationSpecifics;\n }", "public function getColor();", "public function getColor();", "public function getColor();", "public function getColor();", "public static function getProductOptions()\n {\n return self::get('product') ?: [];\n }", "public function getProductAndVariantAttributes()\n\t{\n\t\treturn array_unique(array_merge($this->arrAttributes, $this->arrVariantAttributes));\n\t}", "public function testProductSetVariants()\n {\n $product = $this->find('product', 1);\n \n $product->setVariants();\n $this->flush($product);\n \n $productSizes = $product->getSizes()[0];\n $productColors = $product->getColors()[0];\n \n $this->assertEquals(\n $productColors\n ->getSizes()\n ->contains($productSizes),\n true\n );\n \n $this->assertTrue(\n $productSizes\n ->getColors()\n ->contains($productColors)\n ); \n }", "public function getVariants()\n {\n return array();\n }", "function get_variant_images($id_product, $variant_options=array())\n{\n\tglobal $mysqli, $product;\n\t\n\t$groups=get_variant_groups($id_product);\n\t\n\t// build sql \n\t// get all groups for this product\n\tif (sizeof($groups)) {\n\t\t$joins = array();\t\n\t\t$where = array();\t\t\n\t\t$group_by = array();\t\n\t\t\n\t\t$i=1;\n\t\tforeach ($groups as $id_product_variant_group => $row_group) {\t\n\t\t\t$where_str = array();\n\t\t\t\n\t\t\t$joins[] = 'INNER JOIN\n\t\t\t(product_image_variant_option AS pvo'.$i.')\n\t\t\tON\n\t\t\t(product_image_variant.id = pvo'.$i.'.id_product_image_variant)';\n\t\t\n\t\t\t$where_str[] = 'pvo'.$i.'.id_product_variant_group = \"'.$mysqli->escape_string($id_product_variant_group).'\"';\n\t\t\t\n\t\t\t$stop=0;\n\t\t\tif (isset($variant_options[$id_product_variant_group]) && $variant_options[$id_product_variant_group]) {\n\t\t\t\t$id_product_variant_group_option = $variant_options[$id_product_variant_group];\n\t\t\t\t\n\t\t\t\t$where_str[] = 'pvo'.$i.'.id_product_variant_group_option = \"'.$mysqli->escape_string($id_product_variant_group_option).'\"';\n\t\t\t} else { \n\t\t\t\t$where_str[] = 'pvo'.$i.'.id_product_variant_group_option = 0';\n\t\t\t}\n\t\t\t\n\t\t\t$where[] = implode(' AND ',$where_str);\n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\t//if ($stop) break;\n\t\t}\n\t\t\n\t\t$joins = implode(\"\\r\\n\",$joins);\n\t\t$where = implode(' AND ',$where);\n\t\t$group_by = implode(',',$group_by);\n\t\t\n\t\t$array=array();\n\t\t\t\t\t\t\n\t\tif ($result_options = $mysqli->query('SELECT\n\t\tproduct_image_variant_image.id, \n\t\tproduct_image_variant_image.original, \n\t\tproduct_image_variant_image.filename,\n\t\tproduct_image_variant_image.cover\n\t\tFROM\n\t\tproduct_image_variant\n\t\tINNER JOIN \n\t\tproduct_image_variant_image\n\t\tON\n\t\t(product_image_variant.id = product_image_variant_image.id_product_image_variant)\n\t\t\n\t\t'.$joins.'\n\t\t\n\t\tWHERE\n\t\tproduct_image_variant.id_product = \"'.$mysqli->escape_string($id_product).'\"\n\t\tAND\n\t\t'.$where.'\n\t\tORDER BY \n\t\tIF(product_image_variant_image.cover=1,-1,product_image_variant_image.sort_order) ASC')) {\t\t\n\t\t\t// if we find variant images\n\t\t\tif ($result_options->num_rows) {\n\t\t\t\twhile ($row_option = $result_options->fetch_assoc()) {\n\t\t\t\t\t$array[$row_option['id']] = $row_option;\t\n\t\t\t\t}\n\t\t\t// if no images for specific variant\n\t\t\t} else {\n\t\t\t\t// loop through variant options, remove last until we find images for this variant \n\t\t\t\tdo {\n\t\t\t\t\tif (!sizeof($variant_options)) break;\n\t\t\t\t\tarray_pop($variant_options);\n\t\t\t\t} while (!sizeof($array = get_variant_images($id_product, $variant_options)));\n\t\t\t\t\n\t\t\t\t// if none is found, load default product image\n\t\t\t\tif (!sizeof($array)) return $product['images'];\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $array;\n}", "public function getColorOption($product)\n {\n\t\t$colorcode = $product->getColor();\n\t\t$attr = $product->getResource()->getAttribute('color');\n\t\tif ($attr->usesSource()) {\n\t\t\t$optionText = $attr->getSource()->getOptionText($colorcode);\n\t\t}\n\t\treturn $optionText;\n }", "function fn_product_variations_generate($product_id, $combinations, array $options_ids)\n{\n $languages = Languages::getAll();\n $product_row = db_get_row('SELECT * FROM ?:products WHERE product_id = ?i', $product_id);\n\n $product_variation_ids = db_get_fields('SELECT product_id FROM ?:products WHERE parent_product_id = ?i', $product_id);\n\n foreach ($product_variation_ids as $product_variation_id) {\n fn_delete_product($product_variation_id);\n }\n\n foreach ($combinations as $variation_code => $combination) {\n fn_product_variations_save_variation($product_row, $combination, $languages);\n }\n\n db_query(\n 'UPDATE ?:products SET product_type = ?s, variation_options = ?s WHERE product_id = ?i',\n ProductManager::PRODUCT_TYPE_CONFIGURABLE, json_encode(array_values($options_ids)), $product_id\n );\n}", "public function getColor() {}", "public function getColor() {}", "public function getFullPalette() {\n\t\treturn array(\n\t\t\t\"ContrastColour1\" => $this->ContrastColour1,\n\t\t\t\"ContrastColour2\" => $this->ContrastColour2,\n\t\t\t\"ContrastColour3\" => $this->ContrastColour3,\n\t\t\t\"ContrastColour4\" => $this->ContrastColour4,\n\t\t\t'PaletteColour1' => $this->PaletteColour1,\n\t\t\t'PaletteColour2' => $this->PaletteColour2,\n\t\t\t'PaletteColour3' => $this->PaletteColour3,\n\t\t\t'PaletteColour4' => $this->PaletteColour4,\n\t\t\t'PaletteColour5' => $this->PaletteColour5,\n\t\t\t'PaletteColour6' => $this->PaletteColour6\n\t\t);\n\t}", "private function getSwatchAttributes(Product $product)\n {\n $swatchAttributes = $this->swatchAttributesProvider->provide($product);\n return $swatchAttributes;\n }", "public static function getColors()\n {\n $db = DataBase::connect();\n\n $result = $db->query('SELECT * FROM `color`');\n\n $colors = [];\n\n $i = 1;\n\n while($row = $result->fetch()) {\n $colors[$i]['color'] = $row['color'];\n $colors[$i]['ukr_title'] = $row['ukr_title'];\n $colors[$i]['upper_ukr_title'] = $row['upper_ukr_title'];\n $colors[$i]['default'] = $row['default'];\n\n $i++;\n }\n return $colors;\n }", "function get_variation_by_cat_id($cat_id)\r\n{\r\n\t$sql = \"SELECT * FROM `category_variation` cv, variation v where cv.`cv_variation_id`=v.variation_id and variation_status = 1 and cv.`cv_category_id` = \".$cat_id.\"\";\r\n\t//op variation_name,variation_id,cv_id\r\n\t$results = get_results($sql);\r\n\treturn $results;\r\n}", "public function mainColour() {\n\t\t$images = $this->ShopImage->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'ShopImage.colour_1 IS NULL'\n\t\t\t)\n\t\t));\n\n\t\t$count = count($images);\n\t\tforeach ($images as $k => $image) {\n\t\t\t$this->out(sprintf('%s of %d: %s', str_pad($k+1, strlen($count), ' ', STR_PAD_LEFT), $count, $image['ShopImage']['image_full']));\n\t\t\t$colours = $this->_colour(APP . 'webroot/' . $image['ShopImage']['image_full']);\n\t\t\t$image['ShopImage']['colour_1'] = $colours[0];\n\t\t\t$image['ShopImage']['colour_2'] = $colours[1];\n\t\t\t$this->ShopImage->save($image['ShopImage']);\n\t\t}\n\t}", "function get_variant_options($id_product, $variant_options=array())\n{\n\tglobal $mysqli, $id_cart_discount;\n\t\n\t$output='';\n\t\n\t$groups=get_variant_groups($id_product);\n\t\n\t// build sql \n\t// get all groups for this product\n\tif (sizeof($groups)) {\t\t\n\t\tend($groups); \n\t\t$id_product_variant_group = key($groups); \n\t\n\t\tif (isset($variant_options[$id_product_variant_group]) && $variant_options[$id_product_variant_group]) return false;\n\t\n\t\t$joins = array();\t\n\t\t$where = array();\t\t\n\t\t$group_by = array();\t\n\t\t\n\t\t$i=1;\n\t\tforeach ($groups as $id_product_variant_group => $row_group) {\t\n\t\t\t$where_str = array();\n\t\t\t\n\t\t\t$joins[] = 'INNER JOIN\n\t\t\t(product_variant_option AS pvo'.$i.' CROSS JOIN product_variant_group_option AS pvgo'.$i.' CROSS JOIN product_variant_group_option_description AS pvo'.$i.'_desc)\n\t\t\tON\n\t\t\t(product_variant.id = pvo'.$i.'.id_product_variant AND pvo'.$i.'.id_product_variant_group_option = pvgo'.$i.'.id AND pvgo'.$i.'.id = pvo'.$i.'_desc.id_product_variant_group_option AND pvo'.$i.'_desc.language_code = \"'.$mysqli->escape_string($_SESSION['customer']['language']).'\")';\n\t\t\n\t\t\t$where_str[] = 'pvo'.$i.'.id_product_variant_group = \"'.$mysqli->escape_string($id_product_variant_group).'\"';\n\t\t\t\n\t\t\t$stop=0;\n\t\t\tif (isset($variant_options[$id_product_variant_group]) && $variant_options[$id_product_variant_group]) {\n\t\t\t\t$id_product_variant_group_option = $variant_options[$id_product_variant_group];\n\t\t\t\t\n\t\t\t\t$where_str[] = 'pvo'.$i.'.id_product_variant_group_option = \"'.$mysqli->escape_string($id_product_variant_group_option).'\"';\n\t\t\t} else { \n\t\t\t\t$stop=1;\n\t\t\t}\n\t\t\t\n\t\t\tif ($id_cart_discount) {\n\t\t\t\t$joins[] = 'LEFT JOIN\n\t\t\t\t(rebate_coupon_product AS rcp'.$i.' CROSS JOIN rebate_coupon AS rcpr'.$i.' CROSS JOIN cart_discount AS rcd'.$i.') \n\t\t\t\tON\n\t\t\t\t(product_variant.id_product = rcp'.$i.'.id_product AND rcp'.$i.'.id_rebate_coupon = rcpr'.$i.'.id ANd rcpr'.$i.'.id = rcd'.$i.'.id_rebate_coupon AND rcd'.$i.'.id = \"'.$mysqli->escape_string($id_cart_discount).'\")';\n\t\t\t\t\n\t\t\t\t$joins[] = 'LEFT JOIN\n\t\t\t\t(product_category AS pc'.$i.' CROSS JOIN rebate_coupon_category AS rcc'.$i.' CROSS JOIN rebate_coupon AS rccr'.$i.' CROSS JOIN cart_discount AS rccd'.$i.') \n\t\t\t\tON\n\t\t\t\t(product_variant.id_product = pc'.$i.'.id_product AND pc'.$i.'.id_category = rcc'.$i.'.id_category AND rcc'.$i.'.id_rebate_coupon = rccr'.$i.'.id ANd rccr'.$i.'.id = rcd'.$i.'.id_rebate_coupon AND rcd'.$i.'.id = \"'.$mysqli->escape_string($id_cart_discount).'\")';\n\t\t\t\t\n\t\t\t\t$where_str[] = '(rcp'.$i.'.id_rebate_coupon IS NOT NULL OR rcc'.$i.'.id_rebate_coupon IS NOT NULL)';\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t$select = 'pvo'.$i.'.id_product_variant_group_option,\n\t\t\tpvo'.$i.'.id_product_variant_group,\n\t\t\tpvo'.$i.'_desc.name,\n\t\t\tpvgo'.$i.'.swatch_type,\n\t\t\tpvgo'.$i.'.color,\n\t\t\tpvgo'.$i.'.color2,\n\t\t\tpvgo'.$i.'.color3,\n\t\t\tpvgo'.$i.'.filename';\n\t\t\t\n\t\t\t$where[] = implode(' AND ',$where_str);\n\t\t\t\n\t\t\t$group_by[] = 'pvo'.$i.'.id_product_variant_group_option';\n\t\t\t\n\t\t\t$order_by = 'pvgo'.$i.'.sort_order ASC';\n\t\t\t\n\t\t\t$i++;\n\t\t\t\n\t\t\tif ($stop) break;\n\t\t}\n\t\t\n\t\t$joins = implode(\"\\r\\n\",$joins);\n\t\t$where = implode(' AND ',$where);\n\t\t$group_by = implode(',',$group_by);\n\t\t\t\t\t\n\t\tif ($result_options = $mysqli->query('SELECT\n\t\t'.$select.'\n\t\tFROM\t\t\n\t\tproduct_variant\n\t\t\n\t\t'.$joins.'\n\t\t\n\t\tWHERE\n\t\tproduct_variant.active = 1 \n\t\tAND\n\t\tproduct_variant.id_product = \"'.$mysqli->escape_string($id_product).'\"\n\t\tAND\n\t\t'.$where.'\n\t\tGROUP BY '.\n\t\t$group_by.'\n\t\tORDER BY '.\n\t\t$order_by)) {\t\t\t\n\t\t\tif ($result_options->num_rows) {\n\t\t\t\t$input_type = $groups[$id_product_variant_group]['input_type'];\n\t\n\t\t\t\t$output .= '<div style=\"margin-top:10px; margin-bottom:10px;\" id=\"variant_group_'.$id_product_variant_group.'\">\n\t\t\t\t<div style=\"margin-bottom:5px;\"><strong>'.$groups[$id_product_variant_group]['name'].'</strong></div>';\n\t\n\t\t\t\tif (!$input_type) {\n\t\t\t\t\t$output .= '<select name=\"variant_options['.$id_product_variant_group.']\">\n\t\t\t\t\t<option value=\"0\">--</option>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$i=0;\n\t\t\t\twhile ($row_option = $result_options->fetch_assoc()) {\n\t\t\t\t\t$id_product_variant_group_option = $row_option['id_product_variant_group_option'];\n\t\t\t\t\t\n\t\t\t\t\tswitch ($input_type) {\n\t\t\t\t\t\t// dropdown\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t$output .= '<option value=\"'.$id_product_variant_group_option.'\">'.$row_option['name'].'</option>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// radio\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$output .= '<div><input type=\"radio\" name=\"variant_options['.$id_product_variant_group.']\" id=\"product_variant_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" value=\"'.$id_product_variant_group_option.'\">&nbsp;<label for=\"product_variant_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\">'.$row_option['name'].'</label></div>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// swatch\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t$swatch_type = $row_option['swatch_type'];\n\t\t\t\t\t\t\t$color = $row_option['color'];\n\t\t\t\t\t\t\t$color2 = $row_option['color2'];\n\t\t\t\t\t\t\t$color3 = $row_option['color3'];\n\t\t\t\t\t\t\t$filename = $row_option['filename'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($i==8) { $output .= '<div class=\"cb\"></div>'; $i=0; }\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tswitch ($swatch_type) {\n\t\t\t\t\t\t\t\t// 1 color\n\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border\"><input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" /><div class=\"variant_color_inner_border\"><div style=\"background-color: '.$color.';\" class=\"variant_color\"></div></div></a>';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t// 2 color\n\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border\">\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" />\n\t\t\t\t\t\t\t\t\t<div class=\"variant_color_inner_border\"><div class=\"variant_color\">\n\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:10px; height:20px; background-color: '.$color.';\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:10px; height:20px; background-color: '.$color2.';\"></div>\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<div class=\"cb\"></div>\n\t\t\t\t\t\t\t\t\t</div></div>\n\t\t\t\t\t\t\t\t\t</a>';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t// 3 color\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border\">\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" />\t\n\t\t\t\t\t\t\t\t\t<div class=\"variant_color_inner_border\"><div class=\"variant_color\">\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<div class=\"fl\" style=\"width:7px; height:20px; background-color: '.$color.';\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:6px; height:20px; background-color: '.$color2.';\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:7px; height:20px; background-color: '.$color3.';\"></div>\n\t\t\t\t\t\t\t\t\t<div class=\"cb\"></div>\n\t\t\t\t\t\t\t\t\t</div></div>\n\t\t\t\t\t\t\t\t\t</a>';\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t// file\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border\">\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" />\t\n\t\t\t\t\t\t\t\t\t<div class=\"variant_color_inner_border\"><div class=\"variant_color\">\t\t\n\t\t\t\t\t\t\t\t\t<img src=\"/images/products/swatch/'.$filename.'\" width=\"20\" height=\"20\" border=\"0\" hspace=\"0\" vspace=\"0\" />\n\t\t\t\t\t\t\t\t\t</div></div>\n\t\t\t\t\t\t\t\t\t</a>';\n\t\t\t\t\t\t\t\t\tbreak;\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\t\n\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\n\t\t\t\t\t\t\t++$i;\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tswitch ($input_type) {\n\t\t\t\t\t// dropdown\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t$output .= '</select>\n\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t/* <![CDATA[ */\n\t\n\t\n\t\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\t\tjQuery(\"select[name=\\'variant_options['.$id_product_variant_group.']\\']\").change(function(){\n\t\t\t\t\t\t\t\t// get values\n\t\t\t\t\t\t\t\t// ajax query to get new variants\n\t\t\t\t\t\t\t\tload_variant('.$id_product_variant_group.', jQuery(this).val());\n\t\t\t\t\t\t\t\tif (jQuery(\"#display_error\").css(\"display\") == \"block\"){\njQuery(\"#display_error\").hide(\"blind\", { direction: \"vertical\" }, 1000);\n}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t</script>';\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// radio\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\t$output .= '<script type=\"text/javascript\">\n\t\t\t\t\t\t/* <![CDATA[ */\n\t\n\t\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\t\tjQuery(\"input[name=\\'variant_options['.$id_product_variant_group.']\\']\").change(function(){\n\t\n\t\t\t\t\t\t\t\t// get values\n\t\t\t\t\t\t\t\t// ajax query to get new variants\n\t\t\t\t\t\t\t\tload_variant('.$id_product_variant_group.', jQuery(this).val());\n\t\t\t\t\t\t\t\tif (jQuery(\"#display_error\").css(\"display\") == \"block\"){\njQuery(\"#display_error\").hide(\"blind\", { direction: \"vertical\" }, 1000);\n}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t</script>';\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// swatch\n\t\t\t\t\tcase 2:\t\t\t\t\n\t\t\t\t\t\t$output .= '<script type=\"text/javascript\">\n\t\t\t\t\t\t/* <![CDATA[ */\n\t\n\t\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\t\tjQuery(\"a.variant_color_outer_border\").click(function(){\n\t\t\t\t\t\t\t\tif (!jQuery(\"input[id^=\\'variant_color_\\']:checked\",this).length) { \n\t\t\t\t\t\t\t\t\tjQuery(\"input[id^=\\'variant_color_\\']\",this).attr(\"checked\",true);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tjQuery(\"a.variant_color_outer_border\").removeClass(\"selected\");\n\t\t\t\t\t\t\t\t\tjQuery(this).addClass(\"selected\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get values\n\t\t\t\t\t\t\t\t\t// ajax query to get new variants\n\t\t\t\t\t\t\t\t\tload_variant('.$id_product_variant_group.', jQuery(\"input[id^=\\'variant_color_\\']\",this).val());\n\t\t\t\t\t\t\t\t\tif (jQuery(\"#display_error\").css(\"display\") == \"block\"){\njQuery(\"#display_error\").hide(\"blind\", { direction: \"vertical\" }, 1000);\n}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t</script>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$output .= '<div class=\"cb\"></div></div>';\n\t\t\t} else {\n\t\t\t\t$output .= 'No options found.';\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Exception('An error occured while trying to get variant group options.'.\"\\r\\n\\r\\n\".$mysqli->error);\t\t\n\t\t}\n\t}\n\t\n\treturn $output;\n}", "private function get_convention_product_ids() : array {\n\t\t$all_convention_ids = get_transient( 'ghc-all-convention-variation-ids' );\n\t\tif ( false === $all_convention_ids ) {\n\t\t\t$all_convention_ids = $this->set_convention_variation_ids_transient();\n\t\t}\n\n\t\treturn $all_convention_ids;\n\t}", "function get_all_colors()\n{\n\t$colors = array(\n\t\t\"000000\" => \"Black\",\n\t\t\"0000FF\" => \"Blue\",\n\t\t\"804000\" => \"Brown\",\n\t\t\"736F6E\" => \"Gray\",\n\t\t\"00FF00\" => \"Green\",\n\t\t\"FF8040\" => \"Orange\",\n\t\t\"FF00FF\" => \"Pink\",\n\t\t\"8E35EF\" => \"Purple\",\n\t\t\"FF0000\" => \"Red\",\n\t\t\"FFFF00\" => \"Yellow\",\n\t\t\"FFFFFF\" => \"White\",\n\t);\n\treturn $colors;\n}", "function GetAllColors () {\n $colors = array (\"#00FFFF\",\"#000000\",\"#0000FF\",\"#8A2BE2\",\"#A52A2A\",\"#DEB887\",\"#5F9EA0\",\"#7FFF00\",\"#D2691E\",\"#FF7F50\",\"#6495ED\",\"#00FFFF\",\"#00008B\",\"#008B8B\",\"#B8860B\",\"#A9A9A9\",\"#006400\",\"#BDB76B\",\"#8B008B\",\"#556B2F\",\"#FF8C00\",\"#9932CC\",\"#8B0000\",\"#E9967A\",\"#8FBC8F\",\"#483D8B\",\"#2F4F4F\",\"#2F4F4F\",\"#00CED1\",\"#9400D3\",\"#FF1493\",\"#00BFFF\",\"#696969\",\"#696969\",\"#1E90FF\",\"#B22222\",\"#228B22\",\"#FF00FF\",\"#FFD700\",\"#DAA520\",\"#808080\",\"#808080\",\"#008000\",\"#ADFF2F\",\"#FF69B4\",\"#CD5C5C\",\"#4B0082\",\"#7CFC00\",\"#ADD8E6\",\"#F08080\",\"#E0FFFF\",\"#D3D3D3\",\"#90EE90\",\"#FFB6C1\",\"#FFA07A\",\"#20B2AA\",\"#87CEFA\",\"#778899\",\"#778899\",\"#B0C4DE\",\"#00FF00\",\"#32CD32\",\"#FF00FF\",\"#800000\",\"#66CDAA\",\"#0000CD\",\"#BA55D3\",\"#9370D8\",\"#3CB371\",\"#7B68EE\",\"#00FA9A\",\"#48D1CC\",\"#C71585\",\"#191970\",\"#FFE4E1\",\"#FFE4B5\",\"#000080\",\"#808000\",\"#6B8E23\",\"#FFA500\",\"#FF4500\",\"#DA70D6\",\"#EEE8AA\",\"#98FB98\",\"#AFEEEE\",\"#D87093\",\"#FFDAB9\",\"#CD853F\",\"#FFC0CB\",\"#DDA0DD\",\"#B0E0E6\",\"#800080\",\"#FF0000\",\"#BC8F8F\",\"#4169E1\",\"#8B4513\",\"#FA8072\",\"#F4A460\",\"#2E8B57\",\"#A0522D\",\"#C0C0C0\",\"#87CEEB\",\"#6A5ACD\",\"#708090\",\"#708090\",\"#00FF7F\",\"#4682B4\",\"#D2B48C\",\"#008080\",\"#D8BFD8\",\"#FF6347\",\"#40E0D0\",\"#EE82EE\",\"#F5DEB3\",\"#FFFFFF\",\"#F5F5F5\",\"#FFFF00\",\"#9ACD32\");\n return($colors);\n}", "function get_primary_colors() {\n $colors = array(\n 'ff0000' => 'Red',\n '00ff00' => 'Green',\n '0000ff' => 'Blue',\n );\n $temp = array();\n foreach($colors as $k => $v) {\n $temp[] = '\"'.$k.'\", '.'\"'.$v.'\"';\n }\n return join(', ', $temp);\n}", "public function get_color_scheme() {\r\n\r\n return \tarray(\r\n 'epsilon_general_separator' => array(\r\n 'label' => esc_html__( 'Accent Colors', 'unapp' ),\r\n 'section' => 'colors',\r\n 'separator' => true,\r\n ),\r\n\r\n 'epsilon_accent_color' => array(\r\n 'label' => esc_html__( 'Accent Color #1', 'unapp' ),\r\n 'description' => esc_html__( 'Theme main color.', 'unapp' ),\r\n 'default' => '#798eea',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_accent_color_second' => array(\r\n 'label' => esc_html__( 'Accent Color #2', 'unapp' ),\r\n 'description' => esc_html__( 'The second main color.', 'unapp' ),\r\n 'default' => '#4aca85',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n 'epsilon_accent_color_third' => array(\r\n 'label' => esc_html__( 'Accent Color #3', 'unapp' ),\r\n 'description' => esc_html__( 'The third main color.', 'unapp' ),\r\n 'default' => '#499bea',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_text_separator' => array(\r\n 'label' => esc_html__( 'Typography Colors', 'unapp' ),\r\n 'section' => 'colors',\r\n 'separator' => true,\r\n ),\r\n\r\n 'epsilon_title_color' => array(\r\n 'label' => esc_html__( 'Title Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for titles.', 'unapp' ),\r\n 'default' => '#303133',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_text_color' => array(\r\n 'label' => esc_html__( 'Text Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for paragraphs.', 'unapp' ),\r\n 'default' => '#808080',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_link_color' => array(\r\n 'label' => esc_html__( 'Link Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for links.', 'unapp' ),\r\n 'default' => '#4aca85',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_link_hover_color' => array(\r\n 'label' => esc_html__( 'Link Hover Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for hovered links.', 'unapp' ),\r\n 'default' => '#5ed092',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_menu_separator' => array(\r\n 'label' => esc_html__( 'Navigation Colors', 'unapp' ),\r\n 'section' => 'colors',\r\n 'separator' => true,\r\n ),\r\n\r\n \r\n\r\n 'epsilon_menu_item_color' => array(\r\n 'label' => esc_html__( 'Menu item color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the menu item color.', 'unapp' ),\r\n 'default' => '#ffffff',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_menu_item_hover_color' => array(\r\n 'label' => esc_html__( 'Menu item hover color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the menu item hover color.', 'unapp' ),\r\n 'default' => '#ffffff',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_menu_item_active_color' => array(\r\n 'label' => esc_html__( 'Menu item active color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the menu item active color.', 'unapp' ),\r\n 'default' => '#ffffff',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_dropdown_menu_background' => array(\r\n 'label' => esc_html__( 'Dropdown background', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the menu background.', 'unapp' ),\r\n 'default' => '#000000',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_dropdown_menu_item_color' => array(\r\n 'label' => esc_html__( 'Dropdown menu item color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the menu item color.', 'unapp' ),\r\n 'default' => '#999999',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_dropdown_menu_item_hover_color' => array(\r\n 'label' => esc_html__( 'Dropdown menu item hover color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the menu item hover color.', 'unapp' ),\r\n 'default' => '#ffffff',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_dropdown_menu_item_active_color' => array(\r\n 'label' => esc_html__( 'Dropdown menu item active color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the menu item active color.', 'unapp' ),\r\n 'default' => '#ffffff',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_footer_separator' => array(\r\n 'label' => esc_html__( 'Footer Colors', 'unapp' ),\r\n 'section' => 'colors',\r\n 'separator' => true,\r\n ),\r\n\r\n 'epsilon_footer_contact_background' => array(\r\n 'label' => esc_html__( 'Footer Widget Background', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the footer widget background.', 'unapp' ),\r\n 'default' => '#303133',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_footer_background' => array(\r\n 'label' => esc_html__( 'Footer Copyright Background', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the footer copyright background.', 'unapp' ),\r\n 'default' => '#262626',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_footer_title_color' => array(\r\n 'label' => esc_html__( 'Footer Title Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the footer widget title.', 'unapp' ),\r\n 'default' => '#e6e6e6',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_footer_text_color' => array(\r\n 'label' => esc_html__( 'Text Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the footer text.', 'unapp' ),\r\n 'default' => '#808080',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_footer_link_color' => array(\r\n 'label' => esc_html__( 'Link Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the footer link.', 'unapp' ),\r\n 'default' => '#4aca85',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n 'epsilon_footer_link_hover_color' => array(\r\n 'label' => esc_html__( 'Link Hover Color', 'unapp' ),\r\n 'description' => esc_html__( 'The color used for the footer link hover.', 'unapp' ),\r\n 'default' => '#5ed092',\r\n 'section' => 'colors',\r\n 'hover-state' => false,\r\n ),\r\n\r\n );\r\n\t}", "public function getProductSelections();", "public function findDistinctColor() {\n // Try to run the SQL query.\n try {\n $this->query = $this->db->query(\"SELECT DISTINCT color FROM inventory ORDER BY color;\");\n $result = $this->query->fetchAll(\\PDO::FETCH_ASSOC);\n return $result;\n } catch(\\PDOException $e) {\n exit($e->getMessage());\n }\n }", "public function productColors( $count = 5 ) {\n\t\treturn $this->generator->randomElements( static::$colors, $count );\n\t}", "private function generateProductVariants($product, $params) // .. 2\n {\n $configurableAttributes = $this->_attributeRepository->getConfigurableAttributes();\n $variantAttributes = [];\n\n foreach ($configurableAttributes as $attribute) {\n $variantAttributes[$attribute->code] = $params[$attribute->code];\n }\n\n // dd($variantAttributes);\n\n $variants = $this->generateAttributeCombinations($variantAttributes); // .. 3\n\n // echo '<pre>';\n // print_r($variants);\n // exit;\n\n if ($variants) {\n foreach ($variants as $variant) {\n $variantParams = [\n 'parent_id' => $product->id,\n 'user_id' => $params['user_id'],\n 'sku' => $product->sku . '-' . implode('-', array_values($variant)),\n 'type' => 'simple',\n 'name' => $product->name . $this->convertVariantAsName($variant),\n ];\n\n $variantParams['slug'] = Str::slug($variantParams['name']);\n\n $newProductVariant = Product::create($variantParams);\n\n $categoryIds = !empty($params['category_ids']) ? $params['category_ids'] : [];\n $newProductVariant->categories()->sync($categoryIds);\n\n // dd($variantParams);\n\n $this->saveProductAttributeValues($newProductVariant, $variant);\n }\n }\n }", "function getFlavors()\r\n{\r\n return array(\"grasshopper\",\"maple\",\"carrot\", \"caramel\",\"velvet\",\"lemon\",\"tiramisu\");\r\n}", "public function getVariations() {\n return $this->variations;\n }", "function _acf_apply_hook_variations()\n{\n}", "function elex_bep_create_product_variation( $product_id, $variation_data ) {\n //Get varaible product object parent\n $product = wc_get_product( $product_id );\n //\n $variation_post = array(\n 'post_title' => $product->get_name(),\n 'post_name' => 'product-'.$product_id.'-varation',\n 'post_status' => 'publish',\n 'post_parent' => $product_id,\n 'post_type' => 'product_variation',\n 'guid' => $product->get_permalink()\n );\n\n $variation_id = wp_insert_post( $variation_post );\n $variation = new WC_Product_Variation( $variation_id );\n error_log( $variation_id );\n\n foreach ($variation_data['attributes'] as $attribute => $term_names )\n {\n $taxonomy = 'pa_'.$attribute; // The attribute taxonomy\n\n // If taxonomy doesn't exists we create it (Thanks to Carl F. Corneil)\n if( ! taxonomy_exists( $taxonomy ) ){ \n register_taxonomy(\n $taxonomy, 'product_variation',\n array(\n 'hierarchical' => false,\n 'label' => ucfirst( $attribute ),\n 'query_var' => true,\n 'rewrite' => array( 'slug' => sanitize_title($attribute) ), // The base slug\n )\n );\n }\n foreach( $term_names as $key=> $term_name ){\n error_log( $key. ' '. $term_name );\n // Check if the Term name exist and if not we create it.\n if( ! term_exists( $term_name, $taxonomy ) ){\n wp_insert_term( $term_name, $taxonomy ); // Create the term\n }\n $term_slug = get_term_by('name', $term_name, $taxonomy )->slug; // Get the term slug\n error_log( print_r($term_slug, TRUE ));\n\n // // Get the post Terms names from the parent variable product.\n $post_term_names = wp_get_post_terms( $product_id, $taxonomy, array('fields' => 'names') );\n\n // // Check if the post term exist and if not we set it in the parent variable product.\n if( ! in_array( $term_name, $post_term_names ) )\n wp_set_post_terms( $product_id, $term_name, $taxonomy, true );\n\n // // Set/save the attribute data in the product variation\n update_post_meta( $variation_id, 'attribute_'.$taxonomy, $term_slug );\n }\n }\n if( ! empty( $variation_data['sku'] ) )\n $variation->set_sku( $variation_data['sku'] );\n\n // Prices\n if( empty( $variation_data['sale_price'] ) ){\n $variation->set_price( $variation_data['regular_price'] );\n } else {\n $variation->set_price( $variation_data['sale_price'] );\n $variation->set_sale_price( $variation_data['sale_price'] );\n }\n $variation->set_regular_price( $variation_data['regular_price'] );\n\n // Stock\n if( ! empty($variation_data['stock_qty']) ){\n $variation->set_stock_quantity( $variation_data['stock_qty'] );\n $variation->set_manage_stock(true);\n $variation->set_stock_status('');\n } else {\n $variation->set_manage_stock(false);\n }\n $variation->set_weight(''); // weight (reseting)\n error_log( print_r( $variation, TRUE ));\n $variation->save(); \n}", "function get_variant_options_selected($id_product, $variant_options=array())\n{\n\tglobal $mysqli, $id_cart_discount;\n\t\t\n\t$output='';\n\t\t\n\t$groups=get_variant_groups($id_product);\n\t\n\t// build sql \n\t// get all groups for this product\n\tif (sizeof($groups)) {\t\n\t\t$id_product_variant_group = key($groups);\n\t\t\n\t\t$stop = 0;\n\t\t$i=1;\n\t\tforeach ($groups as $id_product_variant_group => $row_group) {\t\t\t\n\t\t\t$joins = array();\t\n\t\t\t$where = array();\t\t\n\t\t\t$group_by = array();\t\n\t\t\t\n\t\t\t$i=1;\n\t\t\tforeach ($groups as $id_product_variant_group2 => $row_group2) {\t\n\t\t\t\t$where_str = array();\n\t\t\t\t\n\t\t\t\t$joins[] = 'INNER JOIN\n\t\t\t\t(product_variant_option AS pvo'.$i.' CROSS JOIN product_variant_group_option AS pvgo'.$i.' CROSS JOIN product_variant_group_option_description AS pvo'.$i.'_desc)\n\t\t\t\tON\n\t\t\t\t(product_variant.id = pvo'.$i.'.id_product_variant AND pvo'.$i.'.id_product_variant_group_option = pvgo'.$i.'.id AND pvgo'.$i.'.id = pvo'.$i.'_desc.id_product_variant_group_option AND pvo'.$i.'_desc.language_code = \"'.$mysqli->escape_string($_SESSION['customer']['language']).'\")';\n\t\t\t\n\t\t\t\t$where_str[] = 'pvo'.$i.'.id_product_variant_group = \"'.$mysqli->escape_string($id_product_variant_group2).'\"';\n\t\t\t\t\n\t\t\t\t$stop=0;\n\t\t\t\tif ($id_product_variant_group != $id_product_variant_group2 && isset($variant_options[$id_product_variant_group2]) && $variant_options[$id_product_variant_group2]) {\n\t\t\t\t\t$id_product_variant_group_option = $variant_options[$id_product_variant_group2];\n\t\t\t\t\t\n\t\t\t\t\t$where_str[] = 'pvo'.$i.'.id_product_variant_group_option = \"'.$mysqli->escape_string($id_product_variant_group_option).'\"';\n\t\t\t\t} else { \n\t\t\t\t\t$stop=1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\tif ($id_cart_discount) {\n\t\t\t\t\t$joins[] = 'LEFT JOIN\n\t\t\t\t\t(rebate_coupon_product AS rcp'.$i.' CROSS JOIN rebate_coupon AS rcpr'.$i.' CROSS JOIN cart_discount AS rcd'.$i.') \n\t\t\t\t\tON\n\t\t\t\t\t(product_variant.id_product = rcp'.$i.'.id_product AND rcp'.$i.'.id_rebate_coupon = rcpr'.$i.'.id ANd rcpr'.$i.'.id = rcd'.$i.'.id_rebate_coupon AND rcd'.$i.'.id = \"'.$mysqli->escape_string($id_cart_discount).'\")';\n\t\t\t\t\t\n\t\t\t\t\t$joins[] = 'LEFT JOIN\n\t\t\t\t\t(product_category AS pc'.$i.' CROSS JOIN rebate_coupon_category AS rcc'.$i.' CROSS JOIN rebate_coupon AS rccr'.$i.' CROSS JOIN cart_discount AS rccd'.$i.') \n\t\t\t\t\tON\n\t\t\t\t\t(product_variant.id_product = pc'.$i.'.id_product AND pc'.$i.'.id_category = rcc'.$i.'.id_category AND rcc'.$i.'.id_rebate_coupon = rccr'.$i.'.id ANd rccr'.$i.'.id = rcd'.$i.'.id_rebate_coupon AND rcd'.$i.'.id = \"'.$mysqli->escape_string($id_cart_discount).'\")';\n\t\t\t\t\t\n\t\t\t\t\t$where_str[] = '(rcp'.$i.'.id_rebate_coupon IS NOT NULL OR rcc'.$i.'.id_rebate_coupon IS NOT NULL)';\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\t$select = 'pvo'.$i.'.id_product_variant_group_option,\n\t\t\t\tpvo'.$i.'.id_product_variant_group,\n\t\t\t\tpvo'.$i.'_desc.name,\n\t\t\t\tpvgo'.$i.'.swatch_type,\n\t\t\t\tpvgo'.$i.'.color,\n\t\t\t\tpvgo'.$i.'.color2,\n\t\t\t\tpvgo'.$i.'.color3,\n\t\t\t\tpvgo'.$i.'.filename';\n\t\t\t\t\n\t\t\t\t$where[] = implode(' AND ',$where_str);\n\t\t\t\t\n\t\t\t\t$group_by[] = 'pvo'.$i.'.id_product_variant_group_option';\n\t\t\t\t\n\t\t\t\t$order_by = 'pvgo'.$i.'.sort_order ASC';\n\t\t\t\t\n\t\t\t\t$i++;\n\t\t\t\t\n\t\t\t\tif ($stop) break;\n\t\t\t}\n\t\t\t\n\t\t\t$joins = implode(\"\\r\\n\",$joins);\n\t\t\t$where = implode(' AND ',$where);\n\t\t\t$group_by = implode(',',$group_by);\n\t\t\n\t\t\n\t\t\t// we need to list all main group options\n\t\t\tif ($result_group_option = $mysqli->query('SELECT\n\t\t\t'.$select.'\n\t\t\tFROM\n\t\t\tproduct_variant\n\t\t\t\n\t\t\t'.$joins.'\n\t\t\t\n\t\t\tWHERE\n\t\t\tproduct_variant.active = 1\n\t\t\tAND\n\t\t\tproduct_variant.id_product = \"'.$mysqli->escape_string($id_product).'\"\n\t\t\tAND\n\t\t\t'.$where.'\n\t\t\tGROUP BY '.\n\t\t\t$group_by.'\n\t\t\tORDER BY '.\n\t\t\t$order_by)) {\n\t\t\t\tif ($result_group_option->num_rows) {\n\t\t\t\t\t$input_type = $groups[$id_product_variant_group]['input_type'];\n\t\t\t\t\t\n\t\t\t\t\t$output .= '<div style=\"margin-top:10px; margin-bottom:10px;\" id=\"variant_group_'.$id_product_variant_group.'\">\n\t\t\t\t\t<div style=\"margin-bottom:5px;\"><strong>'.$row_group['name'].'</strong></div>';\n\t\t\n\t\t\t\t\tif (!$input_type) {\n\t\t\t\t\t\t$output .= '<select name=\"variant_options['.$id_product_variant_group.']\">\n\t\t\t\t\t\t<option value=\"\">--</option>';\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$current_selected = isset($variant_options[$id_product_variant_group]) ? $variant_options[$id_product_variant_group]:0;\n\t\t\t\t\t\n\t\t\t\t\t$i=0;\n\t\t\t\t\twhile ($row_group_option = $result_group_option->fetch_assoc()) {\n\t\t\t\t\t\t$id_product_variant_group_option = $row_group_option['id_product_variant_group_option'];\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($input_type) {\n\t\t\t\t\t\t\t// dropdown\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t$output .= '<option value=\"'.$id_product_variant_group_option.'\" '.(($current_selected == $id_product_variant_group_option) ? 'selected=\"selected\"':'').'>'.$row_group_option['name'].'</option>';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// radio\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t$output .= '<div>\n\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"variant_options['.$id_product_variant_group.']\" id=\"product_variant_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" value=\"'.$id_product_variant_group_option.'\" '.(($current_selected == $id_product_variant_group_option) ? 'checked=\"checked\"':'').'>&nbsp;<label for=\"product_variant_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\">'.$row_group_option['name'].'</label>\n\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t// swatch\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t$swatch_type = $row_group_option['swatch_type'];\n\t\t\t\t\t\t\t\t$color = $row_group_option['color'];\n\t\t\t\t\t\t\t\t$color2 = $row_group_option['color2'];\n\t\t\t\t\t\t\t\t$color3 = $row_group_option['color3'];\n\t\t\t\t\t\t\t\t$filename = $row_group_option['filename'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($i==8) { $output .= '<div class=\"cb\"></div>'; $i=0; }\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tswitch ($swatch_type) {\n\t\t\t\t\t\t\t\t\t// 1 color\n\t\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border '.(($current_selected == $id_product_variant_group_option) ? 'selected':'').'\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" '.(($current_selected == $id_product_variant_group_option) ? 'checked=\"checked\"':'').' />\n\t\t\t\t\t\t\t\t\t\t<div class=\"variant_color_inner_border\">\n\t\t\t\t\t\t\t\t\t\t<div style=\"background-color: '.$color.';\" class=\"variant_color\"></div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t// 2 color\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border '.(($current_selected == $id_product_variant_group_option) ? 'selected':'').'\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" '.(($current_selected == $id_product_variant_group_option) ? 'checked=\"checked\"':'').' />\n\t\t\t\t\t\t\t\t\t\t<div class=\"variant_color_inner_border\"><div class=\"variant_color\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:10px; height:20px; background-color: '.$color.';\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:10px; height:20px; background-color: '.$color2.';\"></div>\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<div class=\"cb\"></div>\n\t\t\t\t\t\t\t\t\t\t</div></div>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t// 3 color\n\t\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border '.(($current_selected == $id_product_variant_group_option) ? 'selected':'').'\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" '.(($current_selected == $id_product_variant_group_option) ? 'checked=\"checked\"':'').' />\t\n\t\t\t\t\t\t\t\t\t\t<div class=\"variant_color_inner_border\"><div class=\"variant_color\">\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<div class=\"fl\" style=\"width:7px; height:20px; background-color: '.$color.';\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:6px; height:20px; background-color: '.$color2.';\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"fl\" style=\"width:7px; height:20px; background-color: '.$color3.';\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"cb\"></div>\n\t\t\t\t\t\t\t\t\t\t</div></div>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t// file\n\t\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\t\t$output .= '<a href=\"javascript:void(0);\" class=\"fl variant_color_outer_border '.(($current_selected == $id_product_variant_group_option) ? 'selected':'').'\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"variant_color_'.$id_product_variant_group.'_'.$id_product_variant_group_option.'\" name=\"variant_options['.$id_product_variant_group.']\" value=\"'.$id_product_variant_group_option.'\" '.(($current_selected == $id_product_variant_group_option) ? 'checked=\"checked\"':'').' />\t\n\t\t\t\t\t\t\t\t\t\t<div class=\"variant_color_inner_border\"><div class=\"variant_color\">\t\t\n\t\t\t\t\t\t\t\t\t\t<img src=\"/images/products/swatch/'.$filename.'\" width=\"20\" height=\"20\" border=\"0\" hspace=\"0\" vspace=\"0\" />\n\t\t\t\t\t\t\t\t\t\t</div></div>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t\t\t\t\t\t\t\t\tbreak;\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\t\n\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\t\t++$i;\t\t\t\t\t\n\t\t\t\t\t\t\t\tbreak;\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tswitch ($input_type) {\n\t\t\t\t\t\t// dropdown\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t$output .= '</select>\n\t\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t\t/* <![CDATA[ */\n\t\t\n\t\t\n\t\t\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\t\t\tjQuery(\"select[name=\\'variant_options['.$id_product_variant_group.']\\']\").change(function(){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// get values\n\t\t\t\t\t\t\t\t\t// ajax query to get new variants\n\t\t\t\t\t\t\t\t\tload_variant('.$id_product_variant_group.', jQuery(this).val());\n\t\t\t\t\t\t\t\t\tif (jQuery(\"#display_error\").css(\"display\") == \"block\"){\njQuery(\"#display_error\").hide(\"blind\", { direction: \"vertical\" }, 1000);\n}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t\t</script>';\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// radio\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$output .= '<script type=\"text/javascript\">\n\t\t\t\t\t\t\t/* <![CDATA[ */\n\t\t\n\t\t\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\t\t\tjQuery(\"input[name=\\'variant_options['.$id_product_variant_group.']\\']\").change(function(){\n\t\t\n\t\t\t\t\t\t\t\t\t// get values\n\t\t\t\t\t\t\t\t\t// ajax query to get new variants\n\t\t\t\t\t\t\t\t\tload_variant('.$id_product_variant_group.', jQuery(this).val());\n\t\t\t\t\t\t\t\t\tif (jQuery(\"#display_error\").css(\"display\") == \"block\"){\njQuery(\"#display_error\").hide(\"blind\", { direction: \"vertical\" }, 1000);\n}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t\t</script>';\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// swatch\n\t\t\t\t\t\tcase 2:\t\t\t\t\n\t\t\t\t\t\t\t$output .= '<script type=\"text/javascript\">\n\t\t\t\t\t\t\t/* <![CDATA[ */\n\t\t\n\t\t\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\t\t\tjQuery(\"a.variant_color_outer_border\").click(function(){\n\t\t\t\t\t\t\t\t\tif (!jQuery(\"input[id^=\\'variant_color_\\']:checked\",this).length) { \n\t\t\t\t\t\t\t\t\t\tjQuery(\"input[id^=\\'variant_color_\\']\",this).attr(\"checked\",true);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tjQuery(\"a.variant_color_outer_border\").removeClass(\"selected\");\n\t\t\t\t\t\t\t\t\t\tjQuery(this).addClass(\"selected\");\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t// get values\n\t\t\t\t\t\t\t\t\t\t// ajax query to get new variants\n\t\t\t\t\t\t\t\t\t\tload_variant('.$id_product_variant_group.', jQuery(\"input[id^=\\'variant_color_\\']\",this).val());\t\n\t\t\t\t\t\t\t\t\t\tif (jQuery(\"#display_error\").css(\"display\") == \"block\"){\njQuery(\"#display_error\").hide(\"blind\", { direction: \"vertical\" }, 1000);\n}\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t/* ]]> */\n\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$output .= '<div class=\"cb\"></div></div>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result_group_option->free();\n\t\t\t} else {\n\t\t\t\tthrow new Exception('An error occured while trying to get variant group options.'.\"\\r\\n\\r\\n\".$mysqli->error);\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (isset($variant_options[$id_product_variant_group]) && $variant_options[$id_product_variant_group] == 0) break;\n\t\t}\t\n\t}\n\t\n\treturn $output;\t\n}", "public function getProducts_options_values() {\n\t\treturn $this->products_options_values;\n\t}", "public function colorList() {}", "public function getContrastColours() {\n\t\treturn array(\n\t\t\t\"ContrastColour1\" => $this->ContrastColour1,\n\t\t\t\"ContrastColour2\" => $this->ContrastColour2,\n\t\t\t\"ContrastColour3\" => $this->ContrastColour3,\n\t\t\t\"ContrastColour4\" => $this->ContrastColour4\n\t\t);\n\t}", "public function getEnabledVariations(ProductInterface $product);", "public function colorsCombo()\n\t{\n\t\t$colors = getSetting('good_colors');\n\t\t$array = [];\n\t\tif(!$colors or !is_array($colors)) {\n\t\t\treturn [];\n\t\t}\n\n\t\tforeach($colors as $color) {\n\t\t\t$array[] = [$color, trans(\"colors.$color\")];\n\t\t}\n\n\t\treturn $array;\n\t}", "public function getVariants(): Collection\n {\n return $this->paginate([\n 'query' => 'query getVariants($cursor: String) {\n results: productVariants(first:250, after:$cursor) {\n edges {\n node {\n title\n sku\n product {\n title\n handle\n status\n publishedOnCurrentPublication\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }'\n ])\n\n // Remove variants that are missing a sku\n ->filter(function($variant) {\n return !empty($variant['sku']);\n })\n\n // Remove variants that weren't published to the Sales Channel of the\n // Custom App whose credentials are being used to query the API. This\n // can be used to filter out products not intended for the public store,\n // like wholesale only products.\n ->when(!$this->disablePublishedCheck, function($variants) {\n return $variants->filter(function($variant) {\n return $variant['product']['publishedOnCurrentPublication'];\n });\n })\n\n // Dedupe by SKU, prefering active variants. Shopify allows you to\n // re-use SKUs between multiple product variants but this is used in\n // Feed Me as the unique identifier for importing.\n ->reduce(function($variants, $variant) {\n\n // Check if this variant has already been added\n $existingIndex = $variants->search(\n function($existing) use ($variant) {\n return $existing['sku'] == $variant['sku'];\n }\n );\n\n // If this sku is already in the list, replace it if the previous\n // instance was not an active product\n // https://shopify.dev/api/admin-graphql/2022-04/enums/ProductStatus\n if ($existingIndex !== false) {\n $existing = $variants->get($existingIndex);\n if ($existing['product']['status'] != 'ACTIVE') {\n $variants = $variants->replace([\n $existingIndex => $variant\n ]);\n }\n\n // ... else the variant didn't exist, so add it\n } else $variants->push($variant);\n\n // Keep working...\n return $variants;\n }, new Collection)\n\n // Make a title that is more useful for displaying in the CMS.\n ->map(function($variant) {\n $variant['dashboardTitle'] = $variant['product']['title']\n .' - '.$variant['title']\n .(($sku = $variant['sku']) ? ' ('.$sku.')' : null);\n return $variant;\n })\n\n // Remove fields that we're used to pre-filter\n ->map(function($variant) {\n unset(\n $variant['product']['status'],\n $variant['product']['publishedOnCurrentPublication']\n );\n return $variant;\n })\n\n // Use integer keys\n ->values();\n }", "function colourchooser($prodid,$qty_per_item,$totalitems,$omit,$nochanger=\"\",$arrayprodid=\"\",$oid=0)\n{\n\tglobal $images_arr,$page,$extraimg,$db,$mainbase;\n\t?><script type=\"text/javascript\">var medimgs=[];</script><?\n\t$skuvarname=$arrayprodid==\"\"?\"skuvariant[$prodid]\":\"skuvariant[$arrayprodid][$prodid]\";\n\t$extraimg=array();\n\t//$opts_q=mysql_query(\"SELECT * FROM product_options,nav_stock WHERE product_options.variant_id=nav_stock.nav_skuvar AND nav_qty > 0 AND prod_id='$prodid' ORDER BY prod_opt_id\");\n\t$option=\"\";\n\t$ovalid=\"\";\n\t$selected=\"none\";\n\t$adinv=(basename($_SERVER['PHP_SELF'])==\"admin.php\"&&$page==\"invoices\")?1:0;\n\tif($adinv)\n\t{\n\t\t$selected=\"this\";\n\t\t$selectedoptq=mysql_query(\"SELECT *,CONCAT(op.sku,'-v-',op.variant_id) as variant_id FROM orderproducts as op LEFT JOIN option_values as ov ON CONCAT(op.sku,'-v-',op.variant_id)=ov.variant_id WHERE order_prod_id='$omit'\",$db);\n\t\t$selopt=mysql_fetch_assoc($selectedoptq);\n\t\tif($oid>0){\n\t\t\t$selectedoptq=mysql_query(\"SELECT * FROM orderkits as k LEFT JOIN option_values as ov ON k.okit_skuvar=ov.variant_id WHERE order_id='$oid' AND order_prod_id='$omit'\",$db);\n\t\t\t$selopt=mysql_fetch_assoc($selectedoptq);\n\t\t}\n\t\t$ovalid=\"AND variant_id!='$selopt[variant_id]'\";\n\t\t$chosencolor=$selopt['oitem'];\n\t\t$option=\"<option value='$omit' selected='selected'>$chosencolor (Current Choice)</option>\";\n\t}else{$ovalid=\" AND `\".WHICHLIST.\"` = '1'\";}\n\t$qqq=\"SELECT p.`prod_id` as prod_id,ov.`item_desc` as item,`nav_qty`,`nav_skuvar`,ov.`img_filename` as image FROM products as p,fusion_options as fo,option_values as ov,product_options as po,nav_stock WHERE p.`prod_id`=fo.`prod_id` AND po.`opt_id`=fo.`opt_id` AND ov.`opt_id`=fo.`opt_id` AND ov.`variant_id`=nav_stock.`nav_skuvar` AND `nav_qty` > 0 AND p.`prod_id`='$prodid' $ovalid ORDER BY ov.vsort\";\n\t$opts_q=mysql_query($qqq,$db)or die(\"Error $qqq<br />\".mysql_error());\n\t$opts_num=mysql_num_rows($opts_q);\n\tif($opts_num>0)\n\t{\n\t\tif($totalitems==1){?>\n\t\t\t<label for=\"skuvariant<?=$prodid?>\">Colour</label><?=(($adinv)?\" \":\"<br />\")?>\n\t\t<? }\n\t\t\n\t\tif($adinv)\n\t\t{?><input type=\"hidden\" name=\"popttoorderopt[<?=$prodid?>]\" value=\"<?=$omit?>\" /><? }?>\n\t\t<span class=\"hidefromprint\">\n\t\t<select name=\"<?=$skuvarname?>\" id=\"skuvariant<?=$prodid?>\" class=\"formfield\"<? if($adinv==0&&$page==\"products\"&&$nochanger==\"\"){?> onchange=\"javascript:swapimage('thumbnail','<?=$prodid?>-'+this.options[this.selectedIndex].value)\"<? }?>>\n\t\t<? if(!$adinv){?><option value=\"\" selected=\"selected\">-- Select Colour --</option><? }?>\n\t\t<?=$option?>\n\t\t<?\n\t\twhile($opt=mysql_fetch_assoc($opts_q))\n\t\t{\n\t\t\tif(floor($opt['nav_qty']/$qty_per_item)>=1)\n\t\t\t{\n\t\t\t\t$item=str_replace(array(\"(\",\")\"),\"\",$opt['item']);\n\t\t\t\t$stripos=stripos($item,\"LFM\");\n\t\t\t\tif(!$stripos){$stripos=stripos($item,\"60\");}\n\t\t\t\t$nums[0]=($stripos)?substr($item,0,$stripos):$item;\n\t\t\t\t$color=trim($nums[0]);\n\t\t\t\t?><option value=\"<?=$opt['nav_skuvar'].\"-qty-\".$qty_per_item?>\"><?=$color?> (<?=floor($opt['nav_qty']/$qty_per_item)>5?\"in\":\"low\"?> stock)</option><? \t\t\t\n\t\t\t}\n\t\t}\n\t\tmysql_data_seek($opts_q,0);//reset index to 0 so we can reuse the $opts_q query.\n\t\t?>\n\t\t</select></span><span class=\"hidefromweb\"><?=$chosencolor?></span><?=(($adinv)?\" \":\"<br />\")?>\n\t\t<? if($totalitems==1){?><br /><?=(($adinv)?\"\":\"<br />\")?><? }else{?>&#160;<? }?>\n\t\t<? \n\t\t$row=($adinv)?0:1;\n\t\tif($adinv&&$selopt['img_filename']!=\"0\"&&strlen($selopt['img_filename'])>0)\n\t\t{\n\t\t\t?>\n\t\t\t<span class=\"hidefromprint\"><a href=\"#\" onclick=\"document.productoptions.skuvariant<?=$prodid?>[<?=$row?>].selected=true;\" title=\"<?=$selopt['item']?>\" style=\"vertical-align:text-bottom\"><img src=\"content/img/main/leaf-mask-small.png\" style=\"vertical-align:text-bottom;background: url('<?=$images_arr['product_options']['path']?>/small/<?=$selopt['img_filename']?>')\" alt=\"<?=$selopt['item']?>\" /></a></span>\n\t\t\t<?\n\t\t\t$row++;\n\t\t}\n\t\twhile($opt=mysql_fetch_assoc($opts_q))\n\t\t{/* HERE */\n\t\t\t$img=$prodid.\"-\".strtolower($opt['nav_skuvar']).\".jpg\";\n\t\t\t$medimg=\"./\".$images_arr['product']['path'].\"/medium/\".$img;\n\t\t\t$dorollovers=is_file($medimg)?1:0;\n\t\t\tif($dorollovers){ \n\t\t\t\t?><script type=\"text/javascript\">medimgs.push(\"<?=$img?>\");</script><?\n\t\t\t}\n\t\t\tif($opt['image']!=\"0\")\n\t\t\t{\n\t\t\t\tif(floor($opt['nav_qty']/$qty_per_item)>=1){?><span class=\"hidefromprint\"><a href=\"#\" onclick=\"document.productoptions.skuvariant<?=$prodid?>[<?=$row?>].selected=true;<? if($adinv==0&&$page==\"products\"&&$dorollovers){?>swapimage('thumbnail','<?=$img?>')<? }?>\" title=\"<?=$opt['item']?>\" style=\"vertical-align:text-bottom\"<? if($adinv==0&&$page==\"products\"&&$dorollovers){?> onmouseover=\"javascript:swapimage('thumbnail','<?=$img?>')\" onmouseout=\"javascript:returnimage('thumbnail')\"<? }?>><img src=\"content/img/main/leaf-mask<? if($totalitems>1||$adinv){?>-small<? }?>.png\" style=\"vertical-align:text-bottom;background: url('<?=$images_arr['product_options']['path']?>/<? if($totalitems>1||$adinv){?>small/<? }?><?=$opt['image']?>')\" alt=\"<?=$opt['item']?>\" /></a></span><? \n\t\t\t\t\t$row++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$extraimg[]=array(\"image\"=>strtolower($prodid.\"-\".$opt['nav_skuvar'].\".jpg\"),\"name\"=>$opt['item']);\n\t\t}\n\t}\n\telse if($adinv)\n\t{\n\t\t?>\n\t\t<label for=\"skuvariant<?=$prodid?>\">Colour</label> \n\t\t<select name=\"<?=$skuvarname?>\" id=\"skuvariant<?=$prodid?>\" class=\"formfield\">\n\t\t<?=$option?>\n\t\t</select>\n\t\t<? if($selopt['img_filename']!=\"0\"){?>\n\t\t<br />\n\t\t<a href=\"#\" onclick=\"document.productoptions.skuvariant<?=$prodid?>[0].selected=true;\" title=\"<?=$selopt['oitem']?>\" style=\"vertical-align:text-bottom\"><img src=\"content/img/main/leaf-mask-small.png\" style=\"background: url('<?=$images_arr['product_options']['path']?>/small/<?=$selopt['img_filename']?>')\" alt=\"<?=$selopt['oitem']?>\" style=\"vertical-align:text-bottom\" /></a> \n\t\t<?\n\t\t}\n\t}\n\telse//if no option associated so set default\n\t{\n\t\t$sq=mysql_query(\"SELECT nav_skuvar FROM products as p,nav_stock as n WHERE p.sku=n.nav_sku AND p.prod_id='$prodid' AND nav_qty>0 AND \".WHICHLIST.\" = 1 ORDER BY nav_skuvar ASC\",$db);\n\t\tlist($prodsku)=mysql_fetch_row($sq);\n\t\t?><input type=\"hidden\" name=\"<?=$skuvarname?>\" value=\"<?=$prodsku?>-qty-<?=$qty_per_item?>\" /><?\n\t}\n}", "public function get_full_width_product_variations($product_id, $lang_id)\n {\n $product_id = clean_number($product_id);\n $lang_id = clean_number($lang_id);\n $this->db->where('product_id', $product_id);\n $this->db->where('lang_id', $lang_id);\n $this->db->where('visible', 1);\n $this->db->group_start();\n $this->db->where('variation_type', 'checkbox');\n $this->db->or_where('variation_type', 'radio_button');\n $this->db->group_end();\n $query = $this->db->get('product_variations');\n return $query->result();\n }", "public function getColorListAttribute()\n {\n $colors = $this->colors()->lists('name')->all();\n // retorno as tags separadas por uma virgula e um espaço.\n return $colors;\n }", "public static function variant( $id ) {\n $record = array();\n if ( is_array( $id ) ) {\n $record = $id;\n } elseif ( is_numeric( $id ) ) {\n /* @todo Select where $id */\n }\n\n $fields = array_keys( WPXSmartShopProduct::appearanceFields() );\n $result = array();\n foreach ( $fields as $key ) {\n if ( !empty( $record[$key] ) ) {\n $result[$key] = $record[$key];\n }\n }\n\n if ( !empty( $result ) ) {\n return array( $record['id_variant'] => $result );\n }\n\n return $result;\n }", "public function getVariants()\n {\n return $this->variants;\n }", "public static function get_material_design_colors( $context = 'primary' ) {\n\t\t\t$colors = self::get_data( 'meterial_colors' );\n\t\t\tswitch ( $context ) {\n\t\t\t\tcase '50':\n\t\t\t\tcase '100':\n\t\t\t\tcase '200':\n\t\t\t\tcase '300':\n\t\t\t\tcase '400':\n\t\t\t\tcase '500':\n\t\t\t\tcase '600':\n\t\t\t\tcase '700':\n\t\t\t\tcase '800':\n\t\t\t\tcase '900':\n\t\t\t\tcase 'A100':\n\t\t\t\tcase 'A200':\n\t\t\t\tcase 'A400':\n\t\t\t\tcase 'A700':\n\t\t\t\t\t$key = absint( $context ) / 100;\n\t\t\t\t\tif ( 'A100' === $context ) {\n\t\t\t\t\t\t$key = 10;\n\t\t\t\t\t\tunset( $colors['grey'] );\n\t\t\t\t\t} elseif ( 'A200' === $context ) {\n\t\t\t\t\t\t$key = 11;\n\t\t\t\t\t\tunset( $colors['grey'] );\n\t\t\t\t\t} elseif ( 'A400' === $context ) {\n\t\t\t\t\t\t$key = 12;\n\t\t\t\t\t\tunset( $colors['grey'] );\n\t\t\t\t\t} elseif ( 'A700' === $context ) {\n\t\t\t\t\t\t$key = 13;\n\t\t\t\t\t\tunset( $colors['grey'] );\n\t\t\t\t\t}\n\t\t\t\t\tunset( $colors['primary'] );\n\t\t\t\t\t$position_colors = array();\n\t\t\t\t\tforeach ( $colors as $color_family ) {\n\t\t\t\t\t\tif ( isset( $color_family[ $key ] ) ) {\n\t\t\t\t\t\t\t$position_colors[] = $color_family[ $key ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $position_colors;\n\t\t\t\tcase 'all':\n\t\t\t\t\tunset( $colors['primary'] );\n\t\t\t\t\t$all_colors = array();\n\t\t\t\t\tforeach ( $colors as $color_family ) {\n\t\t\t\t\t\tforeach ( $color_family as $color ) {\n\t\t\t\t\t\t\t$all_colors[] = $color;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $all_colors;\n\t\t\t\tcase 'primary':\n\t\t\t\t\treturn $colors['primary'];\n\t\t\t\tdefault:\n\t\t\t\t\tif ( isset( $colors[ $context ] ) ) {\n\t\t\t\t\t\treturn $colors[ $context ];\n\t\t\t\t\t}\n\t\t\t\t\treturn $colors['primary'];\n\t\t\t}\n\t\t}", "function random_color() {\n\t\treturn random_color_part() . random_color_part() . random_color_part();\n\t}", "public function get_variation_attributes() {\n\t\treturn $this->variation_data; // @todo: This returns blank if its set to catch all, how would we deal with that?\n\t}" ]
[ "0.7293336", "0.6595711", "0.63992804", "0.6195265", "0.61694485", "0.6166649", "0.6166649", "0.6166649", "0.6160724", "0.61212796", "0.6115576", "0.60391694", "0.6014347", "0.59842944", "0.59842634", "0.59842634", "0.59842634", "0.59842634", "0.59842634", "0.59842634", "0.59671783", "0.59483796", "0.5927769", "0.58798426", "0.58578426", "0.584655", "0.584234", "0.5815221", "0.57914037", "0.57673717", "0.5755057", "0.5755035", "0.57511884", "0.56785476", "0.5673353", "0.56658775", "0.5661392", "0.5659256", "0.5657863", "0.5656164", "0.56385404", "0.5637601", "0.5631451", "0.5626569", "0.5625878", "0.561209", "0.5598378", "0.55976117", "0.5593168", "0.55860263", "0.55855733", "0.5567401", "0.55630237", "0.5551431", "0.5551431", "0.5551431", "0.5551431", "0.5548365", "0.55417067", "0.5502483", "0.5479929", "0.54766923", "0.5467178", "0.5451827", "0.5445854", "0.5445854", "0.5444409", "0.5440526", "0.5439238", "0.54268026", "0.54067636", "0.5403442", "0.53959286", "0.5394019", "0.53928393", "0.53916067", "0.5390754", "0.5390258", "0.5379977", "0.5375547", "0.537162", "0.5368254", "0.5366875", "0.5363286", "0.53574586", "0.53495026", "0.53454983", "0.53442335", "0.53392404", "0.5336037", "0.5335347", "0.5327933", "0.5327761", "0.532155", "0.5317728", "0.5314069", "0.53104246", "0.53011864", "0.5285939", "0.52832645" ]
0.7296927
0
Set Tracking Number after Student Signup to show lead pixel (using getLeadPixel) for ShareASale to track signup
public function setTrackingNumber($studentId) { // Using session since currently signup is made via AJAX. Need to show lead pixel later Yii::$app->session->set(self::SESSION_KEY, $studentId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final public function Add_Linkedin_Pixel() {\n\t\tif (isset(self::$LINKEDIN_PIXEL_ID) && !empty(self::$LINKEDIN_PIXEL_ID)) {\n\t\t?>\n<script type=\"text/javascript\">\n_linkedin_data_partner_id = \"<?= self::$LINKEDIN_PIXEL_ID; ?>\";\n</script><script type=\"text/javascript\">\n(function(){var s = document.getElementsByTagName(\"script\")[0];\nvar b = document.createElement(\"script\");\nb.type = \"text/javascript\";b.async = true;\nb.src = \"https://snap.licdn.com/li.lms-analytics/insight.min.js\";\ns.parentNode.insertBefore(b, s);})();\n</script>\n<?\n \t}\n\t}", "public function logPixelPaymentInfo($observer){\n //Logging event\n Mage::getModel('core/session')->setPixelPaymentInfo(true);\n }", "public function tracking_field() {\n\t\techo cyprus_get_settings( 'mts_analytics_code' );\n\t}", "public function track_identity()\n {\n }", "public function track($trackingNumber);", "final public function Add_Facebook_Pixel() {\n\t\tif (isset(self::$FACEBOOK_PIXEL_ID) && !empty(self::$FACEBOOK_PIXEL_ID)) {\n\t\t?>\n<script>\n!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?\nn.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;\nn.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;\nt.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,\ndocument,'script','https://connect.facebook.net/en_US/fbevents.js');\nfbq('init', '<?= self::$FACEBOOK_PIXEL_ID; ?>');\nfbq('track', 'PageView');\n</script>\n<noscript><img height=\"1\" width=\"1\" style=\"display:none\"\nsrc=\"https://www.facebook.com/tr?id=<?= self::$FACEBOOK_PIXEL_ID; ?>&ev=PageView&noscript=1\"\n/></noscript>\n<?\n \t}\n\t}", "public function logPixelCompleteRegistration($observer){\n //Logging event\n Mage::getModel('core/session')->setPixelCompleteRegistration(true);\n }", "function trackPageView() {\n $timeStamp = time();\n $domainName = $_SERVER[\"SERVER_NAME\"];\n if (empty($domainName)) {\n $domainName = \"\";\n }\n\n // Get the referrer from the utmr parameter, this is the referrer to the\n // page that contains the tracking pixel, not the referrer for tracking\n // pixel.\n $documentReferer = $_GET[\"utmr\"];\n if (empty($documentReferer) && $documentReferer !== \"0\") {\n $documentReferer = \"-\";\n } else {\n $documentReferer = urldecode($documentReferer);\n }\n $documentPath = $_GET[\"utmp\"];\n if (empty($documentPath)) {\n $documentPath = \"\";\n } else {\n $documentPath = urldecode($documentPath);\n }\n\n $account = $_GET[\"utmac\"];\n $userAgent = $_SERVER[\"HTTP_USER_AGENT\"];\n if (empty($userAgent)) {\n $userAgent = \"\";\n }\n\n // Try and get visitor cookie from the request.\n $cookie = isset($_COOKIE[COOKIE_NAME]) ? $_COOKIE[COOKIE_NAME] : '';\n\n $dcmguid = isset($_SERVER[\"HTTP_X_DCMGUID\"]) ? $_SERVER[\"HTTP_X_DCMGUID\"] : '';\n $visitorId = getVisitorId(\n $dcmguid, $account, $userAgent, $cookie);\n\n // Always try and add the cookie to the response.\n setrawcookie(\n COOKIE_NAME,\n $visitorId,\n $timeStamp + COOKIE_USER_PERSISTENCE,\n COOKIE_PATH);\n\n $utmGifLocation = \"http://www.google-analytics.com/__utm.gif\";\n\n // Construct the gif hit url.\n $utmUrl = $utmGifLocation . \"?\" .\n \"utmwv=\" . VERSION .\n \"&utmn=\" . getRandomNumber() .\n \"&utmhn=\" . urlencode($domainName) .\n \"&utmr=\" . urlencode($documentReferer) .\n \"&utmp=\" . urlencode($documentPath) .\n \"&utmac=\" . $account .\n \"&utmcc=__utma%3D999.999.999.999.999.1%3B\" .\n \"&utmvid=\" . $visitorId .\n \"&utmip=\" . getIP($_SERVER[\"REMOTE_ADDR\"]);\n\n sendRequestToGoogleAnalytics($utmUrl);\n\n // If the debug parameter is on, add a header to the response that contains\n // the url that was used to contact Google Analytics.\n if (!empty($_GET[\"utmdebug\"])) {\n header(\"X-GA-MOBILE-URL:\" . $utmUrl);\n }\n // Finally write the gif data to the response.\n writeGifData();\n }", "public function logPixelCompleteRegistrationNewsletter($observer) {\n $subscriber = $observer->getEvent()->getSubscriber();\n $statusChanged = $subscriber->getIsStatusChanged();\n if($subscriber->getStatus() == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED && $statusChanged) {\n Mage::getModel('core/session')->setPixelCompleteRegistration(true);\n\n //Set flag for Lead Event\n Mage::getModel('core/session')->setPixelLead(true);\n }\n }", "function add_pixel(){\r\n $id = get_option('glv_pixel_value');\r\n $pixel = \"\r\n <!-- Facebook Pixel Code -->\r\n <script>\r\n !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?\r\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;\r\n n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;\r\n t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,\r\n document,'script','https://connect.facebook.net/en_US/fbevents.js');\r\n fbq('init', '\".$id.\"'); // Insert your pixel ID here.\r\n fbq('track', 'PageView');\r\n </script>\r\n <noscript><img height='1' width='1' style='display:none'\r\n src='https://www.facebook.com/tr?id=\".$id.\"&ev=PageView&noscript=1'\r\n /></noscript>\r\n <!-- DO NOT MODIFY -->\r\n <!-- End Facebook Pixel Code -->\r\n \";\r\n print $pixel;\r\n }", "public function tracking() {\n\n\t\t// Return if user is logged in\n\t\tif ( is_user_logged_in() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Display tracking code\n\t\tif ( $tracking = get_theme_mod( 'tracking' ) ) {\n\t\t\techo $tracking;\n\t\t}\n\n\t}", "public function setCreditInfo() {\n\t\t$this->creditInfo = $this->photo['title'] . \"&nbsp;by&nbsp;\" . $this->userName;\n\t}", "public static function optin_track_usage() {\n\n\t\t/** update week day for tracking */\n\t\t$track_week_day = date( 'w' );\n\t\tupdate_option( 'xl_track_day', $track_week_day, false );\n\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $this->payPalPlusHelper->resetWebProfileId();\n }", "public function viewed_signup() {\n\t\tif ( $this->not_page_reload() ) {\n\t\t\t$this->js_record_event( $this->event_name['viewed_signup'] );\n\t\t}\n\t}", "function inject_facebook_pixel() {?>\n\t<!-- Facebook Pixel Code -->\n\t<!-- Pixel ID is embedded here -->\n\t<script>\n\t\t!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n\t\tn.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;\n\t\tn.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;\n\t\tt.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,\n\t\tdocument,'script','https://connect.facebook.net/en_US/fbevents.js');\n\t\tfbq('init', 000000000000000); // Insert your pixel ID here.\n\t\tfbq('track', 'PageView');\n\t</script>\n\t<!-- The Pixel ID is embedded below as well -->\n\t<noscript><img height=\"1\" width=\"1\" style=\"display:none\"\n\t\tsrc=\"https://www.facebook.com/tr?id=000000000000000&ev=PageView&noscript=1\"/>\n\t</noscript>\n\t<!-- DO NOT MODIFY -->\n\t<!-- End Facebook Pixel Code -->\n<?php }", "public static function trackPageHit($email_is_set){\n wp_enqueue_script( 'flexie_metadata_script', plugin_dir_url(__FILE__).'assets/js/flexie_metadata_script.js', array(), null, false );\n if ( $email_is_set ){ \n wp_localize_script( 'flexie_metadata_script', 'flexie_metadata_script_object',\n array(\n 'pageHit' => true,\n 'registerEmail' => wp_get_current_user()->user_email\n )\n );\n } \t\n }", "function tsuiseki_tracking_view($data) {\n if (!empty($data)) {\n $t_data = (string)(trim($data));\n // We need to cut the first \"ref=\" as it comes from the javascript part\n // and may overlay the partner field.\n if (preg_match('/^ref=.*/', $t_data)) {\n $t_data = mb_substr($t_data, mb_strpos($t_data, '=') + 1);\n }\n $t_parts = preg_split('/;;/', $t_data);\n $src_url = (string)(trim($t_parts[0]));\n $width = (string)(trim($t_parts[1]));\n $height = (string)(trim($t_parts[2]));\n $browser = (string)(trim($t_parts[3]));\n $browser_version = (string)(trim($t_parts[4]));\n $referer = (string)(trim($t_parts[5]));\n if (!empty($referer)) {\n // Wir extrahieren nur die Domain!\n $r_parts = array();\n preg_match('/[a-z]{3,5}:\\/\\/(.+?)[\\/?:]/', $referer, $r_parts);\n if (!empty($r_parts[1])) {\n $referer = 'referer='. (string)trim($r_parts[1]);\n }\n }\n }\n $key = (string)trim($_SESSION['TSUISEKI_TRACKER_KEY']);\n if (!empty($src_url) && !empty($key)) {\n $ref = urldecode($src_url);\n $data = (string)(trim(tsuiseki_tracking_get_data($ref)));\n $data .= '&'. $width .'&'. $height .'&'. $browser .'&'. $browser_version .'&'. $referer;\n $data = urlencode($data);\n $ip = ip2long($_SERVER['REMOTE_ADDR']);\n $url = \"http://tracker.tsuiseki.com/tsuiseki.php?q=$key;0;$ip;$data&ajax=1\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, (string)trim($_SERVER['HTTP_USER_AGENT']));\n curl_setopt($ch, CURLOPT_REFERER, $src_url);\n $result = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n trigger_error(curl_error($ch), curl_errno($ch));\n }\n curl_close($ch);\n }\n\n // generate the response\n $response = json_encode( array( 'success' => true ) );\n // response output\n header( \"Content-Type: application/json\" );\n echo $response;\n exit;\n //return 0;\n}", "public function saveSignIn()\n {\n $this->has_signed_in_once = true;\n $this->last_signin = date('Y-m-d H:i:s');\n $this->save();\n }", "public function logPixelPurchase($observer){\n //Logging event\n Mage::getModel('core/session')->setPixelPurchase(true);\n }", "public function getTrackingNumber()\n {\n return $this->tracking_number;\n }", "private function pixel_init_code() {\n\t\t\t$version_info = self::get_version_info();\n\t\t\t$agent_string = sprintf(\n\t\t\t\t'%s-%s-%s',\n\t\t\t\t$version_info['source'],\n\t\t\t\t$version_info['version'],\n\t\t\t\t$version_info['pluginVersion']\n\t\t\t);\n\n\t\t\t$params = array(\n\t\t\t\t'agent' => $agent_string,\n\t\t\t);\n\n\t\t\treturn apply_filters(\n\t\t\t\t'facebook_woocommerce_pixel_init',\n\t\t\t\tsprintf(\n\t\t\t\t\t\"fbq('init', '%s', %s, %s);\\n\",\n\t\t\t\t\tesc_js( self::get_pixel_id() ),\n\t\t\t\t\tjson_encode( $this->user_info, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT ),\n\t\t\t\t\tjson_encode( $params, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT )\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function getTrackingNumber()\n {\n return $this->trackingNumber;\n }", "function tsuiseki_tracking_click($data) {\n if (!empty($data)) {\n $t_data = (string)(trim($data));\n // We need to cut the first \"ref=\" as it comes from the javascript part\n // and may overlay the partner field.\n if (preg_match('/^ref=.*/', $t_data)) {\n $t_data = mb_substr($t_data, mb_strpos($t_data, '=') + 1);\n }\n $t_parts = preg_split('/;;/', $t_data);\n $src_url = (string)(trim($t_parts[0]));\n $width = (string)(trim($t_parts[1]));\n $height = (string)(trim($t_parts[2]));\n $mousex = (string)(trim($t_parts[3]));\n $mousey = (string)(trim($t_parts[4]));\n $browser = (string)(trim($t_parts[5]));\n $browser_version = (string)(trim($t_parts[6]));\n $referer = (string)(trim($t_parts[7]));\n if (!empty($referer)) {\n // Wir extrahieren nur die Domain!\n $r_parts = array();\n preg_match('/[a-z]{3,5}:\\/\\/(.+?)[\\/?:]/', $referer, $r_parts);\n if (!empty($r_parts[1])) {\n $referer = 'referer='. (string)trim($r_parts[1]);\n }\n }\n $click_type = (string)(trim($t_parts[8]));\n $click_bits = (string)trim($t_parts[9]);\n }\n\n $key = (string)trim($_SESSION['TSUISEKI_TRACKER_KEY']);\n if (!empty($src_url) && !empty($key)) {\n $ref = urldecode($src_url);\n $data = (string)(trim(tsuiseki_tracking_get_data($ref)));\n $data .= '&'. $width .'&'. $height .'&'. $mousex .'&'. $mousey .'&'. $browser .'&'. $browser_version .'&'. $click_bits .'&'. $referer .'&'. $click_type;\n $data = urlencode($data);\n $ip = ip2long($_SERVER['REMOTE_ADDR']);\n $url = \"http://tracker.tsuiseki.com/tsuiseki.php?q=$key;1;$ip;$data&ajax=1\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, (string)trim($_SERVER['HTTP_USER_AGENT']));\n curl_setopt($ch, CURLOPT_REFERER, $src_url);\n $result = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n trigger_error(curl_error($ch), curl_errno($ch));\n }\n curl_close($ch);\n }\n // generate the response\n $response = json_encode( array( 'success' => true ) );\n // response output\n header( \"Content-Type: application/json\" );\n echo $response;\n exit;\n //return 0;\n}", "public function affiliate(CommonFunctionsInterface $commonFunctionRepo)\n {\n $insid = $commonFunctionRepo->checkAffiliatePixel('YLBESTPPI',1,1116);\n print $insid;\n exit;\n }", "public function getTrackNumber() {}", "function pmprosl_sociallocker_tracking() {\n\tif ( ! ( int ) $_POST['targetId'] )\n\t\texit;\n\n\t// Next make sure the \"sender\" is valid\n\tif ( empty( $_POST['sender'] ) || ! in_array( $_POST['sender'], array( 'button', 'timer', 'cross' ) ) )\n\t\texit;\n\n\t// Next make sure the \"senderName\" is valid\n\tif ( empty( $_POST['senderName'] ) )\n\t\texit;\n\n\t// Finally, make sure we haven't already set the cookie\n\tif( isset( $_COOKIE['pmprosl_has_access_flag'] ) && ! $_COOKIE['pmprosl_has_access_flag'] )\n\t\texit;\n\n\t// Passed all validation checks, lets set the cookies\n\tsetcookie( 'pmprosl_has_access', PMPROSL_FREE_LEVEL_ID, ( time() + ( 60 * 60 * 24 * PMPROSL_MEMBERSHIP_PERIOD_DAYS ) ), COOKIEPATH, COOKIE_DOMAIN, false ); // has_access cookie (expires in PMPROSL_MEMBERSHIP_PERIOD_DAYS days)\n\tsetcookie( 'pmprosl_has_access_flag', true, ( time() + ( 60 * 60 * 24 * 10 * 365 ) ), COOKIEPATH, COOKIE_DOMAIN, false ); // has_access flag cookie used to verify if a user already had access once (expires in 10 years; i.e. never)\n\n\treturn; // We're returning here because we know Social Locker's hook is coming up next\n}", "function google_analytics_config()\n{\n\n $tracking_code = $this->getRequest()->getParam('google_analytics_tracking_code');\n set_option('google_analytics_tracking_code', $tracking_code);\n\n}", "public function setupTrackKey($track_key = NULL)\n\t{\n\t\tif (!$track_key || $this->statpro->setTrackKey($track_key) != $track_key)\n\t\t{\n\t\t\t$track_key = $this->statpro->createTrackKey();\n\t\t\t\n\t\t\t$this->logNewTrackKey();\n\t\t}\n\t\t\n\t\treturn $track_key;\n\t}", "private function createTrackingNumber()\n {\n $tracking = 5000000000;\n $current = WaybillNumber::orderBy('id', 'DESC')->first();\n\n if (! $current) {\n $tracking = WaybillNumber::create(['current' => $tracking]);\n\n return $tracking->current;\n }\n\n $tracking = (int) $current['current'] + 1;\n\n $tracking = WaybillNumber::create(['current' => $tracking]);\n\n return $tracking->current;\n }", "function landing_visit_counter($_url_params) {\n\t$_url_params['key'] = _KEY;\n\t$_url_params['landing'] = _LANDING_URL;\n\n $_landing = request_post_api(_VISIT_COUNT_URL,$_url_params);\n return $_landing;\n}", "public function general_settings_ga_id() {\n\t\t$google_analytics_id = get_option( 'wsuwp_ga_id', false );\n\n\t\t?><input id=\"wsuwp_ga_id\" name=\"wsuwp_ga_id\" value=\"<?php echo esc_attr( $google_analytics_id ); ?>\" type=\"text\" class=\"regular-text\" /><?php\n\t}", "function do_ad_switch() {\n if (isset($this->html->noise) && is_array($this->html->noise)) {\n foreach ($this->html->noise as $key => $value) {\n if (strpos($value, 'google_ad_client') !== false) {\n $publoc = strpos($value, 'pub-');\n $sufloc = strpos($value, '\"', $publoc);\n if (!$sufloc)\n $sufloc = strpos($value, \"'\", $publoc);\n echo $publoc . ' ' . $sufloc;\n if ($publoc && $sufloc)\n $this->html->noise[$key] = substr($value, 0, $publoc) . 'pub-7523823497771676' . substr($value, $sufloc);\n }\n }\n }\n // INS TAGS\n foreach ($this->html->find('ins') as $e) {\n $e->{'data-ad-client'} = 'ca-pub-7523823497771676';\n }\n }", "public function getTrackingNumber($removeFromSession = false)\n {\n // Using session since currently signup is made via AJAX. Need to show lead pixel later\n $trackingNumber = Yii::$app->session->get(self::SESSION_KEY);\n if ($removeFromSession) {\n Yii::$app->session->remove(self::SESSION_KEY);\n }\n return $trackingNumber;\n }", "function TrackingCode()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\t$code = lookupDbValue('settings', 'value', 'Tracking Code', 'name');\r\n\t\techo\"$code\";\r\n\t}", "public function setUniqueImpression($value)\n\t{\n\t\t$this->uniqueImpression = $value;\t\n\t}", "function google_analytics_tracking_code(){\n ?>\n <script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n ga('create', 'UA-103015653-1', 'auto');\n ga('send', 'pageview');\n </script>\n <?php \n}", "public function genTrackingKey()\n {\n if ($this->trackMails) {\n $trackingKey = Yii::$app->security->generateRandomString(32);\n $this->setTrackingKey($trackingKey);\n return $trackingKey;\n } else {\n return null;\n }\n }", "public function save_follow_count() {\n\t\t// Networks that do not have count data still need an integer.\n\t\tif ( empty( $this->follow_count) ) {\n\t\t\t$this->follow_count = 0;\n\t\t}\n\n\t\tSWFW_Utility::update_network_count( $this->key, $this->follow_count );\n\t}", "public function logPixelAddToWishlist($observer) {\n //Logging event\n Mage::getModel('core/session')->setPixelAddToWishlist(true);\n }", "function feuserloginsystem_addUserStatisticEntry() {\r\n\r\n $timeStamp = time();\r\n\r\n # For the page tracking feature get the time and the page ID.\r\n $pagetrackingArray = array();\r\n $pagetrackingArray[] = array('time' => $timeStamp, 'pageID' => intval($this->id));\r\n\r\n # Get commom information for statistics.\r\n\t\t$insertDataArray = array();\r\n\t\t$insertDataArray['feuserid'] = intval($this->fe_user->user[\"uid\"]);\r\n\t\t$insertDataArray['sessionstart'] = $timeStamp;\r\n\t\t$insertDataArray['lastpageview'] = $timeStamp;\r\n\t\t$insertDataArray['pagecounter'] = intval(1);\r\n\t\t$insertDataArray['pagetracking'] = serialize($pagetrackingArray);\r\n\r\n\t\t# Create statistic entry in the database.\r\n $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_feuserloginsystem_userstatistics',$insertDataArray);\r\n }", "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 general_settings_ga4_id() {\n\t\t$google_analytics_id = get_option( 'wsuwp_ga4_id', false );\n\n\t\t?><input id=\"wsuwp_ga4_id\" name=\"wsuwp_ga4_id\" value=\"<?php echo esc_attr( $google_analytics_id ); ?>\" type=\"text\" class=\"regular-text\" /><?php\n\t}", "public function setSocialUniqueImpression($value)\n\t{\n\t\t$this->socialUniqueImpression = $value;\n\t}", "private function generateTraceId()\n {\n $this->setTraceId($this->generateId());\n }", "function urchin($uuid = null)\n\t{\n\t\t?>\n<script src=\"http://www.google-analytics.com/urchin.js\" type=\"text/javascript\">\n</script>\n<script type=\"text/javascript\">\ntry {\n_uacct = \"<?php echo $uuid; ?>\";\nurchinTracker();\n} catch(err) {}</script>\n\t\t<?php\n\t}", "private function addDeviceToTracking()\n {\n // add device if not owned by you (owners will be able to track their devices by default)\n $owner = $this->getOwnerToken();\n if ($owner != null)\n if (strcmp($this->token, $owner) != 0) {\n $obj = $this->sql->query(\"select `device_count` from \" . tableName . \" where `uid` = '$this->token'\")->fetch_object();\n $x = $obj->device_count + 1;\n\n $str = \"update \" . tableName . \" set `device_count` = '$x' where `uid` = '$this->token';\";\n $str .= \"insert into \" . dataTableName . \" (`token`, `device_id`) VALUES ('$this->token', '$this->deviceID');\";\n\n if ($this->sql->multi_query($str))\n echo \"SUCCESS\";\n\n else die(\"FAILED\");\n } else\n die(\"Already added\");\n else\n die(\"No owners. Device may not have been registered.\");\n }", "function insert_tracking_code() {\n require( 'includes/C6_Page_Close_Tracking.php' );\n}", "function google_analytics_tracking_code(){\n\n\t$propertyID = 'UA-55100652-1'; // GA Property ID\n\n\tif ($options['ga_enable']) { ?>\n\n\t\t<script type=\"text/javascript\">\n\t\t var _gaq = _gaq || [];\n\t\t _gaq.push(['_setAccount', '<?php echo $propertyID; ?>']);\n\t\t _gaq.push(['_trackPageview']);\n\n\t\t (function() {\n\t\t var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\t\t ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\t\t var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n\t\t })();\n\t\t</script>\n\n<?php }\n}", "public static function Generate837()\n\t{\n\t\t$this -> $data837 = 'ISA';\n\t\t$this -> $data837 .= '*';\n\t}", "public static function setTracker($mixable, sfGoogleAnalyticsTracker $tracker)\n {\n sfContext::getInstance()->getRequest()->setAttribute('tracker', $tracker, 'sf_google_analytics_plugin');\n }", "public static function trackBookmarkVisit(){\r\n\t\tif(self::isBookmarkVisit()) {\r\n\t\t\t$bookmark_count = self::getBookmarkCount();\r\n\t\t\tif($bookmark_count > 10) {\r\n\t\t\t\t$bookmark_count = '10+';\r\n\t\t\t}\r\n\t\t\t$bookmark_position = Helper_Request::getRequest('fb_bmpos', '', 'STR');\r\n\t\t\t$bookmark_source = Helper_Request::getRequest('fb_source', '', 'STR');\r\n\t\t\tif($bookmark_position != '' && $bookmark_source != '') {\r\n\t\t\t\t$position_prepend = $bookmark_source == 'bookmarks_apps' ? 'apps_' : 'favs_';\r\n\t\t\t\t$position_parts = explode('_', $bookmark_position);\r\n\t\t\t\tif(count($position_parts) == 2) {\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function preSave($event) {\n $user_id = $this->getUserId();\n\n if (!$user_id) {\n return;\n }\n\n $count = Doctrine_Query::create()\n ->from('OnlineIdentity oi')\n ->where('oi.user_id = ?', $user_id)\n ->andWhere('oi.use_as_avatar = ?', true)\n ->count();\n\n sfContext::getInstance()->getLogger()->notice($user_id);\n if (($count < 1) && $this->getPhoto()) {\n $this->setUseAsAvatar(true);\n }\n }", "function facebook_pixel( $pixel_id ){\n\tif( is_int( $pixel_id ) ){\n\t\n ob_start();\n\n ?>\n <script>!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if( !f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');\n\n fbq('init', '<?php echo $pixel_id; ?>');\n fbq('track', 'PageView');\n\n </script>\n <noscript><img height=\"1\" width=\"1\" style=\"display:none\" src=\"https://www.facebook.com/tr?id=<?php echo $pixel_id; ?>&ev=PageView&noscript=1\"/></noscript>\n <?php\n return ob_get_clean();\n\t\n\t} else {\n\t\t\n\t\treturn false;\n\t\t\n\t}\n\t\n}", "protected function _registerFrontEndClick()\n { // Create a hit id if none present\n if( !$this->_hid /* and APPLICATION_ENVIRONMENT == 'production' */) {\n // Construct the URL\n $url = \"https://affiliate.rbmtracker.com/rd/r.php?pub={$this->_affid}&sid={$this->_cid}&c1={$this->_c1}&c2={$this->_c2}&c3={$this->_c3}\";\n // Mark the click\n $response = file_get_contents($url);\n // Check for permission denied from HitPath\n if( $response == 'The link you have requested is not available, please try your request later.') return;\n // Decode response\n $json = json_decode($response);\n // Check for invalid response\n if( $json === null ) return;\n // Validate the HID\n if( !$json->hid || !is_numeric($json->hid) ) return;\n // Store the HID\n $this->_hid = $json->hid;\n $affData = Yii::app()->session['affData'];\n $affData['hid'] = $this->_hid;\n Yii::app()->session['affData'] = $affData;\n // Log the click\n $this->log('Click registered: '.$this->_hid);\n }\n }", "public function beforeSave(Spot\\Mapper $mapper)\n {\n $this->site_id = \\Kernel()->site()->id;\n }", "public function asigntrackid()\n\t\t {\n\t\t\t $this->layout = '';\n\t\t\t $this->autoRender = false;\n\t\t\t $this->loadModel('Order');\n\t\t\t\t$this->loadModel('Item');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/Auth');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/Factory');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/Orders');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/PrintService');\n\t\t\t\n\t\t\t\t$username = Configure::read('linnwork_api_username');\n\t\t\t\t$password = Configure::read('linnwork_api_password');\n\t\t\t\t\n\t\t\t\t$multi = AuthMethods::Multilogin($username, $password);\n\t\t\t\t\n\t\t\t\t$auth = AuthMethods::Authorize($username, $password, $multi[0]->Id);\t\n\n\t\t\t\t$token = $auth->Token;\t\n\t\t\t\t$server = $auth->Server;\n\t\t\t\t\n\t\t\t\t$Postalservice\t\t=\t$this->request->data['postalservice'];\n\t\t\t\t$TrackingCode\t\t=\t$this->request->data['trackingBarcode'];\n\t\t\t\t\n\t\t\t\t$info['PostalServiceName'] \t= $Postalservice;\n\t\t\t\t$info['TrackingNumber'] \t= $TrackingCode;\n\t\t\t\t$info['ManualAdjust'] \t\t= true;\n\t\t\t\t$scanPerformed \t= \ttrue;\n\t\t\t\t$information\t=\tjson_encode($info);\n\t\t\t\t\n\t\t\t\t$orderId\t\t=\t$this->request->data['pkorder'];\n\t\t\t\t\n\t\t\t\t$results\t\t=\tOrdersMethods::SetOrderShippingInfo($orderId, $info, $token, $server);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(isset($results->ShippingInfo->TrackingNumber))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$orderIdArray[]\t=\t$orderId;\n\t\t\t\t\n\t\t\t\t\t$IDs = $orderIdArray;\n\t\t\t\t\t$parameters = '[]';\n\t\t\t\n\t\t\t\t\t$result \t= \tPrintServiceMethods::CreatePDFfromJobForceTemplate('Invoice Template',$IDs,27,$parameters,'PDF',$token, $server);\n\t\t\t\t\t$results \t= \tPrintServiceMethods::CreatePDFfromJobForceTemplate('Invoice Template',$IDs,27,$parameters,'PDF',$token, $server);\n\t\t\t\t\t$pdf\t\t=\t$result->URL.\"#\".$results->URL;\n\t\t\t\t\techo $pdf;\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"2\";\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t \n\t\t }", "public function get_tracking_code(): string {\n global $OUTPUT, $USER;\n\n $settings = $this->record->get_property('settings');\n\n $template = new \\stdClass();\n $template->siteid = $settings['siteid'];\n $template->siteurl = $settings['siteurl'];\n $custompiwikjs = (isset($settings['piwikjsurl']) && !empty($settings['piwikjsurl']));\n $template->piwikjsurl = $custompiwikjs ? $settings['piwikjsurl'] : $settings['siteurl'];\n $template->imagetrack = $settings['imagetrack'];\n\n $template->userid = false;\n\n if (!empty($settings['userid']) && !empty($settings['usefield']) && !empty($USER->{$settings['usefield']})) {\n $template->userid = $USER->{$settings['usefield']};\n }\n\n $template->doctitle = \"\";\n\n if (!empty($this->record->get_property('cleanurl'))) {\n $template->doctitle = \"_paq.push(['setDocumentTitle', '\" . $this->trackurl() . \"']);\\n\";\n }\n\n return $OUTPUT->render_from_template('watool_matomo/tracking_code', $template);\n }", "function generate_email_tracking_string($obj)\n{\n\tif($obj->session->userdata('userid'))\n\t{\n\t\t$tracking_id = $obj->session->userdata('userid').\"-\".strtotime('now');\n\t}\n\telse\n\t{\n\t\t$tracking_id = \"SF-\".strtotime('now');\n\t}\n\t\n\treturn \"Email Tracking ID: \".$tracking_id;\n}", "function google_analytics_insertGATC()\n{\n\n echo get_option('google_analytics_tracking_code');\n\n}", "public function register_fingerprint() {\n\t\t$status = $_GET['status'];\n\n\t\tif ($status === 'success') {\n\t\t\t$finger_data = array(\n\t\t\t\t'finger_id' => $_GET['finger_id'],\n\t\t\t\t'finger_data' => $_GET['finger_data'],\n\t\t\t\t'member_id' => (int)$_GET['member_id']\n\t\t\t);\n\t\t\t$this->session->set_userdata('current_finger_data', $finger_data);\n\t\t}\n\n\t\techo \"<script>window.close();</script>\";\n\t}", "function trackingno($carrier, $trno, $shipmentMethod){\n\t$carrier1=$carrier;\t\n\t$carrier=strtolower($carrier);\n\t\n\t//$trno=strtolower($trno);\n\t$shipmentMethod1=$shipmentMethod; \n\t$shipmentMethod=strtolower($shipmentMethod);\n\t\n\t$carrierdata=\" (Not Specified)\";\n\t$carrierRG=\"Not Specified\";\n\t\n\t\tif($carrier !=\"\" ){$carrierdata=\" (\".$carrier1.\")\";}\n\tif($carrier=='ups (usa)' || $carrier=='ups' || $carrier=='ups (us)'){\n\t\t\n\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t}\n\t\telseif($carrier==\"\" && substr($shipmentMethod, 0, 3) === 'ups'){\n\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='fedex (usa)' || $carrier=='fedex' || $carrier=='fedex (us)'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t}\n\t\telseif($carrier=='' && substr($shipmentMethod, 0, 3) =='fedex'){$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t$carrierdata =\" (\".$shipmentMethod1.\")\";\n\t\t}\n\t\telseif($carrier=='us postal service'){\n\t\t\t$clink=\"https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=\";\n\t\t}\n\t\t\n\t\telseif($carrier=='miscellaneous' || $carrier=='miscellaneous (us)'){$clink=\"\";}\n\t\telse{$clink=\"\";}\n\t\t\n\t\tif($clink == \"\"){\n\t\t\tif($carrier1!=\"\"){$carrierRG=$carrier1;}\n\t\t\tif (preg_match(\"/\\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\\dT]\\d\\d\\d ?\\d\\d\\d\\d ?\\d\\d\\d)\\b/\", $trno)) {\n\t\t\t\t$clink=\"http://wwwapps.ups.com/etracking/tracking.cgi?AcceptUPSLicenseAgreement=yes&TypeOfInquiryNumber=T&InquiryNumber1=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\t\n\t\t\telseif (preg_match(\"/(\\b96\\d{20}\\b)|(\\b\\d{15}\\b)|(\\b\\d{12}\\b)/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/\\b((98\\d\\d\\d\\d\\d?\\d\\d\\d\\d|98\\d\\d) ?\\d\\d\\d\\d ?\\d\\d\\d\\d( ?\\d\\d\\d)?)\\b/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t\telseif (preg_match(\"/^[0-9]{15}$/\", $trno)) {\n\t\t\t\t$clink=\"https://www.fedex.com/apps/fedextrack/?action=track&cntry_code=us_english&tracknumbers=\";\n\t\t\t\t$carrierdata =\" (\".$carrierRG.\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($clink != \"\"){\n\t\t\t$trdata=\"<a href='\".$clink.\"\".$trno.\"' target='_blank'>\".$trno.\"</a>\".$carrierdata.\", \";\n\t\t}\n\t\telse{\n\t\t\t$trdata=$trno.\"\".$carrierdata.\", \";\n\t\t\t}\n\t\tif($trno==\"\"){$trdata=\"\";}\n\t\treturn $trdata;\n\t}", "protected function increment(){\n $count = $this->model->getClickCount();\n $count++;\n $this->model->setClickCount($count);\n $this->model->save(false);\n \n }", "function teamplatic_view_counter()\r\n{\r\n $settings = get_option( \"templatic_settings\" ); \t\r\n if(isset($settings['templatic_view_counter']) && $settings['templatic_view_counter']=='Yes')\r\n {\t\r\n\t\tglobal $post;\r\n\t\tview_counter_single_post($post->ID);\r\n\t\tview_count('');\r\n } \r\n //view_sharing_buttons('');\r\n tevolution_socialmedia_sharelink();\r\n\t\r\n}", "public function getTrackingNumber() : string\n\t{\n\t\treturn $this->trackingNumber;\n\t}", "public function setProfileAtHandle($newProfileAtHandle) : void {\n\t\t$this->profileAtHandle = $newProfileAtHandle;\n\t}", "function recordAnalytics() {\n\t\t//Is your user agent any of my business? Not really, but don't worry about it.\n\t\texecuteQuery(\"\n\t\t\tINSERT INTO dwm2r_activitymonitor\n\t\t\t(IPAddress,UserAgent,Flags,Seed,CreatedDTS)\n\t\t\tVALUES (\n\t\t\t\t'\".$_SERVER['REMOTE_ADDR'].\"',\n\t\t\t\t'\".$_SERVER['HTTP_USER_AGENT'].\"',\n\t\t\t\t'\".trim($_REQUEST[\"Flags\"]).\"',\n\t\t\t\t'\".$this->modder->flags[\"Seed\"].\"',\n\t\t\t\tNOW()\n\t\t\t)\n\t\t\");\n\t}", "function tracking($uid, $activity, $module) \n{\n\t\n\tglobal $dbf;\n\n\t$running_no = '00001';\n\t\t\n\t$sql_select_tracking = \"SELECT MAX(track_id) AS track_id FROM base_tracking\";\n\t$sql_slct = $dbf;\n\t$sql_slct->query($sql_select_tracking);\n\t$sql_slct->next_record();\n\t\t\n\tif($sql_slct->num_rows($sql_select_tracking)== 0 || $sql_slct->f(\"track_id\")==NULL){\n\t\t$trackId = date(\"Ym\").$running_no;\n\t} else {\n\t \n $todate = date(\"Ym\");\n \n if($todate > substr($sql_slct->f(\"track_id\"),0,6)) {\n $trackId = $todate.$running_no;\n }\n else {\n\t\t $trackId = $sql_slct->f(\"track_id\") + 1;\n }\n\t}\n\t\t\t\n\t$sql_insert_track = \"INSERT INTO base_tracking (track_id, track_ip, track_agent, track_uid, track_activity, track_module, track_url, track_time) VALUES('$trackId','\".$_SERVER['REMOTE_ADDR'].\"','\".$_SERVER['HTTP_USER_AGENT'].\"','$uid', '$activity', '$module', '\".$_SERVER['SCRIPT_NAME'].\"', now())\"; \n\t\t\n\t$sql_ins = $dbf;\n\t$sql_ins->query($sql_insert_track);\n\t\t\t\t\n}", "public function getReviewStudentProfileId() : int {\n\t\treturn ($this->reviewStudentProfileId);\n\t}", "protected function recordUniqueStatHit($stat_name, $date_created = NULL)\n\t{\n\t\t$this->stat_history[$stat_name] = $this->formatStatDate($date_created);\n\t}", "function addLoginStrikes()\n\t{\n\t\t$currentAttempts = $this->getLoginStrikes();\n\t\t\n\t\tif($currentAttempts == false) //This is the first strike, so insert in DB\n\t\t{\n\t\t\t$this->DB->database_insert('activity',\n\t\t\t\t\t\t array('activity_ip' => $_SERVER['REMOTE_ADDR'],\n\t\t\t\t\t\t\t'activity_type' => 'logins',\n\t\t\t\t\t\t\t'activity_strikes' => 1));\n\t\t}\n\t\telse //Update current strike count otherwise\n\t\t{\n\t\t\t$currentAttempts++;\n\t\t\t$time = get_timestamp(); //Time strike occurred. Offset against time required for user to wait\n\t\t\t$this->DB->database_update('activity', array('activity_strikes' => $currentAttempts, 'activity_time' => $time),\n\t\t\t\t\t\t array('activity_type' => 'logins',\n\t\t\t\t\t\t\t 'activity_ip' => $_SERVER['REMOTE_ADDR']));\n\t\t\t\n\t\t}\n\t}", "function wp_aff_gf_save_ap_id($entry, $form) { \n $aff_id = wp_affiliate_get_referrer();\n wp_affiliate_log_debug(\"GF integration... adding ap_id meta data to entry (\".$entry['id'].\") with value: \" . $aff_id, true);\n gform_update_meta($entry['id'], 'ap_id', $aff_id);\n}", "protected function pixelPageView() {\n\t\t$url = $GLOBALS['ccttsUrl'] .'cctts_inc/ajax/ccReg.php';\n\t\t$paramsArr = array('method=pixelPageView');\n\t\tforeach ($this->ccttsParams as $key => $val)\n\t\t\t$paramsArr[] = \"$key=$val\";\n\t\t\n\t\t$paramsStr = implode('&', $paramsArr);\n\t\t$result = $this->curlIt($url, $paramsStr);\n\t}", "function owa_userRegistrationActionTracker($user_id) {\r\n\t\r\n\t$owa = owa_getInstance();\r\n\t$user = get_userdata($user_id);\r\n\tif (!empty($user->first_name) && !empty($user->last_name)) {\r\n\t\t$label = $user->first_name.' '.$user->last_name;\t\r\n\t} else {\r\n\t\t$label = $user->display_name;\r\n\t}\r\n\t\r\n\t$owa->trackAction('wordpress', 'User Registration', $label);\r\n}", "function wolf_tracking_code() {\n\n\t$tracking_code = wolf_get_theme_option( 'tracking_code');\n\n\tif ( $tracking_code && ! is_user_logged_in() ) {\n\t\techo stripslashes( $tracking_code );\n\t}\n\t\t\n}", "public static function maybe_track_usage() {\n\n\t\t/** checking optin state */\n\t\tif ( 'yes' == self::get_optIn_state() ) {\n\t\t\t$data = self::collect_data();\n\n\t\t\t//posting data to api\n\t\t\tXL_API::post_tracking_data( $data );\n\t\t}\n\t}", "function change_mobile_number() {\n\n\t\t$this->authentication->is_user_logged_in(TRUE, 'user/login');\n\n\t\tloadTemplate('user/add_mobile_number');\n\t}", "function action_track() {\n if(model_user::userLoggedIn()) {\n // Include view for this page.\n @include_once APP_PATH . 'view/track_page.tpl.php';\n } else {\n header('Location: /home/login');\n }\n }", "function cemhub_campaign_tracking_generate_session($campaign_source_id){\n $_SESSION[CEMHUB_CAMPAIGN_SOURCE_SESSION] = $campaign_source_id;\n}", "public function addExternalPI($userDetails) {\r\n $this->externalPI = new ExternalInvestigator($this->trackingFormId, true, $userDetails);\r\n }", "function track( array $message ) {\n\tif ( ! initialize() ) {\n\t\treturn;\n\t}\n\n\t// Add user ID if missing.\n\tif ( ! isset( $message['userId'] ) ) {\n\t\t$user = get_segmentio_user_details();\n\t\t$message['userId'] = $user['id'];\n\t}\n\n\tSegment::track( $message );\n}", "public function propegate() : void\n {\n $this->event->sender->enabledForSite = in_array(\n $this->event->sender->siteId,\n $this->event->sender->getFieldValue('sites')\n );\n }", "function _pre()\n\t{\n\t\t$this->takeawayId = $this->takeawaymodel->addTakeaway('testtakeaway', 'testtake', 'test', 'te573t', '555', 'test', 1, 30, 1, 54, -40, 1);\n\t}", "public function getTrackingID()\n {\n return $this->trackingID;\n }", "protected function handlePin() : void // (un)favorite\n {\n if (!User::$id || empty($this->_get['id'][0]))\n {\n trigger_error('AjaxProfile::handlePin - profileId empty or user not logged in', E_USER_ERROR);\n return;\n }\n\n $uid = User::$id;\n if ($this->_get['user'] && User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU))\n {\n if (!($uid = DB::Aowow()->selectCell('SELECT id FROM ?_account WHERE user = ?', $this->_get['user'])))\n {\n trigger_error('AjaxProfile::handlePin - user \"'.$this->_get['user'].'\" does not exist', E_USER_ERROR);\n return;\n }\n }\n\n // since only one character can be pinned at a time we can reset everything\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags & ?d WHERE accountId = ?d', ~PROFILER_CU_PINNED, $uid);\n // and set a single char if necessary\n if (!$this->undo)\n DB::Aowow()->query('UPDATE ?_account_profiles SET extraFlags = extraFlags | ?d WHERE profileId = ?d AND accountId = ?d', PROFILER_CU_PINNED, $this->_get['id'][0], $uid);\n }", "function wpclients_func2() {\r\n global $current_user;\r\n\r\n $client_hub = get_user_meta( $current_user->ID, 'wpc_cl_hubpage_id', true );\r\n\r\n if( 0 < $client_hub ) {\r\n echo \"You will be redirected to the page in a few seconds, if it doesn't redirect , please click <a href='\" . wpc_client_get_slug( 'hub_page_id' ) . \"'>here</a>\";\r\n echo \"<script type='text/javascript'>document.location='\" . wpc_client_get_slug( 'hub_page_id' ) . \"';</script>\";\r\n }\r\n }", "function tsuiseki_tracking_install() {\n add_option('tsuiseki_tracking_key', NULL, NULL, 'no');\n $css = TSUISEKI_TRACKER_CSS_CLASS;\n if (empty($css)) {\n $css = 'a.tsuiseki-link';\n }\n add_option('tsuiseki_tracking_css_class', $css, NULL, 'no');\n add_option('tsuiseki_tracking_excluded_uris', 'wp-admin/*', NULL, 'no');\n}", "function feuserloginsystem_updateUserStatisticEntry() {\r\n\r\n # Get existing statistic information for the current user and session.\r\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t'uid,feuserid,sessionstart,lastpageview,pagecounter,pagetracking',\r\n\t\t\t'tx_feuserloginsystem_userstatistics',\r\n\t\t\tsprintf('feuserid=\\'%s\\'',addslashes(intval($this->fe_user->user[\"uid\"]))),\r\n\t\t\t'',\r\n\t\t\t'sessionstart DESC',\r\n\t\t\t'1'\r\n \t);\r\n \t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\r\n \t# Existing statistic information could be found.\r\n \tif(is_array($row)) {\r\n\r\n $timeStamp = time();\r\n\r\n # Unserialize page tracking information.\r\n $pagetrackingArray = unserialize($row['pagetracking']);\r\n # Add new page tracking information to the already existing page tracking information.\r\n $pagetrackingArray[] = array('time' => $timeStamp, 'pageID' => intval($this->id));\r\n\r\n\t\t\t#Update commom information for statistics.\r\n\t\t $insertDataArray = array();\r\n\t\t $insertDataArray['lastpageview'] = $timeStamp;\r\n\t\t $insertDataArray['pagecounter'] = intval($row['pagecounter'] + 1);\r\n\t\t $insertDataArray['pagetracking'] = serialize($pagetrackingArray);\r\n\r\n\t\t # Update statistic information in the database.\r\n $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\r\n 'tx_feuserloginsystem_userstatistics',\r\n sprintf('uid=\\'%s\\'',addslashes(intval($row['uid']))),\r\n $insertDataArray\r\n );\r\n\r\n }\r\n\r\n }", "public function generate_unique_pin() {\r\n\t\t$found = false;\r\n\t\t$pin = 0;\r\n\t\twhile (!found) {\r\n\t\t\t$pin = rand(10000, 99999);\r\n\t\t\t$query = $this->db->get_where('student_auth', array('student_pin' => $pin));\r\n\t\t\t$found = ($query != null) && ($query->num_rows() == 0);\r\n\t\t}\r\n\t\treturn $pin;\r\n\t}", "function blogolytics_google_tracking() {\n\t?>\n\t<!-- Google Analytics by Blogolytics -->\n\t<script type=\"text/javascript\">\n\t\twindow.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n\t\tga('create', '<?php echo blogolytics_get_option( 'connection', 'tracking_code'); ?>', 'auto');\n\t\tga('send', 'pageview');\n\t</script>\n\t<script async src='https://www.google-analytics.com/analytics.js'></script>\n\t<!-- End Google Analytics by Blogolytics -->\n\t<?php\n}", "function add_trackers_federated($params)\n {\n $this->db->insert('trackers_federated',$params);\n return $this->db->insert_id();\n }", "public function getSocialUniqueImpression()\n\t{\n\t\tif (isset($this->socialUniqueImpression)) {\n\n\t\t\treturn $his->socialUniqueImpression;\n\t\t}\n\n\t\treturn 0;\n\t}", "public function signup() {\n // set third param to 1 so header/footer isn't displayed again\n $this->view->render('index/signup', null, 1);\n }", "public function updateGenerateCount($user_mail,$generate_count) {\n\n $changed = time();\n $generate_count++;\n \n $query = \\Drupal::database()->update('am_registration_login_count');\n $query->fields([\n 'generatecount' => $generate_count,\n 'changed' => $changed,\n ]);\n $query->condition('mail', $user_mail);\n $query->execute();\n \n return $result;\n }", "public function generateSignCodes() {\n $users = $this->connection->fetchAll('SELECT * FROM [reg_users]');\n \n if ($users) {\n foreach ($users as $user) {\n $data = array(\n 'signin_hash%s' => $this->generateUserHash($user, 'sign_in'),\n 'signoff_hash%s' => $this->generateUserHash($user, 'sign_off')\n );\n \n $this->connection->query('UPDATE [reg_users] SET', $data, 'WHERE [user_id] = %i', $user['user_id']);\n }\n }\n \n }", "public function setSocialUniqueClick($value)\n\t{\n\t\t$this->socialUniqueClick = $value;\n\t}", "public function trackingProvider()\n {\n return [[1.1], [1]];\n }", "public function trackingProvider()\n {\n return [[1.1], [1]];\n }", "public function setTrackCount($trackCount)\n {\n $this->_trackCount = $trackCount;\n }", "public function setPageID(){/*ACTUALLY NOT DEFINED*/}" ]
[ "0.59880346", "0.5326944", "0.5278816", "0.52383524", "0.5222721", "0.5217581", "0.5213451", "0.51702744", "0.51691544", "0.5159023", "0.5077513", "0.5053144", "0.5021646", "0.50158083", "0.49500686", "0.4865999", "0.48360163", "0.48113772", "0.4803118", "0.47862053", "0.4763268", "0.47515666", "0.47436506", "0.47396293", "0.47105646", "0.47038642", "0.47000957", "0.46645856", "0.46629623", "0.4655514", "0.4648218", "0.46389806", "0.461677", "0.4615358", "0.46134892", "0.46028584", "0.46027493", "0.4598826", "0.4598341", "0.45927116", "0.45853543", "0.4579609", "0.45717892", "0.45675394", "0.45568675", "0.45533156", "0.45476878", "0.45382744", "0.4536369", "0.4532054", "0.45304427", "0.45296335", "0.45288113", "0.4513477", "0.4502535", "0.4501276", "0.44987452", "0.44967583", "0.4467335", "0.4458845", "0.4453217", "0.44525403", "0.4448884", "0.44461134", "0.4431104", "0.4425343", "0.44121134", "0.44113916", "0.44069922", "0.44003585", "0.43879217", "0.43829748", "0.43827", "0.43789342", "0.43774456", "0.4376568", "0.43732056", "0.4371894", "0.4371778", "0.43701828", "0.43587005", "0.43569496", "0.4352015", "0.43496054", "0.43486357", "0.43472683", "0.43462706", "0.43307328", "0.43306136", "0.4329992", "0.43255454", "0.43244073", "0.43243045", "0.43226647", "0.432247", "0.4314183", "0.43124986", "0.43124986", "0.43063566", "0.4299556" ]
0.58327305
1
Get Tracking Number from session
public function getTrackingNumber($removeFromSession = false) { // Using session since currently signup is made via AJAX. Need to show lead pixel later $trackingNumber = Yii::$app->session->get(self::SESSION_KEY); if ($removeFromSession) { Yii::$app->session->remove(self::SESSION_KEY); } return $trackingNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTrackingNumber()\n {\n return $this->tracking_number;\n }", "public function getTrackingNumber()\n {\n return $this->trackingNumber;\n }", "public function getTrackingNumber() : string\n\t{\n\t\treturn $this->trackingNumber;\n\t}", "public function getTrackingID()\n {\n return $this->trackingID;\n }", "public function getTrackingId()\n {\n return $this->trackingId;\n }", "public function getTrackNumber() {}", "public function getTrackingId()\n {\n if (isset($this->data['TrackingId'])) {\n return $this->data['TrackingId'];\n } else {\n return false;\n }\n }", "public function getTrackingNumber(Mage_Sales_Model_Order_Shipment $shipment)\n {\n $trackingNumber = '';\n $tracks = $shipment->getAllTracks();\n\n if (array_key_exists(0, $tracks)) {\n $trackingNumber = $tracks[0]->getTrackNumber();\n }\n\n return $trackingNumber;\n }", "private function getEntryIdFromSession()\n {\n return Session::get($this->session_key, 0);\n }", "public function getTrackNumber()\n {\n return $this->trackNumber;\n }", "public function getSessionID() {\n if(isset($this->data['booking']['session']['id'])) {\n return $this->data['booking']['session']['id'];\n }\n return null;\n\n }", "public function getSessionID(){\r\n\t\treturn $this->sessionID;\r\n\t}", "final function getSession_id() {\n\t\treturn $this->getSessionId();\n\t}", "public function getSessionID();", "private function createTrackingNumber()\n {\n $tracking = 5000000000;\n $current = WaybillNumber::orderBy('id', 'DESC')->first();\n\n if (! $current) {\n $tracking = WaybillNumber::create(['current' => $tracking]);\n\n return $tracking->current;\n }\n\n $tracking = (int) $current['current'] + 1;\n\n $tracking = WaybillNumber::create(['current' => $tracking]);\n\n return $tracking->current;\n }", "public function get_session_id()\n {\n }", "public function getSessionID()\n {\n return $this->sessionID;\n }", "public function getSessionID() {\n return $this->sessionID;\n }", "public static function getIdFromSession()\n\t{\n\n\t\treturn $_SESSION[User::SESSION]['iduser'];\t\t\n\n\t}", "public function getSessionid()\n {\n return $this->sessionid;\n }", "public function getSessionID()\n {\n return $this->getKey('SessionID');\n }", "public function getTrackingAttribute()\n {\n return data_get($this, 'trackingNumber.tracking_number');\n }", "public static function getId(){\n\t\treturn session_id();\n\t}", "public static function getCurLocationID()\n {\n return Yii::app()->getsetSession->getLocationId();\n }", "public function getSessionID()\n {\n return $this->_session;\n }", "public function getID()\n {\n // this only works for web users!\n return $this->session->userdata('ID');\n }", "protected function _getId ()\n {\n return session_id();\n }", "public function getId()\n {\n return $this->getValue('session_id');\n }", "public function getSession()\r\n {\r\n return $this->sessionID;\r\n }", "private function getCurrentID() {\n if ($this->sessionid > 0) {\n\t\t\treturn $this->sessionid;\n\t\t}\n $cookie_id = 0;\n\t\tif (isset($GLOBALS[\"_COOKIE\"][\"sessionid\"])) {\n\t\t\t$cookie_array = explode('|', $GLOBALS[\"_COOKIE\"][\"sessionid\"]);\n\t\t\tif ($cookie_array[0]) {\n\t\t\t\t$cookie_id = $cookie_array[0];\n\t\t\t}\n\t\t}\n\t\treturn $cookie_id;\n }", "protected function getSessionId()\n {\n return \\Session::getId();\n }", "function get_token()\n\t{\n\t\treturn session_id();\n\t}", "public static function getSessionid();", "protected function getTrackedClientId() {\n /*if (isset($_COOKIE['_ga'])) {\n list($version,$domainDepth, $cid1, $cid2) = preg_split('[\\.]', $_COOKIE[\"_ga\"],4);\n $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1.'.'.$cid2);\n $cid = $contents['cid'];\n }\n else {*/\n $cid = $this->client->serial;\n //}\n return $cid;\n }", "function getSessionId() {\n\t\treturn $this->session_id;\n\t}", "protected function getSessionId()\n {\n $id = $this->di->session->get('requestRecorderId');\n\n if ($id == null) {\n $id = time();\n $this->di->session->set('requestRecorderId', $id); // Figure out something better than time()\n }\n\n return $id;\n }", "public function getInfoSerialNumber() {\n //\n // 3COM\n return PNMSnmp::get($this, '1.3.6.1.2.1.47.1.1.1.1.11.1', Yii::app()->params['cacheTtlGetSnmp']);\n }", "public function getTrackingKey()\n {\n if (!is_null($this->_messageTrackKey))\n return $this->_messageTrackKey;\n else\n return null;\n }", "public function getLast() {\n $tracking = new TrackingEntity();\n // Get last session\n if ($this->session->info):\n $tracking->id = $this->session->info->id;\n $report = new Report($tracking);\n $tracking = $report->read($report->file);\n if (!empty($tracking)): \n return $tracking;\n endif; \n endif;\n \n return false; // Session not found\n }", "protected function getSimulatingUserId()\n {\n return session(static::SIMULATING_USER_PROFILE_ID);\n }", "public function getUid()\n {\n return $this->_session->getUid();\n }", "function sess_id()\n {\n return session_id();\n }", "public function getIdlasession(): int\n {\n return $this->idlasession;\n }", "public function getSessionId() {\n $this->_session_id = $this->pub_session_id;\n return $this->pub_session_id;\n }", "public function order_tracking_numbers()\n\t{\n\t\t$order_id = ee()->TMPL->fetch_param('order_id');\n\n\t\t$query = ee()->db\n\t\t\t->where('order_id', $order_id)\n\t\t\t->where('order_status_name', 'Shipped')\n\t\t\t->get('store_order_history');\n\n\t\t$variables = array();\n\n\t\tforeach($query->result() as $row)\n\t\t{\n\t\t\t\n\t\t\t$exploded = explode('|', $row->order_status_message);\n\n\t\t\tif(count($exploded) == 2)\n\t\t\t{\n\t\t\t\t$variables[] = array(\n \t\t'tracking_url' => $this->get_tracking_url($exploded[0], $exploded[1]),\n \t\t'tracking_number' => $exploded[1]\n \t\n \t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$variables[] = array(\n \t\t'tracking_url' => '',\n \t\t'tracking_number' => $row->order_status_message\n \t\n \t\t);\n\t\t\t}\t\n\t\t\t\n\t\t}\t\n\n \treturn ee()->TMPL->parse_variables(ee()->TMPL->tagdata, $variables);\t\n\n\t}", "public static function get_id() {\n self::$_id = $_SESSION['id'];\n return self::$_id;\n }", "public function getId() {\n\t\treturn session_id();\n\t}", "public function tracking_field() {\n\t\techo cyprus_get_settings( 'mts_analytics_code' );\n\t}", "private function getSessionTimestamp()\n {\n if ($this->_phpsession && isset($_SESSION[$this->_sessionName]->SessionID))\n $timestamp = $_SESSION[$this->_sessionName]->SessionID;\n\n\n if ($this->_cookie && isset($_COOKIE[$this->_sessionName . \"_Timestamp\"]))\n $timestamp = $_COOKIE[$this->_sessionName . \"_Timestamp\"];\n\n return $timestamp;\n }", "public function getId(): string\n {\n return session_id();\n }", "function get_id () {\n\t\treturn $this->session_id ?: false;\n\t}", "function getTrackID() {\n\t\treturn $this->_TrackID;\n\t}", "public function getSessionId(): string\n {\n return $this->getData(self::SESSION_ID);\n }", "private function getPaymentId()\n {\n return Session::get('mall.payment.id');\n }", "public function decodeTrackingNo($trackingNo);", "public static function getId() {\n return (int)$_SESSION['user']['id'];\n }", "public function getCustomerSessionID(){\r\n\t\treturn $this->customerSessionID;\r\n\t}", "public function getTrackKey()\n\t{\n\t\treturn $this->statpro->getTrackKey();\n\t}", "public function getSession() \r\n\t{\t\t\t\r\n\t\t$this->url = $this->server . \"/X?op=login_request\" .\r\n\t\t\t\"&user_name=\" . $this->username .\r\n\t\t\t\"&user_password=\" . $this->password;\r\n\r\n\t\t// get login_response from Metalib\r\n\r\n\t\t$this->xml = $this->getResponse($this->url, $this->timeout);\r\n\t\t\r\n\t\t// extract session ID\r\n\t\t\r\n\t\t$objSession = $this->xml->getElementsByTagName(\"session_id\")->item(0);\r\n\t\treturn $objSession->nodeValue;\r\n\t}", "public function getSequenceNo()\n {\n $session = Mage::getSingleton('core/session');\n $number = $session->getSequenceNo() ? : 0;\n $session->setSequenceNo($number + 1);\n return $number;\n }", "public static function getCurrentID() {\n return Session::get(Privilege::SESSION_NAME_ID);\n }", "public function get_sessionstring()\n {\n \treturn \"$this->_session_name=$this->_session_id\";\n }", "function getSessionId() {\r\n return getAllHeaders()['X-Session-Id'];\r\n}", "protected function getSessionId() {\r\n\t\treturn $this->id;\r\n\t}", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "public function getSessionId()\n {\n return $this->session_id;\n }", "static function reporticoSessionName()\n {\n //if ( ReporticoApp::get(\"session_namespace\") )\n if (self::getReporticoSessionParam(\"framework_parent\")) {\n return \"NS_\" . ReporticoApp::get(\"session_namespace\");\n } else {\n return session_id() . \"_\" . ReporticoApp::get(\"session_namespace\");\n }\n\n }", "function cemhub_get_campaign_source_code_session_value() {\n $campaign_source = NULL;\n\n if (isset($_SESSION[CEMHUB_CAMPAIGN_SOURCE_SESSION])) {\n $campaign_source = $_SESSION[CEMHUB_CAMPAIGN_SOURCE_SESSION];\n }\n\n return $campaign_source;\n}", "public function getShopNumber()\n {\n if ($this->shop_number === null) {\n $this->shop_number = $this->configHelper->getShopNumber();\n }\n\n return $this->shop_number;\n }", "public static function getSessionId(){\n return self::$sessionId;\n }", "public function getSearchLogId()\n\t{\n\t\tif ($this->request AND $this->session AND $this->session->has('last_searchlog_id')) {\n\t\t\t$ref = $this->request->server->get('HTTP_REFERER');\n\t\t\t$search_url = App::getRouter()->generate('user', array(), true) . 'search';\n\t\t\t$search_url = preg_replace('#^https?://#', '', $search_url);\n\n\t\t\tif ($ref && preg_match('#' . preg_quote($search_url, '#') . '(\\?.*?)?$#', $ref)) {\n\t\t\t\t$searchlog = App::findEntity('DeskPRO:SearchLog', $this->session->has('last_searchlog_id'));\n\t\t\t\tif ($searchlog->visitor && $this->visitor && $searchlog->visitor == $this->visitor) {\n\t\t\t\t\treturn $searchlog['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "function get_id ()\r\n {\r\n return $_SESSION[\"id\"];\r\n }", "public static function getLoggedUserId()\r\n {\r\n return self::getVariable(\"login\", \"user-id\");\r\n }", "public function getSessionId()\n {\n return session_id();\n }", "public function getTrackKey()\n\t{\n\t\treturn $this->track_key;\n\t}", "public function getId()\n {\n return $this->_session->getId();\n }", "protected function get_user_id() {\n session_start();\n \n return session_id();\n }", "public function getUserNumber() {\n $this->rnd_users_number = $this->recordNumber(self::RNDUSERSC_NAME);\n return $this->rnd_users_number;\n }", "function generate_email_tracking_string($obj)\n{\n\tif($obj->session->userdata('userid'))\n\t{\n\t\t$tracking_id = $obj->session->userdata('userid').\"-\".strtotime('now');\n\t}\n\telse\n\t{\n\t\t$tracking_id = \"SF-\".strtotime('now');\n\t}\n\t\n\treturn \"Email Tracking ID: \".$tracking_id;\n}", "public static function trackId(): string\n {\n return 'tid';\n }", "function getNumericalSession($sessionStart, $timenow, $number){\n\tif($timenow >= $sessionStart){\n\t\treturn getNumericalSession($sessionStart,$timenow - INTERVAL_I, $number+1);\n\t}else{\n\t\treturn $number;\n\t}\n}", "public function getShopNumber()\n {\n return $this->ShopNumber;\n }", "public function getBadgeValue()\n {\n return $this->auth->loggedIn() ? $this->auth->id() : null;\n }", "public function genTrackingKey()\n {\n if ($this->trackMails) {\n $trackingKey = Yii::$app->security->generateRandomString(32);\n $this->setTrackingKey($trackingKey);\n return $trackingKey;\n } else {\n return null;\n }\n }", "public function getLoggedUserId()\n {\n return $this->proxyBase->loggedUserId;\n }", "public function getSessionId()\r\n\t{\r\n\t\treturn $this->session;\r\n\t}", "function requestRefHgsID($spc) {\n // if there is no such thing, then use $_SESSION['ID'] to populate a fake one\n // however, still need to be posted after the real one is generated by UCSC\n if(!isset($_SESSION['hgsIDs'])) {\n $_SESSION['hgsIDs'] = array();\n }\n if(!isset($_SESSION['hgsIDs'][$spc])) {\n $_SESSION['hgsIDs'][$spc] = $_SESSION['ID'] * 10 + 1 + count($_SESSION['hgsIDs']);\n }\n return $_SESSION['hgsIDs'][$spc];\n}", "public function getSubscriptionTracking()\n {\n return $this->subscription_tracking;\n }", "public function getUserIdFromSessionId($session_id);", "public function getCheckoutIdentifier()\n {\n return Mage::getStoreConfig(\"fontis_masterpass/settings/checkout_identifier\");\n }", "private function session_id()\r\n {\r\n return md5(__FILE__ . \"_\" . $_SERVER[\"HTTP_HOST\"]);\r\n }", "public function getId(): string\n {\n return session()->getId();\n }", "public function getCurrentUserId()\n\t{\n\t\treturn array_key_exists('user_id', $this->session->data) ? $this->session->data['user_id'] : 0;\n\t}", "public function getShopId()\n {\n return $this->metaRefreshValues['shopid'];\n }", "function get_user_identification($obj, $return_type)\n{\n\t$ipaddress = $obj->input->ip_address();\n\t$value = ($obj->session->userdata($return_type))?$obj->session->userdata($return_type):$ipaddress;\n\t\n\treturn $value;\n}", "function TrackingCode()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\t$code = lookupDbValue('settings', 'value', 'Tracking Code', 'name');\r\n\t\techo\"$code\";\r\n\t}", "private function getSessionId()\n {\n $request = Request::factory(self::$apiUrl . self::$authPath)\n ->method(Request::POST)\n ->headers('content-type', 'application/json')\n ->body(json_encode([\n 'domain' => self::$apiDomain,\n 'apiKey' => self::$apiKey,\n ]))\n ->execute();\n $setCookie = $request->headers('set-cookie');\n preg_match('/JSESSIONID=(?<id>\\w+);/', $setCookie, $jSessionId);\n\n return $jSessionId['id'];\n }" ]
[ "0.78255403", "0.777399", "0.76148957", "0.7233682", "0.6962543", "0.67749804", "0.67300135", "0.6602317", "0.65683454", "0.6556503", "0.64596075", "0.6437846", "0.64263564", "0.63654274", "0.63055474", "0.63038117", "0.62856865", "0.6276421", "0.62431353", "0.62251395", "0.6170429", "0.61490595", "0.6144043", "0.6141713", "0.6128415", "0.6122834", "0.6101129", "0.6095861", "0.60818887", "0.60724294", "0.60406905", "0.599993", "0.5999143", "0.5997545", "0.5978962", "0.5954212", "0.5936557", "0.5925132", "0.59214497", "0.5909842", "0.5889508", "0.58680916", "0.58632886", "0.5850609", "0.58489853", "0.5847609", "0.5845767", "0.5833203", "0.5831331", "0.58258206", "0.58203006", "0.58164585", "0.5813136", "0.5811072", "0.5794497", "0.5789675", "0.5775615", "0.5772011", "0.5757844", "0.57525206", "0.5748764", "0.57429004", "0.5739244", "0.57349527", "0.57261395", "0.57261395", "0.57261395", "0.57261395", "0.57261395", "0.5723375", "0.57202905", "0.5716786", "0.5703201", "0.5699097", "0.5698243", "0.5695277", "0.5683073", "0.568215", "0.56814384", "0.56775063", "0.5677132", "0.5673883", "0.5671758", "0.56373936", "0.5618304", "0.5607562", "0.560434", "0.55731106", "0.557243", "0.5571188", "0.5569314", "0.55678326", "0.556575", "0.55648726", "0.5559029", "0.55585486", "0.55569434", "0.55535465", "0.55460274", "0.55453163" ]
0.7838732
0
Send Reference request to ShareASale to convert lead to sale
public function sendReference($studentId, $studentCreatedAt, $amount, $transactionId) { $timestamp = gmdate(DATE_RFC1123); $action = 'reference'; $client = new Client(); $request = $client->createRequest() ->setMethod('get') ->addHeaders([ 'x-ShareASale-Date' => $timestamp, 'x-ShareASale-Authentication' => $this->generateHash($action, $timestamp), ]) ->setUrl($this->apiUrl) ->setData([ 'merchantId' => $this->merchantId, 'token' => $this->token, 'version' => $this->version, 'action' => $action, 'date' => Yii::$app->formatter->asDate($studentCreatedAt, 'php:n/j/Y'), 'ordernumber' => $studentId, 'transtype' => 'sale', 'amount' => $amount, 'tracking' => $transactionId, ]); $response = $request->send(); $responseContent = $response->getContent(); if (!$response->isOk || stripos($responseContent, "Error Code ")) { Yii::error('Failed to send ShareASale reference. Details: ' . $responseContent, 'shareasale'); return false; } Yii::info('ShareASale response details: ' . $responseContent, 'shareasale'); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sale($request);", "function _ws_apply_send_reference($key, $student, $contact, $case) {\n //Create new case activity\n $params = array(\n 'case_id' => $case['id'],\n 'subject' => 'Request sent',\n 'activity_type_id' => $key == 'parent' ? 38 : 39,\n 'source_contact_id' => $student['contact_id'],\n 'target_contact_id' => $contact['contact_id'],\n 'status_id' => 5,\n 'medium_id' => 7,\n );\n $result = woolman_civicrm_api('activity', 'create', $params);\n $act = $params['id'] = $result['id'];\n\n $query = db_query(\"SELECT id FROM {civicrm_activity_contact} WHERE activity_id = $act AND record_type_id = 3 AND contact_id = {$contact['contact_id']}\");\n $target = db_fetch_array($query);\n $link = 'http://semester.woolman.org/admissions/reference?id=' . $student['contact_id'] . '-' . $contact['contact_id'] . '-' . $act . '-' . $target['id'];\n\n // Update activity with link\n $params['details'] = '<p>This personalized link was sent to ' . woolman_contact_link($contact['first_name'] . ' ' . $contact['last_name'], $contact['contact_id']) . ' (<a href=\"mailto:' . $contact['email'] . '\">' . $contact['email'] . '</a>) on ' . date('M j Y') . ':</p><p>' . $link . '</p>';\n woolman_civicrm_api('activity', 'create', $params);\n\n $subject = _ws_apply_settings('ws_apply_' . $key . '_subject');\n $body = _ws_apply_settings('ws_apply_' . $key . '_email');\n\n $message = array(\n 'subject' => _ws_apply_replace_tokens($subject, $student, $contact, $link),\n 'body' => _ws_apply_replace_tokens($body, $student, $contact, $link),\n );\n\n drupal_mail('woolman_website', 0, $contact['email'], language_default(), $message, '[email protected]');\n\n return $link;\n}", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "function triangleMediaGetSalesReport($credentials,$url,$dateStart,$dateEnd,$arrVariables) {\n\t\tglobal $reportSuccess;\n\t\tglobal $reportResult;\n\t\tglobal $arrResult;\n\t\t\n\t\t// Extract credentials\n\t\t$arrCredentials = explode('||',$credentials);\n\t\t$arrSplit = explode('::',$arrCredentials[2]);\n\t\t$username = $arrSplit[1];\n\t\t$arrSplit = explode('::',$arrCredentials[3]);\n\t\t$password = $arrSplit[1];\n\t\t// Build transaction\n\t\t$post_url = $url;\n\t\t// Build xml to post\n\t\t$post_xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\".\n\t\t\"<soap:Envelope xmlns:xsi=\\\"http://www.w3.org/2001/XMLSchema-instance\\\" xmlns:xsd=\\\"http://www.w3.org/2001/XMLSchema\\\" xmlns:soap=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n\".\n\t\t\t\"<soap:Body>\\n\".\n\t\t\t\t\"<GetAgentSalesDetail xmlns=\\\"http://trianglecrm.com/\\\">\\n\".\n\t\t\t\t\t\"<username>\".$username.\"</username>\\n\".\n\t\t\t\t\t\"<password>\".$password.\"</password>\\n\".\n\t\t\t\t\t\"<startDate>\".$dateStart.\"</startDate>\\n\".\n\t\t\t\t\t\"<endDate>\".$dateEnd.\"</endDate>\\n\".\n\t\t\t\t\"</GetAgentSalesDetail>\\n\".\n\t\t\t\"</soap:Body>\\n\".\n\t\t\"</soap:Envelope>\";\n\t\t// Initialize curl and send\n\t\t$request = curl_init();\n\t\tcurl_setopt($request, CURLOPT_URL, $post_url);\n\t\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($request, CURLOPT_HTTPHEADER, Array('Content-type: text/xml;charset=\"utf-8\"','Accept: text/xml','Cache-Control: no-cache','Pragma: no-cache','SOAPAction: \"http://trianglecrm.com/GetAgentSalesDetail\"','Content-length: '.strlen($post_xml)));\n\t\tcurl_setopt($request, CURLOPT_HEADER, 1);\n\t\tcurl_setopt($request, CURLOPT_POSTFIELDS, $post_xml);\n\t\tcurl_setopt($request, CURLOPT_POST, 1);\n\t\tcurl_setopt($request, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t$post_response = curl_exec($request);\n\t\tcurl_close ($request);\n\t\t//echo $post_response;\n\t\t// Response\n\t\tif (strstr($post_response,'<State>')) {\n\t\t\t$strStart = strpos($post_response,'<State>')+strlen('<State>');\n\t\t\t$strEnd = strpos($post_response,'</State>');\n\t\t\t$postStatus = substr($post_response,$strStart,($strEnd-$strStart));\n\t\t}\n\t\t// Return response codes\n\t\tif ($postStatus === 'Success') {\n\t\t\t$reportSuccess = true;\n\t\t\t// Get report array\n\t\t\t$str1 = '<ReturnValue>';\n\t\t\t$str2 = '</ReturnValue>';\n\t\t\t$strXML = \"<salesReport>\\n\".substr($post_response,strpos($post_response,$str1)+strlen($str1),strrpos($post_response,$str2)-(strpos($post_response,$str1)+strlen($str1))).\"\\n</salesReport>\";\n\t\t\t// Load xml string into array\n\t\t\t$xmlParser = xml_parser_create();\n\t\t\txml_parse_into_struct($xmlParser,$strXML,$arrVals,$arrIndex);\n\t\t\txml_parser_free($xmlParser);\n\t\t\t$arrRaw = simplexml_load_string($strXML);\n\t\t\t// Read results into standardized array\n\t\t\t//OrderID\n\t\t\t//OrderAgent\n\t\t\t//OrderCustomer (customer id, first name, last name, address, address2, city, state, zip, country, phone, email)\n\t\t\t//OrderDate\n\t\t\t//OrderTotal\n\t\t\t//OrderTax\n\t\t\t//OrderShipping\n\t\t\t//OrderDetails (product skus, quantity, price per unit)\n\t\t\t//OrderHasParent (whether it’s related to another order, then that order’s ID)\n\t\t\t//OrderIsUpsell (whether it’s an upsell for another order)\n\t\t\t//OrderIsSubscription (whether it’s a recurring subscription)\n\t\t\t//OrderSubscriptionBillingCycle (number of days between each billing)\n\t\t\tforeach ($arrRaw as $agent) {\n\t\t\t\t// Agent details\n\t\t\t\t//$agent['AgentName'];\n\t\t\t\t$OrderAgent = $agent['AgentName'];\n\t\t\t\t// Customer details\n\t\t\t\t$arrCustomer = array();\n\t\t\t\tforeach ($agent->Customers->CustomerSaleView as $customer) {\n\t\t\t\t\t$arrCustomer['CustomerID'] = (string)$customer->Customer->BillingID;\n\t\t\t\t\t$arrCustomer['BillingNameFirst'] = (string)ucwords(strtolower($customer->Customer->FirstName));\n\t\t\t\t\t$arrCustomer['BillingNameLast'] = (string)ucwords(strtolower($customer->Customer->LastName));\n\t\t\t\t\t$arrCustomer['BillingAddress'] = (string)ucwords($customer->Customer->Address1);\n\t\t\t\t\t$arrCustomer['BillingAddress2'] = (string)ucwords($customer->Customer->Address2);\n\t\t\t\t\t$arrCustomer['BillingCity'] = (string)ucwords(strtolower($customer->Customer->City));\n\t\t\t\t\t$arrCustomer['BillingState'] = (string)strtoupper($customer->Customer->State);\n\t\t\t\t\t$arrCustomer['BillingZip'] = (string)$customer->Customer->Zip;\n\t\t\t\t\t$arrCustomer['BillingCountry'] = ($customer->Customer->Country != '') ? (string)strtoupper($customer->Customer->Country) : 'US';\n\t\t\t\t\t$arrCustomer['ShippingNameFirst'] = (string)ucwords(strtolower($customer->Customer->FirstName));\n\t\t\t\t\t$arrCustomer['ShippingNameLast'] = (string)ucwords(strtolower($customer->Customer->LastName));\n\t\t\t\t\t$arrCustomer['ShippingAddress'] = (string)ucwords($customer->Customer->Address1);\n\t\t\t\t\t$arrCustomer['ShippingAddress2'] = (string)ucwords($customer->Customer->Address2);\n\t\t\t\t\t$arrCustomer['ShippingCity'] = (string)ucwords(strtolower($customer->Customer->City));\n\t\t\t\t\t$arrCustomer['ShippingState'] = (string)strtoupper($customer->Customer->State);\n\t\t\t\t\t$arrCustomer['ShippingZip'] = (string)$customer->Customer->Zip;\n\t\t\t\t\t$arrCustomer['ShippingCountry'] = ($customer->Customer->Country != '') ? (string)strtoupper($customer->Customer->Country) : 'US';\n\t\t\t\t\t$arrCustomer['Phone'] = (string)$customer->Customer->Phone;\n\t\t\t\t\t$arrCustomer['Email'] = (string)strtolower($customer->Customer->Email);\n\t\t\t\t\t//print_r($arrCustomer).'<p>';\n\t\t\t\t\t// Customer sales (internal)\n\t\t\t\t\t$orderID = false;\n\t\t\t\t\tforeach ($customer->Sales as $sale) {\n\t\t\t\t\t\tif ($sale->SaleInfo->SaleID != '') {\n\t\t\t\t\t\t\t$orderID = (string)$sale->SaleInfo->SaleID;\n\t\t\t\t\t\t\t$arrSale = array();\n\t\t\t\t\t\t\t$arrSale['OrderID'] = $orderID;\n\t\t\t\t\t\t\t$arrSale['OrderAgent'] = (string)$OrderAgent;\n\t\t\t\t\t\t\t$arrSale['OrderCustomer'] = $arrCustomer;\n\t\t\t\t\t\t\t//$sale->SaleInfo->BillingID;\n\t\t\t\t\t\t\t$arrSale['OrderDate'] = date(\"Y-m-d H:i:s\",strtotime((string)$sale->SaleInfo->SaleDate));\n\t\t\t\t\t\t\t//$arrSale['OrderDate'] = (string)str_replace('T',' ',$sale->SaleInfo->SaleDate);\n\t\t\t\t\t\t\t$arrSale['OrderTotal'] = (string)$sale->SaleInfo->PricePaid;\n\t\t\t\t\t\t\t$arrSale['OrderTax'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderShipping'] = '';\n\t\t\t\t\t\t\t// Order product details\n\t\t\t\t\t\t\t$arrProducts = array();\n\t\t\t\t\t\t\tforeach ($sale->SaleInfo->ProductList as $products) {\n\t\t\t\t\t\t\t\t$arrProducts[] = array('SKU'=>(string)$products->SaleProduct->SKU,'Quantity'=>(string)$products->SaleProduct->Quantity,'Description'=>'','Price'=>'');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$arrSale['OrderDetails'] = $arrProducts;\n\t\t\t\t\t\t\tunset($arrProducts);\t\t\t\t\t\t\n\t\t\t\t\t\t\t$arrSale['OrderHasParent'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderIsUpsell'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderIsSubscription'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderSubscriptionBillingCycle'] = '';\n\t\t\t\t\t\t\t$arrResult[] = $arrSale;\n\t\t\t\t\t\t\t//print_r($arrSale);\n\t\t\t\t\t\t\tunset($arrSale);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Customer sales (external)\n\t\t\t\t\tforeach ($customer->ExternalSales->DirectActionSaleInfo as $sale) {\n\t\t\t\t\t\tif ($sale->DirectActionClubRequestID != '') {\n\t\t\t\t\t\t\t$arrSale = array();\n\t\t\t\t\t\t\t$arrSale['OrderID'] = (string)$sale->DirectActionClubRequestID;\n\t\t\t\t\t\t\t$arrSale['OrderAgent'] = (string)$OrderAgent;\n\t\t\t\t\t\t\t$arrSale['OrderCustomer'] = $arrCustomer;\n\t\t\t\t\t\t\t//$sale->SaleInfo->BillingID;\n\t\t\t\t\t\t\t$arrSale['OrderDate'] = date(\"Y-m-d H:i:s\",strtotime((string)$sale->SaleDate));\n\t\t\t\t\t\t\t//$arrSale['OrderDate'] = (string)str_replace('T',' ',$sale->SaleDate);\n\t\t\t\t\t\t\t$arrSale['OrderTotal'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderTax'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderShipping'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderDetails'] = array(array('SKU'=>(string)$sale->UpsellID,'Quantity'=>'1','Description'=>'','Price'=>''));\n\t\t\t\t\t\t\t$arrSale['OrderHasParent'] = $orderID;\n\t\t\t\t\t\t\t$arrSale['OrderIsUpsell'] = '1';\n\t\t\t\t\t\t\t$arrSale['OrderIsSubscription'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderSubscriptionBillingCycle'] = '';\n\t\t\t\t\t\t\t$arrResult[] = $arrSale;\n\t\t\t\t\t\t\t//print_r($arrSale);\n\t\t\t\t\t\t\tunset($arrSale);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Customer sales (subscriptions)\n\t\t\t\t\tforeach ($customer->Subscriptions as $subscription) {\n\t\t\t\t\t\tif ($subscription->SubscriptionInfo->PlanID != '') {\n\t\t\t\t\t\t\t$arrSale = array();\n\t\t\t\t\t\t\t$arrSale['OrderID'] = (string)$subscription->SubscriptionInfo->PlanID;\n\t\t\t\t\t\t\t$arrSale['OrderAgent'] = (string)$OrderAgent;\n\t\t\t\t\t\t\t$arrSale['OrderCustomer'] = $arrCustomer;\n\t\t\t\t\t\t\t//$sale->SaleInfo->BillingID;\n\t\t\t\t\t\t\t$arrSale['OrderDate'] = date(\"Y-m-d H:i:s\",strtotime((string)$subscription->SubscriptionInfo->CreateDate));\n\t\t\t\t\t\t\t//$arrSale['OrderDate'] = (string)str_replace('T',' ',$subscription->SubscriptionInfo->CreateDate);\n\t\t\t\t\t\t\t$arrSale['OrderTotal'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderTax'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderShipping'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderDetails'] = array(array('SKU'=>(string)$subscription->SubscriptionInfo->PlanID,'Quantity'=>'1','Description'=>'','Price'=>''));\n\t\t\t\t\t\t\t$arrSale['OrderHasParent'] = (string)$subscription->SubscriptionInfo->InitialSaleID;\n\t\t\t\t\t\t\t$arrSale['OrderIsUpsell'] = '';\n\t\t\t\t\t\t\t$arrSale['OrderIsSubscription'] = '1';\n\t\t\t\t\t\t\t// Calculate billing cycle data\n\t\t\t\t\t\t\tif ($subscription->SubscriptionInfo->NextBillDate != '') {\n\t\t\t\t\t\t\t\t$date_start = strtotime(date(date(\"Y-m-d H:i:s\",strtotime((string)$subscription->SubscriptionInfo->CreateDate))));\n\t\t\t\t\t\t\t\t$date_end = strtotime(date(date(\"Y-m-d H:i:s\",strtotime((string)$subscription->SubscriptionInfo->NextBillDate))));\n\t\t\t\t\t\t\t\t$arrSale['OrderSubscriptionBillingCycle'] = (string)round(($date_end-$date_start)/(60*60*24));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$arrSale['OrderSubscriptionBillingCycle'] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$arrResult[] = $arrSale;\n\t\t\t\t\t\t\t//print_r($arrSale);\n\t\t\t\t\t\t\tunset($arrSale);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Clear variables\n\t\t\t\t\t$orderID = false;\n\t\t\t\t\tunset($arrCustomer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$reportSuccess = false;\n\t\t\t$reportResult = $postStatus;\n\t\t\t$arrResult = false;\n\t\t}\n\t\t//print_r($arrResult);\n\t\t//die();\n\t\t\t\t\n\t\treturn $reportSuccess;\n\t\treturn $reportResult;\n\t\treturn $arrResult;\n\t}", "public function sendLead() {\n\n /////////////////////////////////////////////////////////////////////\n // CHECK REQUIRED DATA //////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n if (is_null($this->__apiToken)) {\n throw new \\Exception(\"API Token must be setted!\");\n }\n\n if (is_null($this->__leadEmail)) {\n throw new \\Exception(\"Lead email must be setted!\");\n }\n\n if (!isset($this->__leadData['identifier'])) {\n throw new \\Exception(\"Lead data 'identifier' must be setted!\");\n }\n\n /////////////////////////////////////////////////////////////////////\n // PREPARE DATA COLLECTION //////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n $this->__translateLeadData();\n\n $this->__leadData['token_rdstation'] = $this->__apiToken;\n $this->__leadData['email'] = $this->__leadEmail;\n\n /////////////////////////////////////////////////////////////////////\n // PERFORM REQUEST TO API ///////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n return $this->__request('POST', 'conversions');\n }", "function _processSale() {\n// \t\tAndroidHelper::write_log('braintree.txt', 'Payment_method_nonce: '.$_POST['payment_method_nonce']);\t\n\t\t$this->autoload();\n\t\t$input = JFactory::getApplication()->input;\n\t\t$order_id = $input->getString('order_number');\n\t\t\n\t\t$orderComplex = AndroidHelper::getOrderDetail($order_id);\n\t\tAImporter::classes('order');\n\t\t$order = new BookproOrder();\n\t\t\n\t\t$this->setConfig();\n\t\tif($this->sale($orderComplex)){\n\t\t\t$result = array(\n\t\t\t\t\t'status'=>1,\n\t\t\t\t\t'tx_id'=>$paymentId,\n\t\t\t\t\t'desc'=>$transaction[0]->description,\n\t\t\t\t\t'total'=>$transaction[0]->getAmount()->getTotal(),\n\t\t\t\t\t'currency'=>$transaction[0]->getAmount()->getCurrency(),\n\t\t\t\t\t'created'=>$payment->getCreateTime(),\n\t\t\t\t\t'method'=>$payment->getPayer()->getPaymentMethod()\n\t\t\t);\n\t\t\t$cardinfo = $payment->getPayer()->getFundingInstruments();\n\t\t\tif($cardinfo[0]){\n\t\t\t\t$result['card_info']['type'] = $cardinfo[0]->getCreditCardToken()->getType();\n\t\t\t\t$result['card_info']['last4'] = $cardinfo[0]->getCreditCardToken()->getLast4();\n\t\t\t}\n\t\t\treturn $result;\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "function back_to_source($provided_reference_id, $transaction_id, $merchant_order_id, $amount, $message){\n\n $url = \"https://apps-uat.phonepe.com/v3/credit/backToSource\";\n $body = array(\n \"merchantId\" => $this->credentials.mid,\n \"amount\" => $amount,\n \"transactionId\" => $transaction_id,\n \"merchantOrderId\" => $merchant_order_id,\n \"message\" => $message,\n \"providerReferenceId\" => $provided_reference_id\n );\n $encoded_request = base64_encode(json_encode($body));\n $salt_key = $this->credentials.salt_key;\n $salt_index = $this->credentials.salt_index;\n $_sha256 =hash(\"sha256\", \"$encoded_request/v3/credit/backToSource$salt_key\");\n $request = new HttpRequest();\n $request->setUrl($url);\n $request->setMethod(HTTP_METH_POST);\n $request->setHeaders(array(\n \"x-verify\" => \"$_sha256###$salt_index\",\n \"x-client-id\" => $this->credentials.client_id,\n \"Content-Type\" => 'application/json'\n ));\n $request->setBody('{\n \"request\": $encoded_request\n }');\n\n try {\n $response = $request->send();\n return $response->getBody();\n } catch (Exception $ex) {\n return $ex;\n }\n }", "public function renewLoan($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->renewLoanError->_value = 'authentication_error';\n else {\n $agencyId = self::strip_agency($param->agencyId->_value);\n $targets = $this->config->get_value('ruth', 'ztargets');\n if ($tgt = $targets[$agencyId]) {\n $renewal = &$renew->Renewal->_value;\n $renewal->LibraryNo->_value = $agencyId;\n $renewal->BorrowerTicketNo->_value = $param->userId->_value;\n if (is_array($param->copyId))\n foreach ($param->copyId as $copyId)\n $renewal->CopyNos->_value->CopyNo[]->_value = $copyId->_value;\n else\n $renewal->CopyNos->_value->CopyNo->_value = $param->copyId->_value;\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($renew));\n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n//echo 'error: ' . $z->get_errno();\n//print_r($xml);\n//print_r($xml_ret);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = $dom->getElementsByTagName('BorrowerError')->item(0)->nodeValue) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err);\n if (!($res->renewLoanError->_value = $this->errs[$err])) \n $res->renewLoanError->_value = 'unspecified error (' . $err . '), order not possible';\n } else {\n foreach ($dom->getElementsByTagName('CopyNoStatus') as $cns) {\n $rl->copyId->_value = $cns->getAttribute('CopyNo');\n if (!$cns->nodeValue)\n $rl->renewLoanOk->_value = 'true';\n elseif (!($rl->renewLoanError->_value = $this->errs[$cns->nodeValue])) \n $rl->renewLoanError->_value = 'unspecified error (' . $cns->nodeValue . '), order not possible';\n $res->renewLoan[]->_value = $rl;\n unset($rl);\n }\n }\n } else {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') loadXML error of: ' . $xml_ret['xmlUpdateDoc']);\n $res->renewLoanError->_value = 'system error';\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->renewLoanError->_value = 'system error';\n }\n } else\n $res->renewLoanError->_value = 'unknown agencyId';\n }\n\n $ret->renewLoanResponse->_value = $res;\n //print_r($param); print_r($res); die();\n return $ret;\n }", "function createGatewayLink( $request )\r\n\t{\r\n\t\t$var['post_url']\t\t= \"https://ssl.ditonlinebetalingssystem.dk/popup/default.asp\";\r\n\t\t$var['orderid']\t\t\t= $request->invoice->id;\r\n\t\t$var['amount']\t\t\t= $request->int_var['amount'] * 100;\r\n\t\t$var['merchantnumber']\t= $this->settings['merchantnumber'];\r\n\t\t$var['currency']\t\t= AECToolbox::aecNumCurrency( $this->settings['currency'] );\r\n\t\t$var['language']\t\t= $this->getEpayLanguage( $this->settings['language'] );\r\n\r\n\t\t// for this solution always use state 2 (full window (same window))\r\n\t\t$var['windowstate']\t\t= $this->settings['windowstate'];\r\n\t\t$var['accepturl']\t\t= $request->int_var['return_url'];\r\n\t\t$var['declineurl']\t\t= AECToolbox::deadsureURL(\"index.php?option=com_acctexp&amp;task=cancel\");\r\n\t\t$var['callbackurl']\t\t= AECToolbox::deadsureURL(\"index.php?option=com_acctexp&amp;task=epaynotification\");\r\n\r\n\t\t$var['group']\t\t\t= $this->settings['group'];\r\n\t\t$var['description']\t\t= AECToolbox::rewriteEngineRQ( $this->settings['description'], $request );\r\n\t\t$var['authsms']\t\t\t= $this->settings['authsms'];\r\n\t\t$var['authmail']\t\t= $this->settings['authmail'];\r\n\r\n\t\tif ( $this->settings['use3D'] == 1 ) {\r\n\t\t\t$var['use3D'] = \"1\";\r\n\t\t}\r\n\r\n\t\tif ( $this->settings['addfee'] == 1 ) {\r\n\t\t\t$var['addfee'] = \"1\";\r\n\t\t}\r\n\r\n\t\treturn $var;\r\n\t}", "public function sendApproval(Request $request)\n {\n $salesReturnByApprovers = [];\n\n DB::connection('tenant')->transaction(function () use ($request, $salesReturnByApprovers) {\n $sendBy = tenant(auth()->user()->id);\n $salesReturns = SalesReturn::whereIn('id', $request->ids)->get();\n\n // delivery order grouped by approver\n foreach ($salesReturns as $do) { \n $salesReturnByApprovers[$do->form->request_approval_to][] = $do;\n }\n \n foreach ($salesReturnByApprovers as $salesReturnByApprover) {\n $approver = null;\n\n $formStart = head($salesReturnByApprover)->form;\n $formEnd = last($salesReturnByApprover)->form;\n\n $form = [\n 'number' => $formStart->number,\n 'date' => $formStart->date,\n 'created' => $formStart->created_at,\n 'send_by' => $sendBy\n ];\n\n // loop each sales return by group approver\n foreach ($salesReturnByApprover as $salesReturn) {\n $salesReturn->action = 'create';\n \n if(!$approver) {\n $approver = $salesReturn->form->requestApprovalTo;\n // create token based on request_approval_to\n $approverToken = Token::where('user_id', $approver->id)->first();\n if (!$approverToken) {\n $approverToken = new Token();\n $approverToken->user_id = $approver->id;\n $approverToken->token = md5($approver->email.''.now());\n $approverToken->save();\n }\n\n $approver->token = $approverToken->token;\n }\n \n if ($salesReturn->form->close_status === 0) $salesReturn->action = 'close';\n\n if (\n $salesReturn->form->cancellation_status === 0\n && $salesReturn->form->close_status === null\n ) {\n $salesReturn->action = 'delete';\n }\n\n if (\n $salesReturn->form->cancellation_status === null \n && $salesReturn->form->close_status === null\n && $salesReturn->form->approval_status === 0\n ) {\n $userActivity = UserActivity::where('number', $salesReturn->form->number)\n ->where('activity', 'like', '%' . 'Update' . '%');\n\n $updateCount = $userActivity->count();\n if ($updateCount > 0) $salesReturn->action = 'update';\n }\n\n $salesReturn->form->fireEventRequestApproval();\n }\n \n if (count($salesReturnByApprover) > 1) {\n $formattedFormStartDate = date('d F Y', strtotime($formStart->date));\n $formattedFormEndDate = date('d F Y', strtotime($formEnd->date));\n $formattedFormStartCreate = date('d F Y H:i:s', strtotime($formStart->created_at));\n $formattedFormEndCreate = date('d F Y H:i:s', strtotime($formEnd->created_at));\n\n $form['number'] = $formStart->number . ' - ' . $formEnd->number;\n $form['date'] = $formattedFormStartDate . ' - ' . $formattedFormEndDate;\n $form['created'] = $formattedFormStartCreate . ' - ' . $formattedFormEndCreate;\n }\n\n $approvalRequest = new SalesReturnApprovalRequest($salesReturnByApprover, $approver, (object) $form, $_SERVER['HTTP_REFERER']);\n Mail::to([ $approver->email ])->queue($approvalRequest);\n }\n });\n\n // return $result;\n return [\n 'input' => $request->all(),\n ];\n }", "public function finishSale(Request $request)\n {\n $user = auth()->user();\n $returnResult = [];\n $success = false;\n $id = $request->id;\n $quoteUser = \\App\\Quote::find($id)->users;\n $quote = \\App\\Quote::find($id);\n if ($user->organization_id == $quoteUser->organization_id) {\n $quote->stage_id=3;\n $quote->aditional_detail=$request->aditional_detail;\n $quote->quote_date=$request->quote_date;\n if ($quote->save()) {\n $returnResult['message'] = 'Success';\n $success = true;\n } else {\n $returnResult['message'] = 'An internal server erros has ocurred, please contact your administrator';\n }\n } else {\n $returnResult['message'] = 'You have no permissions on this record';\n }\n return response()->json(array('success' => $success, 'data'=>$returnResult));\n }", "function spgateway_credit_refund($params) {\n\n $amount = $params['amount']; # Format: ##.##\n $TotalAmount = round($amount);\n $transid = $params['transid'];\n\n # 是否為測試模式\n $posturl = ($params['testMode']==\"on\") ? 'https://ccore.spgateway.com/MPG/mpg_gateway'\n : 'https://core.spgateway.com/MPG/mpg_gateway' ;\n\n // post data\n $PostData = http_build_query(\n array( 'RespondType' => 'String',\n 'Version' => '1.0',\n 'Amt' => $TotalAmount,\n 'TradeNo' => $transid,\n 'TimeStamp' => time(),\n 'IndexType' => '2',\n 'CloseType' => '2'\n ));\n $PostData = trim(\n bin2hex(\n mcrypt_encrypt( MCRYPT_RIJNDAEL_128,\n $params['HashKey'],\n spgateway_credit_addpadding($PostData),\n MCRYPT_MODE_CBC,\n $params['HashIV'])\n )\n );\n\n // post\n $post = array( 'MerchantID_' => $params['MerchantID'],\n 'PostData_' => $PostData);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $posturl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n if ($params['testMode']=='on') curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // On dev server only!\n $result = curl_exec($ch);\n curl_close($ch);\n\n parse_str(trim($result),$result);\n\n switch($result['Status']){\n case 'SUCCESS':\n case 'TRA10045':\n return array('status'=>'success', 'rawdata'=>$result, 'transid'=>$result['TradeNo'], 'fees'=>0);\n case 'TRA10058':\n case 'TRA10675':\n case 'TRA10013':\n case 'TRA10035':\n return array('status'=>'declined', 'rawdata'=>$result);\n default:\n return array('status'=>'error', 'rawdata'=>$result);\n }\n}", "public function doReferenceTransaction($ref) {\n\t\t$nvpstr =\n\t\t\t'&REFERENCEID=' . $ref .\n\t\t\t'&AMT=10' .\n\t\t\t'&PAYMENTACTION=Sale&REQCONFIRMSHIPPING=0';\n\n\t\t$this->hash_call('DoReferenceTransaction', $nvpstr);\n\t}", "function addArticleCrossselling($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedCrosssellingIdOnMarketplace_'.rand(1000, 9999); \n \n}", "public function getFinancial($param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null, $param8 = null)\n {\n //$endUseList,$loanType, $amount=null, $loanTenure = null, $companySharePledged= null, $bscNscCode = null,$loanId=null\n $endUseList = $param1;\n $loanType = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n $loan = null;\n $model = null;\n $setDisable = null;\n $user = Auth::getUser();\n $setDisable = $this->getIsDisabled($user);\n $isRemoveMandatory = MasterData::removeMandatory();\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n $validLoanHelper = new validLoanUrlhelper();\n if (isset($loanId)) {\n $validLoan = $validLoanHelper->isValidLoan($loanId);\n if (!$validLoan) {\n return view('loans.error');\n }\n $status = $validLoanHelper->getTabStatus($loanId, 'promoter_details');\n if ($status == 'Y' && $setDisable != 'disabled') {\n $setDisable = 'disabled';\n }\n }\n\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $userId = $loan->user_id;\n //$model = $loan->getBalanceSheetDetails()->get()->first();\n //dd($loan, $model);\n if (!isset($endUseList)) {\n $endUseList = $loan->end_use;\n }\n if (!isset($loanType)) {\n $loanType = $loan->type;\n }\n if (!isset($amount)) {\n $amount = $loan->loan_amount;\n }\n if (!isset($loanTenure)) {\n $loanTenure = $loan->loan_tenure;\n }\n //$chosenCompanyPositionTypes = CompanyPosition::where('loan_id','=', $loanId)->get()->lists('position');\n //@$business_object = Business::where('loan_id', '=', $loanId)->get()->first();\n }\n $userPr = UserProfile::where('user_id', '=', $userId)->first();\n $userProfile = UserProfile::with('user')->find($userPr->id);\n $helper = new DeletedQuestionsHelper($loan);\n $deletedQuestionsLoan = $this->getDeletedQuestionLoan($loan, $loanType, $amount);\n $deletedQuestionHelper = new DeletedQuestionsHelper($deletedQuestionsLoan);\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $choosenApproxValue = null;\n $subViewType = 'loans._financial';\n $formaction = 'Loans\\LoansController@postFinancial';\n $bl_details = [];\n $pl_details = [];\n $existingloan_details = [];\n $bl_details = BalanceSheetDetail::where('loan_id', '=', $loanId)->orderBy('finyear', 'DESC')->get();\n $pl_details = ProfitLossDetail::where('loan_id', '=', $loanId)->orderBy('finyear', 'DESC')->get();\n $existingloan_details = ExistingLoanDetail::where('loan_id', '=', $loanId)->get();\n $financialBLDataMap = new Collection();\n $financialPLDataMap = new Collection();\n foreach ($bl_details as $financialData) {\n $financialBLDataMap->offsetSet($financialData->finyear, $financialData);\n }\n foreach ($pl_details as $financialData) {\n $financialPLDataMap->offsetSet($financialData->finyear, $financialData);\n }\n //dd( $bl_year, $bl_details, $pl_details, $existingloan_details);\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.createedit', compact(\n 'subViewType',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'loan',\n 'companySharePledged',\n 'bscNscCode',\n 'loanId',\n 'formaction',\n 'bl_year',\n 'bl_details',\n 'pl_details',\n 'existingloan_details',\n 'choosenApproxValue',\n 'helper',\n 'deletedQuestionHelper',\n 'setDisable',\n 'validLoanHelper',\n 'removeMandatory',\n 'userProfileFirm',\n 'loanUserProfile',\n 'userProfile',\n 'financialBLDataMap',\n 'financialPLDataMap'\n ));\n }", "public function createLeadOther(Request $request)\n {\n $role = Auth::user()->roleDetail('abbreviation');\n if ($role['abbreviation'] == 'EM' || $role['abbreviation'] == 'CO' || $role['abbreviation'] == 'AG' || $role['abbreviation'] == 'RP' || $role['abbreviation'] == 'SV') {\n $employee_id = new ObjectID(Auth::id());\n $LeadDetails = LeadDetails::where('active', 1)->where('employeeTabStatus', (int) 1)->whereNotNull('transferTo')->where(function ($q) use ($employee_id) {\n $q->where('transferTo', 'elemMatch', array('id' => $employee_id, 'status' => 'Transferred'))->orwhere('transferTo', 'elemMatch', array('id' => $employee_id, 'status' => 'Collected'));\n })->get();\n if (count($LeadDetails) >= 20) {\n return response()->json([\n 'success' => false,\n 'save_method' => '',\n 'next_location' => ''\n ]);\n }\n }\n $save_from = $request->input('save_from');\n $reference_number = $request->input('reference_number');\n $dispatch_type = $request->input('dispatch_type');\n\n $leadDetails = new LeadDetails();\n $pipelineItem = WorkTypeData::where('refereneceNumber', $reference_number)->first();\n $customer_name = $pipelineItem['customer']['name'];\n $customer_id = $pipelineItem['customer']['id'];\n $customerCode = $pipelineItem['customer']['customerCode'];\n\n $customer_object = new \\stdClass();\n $customer_object->id = new ObjectID($customer_id);\n $customer_object->name = $customer_name;\n $customer_object->recipientName = $customer_name;\n $customer_object->customerCode = $customerCode;\n $leadDetails->customer = $customer_object;\n $leadDetails->saveType = 'customer';\n\n\n $agentId = $pipelineItem['agent']['id'];\n $agent = User::find($agentId);\n $agentObject = new \\stdClass();\n $agentObject->id = new ObjectID($request->input('agent'));\n $agentObject->name = $agent->name;\n $leadDetails->agent = $agentObject;\n\n $casemanagerId = $pipelineItem['caseManager']['id'];\n $caseManager = User::find($casemanagerId);\n $caseManagerObject = new \\stdClass();\n $caseManagerObject->id = new ObjectID($request->input('caseManager'));\n $caseManagerObject->name = $caseManager->name;\n $leadDetails->caseManager = $caseManagerObject;\n\n $dispatchType = DispatchTypes::where('type', $dispatch_type)->first();\n $dispatchTypeObject = new \\stdClass();\n $dispatchTypeObject->id = new ObjectID($dispatchType->_id);\n $dispatchTypeObject->dispatchType = $dispatchType->type;\n $dispatchTypeObject->code = $dispatchType->code;\n $leadDetails->dispatchType = $dispatchTypeObject;\n $leadDetails->active = (int) 1;\n $customer = Customer::find($customer_id);\n $leadDetails->contactEmail = $customer->email[0];\n $leadDetails->contactNumber = $customer->contactNumber[0];\n\n\n $Date = date('d/m/y');\n $splted_date = explode('/', $Date);\n $currentdate = implode($splted_date);\n date_default_timezone_set('Asia/Dubai');\n $time = date('His');\n $count = LeadDetails::where('referenceNumber', 'like', '%' . $currentdate . '%')->count();\n $newCount = $count + 1;\n if ($newCount < 10) {\n $newCount = '0' . $newCount;\n }\n $refNumber = $dispatchTypeObject->code . \"/\" . $currentdate . \"/\" . $time . \"/\" . $newCount;\n $leadDetails->referenceNumber = (string) $refNumber;\n\n $createdBy_obj = new \\stdClass();\n $createdBy_obj->id = new ObjectID(Auth::id());\n $createdBy_obj->name = Auth::user()->name;\n $createdBy_obj->date = date('d/m/Y');\n $createdBy_obj->action = \"Lead Created\";\n $createdBy[] = $createdBy_obj;\n $leadDetails->createdBy = $createdBy;\n\n $leadDetails->other_id = new ObjectID($pipelineItem->_id);\n $leadDetails->saveFrom = $save_from;\n if ($dispatchType->type == 'Direct Collections' || $dispatchType->type == 'Direct Delivery') {\n $leadDetails->dispatchStatus = 'Reception';\n $next_location = 'go_reception';\n } else {\n $leadDetails->dispatchStatus = 'Lead';\n $next_location = 'go_lead';\n }\n $leadDetails->save();\n if ($next_location == 'go_lead') {\n $this->saveTabStatus($leadDetails->_id);\n } else {\n if ($next_location == 'go_reception') {\n $this->saveDirectTabStatus($leadDetails->_id);\n }\n }\n Session::flash('status', 'Lead created successfully');\n\n return response()->json([\n 'success' => true,\n 'save_method' => $save_from,\n 'next_location' => $next_location\n ]);\n }", "function save_sales($office, $sale_id)\n {\n $sale_data = array(\n 'sale_time' => date('Y-m-d', strtotime($this->input->post('date'))),\n 'customer_id' => $this->input->post('customer_id') ? $this->input->post('customer_id') : null,\n 'employee_id' => $this->input->post('employee_id'),\n 'commisioner_id' => $this->input->post('commissioner_id')==''?NULL:$this->input->post('commissioner_id'),\n 'commision_price' => $this->input->post('commissioner_price'),\n 'deposit' => $this->input->post('deposit_price'),\n 'comment' => $this->input->post('comment'),\n 'show_comment_on_receipt' => $this->input->post('show_comment_on_receipt') ? 1 : 0\n );\n \n if ($this->Sale->update($sale_data, $sale_id))\n {\n echo json_encode(array('success'=>true,'message'=>lang('sales_successfully_updated')));\n }\n else\n {\n echo json_encode(array('success'=>false,'message'=>lang('sales_unsuccessfully_updated')));\n }\n }", "function fn_rus_payments_payanyway_send_order_info($params, $order_info)\n{\n $inventory_positions = fn_rus_payments_payanyway_get_inventory_positions($order_info);\n\n if (!empty($inventory_positions)) {\n $data = array(\n 'id' => $params['MNT_TRANSACTION_ID'],\n 'checkoutDateTime' => date(DATE_ATOM),\n 'docNum' => $params['MNT_TRANSACTION_ID'],\n 'docType' => 'SALE',\n 'email' => $order_info['email'],\n 'inventPositions' => $inventory_positions,\n 'moneyPositions' => array(array('paymentType' => 'CARD', 'sum' => $params['MNT_AMOUNT']))\n );\n\n $mnt_dataintegrity_code = $order_info['payment_method']['processor_params']['mnt_dataintegrity_code'];\n $data['signature'] = md5($data['id'] . $data['checkoutDateTime'] . $mnt_dataintegrity_code);\n $jsonData = json_encode($data);\n $operationUrl = PAYANYWAY_GATEWAY_URL . '/api/api.php?method=sale&accountid=' . $params['MNT_ID'];\n\n $extra = array(\n 'headers' => array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($jsonData)\n ),\n 'log_preprocessor' => '\\Tygh\\Http::unescapeJsonResponse'\n );\n\n Http::post($operationUrl, $jsonData, $extra);\n }\n}", "private function _runCrossReferenceTransaction(Varien_Object $payment, $szTransactionType, $amount = false)\r\n {\r\n \t$error = false;\r\n \t$boTransactionProcessed = false;\r\n \t$PaymentProcessorFullDomain;\r\n \t$rgeplRequestGatewayEntryPointList;\r\n \t$crtCrossReferenceTransaction;\r\n \t$crtrCrossReferenceTransactionResult;\r\n \t$todTransactionOutputData;\r\n \t$szMerchantID = $this->getConfigData('merchantid');\r\n\t\t$szPassword = $this->getConfigData('password');\r\n\t\t//\r\n\t\t$iclISOCurrencyList = PYS_ISOCurrencies::getISOCurrencyList();\r\n\t\t$szAmount;\r\n\t\t$nAmount;\r\n\t\t$szCurrencyShort;\r\n\t\t$iclISOCurrencyList;\r\n \t$power;\r\n \t$nDecimalAmount;\r\n \t$szNewCrossReference;\r\n \t\r\n \t$order = $payment->getOrder();\r\n \t$szOrderID = $order->getRealOrderId();;\r\n \t//$szCrossReference = $payment->getLastTransId();\r\n \t$additionalInformation = $payment->getAdditionalInformation();\r\n\r\n \t$szCrossReference = $additionalInformation[\"CrossReference\"];\r\n \t$szCrossReference = $payment->getLastTransId();\r\n \t\r\n \t// check the CrossRference and TransactionType parameters\r\n\t\tif(!$szCrossReference)\r\n\t\t{\r\n\t\t\t$error = 'Error occurred for '.$szTransactionType.': Missing Cross Reference';\r\n\t\t}\r\n\t\tif(!$szTransactionType)\r\n\t\t{\r\n\t\t\t$error = 'Error occurred for '.$szTransactionType.': Missing Transaction Type';\r\n\t\t}\r\n\t\t\r\n\t\tif($error === false)\r\n\t\t{\r\n\t\t\t$PaymentProcessorFullDomain = $this->_getPaymentProcessorFullDomain();\r\n\t\t\t\r\n\t \t$rgeplRequestGatewayEntryPointList = new PYS_RequestGatewayEntryPointList();\r\n\t\t\t$rgeplRequestGatewayEntryPointList->add(\"https://gw1.\".$PaymentProcessorFullDomain, 100, 2);\r\n\t\t\t$rgeplRequestGatewayEntryPointList->add(\"https://gw2.\".$PaymentProcessorFullDomain, 200, 2);\r\n\t\t\t$rgeplRequestGatewayEntryPointList->add(\"https://gw3.\".$PaymentProcessorFullDomain, 300, 2);\r\n\t \t\r\n\t \t$crtCrossReferenceTransaction = new PYS_CrossReferenceTransaction($rgeplRequestGatewayEntryPointList);\r\n\t \t$crtCrossReferenceTransaction->getMerchantAuthentication()->setMerchantID($szMerchantID);\r\n\t\t\t$crtCrossReferenceTransaction->getMerchantAuthentication()->setPassword($szPassword);\r\n\t\t\t\r\n\t\t\t// if no amount is specified get the grand total amount\r\n\t\t\tif($amount === false)\r\n\t\t\t{\r\n\t\t\t\t$nAmount = $order->getBaseGrandTotal();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$nAmount = $amount;\r\n\t\t\t}\r\n\r\n\t\t\t$szCurrencyShort = $order->getOrderCurrency()->getCurrencyCode();\r\n\t\t\tif ($szCurrencyShort != '' &&\r\n\t\t\t\t$iclISOCurrencyList->getISOCurrency($szCurrencyShort, $icISOCurrency))\r\n\t\t\t{\r\n\t\t\t\t$nCurrencyCode = new PYS_NullableInt($icISOCurrency->getISOCode());\r\n\t\t\t\t$crtCrossReferenceTransaction->getTransactionDetails()->getCurrencyCode()->setValue($icISOCurrency->getISOCode());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// round the amount before use\r\n\t\t\t$nAmount = round($nAmount, $icISOCurrency->getExponent());\r\n\t\t\t$power = pow(10, $icISOCurrency->getExponent());\r\n\t\t\t$nDecimalAmount = $nAmount * $power;\r\n\t\t\t\r\n\t\t\t$crtCrossReferenceTransaction->getTransactionDetails()->setOrderID($szOrderID);\r\n\t\t\t$crtCrossReferenceTransaction->getTransactionDetails()->getAmount()->setValue($nDecimalAmount);\r\n\t\t\t\r\n\t\t\t$crtCrossReferenceTransaction->getTransactionDetails()->getMessageDetails()->setCrossReference($szCrossReference);\r\n\t\t\t$crtCrossReferenceTransaction->getTransactionDetails()->getMessageDetails()->setTransactionType($szTransactionType);\r\n\t \t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t$boTransactionProcessed = $crtCrossReferenceTransaction->processTransaction($crtrCrossReferenceTransactionResult, $todTransactionOutputData);\r\n\t\t\t}\r\n\t\t\tcatch (Exception $exc)\r\n\t\t\t{\r\n\t\t\t\tMage::log(\"exception: \".$exc->getMessage());\r\n\t\t\t}\r\n\t \t\r\n\t\t\tif ($boTransactionProcessed == false)\r\n\t\t\t{\r\n\t\t\t\t// could not communicate with the payment gateway\r\n\t\t\t\t$error = \"Couldn't complete \".$szTransactionType.\" transaction. Details: \".$crtCrossReferenceTransaction->getLastException();\r\n\t\t\t\t$szLogMessage = $error;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tswitch($crtrCrossReferenceTransactionResult->getStatusCode())\r\n\t\t\t\t{\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t$error = false;\r\n\t\t\t\t\t\t$szNewCrossReference = $todTransactionOutputData->getCrossReference();\r\n\t\t\t\t\t\t$szLogMessage = $szTransactionType . \" CrossReference transaction successfully completed. Response object: \";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$payment->setTransactionId($szNewCrossReference)\r\n\t\t\t\t\t\t\t\t->setParentTransactionId($szCrossReference)\r\n\t\t\t\t\t\t\t\t->setIsTransactionClosed(1);\r\n\t\t\t\t\t\t$payment->save();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$szLogMessage = $crtrCrossReferenceTransactionResult->getMessage();\r\n\t\t\t\t\t\tif ($crtrCrossReferenceTransactionResult->getErrorMessages()->getCount() > 0)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$szLogMessage = $szLogMessage.\".\";\r\n\t\t\r\n\t\t\t\t\t\t\tfor ($LoopIndex = 0; $LoopIndex < $crtrCrossReferenceTransactionResult->getErrorMessages()->getCount(); $LoopIndex++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$szLogMessage = $szLogMessage.$crtrCrossReferenceTransactionResult->getErrorMessages()->getAt($LoopIndex).\";\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$szLogMessage = $szLogMessage.\" \";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t$error = \"Couldn't complete \".$szTransactionType.\" transaction for CrossReference: \" . $szCrossReference . \". Payment Response: \".$szLogMessage;\r\n\t\t\t\t\t\t$szLogMessage = $szTransactionType . \" CrossReference transaction failed. Response object: \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$szLogMessage = $szLogMessage.print_r($crtrCrossReferenceTransactionResult, 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tMage::log($szLogMessage);\r\n\t\t}\r\n\t\t\r\n\t\treturn $error;\r\n }", "public function fetchVoucherDetails(Request $request){\n\n\t\t// check for the header authentication\n\t\t$auth_token = $request->header('auth');\n\n\t\tif( !$this->checkAuthentication($auth_token) ){\n\t\t\t$finalResponse = array(\n\t\t\t\t'message'\t=> 'Invalid authentication! Call aborted',\n\t\t\t\t'status'\t=> 'failed',\n\t\t\t\t'code'\t\t=> '400'\n\t\t\t);\n\n\t\t\treturn $finalResponse;\n\t\t}\n \n $compnayFromInput \t= str_replace(\"&\", \"&amp;\", $request->input('companyName'));\n\t\t// Get Company Name\n\t\t$currentCompanyName = trim($compnayFromInput);\n\t\tif($currentCompanyName==\"\"){\n\t\t\t$currentCompanyName = $this->objTallyConnector->getCompanyName();\n\t\t}\n\n\t\t$startDate \t= $request->input('startDate');\n\t\t$endDate \t= $request->input('endDate');\n\n\t\t// Prepare XML to Fetch Ledger Master\n\t\t$requestXML = '\n\t\t<ENVELOPE>\n\t\t <HEADER>\n\t\t <VERSION>1</VERSION>\n\t\t <TALLYREQUEST>Export</TALLYREQUEST>\n\t\t <TYPE>Collection</TYPE>\n\t\t <ID>Sales</ID>\n\t\t </HEADER>\n\t\t\t<BODY>\n\t\t\t <DESC>\n\t\t\t <STATICVARIABLES>\n\t\t\t \t<SVCURRENTCOMPANY>'.$currentCompanyName.'</SVCURRENTCOMPANY>\n\t\t\t <SVFROMDATE TYPE=\"Date\">'.$startDate.'</SVFROMDATE>\n\t\t\t <SVTODATE TYPE=\"Date\">'.$endDate.'</SVTODATE>\n\t\t\t <EXPLODEFLAG>Yes</EXPLODEFLAG>\n\t\t\t <SVVOUCHERTYPENAME>Receipt</SVVOUCHERTYPENAME>\n\t\t\t <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT> \n\t\t\t </STATICVARIABLES>\n\t\t\t <TDL>\n\t\t\t <TDLMESSAGE>\n\t\t\t <COLLECTION NAME=\"Sales\" ISMODIFY=\"No\">\n\t\t\t <TYPE>Voucher</TYPE> \n\t\t\t <FETCH>Vouchernumber</FETCH>\n\t\t\t <FETCH>VoucherTypeName</FETCH>\n\t\t\t <FETCH>LedgerName</FETCH>\n\t\t\t <FETCH>Amount</FETCH>\n\t\t\t <FETCH>REFERENCE</FETCH>\n\t\t\t </COLLECTION>\n\t\t\t </TDLMESSAGE>\n\t\t\t </TDL>\n\t\t\t </DESC> \n\t\t\t</BODY>\n\t\t</ENVELOPE> \n\t\t';\n\n\t\t// call CURL function to get tally response\n\t\t$tallyFinalResponse = $this->objTallyConnector->executeTallyCURL($requestXML, 1);\n\n\t\t// return $tallyFinalResponse;\n\t\t// exit;\n\n\t\t// Convert Data into Proper Array Format\n\t\t$tallyAllVouchers = array();\n\t\tif( isset($tallyFinalResponse['BODY']['DATA']['COLLECTION']['VOUCHER']) ){\n\t\t\t$tallyFinalResponse = $tallyFinalResponse['BODY']['DATA']['COLLECTION']['VOUCHER'];\n\t\t\t$loop_couneter=0;\n\n\n\t\t\tif(isset($tallyFinalResponse[0])){\n\n\t\t\t\tforeach($tallyFinalResponse as $data){\n\n\t\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t\t= \tisset($data['VOUCHERTYPENAME']) ? $data['VOUCHERTYPENAME'] : 'NotFound';\n\t\t\t\t\t$tallyAllVouchers[$loop_couneter]['DATE']\t\t\t\t= \tisset($data['DATE']) ? date('Y-m-d', strtotime($data['DATE'])) : date('Y-m-d');\n\t\t\t\t\t$tallyAllVouchers[$loop_couneter]['LEDGERNAME-ONE']\t\t=\tisset($data['LEDGERNAME']) ? $data['LEDGERNAME'] : \"\";\n\t\t\t\t\t$tallyAllVouchers[$loop_couneter]['LEDGERNAME-TWO']\t\t=\tisset($data['ALLLEDGERENTRIES.LIST'][1]['LEDGERNAME']) ? $data['ALLLEDGERENTRIES.LIST'][1]['LEDGERNAME'] : \"\";\n\t\t\t\t\t$tallyAllVouchers[$loop_couneter]['VOUCHERNUMBER']\t\t=\tisset($data['VOUCHERNUMBER']) ? $data['VOUCHERNUMBER'] : \"\";\n\t\t\t\t\t$tallyAllVouchers[$loop_couneter]['AMOUNT']\t\t\t\t=\tisset($data['AMOUNT']) ? abs($data['AMOUNT']) : 0;\n\t\t\t\t\t$tallyAllVouchers[$loop_couneter]['REFERENCE']\t\t\t=\tisset($data['REFERENCE']) && !is_array($data['REFERENCE']) ? $data['REFERENCE'] : \"\";\n\n\t\t\t\t\t$loop_couneter++;\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t= \tisset($tallyFinalResponse['VOUCHERTYPENAME']) ? $tallyFinalResponse['VOUCHERTYPENAME'] : 'NotFound';\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['DATE']\t\t\t= \tisset($tallyFinalResponse['DATE']) ? date('Y-m-d', strtotime($tallyFinalResponse['DATE'])) : date('Y-m-d');\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['LEDGERNAME-ONE']\t\t=\tisset($tallyFinalResponse['LEDGERNAME']) ? $tallyFinalResponse['LEDGERNAME'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['LEDGERNAME-TWO']\t\t=\tisset($data['ALLLEDGERENTRIES.LIST'][1]['LEDGERNAME']) ? $data['ALLLEDGERENTRIES.LIST'][1]['LEDGERNAME'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['VOUCHERNUMBER']\t=\tisset($tallyFinalResponse['VOUCHERNUMBER']) ? $tallyFinalResponse['VOUCHERNUMBER'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['AMOUNT']\t\t\t=\tisset($tallyFinalResponse['AMOUNT']) ? abs($tallyFinalResponse['AMOUNT']) : 0;\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['REFERENCE']\t\t=\tisset($tallyFinalResponse['REFERENCE']) && !is_array($tallyFinalResponse['REFERENCE']) ? $tallyFinalResponse['REFERENCE'] : \"\";\n\t\t\t\t$loop_couneter++;\n\n\t\t\t}\n\t\t\t\t\t\t\n\t\t}\n\n\t\t/*print_r($tallyAllVouchers);\n\t\texit;*/\n\n\t\t$counter=1;\n\t\t$receiptTotal = 0;\n\t\t$receiptArray = array();\n\t\tforeach($tallyAllVouchers as $value){\n\t\t\tif($value['Type']=='Sales'){\n\t\t\t\t$receiptArray[$counter] = $value;\n\t\t\t\t$receiptTotal = $receiptTotal + $value['AMOUNT'];\n\t\t\t\t$counter++;\n\t\t\t}\n\t\t}\n\t\t\n\n\t\t// Making the final response\n\t\t$finalResponse = array(\n\t\t\t'message'\t=> 'Ledger Imported Successfully!',\n\t\t\t'status'\t=> 'Success',\n\t\t\t'code'\t\t=> '200',\n\t\t\t'data'\t\t=> $receiptArray,\n\t\t\t'Total'\t\t=> $receiptTotal\n\t\t);\n\n\t\treturn $finalResponse;\n\t}", "function directPayment()\n\t{\n\t\tglobal $eWAYCustomerID,\n\t\t\t\t$eWayTotalAmount,\n\t\t\t\t$ewayCustomerFirstName,\n\t\t\t\t$ewayCustomerLastName,\n\t\t\t\t$ewayCustomerEmail,\n\t\t\t\t$ewayCustomerAddress,\n\t\t\t\t$ewayCustomerPostcode,\n\t\t\t\t$ewayCustomerInvoiceDescription,\n\t\t\t\t$ewayCustomerInvoiceRef,\n\t\t\t\t$ewayCardHoldersName,\n\t\t\t\t$ewayCardNumber,\n\t\t\t\t$ewayCardExpiryMonth,\n\t\t\t\t$ewayCardExpiryYear,\n\t\t\t\t$ewayCVN,\n\t\t\t\t$ewayTrxnNumber,\n\t\t\t\t$ewayOption1,\n\t\t\t\t$ewayOption2,\n\t\t\t\t$ewayOption3,\n\t\t\t\t$directPaymentUrl,\n\t\t\t\t$eWaySOAPActionURL;\n\t\t\t\t$testUrl = \"https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp\";\n\t\t\t\t$liveUrl = \"https://www.eway.com.au/gateway_cvn/xmlpayment.asp\";\n\t\t\t\t$eWaySOAPActionURL = \"https://www.eway.com.au/gateway/managedpayment\";\n\t\t\t\t$eWayCustomerId = \"91901390\"; /* test account */\n\t\t\t\t$eWayTotalAmount = 100; /* 1$ = 100 cent */\n\t\t\t\t$directXML = \"<ewaygateway>\".\n\t\t\t\t\"<ewayCustomerID>\".$eWAYCustomerID.\"</ewayCustomerID>\".\n\t\t\t\t\"<ewayTotalAmount>\".$eWayTotalAmount.\"</ewayTotalAmount>\".\n\t\t\t\t\"<ewayCustomerFirstName>\".$ewayCustomerFirstName.\"</ewayCustomerFirstName>\".\n\t\t\t\t\"<ewayCustomerLastName>\".$ewayCustomerLastName.\"</ewayCustomerLastName>\".\n\t\t\t\t\"<ewayCustomerEmail>\".$ewayCustomerEmail.\"</ewayCustomerEmail>\".\n\t\t\t\t\"<ewayCustomerAddress>\".$ewayCustomerAddress.\"</ewayCustomerAddress>\".\n\t\t\t\t\"<ewayCustomerPostcode>\".$ewayCustomerPostcode.\"</ewayCustomerPostcode>\".\n\t\t\t\t\"<ewayCustomerInvoiceDescription>\".$ewayCustomerInvoiceDescription.\"</ewayCustomerInvoiceDescription>\".\n\t\t\t\t\"<ewayCustomerInvoiceRef>\".$ewayCustomerInvoiceRef.\"</ewayCustomerInvoiceRef>\".\n\t\t\t\t\"<ewayCardHoldersName>\".$ewayCardHoldersName.\"</ewayCardHoldersName>\".\n\t\t\t\t\"<ewayCardNumber>\".$ewayCardNumber.\"</ewayCardNumber>\".\n\t\t\t\t\"<ewayCardExpiryMonth>\".$ewayCardExpiryMonth.\"</ewayCardExpiryMonth>\".\n\t\t\t\t\"<ewayCardExpiryYear>\".$ewayCardExpiryYear.\"</ewayCardExpiryYear>\".\n\t\t\t\t\"<ewayCVN>\".$ewayCVN.\"</ewayCVN>\".\n\t\t\t\t\"<ewayTrxnNumber>\".$ewayTrxnNumber.\"</ewayTrxnNumber>\".\n\t\t\t\t\"<ewayOption1>\".$ewayOption1.\"</ewayOption1>\".\n\t\t\t\t\"<ewayOption2>\".$ewayOption2.\"</ewayOption2>\".\n\t\t\t\t\"<ewayOption3>\".$ewayOption3.\"</ewayOption3>\".\n\t\t\t\"</ewaygateway>\";\n\t\t\t //echo $directXML;\n\t\t\t //exit;\n\t\t\t\t$result = $this->makeCurlCall($testUrl, /* CURL URL */\"POST\", /* CURL CALL METHOD */\n\t\t\t\tarray( /* CURL HEADERS */\n\t\t\t\t\t\"Content-Type: text/xml; charset=utf-8\",\n\t\t\t\t\t\"Accept: text/xml\",\n\t\t\t\t\t\"Pragma: no-cache\",\n\t\t\t\t\t\"SOAPAction: \".$eWaySOAPActionURL,\n\t\t\t\t\t\"Content_length: \".strlen(trim($directXML))\n\t\t\t\t),\n\t\t\t\tnull, /* CURL GET PARAMETERS */\n\t\t\t\t$directXML /* CURL POST PARAMETERS AS XML */\n\t\t\t);\n\t\t\tif($result != null && isset($result[\"response\"])) {//$response = new SimpleXMLElement($result[\"response\"]);\n\t\t\t // $response = simpleXMLToArray($response);\n\t\t\t $result\t\t\t\t=\t$result[\"response\"];\n\t\t\t // exit;\n\t\t\t $ewayTrxnStatus\t\t=\t$this->getTextBetweenTags($result,'ewayTrxnStatus');\n\t\t\t if($ewayTrxnStatus)\n\t\t\t {\n\t\t\t\t\t$ewayTrxnNumber\t=\t $this->getTextBetweenTags($result,'ewayTrxnNumber');\n\t\t\t\t\t$ewayAuthCode\t=\t $this->getTextBetweenTags($result,'ewayAuthCode');\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t\t\t\"ewayTrxnStatus\"=>$ewayTrxnStatus,\n\t\t\t\t\t\t\t\t\t\"ewayTrxnNumber\"=>$ewayTrxnNumber,\n\t\t\t\t\t\t\t\t\t\"ewayAuthCode\"=>$ewayAuthCode\n\t\t\t\t\t\t\t\t);\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t return 'error: Account creation fail';\n\t\t\t }\n\t\t\t}\n\t\t\tdie(\"\");\n\t}", "public function confirmOrderReference($requestParameters = array());", "public function sendReferenceToPolaris($data)\r\n {\r\n $user_id = 24;\r\n\r\n //Set other parameters as keys in the $postdata array\r\n $postdata = array(\r\n 'user_id' => $user_id,\r\n 'unique_code' => $data['reference']\r\n );\r\n\r\n $url = \"https://api.paystack.co/transaction/initialize\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($postdata)); //Post Fields\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\r\n $headers = [\r\n 'Authorization: Bearer ' . \"Gbenga\",\r\n 'Content-Type: application/json',\r\n ];\r\n\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\r\n $request = curl_exec($ch);\r\n\r\n curl_close($ch);\r\n\r\n if ($request)\r\n {\r\n $result = json_decode($request, true);\r\n }\r\n else\r\n {\r\n $result = json_decode($request, true);\r\n }\r\n\r\n if($result['status'] )\r\n {\r\n }\r\n else\r\n {\r\n\r\n }\r\n\r\n return $result;\r\n }", "public function actionGenerateSaleQuotation($project,$seller)\n {\n\n $newProject_id = new \\MongoDB\\BSON\\ObjectID($project);\n\n $collection = Yii::$app->mongo->getCollection('project');\n $model = $collection->aggregate([\n [\n '$unwind' => '$sellers'\n ],\n [\n '$match' => [\n '_id' => $newProject_id,\n 'sellers.seller' => $seller,\n ]\n ],\n\n ]); \n\n $collection = Yii::$app->mongo->getCollection('project');\n $arrUpdate = [\n '$set' => [\n 'date_update' => date('Y-m-d h:i:s'),\n 'update_by' => Yii::$app->user->identity->id,\n 'sellers.$.status' => 'Quoted',\n 'sellers.$.history' => [\n [\n 'quotation_no' => $quotation_no = $model[0]['sellers']['quotation_no'],\n ]\n \n ]\n \n ]\n \n ];\n $collection->update(['_id' => $newProject_id,'sellers.seller' => $seller],$arrUpdate); \n\n return $this->redirect(['quote/index']);\n\n }", "public function store(Request $request)\n {\n //dd($request);\n\n $cliente_referido = Client::find($request->referido);\n \n $cliente_referido->add_points($request->points);\n //dd($cliente_referido);\n \n Client::create(['referred_by' => $request->referido] + $request->all());\n \n if ($request->sale == 1){\n return redirect()-> back();\n }\n return redirect()->route('clients.index');\n }", "public function joinPaymentInfo();", "public function make(Request $request)\n {\n $now= new Carbon();\n $time= Carbon::now();\n $data = $request->all();\n $sponsor = Sponsor::find($data['sponsor']);\n $apartment = Apartment::find($data['apa']);\n\n $payload = $request->input('payload', false);\n $nonce = $payload['nonce'];\n $gateway = $this->brainConfig();\n $status = $gateway->transaction()->sale([\n 'amount' => $sponsor->cost,\n 'paymentMethodNonce' => $nonce,\n 'options' => [\n 'submitForSettlement' => True\n ]\n ]);\n\n if ($status->success) {\n\n $payment = new Payment();\n $payment->apartment_id = $apartment->id;\n $payment->sponsor_id = $sponsor->id;\n if($sponsor->id == 1){\n $payment->expire_date = $time->add(1, 'day');\n };\n if($sponsor->id == 2){\n $payment->expire_date = $time->add(3, 'day');\n };\n if($sponsor->id == 3){\n $payment->expire_date = $time->add(6, 'day');\n };\n $payment->total = $sponsor->cost;\n $payment->status = true;\n $payment->save();\n\n $apartment->sponsorActive=true;\n $apartment->save();\n\n return response()->json($status);\n \n } else {\n\n $payment = new Payment();\n $payment->apartment_id = $apartment->id;\n $payment->sponsor_id = $sponsor->id;\n $payment->expire_date = $time;\n $payment->total = $sponsor->cost;\n $payment->status = false;\n $payment->save();\n\n return response()->json($status);\n }\n }", "public function sales_complete()\n {\n $sales_no = trim($this->input->post('sales_no'));\n $sales_date = date_to_db(trim($this->input->post('sales_date')));\n\n $sales = $this->MSales_master->get_by_sales_no($sales_no);\n $this->MSales_master->update($sales[0]['id']);\n $this->MSales_master->update_tax_info($sales_no);\n\n /** Check if previous sales journal exist then Remove sales journal details else make new sales journal master */\n $sales_journal = $this->MAc_journal_master->get_by_doc('Sales', $sales_no);\n if (count($sales_journal) > 0)\n {\n $sales_journal_no = $sales_journal['journal_no'];\n $this->MAc_journal_details->delete_by_journal_no($sales_journal_no);\n }\n else\n {\n $sales_journal_no = $this->MAc_journal_master->get_journal_number();\n $this->MAc_journal_master->create_by_sales($sales_journal_no, $sales_no);\n }\n\n $settings = $this->MSettings->get_by_company_id($this->session->user_company);\n $total_price = $this->MSales_details->get_total_price_by_sales_no($sales_no);\n\n /** Calculate COGS */\n $total_cogs = $this->MSales_details->get_total_cogs($sales_no);\n\n /** Calculate Sales Tax */\n $tax_amount = 0;\n $tax_percent = $settings['tax_rate'];\n if ($tax_percent > 0)\n {\n $tax_amount = ($total_price * $tax_percent) / 100;\n }\n\n /** Calculate Dues */\n $total_paid = $this->input->post('paid_amount');\n $dues = ((float)$total_price + (float)$tax_amount) - (float)$total_paid;\n /** Discount price calculation */\n // $discount = $this->input->post('discount');\n // $dues = (float)$total_price - (float)$discount - (float)$total_paid;\n\n /** Sales Journal details entry */\n if ($dues == 0)\n {\n /** Cash debit (gross amount) */\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_cash'], $total_paid);\n /** Sales revenue credit (net sale amount) */\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_sales'], NULL, $total_price);\n /** Tax payable credit (tax amount) */\n if ($tax_amount > 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_tax'], NULL, $tax_amount);\n }\n }\n else\n {\n /** Accounts receivable / Customer account debit (dues amount) */\n $customer = $this->MCustomers->get_by_id($this->input->post('customer_id'));\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $customer['ac_id'], $dues);\n /** Cash debit (paid amount if any) */\n if ((float)$total_paid != 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_cash'], $total_paid);\n }\n /** Sales revenue credit (net sale amount) */\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_sales'], NULL, $total_price);\n /** Tax payable credit (tax amount) */\n if ($tax_amount > 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_journal_no, $settings['ac_tax'], NULL, $tax_amount);\n }\n }\n\n /** Check if previous expense journal exist then Remove expense journal details else make new expense journal master */\n $expense_journal = $this->MAc_journal_master->get_by_doc('Expense', $sales_no);\n if (count($expense_journal) > 0)\n {\n $expense_journal_no = $expense_journal['journal_no'];\n $this->MAc_journal_details->delete_by_journal_no($expense_journal_no);\n }\n else\n {\n $expense_journal_no = $this->MAc_journal_master->get_journal_number();\n $this->MAc_journal_master->create_by_doc($expense_journal_no, $sales_date, 'Direct Sales', 'Expense', $sales_no);\n }\n $this->MAc_journal_details->create_by_inventory($expense_journal_no, $settings['ac_cogs'], $total_cogs);\n $this->MAc_journal_details->create_by_inventory($expense_journal_no, $settings['ac_inventory'], NULL, $total_cogs);\n\n /** Auto Money Receipt if partial or full cash paid */\n if ((float)$total_paid != 0)\n {\n $mr = $this->MAc_money_receipts->get_latest();\n if (count($mr) > 0)\n {\n $mr_no = (int)$mr['mr_no'] + 1;\n }\n else\n {\n $mr_no = 1001;\n }\n $this->MAc_money_receipts->create_by_sales($mr_no, $total_paid, $sales_no);\n }\n\n echo 'inventory/sales-list';\n }", "public function fetchLedgerWithBalance(Request $request){\n\n\t\t// check for the header authentication\n\t\t$auth_token = $request->header('auth');\n\n\t\tif( !$this->checkAuthentication($auth_token) ){\n\t\t\t$finalResponse = array(\n\t\t\t\t'message'\t=> 'Invalid authentication! Call aborted',\n\t\t\t\t'status'\t=> 'failed',\n\t\t\t\t'code'\t\t=> '400'\n\t\t\t);\n\n\t\t\treturn $finalResponse;\n\t\t}\n\n\t\t$compnayFromInput \t= str_replace(\"&\", \"&amp;\", $request->input('companyName'));\n\t\t\n\t\t// Get Company Name\n\t\t$currentCompanyName = trim($compnayFromInput);\n\t\tif($currentCompanyName==\"\"){\n\t\t\t$currentCompanyName = $this->objTallyConnector->getCompanyName();\n\t\t}\n\n\t\t$startDate = $request->input('startDate');\n\t\t$toDate = $request->input('toDate');\n\n\t\t// Prepare XML to Fetch Ledger Master\n\t\t$requestXML = '\n\t\t\t\t<ENVELOPE>\n\t\t\t <HEADER>\n\t\t\t\t\t\t<VERSION>1</VERSION>\n\t\t\t\t\t\t<TALLYREQUEST>EXPORT</TALLYREQUEST>\n\t\t\t\t\t\t<TYPE>COLLECTION</TYPE>\n\t\t\t\t\t\t<ID>Remote Ledger Coll</ID>\n\t\t\t </HEADER>\n\t\t\t <BODY>\n\t\t\t\t\t\t<DESC>\n\t\t\t\t\t\t\t<STATICVARIABLES>\n\t\t\t\t\t\t\t\t<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>\n\t\t\t\t\t\t\t\t<SVCURRENTCOMPANY>'.$compnayFromInput.'</SVCURRENTCOMPANY>\n\t\t\t\t\t\t\t\t<SVFROMDATE TYPE=\"Date\">'.$startDate.'</SVFROMDATE>\n\t\t\t\t\t\t\t\t<SVTODATE TYPE=\"Date\">'.$toDate.'</SVTODATE>\n\t\t\t\t\t\t\t\t</STATICVARIABLES>\n\t\t\t\t\t\t\t<TDL>\n\t\t\t\t\t\t\t\t<TDLMESSAGE>\n\t\t\t\t\t\t\t\t\t<COLLECTION NAME=\"Remote Ledger Coll\" ISINITIALIZE=\"Yes\">\n\t\t\t\t\t\t\t\t\t\t<TYPE>Ledger</TYPE>\n\t\t\t\t\t\t\t\t\t\t<NATIVEMETHOD>Name</NATIVEMETHOD>\n\t\t\t\t\t\t\t\t\t\t<NATIVEMETHOD>OpeningBalance</NATIVEMETHOD>\n\t\t\t\t\t\t\t\t\t\t<NATIVEMETHOD>ClosingBalance</NATIVEMETHOD>\n\t\t\t\t\t\t\t\t\t\t<NATIVEMETHOD>Parent</NATIVEMETHOD>\n\t\t\t\t\t\t\t\t\t</COLLECTION>\n\t\t\t\t\t\t\t\t</TDLMESSAGE>\n\t\t\t\t\t\t\t</TDL>\n\t\t\t\t\t\t</DESC>\n\t\t\t\t\t</BODY>\n\t\t\t</ENVELOPE>';\n\n\t\t/*echo $requestXML;exit;*/\n\n\t\t// call CURL function to get tally response\n\t\t$tallyFinalResponse = $this->objTallyConnector->executeTallyCURL($requestXML, 1);\n\n\t\t// Convert Data into Proper Array Format\n\t\t$tallyAllVouchers = array();\n\t\t$loop_couneter=0;\n\t\t$tallyFinalResponse = $tallyFinalResponse['BODY']['DATA']['COLLECTION']['LEDGER'];\n\n\t\t/*echo '<pre>';\n\t\tprint_r($tallyFinalResponse);\n\t\texit;*/\n\n\t\t// Loop through the data\n\t\t$salesTotal = 0;\n\t\t$salesReturnTotal = 0;\n\t\t$purchaseTotal = 0;\n\t\t$purchaseVatTotal = 0;\n\t\t$salesVatTotal = 0;\n\t\t$disCountOnPurchase = 0;\n\n\t\t$newArr = array();\n\n\t\tforeach($tallyFinalResponse as $data){\n\n\t\t\t$ClosingBalance = isset($data['CLOSINGBALANCE']) ? $data['CLOSINGBALANCE'] : \"0\";\n\t\t\t$OpeningBalance = isset($data['OPENINGBALANCE']) ? $data['OPENINGBALANCE'] : \"0\";\n\n\t\t\tif( !is_array($ClosingBalance) ){\n\t\t\t\t$ClosingBalance = isset($data['CLOSINGBALANCE']) ? (float)$data['CLOSINGBALANCE'] : \"0\";\n\t\t\t}else{\n\t\t\t\t$ClosingBalance = 0;\n\t\t\t}\n\n\t\t\tif( !is_array($OpeningBalance) ){\n\t\t\t\t$OpeningBalance = isset($data['OPENINGBALANCE']) ? (float)$data['OPENINGBALANCE'] : \"0\";\n\t\t\t}else{\n\t\t\t\t$OpeningBalance = 0;\n\t\t\t}\n\n\t\t\t// Actual Balance\n\t\t\t$ClosingBalance = $ClosingBalance - $OpeningBalance;\n\n\t\t\t// For Sales Account\n\t\t\tif( $data['PARENT'] == \"Sales Accounts\" && $ClosingBalance>0 ){\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t\t= \tisset($data['@attributes']['NAME']) ? $data['@attributes']['NAME'] : 'NotFound';\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['PARENT']\t\t\t\t= \tisset($data['PARENT']) ? $data['PARENT'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['OPENINGBALANCE']\t\t=\tisset($data['OPENINGBALANCE']) ? $data['OPENINGBALANCE'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['CLOSINGBALANCE']\t\t=\tisset($data['CLOSINGBALANCE']) ? $data['CLOSINGBALANCE'] : \"\";\n\t\t\t\t$loop_couneter++;\n\t\t\t\t$salesTotal = $salesTotal+$ClosingBalance;\n\t\t\t}\n\n\t\t\t// For Sales Return Account\n\t\t\tif( $data['PARENT'] == \"Sales Accounts\" && $ClosingBalance<0 ){\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t\t= \tisset($data['@attributes']['NAME']) ? $data['@attributes']['NAME'] : 'NotFound';\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['PARENT']\t\t\t\t= \tisset($data['PARENT']) ? $data['PARENT'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['OPENINGBALANCE']\t\t=\tisset($data['OPENINGBALANCE']) ? $data['OPENINGBALANCE'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['CLOSINGBALANCE']\t\t=\tisset($data['CLOSINGBALANCE']) ? $data['CLOSINGBALANCE'] : \"\";\n\t\t\t\t$loop_couneter++;\n\t\t\t\t$salesReturnTotal = $salesReturnTotal+$ClosingBalance;\n\t\t\t}\n\n\t\t\t// For Purchase Account\n\t\t\tif( $data['PARENT'] == \"Purchase Accounts\" && $ClosingBalance<0 ){\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t\t= \tisset($data['@attributes']['NAME']) ? $data['@attributes']['NAME'] : 'NotFound';\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['PARENT']\t\t\t\t= \tisset($data['PARENT']) ? $data['PARENT'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['OPENINGBALANCE']\t\t=\tisset($data['OPENINGBALANCE']) ? $data['OPENINGBALANCE'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['CLOSINGBALANCE']\t\t=\tisset($data['CLOSINGBALANCE']) ? $data['CLOSINGBALANCE'] : \"\";\n\t\t\t\t$loop_couneter++;\n\t\t\t\t$purchaseTotal = $purchaseTotal+$ClosingBalance;\n\t\t\t}\n\n\t\t\t// For Sales VAT Account\n\t\t\tif( ($data['@attributes']['NAME'] == \"Input TS VAT @14.5%\") || ($data['@attributes']['NAME'] == \"Input TS VAT @5%\") ){\n\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t\t= \tisset($data['@attributes']['NAME']) ? $data['@attributes']['NAME'] : 'NotFound';\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['PARENT']\t\t\t\t= \tisset($data['PARENT']) ? $data['PARENT'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['OPENINGBALANCE']\t\t=\tisset($data['OPENINGBALANCE']) ? $data['OPENINGBALANCE'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['CLOSINGBALANCE']\t\t=\tisset($data['CLOSINGBALANCE']) ? $data['CLOSINGBALANCE'] : \"\";\n\t\t\t\t$loop_couneter++;\n\t\t\t\t$purchaseVatTotal = $purchaseVatTotal+$ClosingBalance;\n\t\t\t}\n\n\t\t\t// For Purchase VAT Account\n\t\t\tif( ($data['@attributes']['NAME'] == \"Output TS VAT @14.5%\") || ($data['@attributes']['NAME'] == \"Output TS VAT @5%\") ){\n\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t\t= \tisset($data['@attributes']['NAME']) ? $data['@attributes']['NAME'] : 'NotFound';\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['PARENT']\t\t\t\t= \tisset($data['PARENT']) ? $data['PARENT'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['OPENINGBALANCE']\t\t=\tisset($data['OPENINGBALANCE']) ? $data['OPENINGBALANCE'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['CLOSINGBALANCE']\t\t=\tisset($data['CLOSINGBALANCE']) ? $data['CLOSINGBALANCE'] : \"\";\n\t\t\t\t$loop_couneter++;\n\t\t\t\t$salesVatTotal = $salesVatTotal+$ClosingBalance;\n\t\t\t}\n\n\t\t\t// For Discount on Purchase\n\t\t\tif( ($data['PARENT'] == \"Indirect Incomes\") || ($data['@attributes']['NAME'] == \"Discount Receivables\") ){\n\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['Type']\t\t\t\t= \tisset($data['@attributes']['NAME']) ? $data['@attributes']['NAME'] : 'NotFound';\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['PARENT']\t\t\t\t= \tisset($data['PARENT']) ? $data['PARENT'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['OPENINGBALANCE']\t\t=\tisset($data['OPENINGBALANCE']) ? $data['OPENINGBALANCE'] : \"\";\n\t\t\t\t$tallyAllVouchers[$loop_couneter]['CLOSINGBALANCE']\t\t=\tisset($data['CLOSINGBALANCE']) ? $data['CLOSINGBALANCE'] : \"\";\n\t\t\t\t$loop_couneter++;\n\t\t\t\t$disCountOnPurchase = $disCountOnPurchase+$ClosingBalance;\n\t\t\t}\n\n\t\t\t//$newArr[]= $data['PARENT'] . '======' . $data['@attributes']['NAME'];\n\t\t}\n\n\t\t// Making the final response\n\t\t$finalResponse = array(\n\t\t\t'message'\t\t\t\t\t=> 'Ledger Imported Successfully!',\n\t\t\t'status'\t\t\t\t\t=> 'Success',\n\t\t\t'code'\t\t\t\t\t\t=> '200',\n\t\t\t'data'\t\t\t\t\t\t=> $tallyAllVouchers,\n\t\t\t'salesTotal'\t\t\t\t=> $salesTotal,\n\t\t\t'salesReturnTotal'\t\t\t=> $salesReturnTotal,\n\t\t\t'purchaseTotal'\t\t\t\t=> $purchaseTotal,\n\t\t\t'purchaseVATTotal'\t\t\t=> $purchaseVatTotal,\n\t\t\t'salesVATTotal'\t\t\t\t=> $salesVatTotal,\n\t\t\t'disCountOnPurchase'\t\t=> $disCountOnPurchase\n\t\t);\n\n\t\t/*print_r($finalResponse);\n\t\texit;*/\n\n\t\t// call the method to add logg in MongoDB\n\t\t//$requestIPAddress = request()->ip();\n\t\t//$this->objTallyLogger->addTallyTransactionLog($requestIPAddress, $finalResponse, \"\",'Fetch','LEDGER_MASTER_WITH_BALANCE');\n\n\t\treturn $finalResponse;\n\t}", "function addArticleAttribut($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedAttributIdOnMarketplace_'.rand(1000, 9999); \n}", "public function store(Request $request)\n {\n $validator = Validator::make(\n $request->all(),\n [\n 'business_location_id' => 'required',\n 'supplier_id' => 'required',\n ]\n );\n\n if ($validator->fails()) {\n return response()->json(['success' => false, 'error' => $validator->errors()], 422);\n }\n DB::beginTransaction();\n try {\n $sale = new Sale();\n\n $business_location = BusinessLocation::findOrFail($request->business_location_id);\n // dd($business_location);\n $sale->business_location_id = $business_location->id;\n\n $sale->ref_no = $request->ref_no;\n $sale->contact_id = $request->supplier_id;\n $sale->sale_status = $request->sale_status;\n $sale->sale_date = date(\"Y-m-d\", strtotime($request->sale_date));\n\n $sale->sale_discount = $request->sale_discount;\n $sale->sale_tax = $request->sale_tax;\n\n $sale->shipping_cost = $request->shipping_cost;\n\n $sale->created_by = auth()->user()->id;\n $sale->updated_by = auth()->user()->id;\n\n $sale->save();\n\n $item_sale_quantity = 0;\n $item_subtotal_price = 0;\n foreach ($request->store_items as $store_items) {\n $sale_item = SaleItem::saveSaleItems($sale->id, $store_items);\n $item_sale_quantity += $sale_item->sale_quantity;\n $item_subtotal_price += $sale_item->total_price;\n }\n\n $sale->total_sale_quantity = $item_sale_quantity;\n $sale->subtotal_cost = $item_subtotal_price;\n\n $discountInPercentage = ($sale->sale_discount / 100);\n $afterDiscount = $sale->subtotal_cost - ($sale->subtotal_cost * $discountInPercentage);\n\n $taxInPercentage = ($sale->sale_tax / 100);\n $afterTax = $sale->subtotal_cost + ($sale->subtotal_cost * $taxInPercentage);\n\n $sale->total_cost = $sale->subtotal_cost - $afterDiscount + $afterTax;\n\n $sale->save();\n } catch (\\Exception $e) {\n DB::rollback();\n return response()->json(['success' => false, 'errmsg' => $e->getMessage()], 500);\n }\n DB::commit();\n\n return response(new SaleResource($sale), Response::HTTP_CREATED);\n }", "public function sendMarketing()\n {\n }", "public function salesFinalValidationAction()\n\t{\n\t\t$prod_parameters=$this->_request->getParams();\n\n\t\t$quote_id=$prod_parameters['quote_id'];\n\n\t\t$quote_obj=new Ep_Quote_Quotes();\t\t\n\n\t\tif($quote_id)\n\t\t{\n\t\t\t//prod details to view in a tab\n\t\t\t$this->_view->prod_view_details=$this->prodViewDetails($quote_id);\n\n\n\t\t\t$quoteDetails=$quote_obj->getQuoteDetails($quote_id);\n\t\t\tif($quoteDetails)\n\t\t\t{\n\t\t\t\t$q=0;\n\t\t\t\tforeach($quoteDetails as $quote)\n\t\t\t\t{\n\t\t\t\t\t$quoteDetails[$q]['category_name']=trim($this->getCategoryName($quote['category']));\n\t\t\t\t\t$quoteDetails[$q]['websites']=explode(\"|\",$quote['websites']);\n\t\t\t\t\t\n\t\t\t\t\tif($quote['documents_path'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$related_files='';\n\t\t\t\t\t\t$documents_path=explode(\"|\",$quote['documents_path']);\n\t\t\t\t\t\t$documents_name=explode(\"|\",$quote['documents_name']);\n\n\t\t\t\t\t\tforeach($documents_path as $k=>$file)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($documents_name[$k])\n\t\t\t\t\t\t\t\t$file_name=$documents_name[$k];\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$file_name=basename($file);\n\n\t\t\t\t\t\t\t$related_files.='<a href=\"/quote/download-document?type=quote&index='.$k.'&quote_id='.$quote_id.'\">'.$file_name.'</a><br>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$quoteDetails[$q]['related_files']=trim($related_files);\n\n\t\t\t\t\t$quoteDetails[$q]['sales_suggested_price_format']=number_format($quote['sales_suggested_price'], 2, ',', ' ');\n\t\t\t\t\t$quoteDetails[$q]['comment_time']=time_ago($quote['created_at']);\n\t\t\t\t\t\n\t\t\t\t\t//attached File in sales final\n\t\t\t\t\t\tif($quote['sales_final_documents_path']!=\"\" && $quote['sales_final_documents_names']!=\"\"){\n\t\t\t\t\t\t$quote_file=explode('|',$quote['sales_final_documents_path']);\n\t\t\t\t\t\t$quoteDetails[$q]['sales_file']=$this->getSaleFiles($quote['sales_final_documents_path'],$quote_id);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//get client contact details\n\t\t\t\t\t$contact_obj=new Ep_Quote_ClientContacts();\n\t\t\t\t\t$contactDetails=$contact_obj->getClientMainContacts($quote['client_id']);\n\t\t\t\t\tif($contactDetails!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['client_contact_name']=$contactDetails[0]['first_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['client_contact_email']=$contactDetails[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['client_contact_phone']=$contactDetails[0]['office_phone'];\n\t\t\t\t\t\t$quoteDetails[$q]['job_title']=$contactDetails[0]['job_title'];\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//bo user details\n\t\t\t\t\t$quote_by=$quote['quote_by'];\n\t\t\t\t\t$client_obj=new Ep_Quote_Client();\n\t\t\t\t\t$bo_user_details=$client_obj->getQuoteUserDetails($quote_by);\n\t\t\t\t\tif($bo_user_details!='NO')\n\t\t\t\t\t{\n\t\t\t\t\t\t$quoteDetails[$q]['quote_user_name']=$bo_user_details[0]['first_name'].' '.$bo_user_details[0]['last_name'];\n\t\t\t\t\t\t$quoteDetails[$q]['email']=$bo_user_details[0]['email'];\n\t\t\t\t\t\t$quoteDetails[$q]['phone_number']=$bo_user_details[0]['phone_number'];\n\t\t\t\t\t}\t\n\n\t\t\t\t\t//getting mission details\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['include_final']='yes';\n\n\t\t\t\t\t$quoteMission_obj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t$missonDetails=$quoteMission_obj->getMissionDetails($searchParameters);\n\t\t\t\t\t\n\t\t\t\t\t$total_unitprice=0;\n\t\t\t\t\t$total_turnover=0;\n\t\t\t\t\t$total_internalcost=0;\n\t\t\t\t\tif($missonDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$m=0;\n\t\t\t\t\t\t$mission_length_array=array();\n\t\t\t\t\t\t$prior_length_array=array();\n\t\t\t\t\t\tforeach($missonDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$missonDetails[$m]['product_name']=$this->seo_product_array[$mission['product']];\t\t\t\n\t\t\t\t\t\t\t$missonDetails[$m]['language_source_name']=$this->getLanguageName($mission['language_source']);\n\t\t\t\t\t\t\t$missonDetails[$m]['product_type_name']=$this->producttype_array[$mission['product_type']];\n\t\t\t\t\t\t\tif($mission['language_dest'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['language_dest_name']=$this->getLanguageName($mission['language_dest']);\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$missonDetails[$m]['comment_time']=time_ago($mission['created_at']);\n\n\t\t\t\t\t\t\tif($mission['product']=='seo_audit' || $mission['product']=='smo_audit' )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif($mission['internal_cost']>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost']=$mission['internal_cost'];\n\t\t\t\t\t\t\t\t\t$audit=$mission['product']=='seo_audit' ?'SEO':'SMO';\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internalcost_details']=\"$audit Audit : \".zero_cut($mission['cost'],2).\" &\".$quote['sales_suggested_currency'].\";<br>\";\n\t\t\t\t\t\t\t\t\t$total_internalcost+=$mission['internal_cost'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost']=$mission['cost'];\n\t\t\t\t\t\t\t\t\t$audit=$mission['product']=='seo_audit' ?'SEO':'SMO';\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internalcost_details']=\"$audit Audit : \".zero_cut($mission['cost'],2).\" &\".$quote['sales_suggested_currency'].\";<br>\";\n\t\t\t\t\t\t\t\t\t$total_internalcost+=$mission['cost'];\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t$missonDetails[$m]['required_writes']=1;\n\n\t\t\t\t\t\t\t\t//if mission is prior to prod\n\t\t\t\t\t\t\t\tif($mission['before_prod']=='yes')\n\t\t\t\t\t\t\t\t\t$prior_length_array[]=$mission['mission_length'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t//get Internal cost of a mission\n\t\t\t\t\t\t\t\t$prodMissionObj=new Ep_Quote_ProdMissions();\n\t\t\t\t\t\t\t\t$prodMissionDetails=$prodMissionObj->getProdCostDetails($mission['identifier']);\n\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);\n\t\t\t\t\t\t\t\tif($prodMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$internalcost=0;\n\t\t\t\t\t\t\t\t\t$internalcost_details='';\n\t\t\t\t\t\t\t\t\t$staff_time=array();\n\t\t\t\t\t\t\t\t\t$prod_delivery_time=array();\n\t\t\t\t\t\t\t\t\t//$required_writes=1;\n\n\t\t\t\t\t\t\t\t\tforeach($prodMissionDetails as $prodMission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$internalcost=$internalcost+$prodMission['cost'];\n\t\t\t\t\t\t\t\t\t\t$internalcost_details.=$this->seo_product_array[$prodMission['product']]. \" : \".zero_cut($prodMission['cost'],2).\" &\".$prodMission['currency'].\";<br>\";\n\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//adding proof reading time too for mission total time\n\n\t\t\t\t\t\t\t\t\t\tif($prodMission['product']!='proofreading')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif($prodMission['staff_time_option']=='hours')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$staff_mission_stetup=($prodMission['staff_time']/24);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$staff_mission_stetup=($prodMission['staff_time']);\n\n\t\t\t\t\t\t\t\t\t\t\tif($prodMission['delivery_option']=='hours')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$prod_delivery_stetup=($prodMission['delivery_time']/24);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$prod_delivery_stetup=($prodMission['delivery_time']);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif($prodMission['product']=='proofreading')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tif($prodMission['staff_time_option']=='hours')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$staff_mission_stetup+=($prodMission['staff_time']/24);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$staff_mission_stetup+=($prodMission['staff_time']);\n\n\t\t\t\t\t\t\t\t\t\t\tif($prodMission['delivery_option']=='hours')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$prod_delivery_stetup+=($prodMission['delivery_time']/24);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t$prod_delivery_stetup+=($prodMission['delivery_time']);\n\t\t\t\t\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\n\n\t\t\t\t\t\t\t\t\t\t$staff_time[]=$staff_mission_stetup;\n\t\t\t\t\t\t\t\t\t\t$prod_delivery_time[]=$prod_delivery_stetup;\n\n\t\t\t\t\t\t\t\t\t\t//getting required writers\t\n\t\t\t\t\t\t\t\t\t\tif($prodMission['product']=='redaction' || $prodMission['product']=='translation' || (!$required_writes && $prodMission['product']=='autre' ))\n\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$required_writes=$prodMission['staff'];\n\t\t\t\t\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}\n\t\t\t\t\t\t\t\t\t//required Writres\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['required_writes']=$required_writes;\n\n\t\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($prodMissionDetails);\t\t\n\t\t\t\t\t\t\t\t\t/*if($mission['internal_cost']>0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost']=$mission['internal_cost'];\n\t\t\t\t\t\t\t\t\t\t$total_internalcost+=$mission['internal_cost'];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t{*/\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost']=$internalcost;\n\t\t\t\t\t\t\t\t\t\t$total_internalcost+=$internalcost;\n\t\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internalcost_details']=$internalcost_details;\n\n\n\t\t\t\t\t\t\t\t\t//Adding prod staff setup time to mission length\n\t\t\t\t\t\t\t\t\t$prod_team_setup=max($staff_time)+max($prod_delivery_time);\n\n\t\t\t\t\t\t\t\t\t/*removed w.r.t tempo*/\n\t\t\t\t\t\t\t\t\t//$missonDetails[$m]['mission_length']=round($prod_team_setup);\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\telse if($mission['internal_cost']>0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//$missonDetails[$m]['internal_cost']=$mission['internal_cost'];\n\t\t\t\t\t\t\t\t\t//$missonDetails[$m]['internalcost_details'].=\"Internal cost : \".zero_cut($mission['internal_cost'],2).\" &\".$quote['sales_suggested_currency'].\";<br>\";\n\t\t\t\t\t\t\t\t\t$archmission_obj=new Ep_Quote_Mission();\n\t\t\t\t\t\t\t\t\t$archParameters['mission_id']=$mission['sales_suggested_missions'];\n\t\t\t\t\t\t\t\t\t$suggested_mission_details=$archmission_obj->getMissionDetails($archParameters);\n\t\t\t\t\t\t\t\t\tif($suggested_mission_details)\n\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\n\t\t\t\t\t\t\t\t\t\t$nb_words=($mission['nb_words']/$suggested_mission_details[0]['article_length']);\n\t\t\t\t\t\t\t\t\t\t$redactionCost=$nb_words*($suggested_mission_details[0]['writing_cost_before_signature']);\n\t\t\t\t\t\t\t\t\t\t$correctionCost=$nb_words*($suggested_mission_details[0]['correction_cost_before_signature']);\n\t\t\t\t\t\t\t\t\t\t$otherCost=$nb_words*($suggested_mission_details[0]['other_cost_before_signature']);\n\n\t\t\t\t\t\t\t\t\t\t$internalcost=($redactionCost+$correctionCost+$otherCost);\n\t\t\t\t\t\t\t\t\t\t$internalcost=number_format($internalcost,2,'.','');\n\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost']=$internalcost;\n\t\t\t\t\t\t\t\t\t $missonDetails[$m]['internalcost_details'].=$this->seo_product_array['redaction']. \" : \".zero_cut($redactionCost,2).\" &\".$quote['sales_suggested_currency'].\";<br>\";\n\t\t\t\t\t\t\t\t\t $missonDetails[$m]['internalcost_details'].=$this->seo_product_array['translation']. \" : \".zero_cut($correctionCost,2).\" &\".$quote['sales_suggested_currency'].\";<br>\";\n\t\t\t\t\t\t\t\t\t if($otherCost)\n\t\t\t\t\t\t\t\t\t \t$missonDetails[$m]['internalcost_details'].=$this->seo_product_array['autre']. \" : \".zero_cut($otherCost,2).\" &\".$quote['sales_suggested_currency'].\";<br>\";\n\n\n\t\t\t\t\t\t\t\t\t //pre-fill staff calculations\n\n\t\t\t\t\t\t\t\t\t\t//total mission words\n\t\t\t\t\t\t\t\t\t\t$mission_volume=$mission['volume'];\n\t\t\t\t\t\t\t\t\t\t$mission_nb_words=$mission['nb_words'];\n\t\t\t\t\t\t\t\t\t\t$total_mission_words=($mission_volume*$mission_nb_words);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//words that can write per writer with in delivery weeks\n\t\t\t\t\t\t\t\t\t\t$sales_delivery_time=$quote['sales_delivery_time_option']=='hours' ? ($quote['sales_delivery_time']/24) : $quote['sales_delivery_time'];\n\t\t\t\t\t\t\t\t\t\t$sales_delivery_week=ceil($sales_delivery_time/7);\n\n\t\t\t\t\t\t\t\t\t\t$mission_product=$mission['product_type'];\n\t\t\t\t\t\t\t\t\t\tif($mission['product_type']=='autre')\n\t\t\t\t\t\t\t\t\t\t\t\t$mission_product='article_seo';\n\t\t\t\t\t\t\t\t\t\t$articles_perweek=$this->configval['max_writer_'.$mission_product];\n\t\t\t\t\t\t\t\t\t\t$words_perweek_peruser=$articles_perweek*250;\n\t\t\t\t\t\t\t\t\t\t$words_peruser_perdelivery=$sales_delivery_week*$words_perweek_peruser;\n\n\t\t\t\t\t\t\t\t\t\t//wrting and proofreading staff calculations\n\t\t\t\t\t\t\t\t\t\t$writing_staff=round($total_mission_words/$words_peruser_perdelivery);\n\t\t\t\t\t\t\t\t\t\tif(!$writing_staff || $writing_staff <1)\n\t\t\t\t\t\t\t\t\t\t\t$writing_staff=1;\t\n\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['required_writes']=$writing_staff;\n\n\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}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost']=0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//array of mission lengths\n\t\t\t\t\t\t\t\t$mission_length_array[]=$missonDetails[$m]['mission_length'];//$mission['mission_length'];\n\t\t\t\t\t\t\t}\t\n\n\n\t\t\t\t\t\t\t$missonDetails[$m]['unit_price']=number_format(($missonDetails[$m]['internal_cost']/(1-($mission['margin_percentage']/100))),2, '.', '');\n\t\t\t\t\t\t\t//echo $missonDetails[$m]['unit_price'].\"--\".$missonDetails[$m]['internal_cost'].\"--\".$mission['margin_percentage'].\"<br>\";\n\t\t\t\t\t\t\t$missonDetails[$m]['turnover']=$missonDetails[$m]['unit_price']*$mission['volume'];\n\n\t\t\t\t\t\t\t//total turnover and total unit price\n\t\t\t\t\t\t\tif($missonDetails[$m]['turnover'])\t\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$total_unitprice+=$missonDetails[$m]['unit_price'];\n\t\t\t\t\t\t\t\t$total_turnover+=$missonDetails[$m]['turnover'];\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t//if mission is prior to prod\n\t\t\t\t\t\t\tif($mission['before_prod']=='yes')\n\t\t\t\t\t\t\t\t$prior_length_array[]=$mission['mission_length'];\n\n\n\t\t\t\t\t\t\t//versioning\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t\t\t$quoteMissionObj=new Ep_Quote_QuoteMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier'],$previousVersion);\n\t\t\t\t\t\t\t\t//echo \"<pre>\";print_r($previousMissionDetails);exit;\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tforeach($previousMissionDetails as $key=>$vmission)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_name']=$this->seo_product_array[$vmission['product']];\t\t\t\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_source_name']=$this->getLanguageName($vmission['language_source']);\n\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['product_type_name']=$this->producttype_array[$vmission['product_type']];\n\t\t\t\t\t\t\t\t\t\tif($vmission['language_dest'])\n\t\t\t\t\t\t\t\t\t\t\t$previousMissionDetails[$key]['language_dest_name']=$this->getLanguageName($vmission['language_dest']);\n\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$quoteMissionObj->getMissionVersionDetails($mission['identifier']);\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\n\t\t\t\t\t\t\t\t\t\t$language_versions=$product_type_versions=$volume_versions=$nb_words_versions='';\n\t\t\t\t\t\t\t\t\t\t$margin_versions=$internal_cost_versions=$turnover_versions=$price_versions=$mission_length_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \tif($versions['product']=='translation')\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']).\" > \".$this->getLanguageName($vmission['language_dest']);\n\t\t\t\t\t\t\t\t\t\t \telse\n\t\t\t\t\t\t\t\t\t\t \t\t$language= $this->getLanguageName($versions['language_source']);\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\n\t\t\t\t\t\t\t\t\t\t \t$language_versions.=\"<tr><td>$language</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$product_type_versions.=\"<tr><td>\".$this->producttype_array[$versions['product_type']].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$volume_versions.=\"<tr><td>\".$versions['volume'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$nb_words_versions.=\"<tr><td>\".$versions['nb_words'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['unit_price'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$this->duration_array[$versions['mission_length_option']];//$versions['mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$turnover_versions.=\"<tr><td>\".zero_cut($versions['turnover'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$internal_cost_versions.=\"<tr><td>\".zero_cut($versions['internal_cost'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$margin_versions.=\"<tr><td>\".$versions['margin_percentage'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\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}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['language_source'] !=$previousMissionDetails[0]['language_source'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['language_dest'] !=$previousMissionDetails[0]['language_dest'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['language_versions']=$table_start.$language_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['product_type'] !=$previousMissionDetails[0]['product_type'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['product_type_versions']=$table_start.$product_type_versions.$table_end;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($missonDetails[$m]['turnover'] !=$previousMissionDetails[0]['turnover'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['turnover_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['turnover_versions']=$table_start.$turnover_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\t$current_internal_cost=number_format($missonDetails[$m]['internal_cost'],2);\n\t\t\t\t\t\t\t\t\t$prev_internal_cost=number_format($previousMissionDetails[0]['internal_cost'],2);\n\n\t\t\t\t\t\t\t\t\tif($current_internal_cost != $prev_internal_cost)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//echo $current_internal_cost.\"---\".$prev_internal_cost.\"<br>\";\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['internal_cost_versions']=$table_start.$internal_cost_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t\t\tif($mission['margin_percentage'] !=$previousMissionDetails[0]['margin_percentage'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['margin_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['margin_versions']=$table_start.$margin_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($mission['volume'] !=$previousMissionDetails[0]['volume'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['volume_versions']=$table_start.$volume_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif($mission['nb_words'] !=$previousMissionDetails[0]['nb_words'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['nb_words_versions']=$table_start.$nb_words_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//echo $missonDetails[$m]['unit_price'].\"--\".$previousMissionDetails[0]['unit_price'].\"<br>\";\n\t\t\t\t\t\t\t\t\tif($missonDetails[$m]['unit_price'] !=$previousMissionDetails[0]['unit_price'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['unit_price_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['mission_length_option']=='hours' ? ($missonDetails[$m]['mission_length']/24) : $missonDetails[$m]['mission_length'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['mission_length_option']=='hours' ? ($previousMissionDetails[0]['mission_length']/24) : $previousMissionDetails[0]['mission_length'];\n\t\t\t\t\t\t\t\t\t//echo $current_mission_lenght.\"--\".$previous_mission_lenght.\"<br>\";\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$missonDetails[$m]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$missonDetails[$m]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//calculating team price\n\t\t\t\t\t\t\tif(!$missonDetails[$m]['team_fee'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$teamPrice=0;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$teamPrice=350;//(ceil($missonDetails[$m]['required_writes']/3))*350;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$missonDetails[$m]['team_fee']=$teamPrice;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!$missonDetails[$m]['team_packs'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$missonDetails[$m]['team_packs']=(ceil($missonDetails[$m]['required_writes']/3));\t\n\t\t\t\t\t\t\t\t$missonDetails[$m]['team_packs']=$missonDetails[$m]['required_writes'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//calculate user turnover for user package\n\t\t\t\t\t\t\tif(!$missonDetails[$m]['user_fee'])\n\t\t\t\t\t\t\t\t$missonDetails[$m]['user_fee']=350;\n\n\t\t\t\t\t\t\t$missonDetails[$m]['user_package_turnover']=(($missonDetails[$m]['required_writes']*$missonDetails[$m]['user_fee']));\n\t\t\t\t\t\t\t//$missonDetails[$m]['team_package_turnover']=(($missonDetails[$m]['turnover']+$missonDetails[$m]['team_fee']));\n\t\t\t\t\t\t\t$missonDetails[$m]['team_package_turnover']=($missonDetails[$m]['turnover']+($missonDetails[$m]['team_fee']*$missonDetails[$m]['team_packs']));\n\n\t\t\t\t\t\t\tif($missonDetails[$m]['package']=='team')\n\t\t\t\t\t\t\t\t$total_turnover+=($missonDetails[$m]['team_package_turnover']-$missonDetails[$m]['turnover']);\n\t\t\t\t\t\t\telseif($missonDetails[$m]['package']=='user')\n\t\t\t\t\t\t\t\t$total_turnover+=$missonDetails[$m]['user_package_turnover'];\n\t\t\t\t\t\t\t//echo $total_turnover;exit;\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$missonDetails[$m]['tempo_length_option_text']=$this->duration_array[$mission['tempo_length_option']];\n\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t//echo \"<pre>\";print_r($missonDetails);exit;\n\t\t\t\t\t\t$quoteDetails[$q]['mission_details']=$missonDetails;\n\t\t\t\t\t}\n\t\t\t\t\t/***************getting Tech mission details******************/\n\t\t\t\t\t$tech_obj=new Ep_Quote_TechMissions();\n\t\t\t\t\t$searchParameters['quote_id']=$quote_id;\n\t\t\t\t\t$searchParameters['include_final']='yes';\n\t\t\t\t\t$techMissionDetails=$tech_obj->getTechMissionDetails($searchParameters);\n\t\t\t\t\tif($techMissionDetails)\n\t\t\t\t\t{\n\t\t\t\t\t\t$t=0;\n\t\t\t\t\t\t$mission=array();\n\t\t\t\t\t\tforeach($techMissionDetails as $mission)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$techMissionDetails[$t]['internal_cost']=$mission['cost'];\n\t\t\t\t\t\t\t$techMissionDetails[$t]['unit_price']=number_format(($techMissionDetails[$t]['internal_cost']/(1-($mission['margin_percentage']/100))),2, '.', '');\n\t\t\t\t\t\t $techMissionDetails[$t]['turnover']=$techMissionDetails[$t]['unit_price']*$mission['volume'];\n\n\t\t\t\t\t\t $total_internalcost+=$mission['cost'];\n\t\t\t\t\t\t $total_unitprice+=$techMissionDetails[$t]['unit_price'];\n\t\t\t\t\t\t\t$total_turnover+=$techMissionDetails[$t]['turnover'];\n\n\n\t\t\t\t\t\t\t$mission_length_array[]=$mission['delivery_time'];\n\n\t\t\t\t\t\t\t//if mission is prior to prod\n\t\t\t\t\t\t\tif($mission['before_prod']=='yes')\n\t\t\t\t\t\t\t\t$prior_length_array[]=$mission['delivery_time'];\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t//calculating team price\n\t\t\t\t\t\t\t$techMissionDetails[$t]['required_writes']=1;\n\t\t\t\t\t\t\tif(!$techMissionDetails[$t]['team_fee'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$teamPrice=0;\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$teamPrice=350;//(ceil($techMissionDetails[$t]['required_writes']/3))*350;\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['team_fee']=$teamPrice;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!$techMissionDetails[$t]['team_packs'])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//$techMissionDetails[$t]['team_packs']=(ceil($techMissionDetails[$t]['required_writes']/3));\t\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['team_packs']=$techMissionDetails[$t]['required_writes'];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//calculate user turnover for user package\n\t\t\t\t\t\t\tif(!$techMissionDetails[$t]['user_fee'])\n\t\t\t\t\t\t\t\t$techMissionDetails[$t]['user_fee']=350;\n\n\t\t\t\t\t\t\t$techMissionDetails[$t]['user_package_turnover']=(($techMissionDetails[$t]['required_writes']*$techMissionDetails[$t]['user_fee']));\n\t\t\t\t\t\t\t//$techMissionDetails[$t]['team_package_turnover']=(($techMissionDetails[$t]['turnover']+$techMissionDetails[$t]['team_fee']));\n\t\t\t\t\t\t\t$techMissionDetails[$t]['team_package_turnover']=($techMissionDetails[$t]['turnover']+($techMissionDetails[$t]['team_fee']*$techMissionDetails[$t]['team_packs']));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//mission versionings if version is gt 1\n\t\t\t\t\t\t\tif($quoteDetails[0]['version']>1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$previousVersion=($quoteDetails[0]['version']-1);\n\n\t\t\t\t\t\t\t\t$techMissionObj=new Ep_Quote_TechMissions();\n\t\t\t\t\t\t\t\t$previousMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier'],$previousVersion);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($previousMissionDetails)\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//Get All version details of a mission\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$allVersionMissionDetails=$techMissionObj->getMissionVersionDetails($mission['identifier'],$quoteDetails[0]['identifier']);\n\t\t\t\t\t\t\t\t\tif($allVersionMissionDetails)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$price_versions=$mission_length_versions='';\n\t\t\t\t\t\t\t\t\t\t$title_versions='';\n\n\t\t\t\t\t\t\t\t\t\tforeach($allVersionMissionDetails as $versions)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\n\t\t\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\n\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t \t$title_versions.=\"<tr><td>\".$versions['title'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$price_versions.=\"<tr><td>\".zero_cut($versions['cost'],2).\" &\". $versions['currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['delivery_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t\t\t \t$mission_length_versions.=\"<tr><td>\".$versions['delivery_time'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\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}\n\n\n\t\t\t\t\t\t\t\t\t//checking the version differences\n\t\t\t\t\t\t\t\t\tif($mission['title'] !=$previousMissionDetails[0]['title'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$techMissionDetails[$t]['title_versions']=$table_start.$title_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\tif($mission['cost'] !=$previousMissionDetails[0]['cost'])\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$techMissionDetails[$t]['cost_difference']='yes';\n\t\t\t\t\t\t\t\t\t\t$techMissionDetails[$t]['price_versions']=$table_start.$price_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$current_mission_lenght=$mission['delivery_option']=='hours' ? ($mission['delivery_time']/24) : $mission['delivery_time'];\n\t\t\t\t\t\t\t\t\t$previous_mission_lenght=$previousMissionDetails[0]['delivery_option']=='hours' ? ($previousMissionDetails[0]['delivery_time']/24) : $previousMissionDetails[0]['delivery_time'];\n\t\t\t\t\t\t\t\t\tif($current_mission_lenght !=$previous_mission_lenght)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t\t$techMissionDetails[$t]['mission_length_versions']=$table_start.$mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t\t}\n\n\n\n\t\t\t\t\t\t\t\t\t$techMissionDetails[$t]['previousMissionDetails']=$previousMissionDetails;\n\t\t\t\t\t\t\t\t}\t\n\n\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\n\t\t\t\t\t\t$quoteDetails[$q]['tech_mission_details']=$techMissionDetails;\n\t\t\t\t\t}\n\n\t\t\t\t\t//echo \"<pre>\";print_r($techMissionDetails);exit;\n\n\n\t\t\t\t\t//total cost details\n\t\t\t\t\t$quoteDetails[$q]['total_internalcost']=$total_internalcost;\n\t\t\t\t\t$quoteDetails[$q]['total_unitprice']=$total_unitprice;\n\t\t\t\t\t$quoteDetails[$q]['total_turnover']=$total_turnover;\n\t\t\t\t\t$quoteDetails[$q]['over_all_margin']=number_format(((100-($quoteDetails[$q]['total_internalcost']/$quoteDetails[$q]['total_unitprice'])*100)),2);\n\n\t\t\t\t\t//commented w.r.t Tempo\n\t\t\t\t\t/*if(!$quoteDetails[$q]['final_mission_length'])\n\t\t\t\t\t{\n\t\t\t\t\t\tif(count($prior_length_array)>0)\n\t\t\t\t\t\t\t$quoteDetails[$q]['total_mission_length']=max($mission_length_array)+max($prior_length_array);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$quoteDetails[$q]['total_mission_length']=max($mission_length_array);\n\t\t\t\t\t}\n\t\t\t\t\telse*/\n\t\t\t\t\t\tif($quoteDetails[$q]['final_mission_length'])\n\t\t\t\t\t\t\t$quoteDetails[$q]['total_mission_length']=$quoteDetails[$q]['final_mission_length'];\t\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$quoteDetails[$q]['total_mission_length']='';\n\n\t\t\t\t\t//Quote versioning\t\n\t\t\t\t\tif($quote['version']>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\n\t\t\t\t\t\t$quoteObj=new Ep_Quote_Quotes();\n\t\t\t\t\t\t$previousQuoteDetails=$quoteObj->getQuoteVersionDetails($quote['identifier'],$previousVersion);\n\n\t\t\t\t\t\tif($previousQuoteDetails)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//Get All Quote version Details\n\t\t\t\t\t\t\t$allVersionQuoteDetails=$quoteObj->getQuoteVersionDetails($quote['identifier']);\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($allVersionQuoteDetails)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$table_start='<table class=\"table quote-history table-striped\">';\n\t\t\t\t\t\t\t\t$table_end='</table>';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$final_margin_versions=$final_turnover_versions=$final_mission_length_versions='';\n\n\t\t\t\t\t\t\t\tforeach($allVersionQuoteDetails as $versions)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$created_at=date(\"d/m/Y\", strtotime($versions['created_at']));\n\n\t\t\t\t\t\t\t\t \t$version_text='v'.$versions['version'];\t\t\t\t\t\t\t\t \t\n\n\t\t\t\t\t\t\t\t \t$mission_length_option=$versions['final_mission_length_option']=='days' ? ' Jours' : ' Hours';\n\n\t\t\t\t\t\t\t\t \t$final_mission_length_versions.=\"<tr><td>\".$versions['final_mission_length'].\" $mission_length_option</td><td>$created_at</td><td>$version_text</td></tr>\";\n\n\t\t\t\t\t\t\t\t \t$final_turnover_versions.=\"<tr><td>\".zero_cut($versions['final_turnover'],2).\" &\". $versions['sales_suggested_currency'].\";</td><td>$created_at</td><td>$version_text</td></tr>\";\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t \t$final_margin_versions.=\"<tr><td>\".$versions['final_margin'].\"</td><td>$created_at</td><td>$version_text</td></tr>\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t//echo $quoteDetails[0]['total_turnover'].\"--\".$previousQuoteDetails[0]['final_turnover'];\n\t\t\t\t\t\t\t\tif($quoteDetails[0]['total_turnover'] !=$previousQuoteDetails[0]['final_turnover'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$quoteDetails[$q]['final_turnover_difference']='yes';\n\t\t\t\t\t\t\t\t\t$quoteDetails[$q]['final_turnover_versions']=$table_start.$final_turnover_versions.$table_end;\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\tif($quoteDetails[0]['over_all_margin'] !=$previousQuoteDetails[0]['final_margin'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$quoteDetails[$q]['final_margin_difference']='yes';\n\t\t\t\t\t\t\t\t\t$quoteDetails[$q]['final_margin_versions']=$table_start.$final_margin_versions.$table_end;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$current_quote_lenght=$quote['final_mission_length_option']=='hours' ? ($quoteDetails[$q]['total_mission_length']/24) : $quoteDetails[$q]['total_mission_length'];\n\t\t\t\t\t\t\t\t$previous_quote_lenght=$previousQuoteDetails[0]['final_mission_length_option']=='hours' ? ($previousQuoteDetails[0]['final_mission_length']/24) : $previousQuoteDetails[0]['final_mission_length'];\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($current_quote_lenght !=$previous_quote_lenght)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$quoteDetails[$q]['final_mission_length_difference']='yes';\t\n\t\t\t\t\t\t\t\t\t$quoteDetails[$q]['final_mission_length_versions']=$table_start.$final_mission_length_versions.$table_end;\n\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Deleted mission version details\n\t\t\t\t\t\t\n\t\t\t\t\t\t$previousVersion=($quote['version']-1);\n\t\t\t\t\t\t$deletedMissionVersions=$this->deletedMissionVersions($quote['identifier'],$previousVersion);\n\t\t\t\t\t\tif($deletedMissionVersions)\n\t\t\t\t\t\t\t$quoteDetails[$q]['deletedMissionVersions']=$deletedMissionVersions;\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$q++;\n\t\t\t\t}\n\t\t\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\n\t\t\t\t$this->_view->quoteDetails=$quoteDetails;\n\t\t\t}\n\t\t}\n\t\n\t\t//echo \"<pre>\";print_r($quoteDetails);exit;\n\n\t\tif($prod_parameters['ajax']=='yes' && $_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest')\n\t\t{\n\t\t\t$this->render('popup-sales-final-validation');\n\t\t}\n\t\telse\n\t\t\t$this->render('sales-final-validation');\n\t}", "protected function makePayment(){\n\t \n $receiver = Input::get('number');\n $amounttosend = Input::get('amount');\n $currency = Input::get('currency');\n $destinationProvider = Input::get('target');\n $charges = new PlatformCharges($amounttosend, $currency, $destinationProvider);\n $desc = $charges->getReceiverType($destinationProvider);\n $user = User::find(Auth::user()->id);\n \n $transaction = [\n 'Customer' => [\n 'FirstName' => Auth::user()->name,\n 'Street1' => 'Level 5',\n 'Country' => 'US',\n 'Mobile' => Auth::user()->number,\n 'Email' => Auth::user()->email\n ],\n 'Items' => [\n [\n 'SKU' => mt_rand(),\n 'Description' => 'Hybrid Transfer from EWAY to '.$desc.' user',\n 'Quantity' => 1,\n 'UnitCost' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)),\n 'Tax' => 100, //$1 applied as charge to every transaction irrespective of the amount transfered\n // Total is calculated automatically\n ]\n ],\n 'Options' => [\n [\n 'Value' => $desc,//Receipient's payement system\n ],\n [\n 'Value' => $receiver, //receiver's details to which to make the due transfer\n ],\n [\n 'Value' => 'AUD', // currency used to make the transfer when sending to the receipient\n ],\n [\n 'Value' =>(0.01 * $amounttosend)\n ]\n ],\n 'Payment' => [\n 'TotalAmount' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)) * 100, //$amounttosend,\n 'CurrencyCode' => 'AUD'\n ],\n 'Method' => 'ProcessPayment',\n 'RedirectUrl' => URL::route('dashboard').'/ewayconfirm',\n 'CancelUrl' => URL::route('dashboard').'/ewaycancel',\n 'PartnerID' => EwayController::$_EWAY_CUSTOMER_ID,\n 'TransactionType' => \\Eway\\Rapid\\Enum\\TransactionType::PURCHASE, //normally would be PURCHASE. Modes are MOTO, Recurring\n 'Capture' => true,\n 'LogoUrl' => 'https://izepay.iceteck.com/public/images/logo.png',\n 'HeaderText' => 'Izepay Money Transfer',\n 'Language' => 'EN',\n 'CustomView' => 'BootstrapCerulean', //Bootstrap, BootstrapAmelia, BootstrapCerulean, BootstrapCosmo, BootstrapCyborg, BootstrapFlatly, BootstrapJournal, BootstrapReadable, BootstrapSimplex, BootstrapSlate, BootstrapSpacelab, BootstrapUnited\n 'VerifyCustomerEmail' => true,\n 'Capture' => true,\n 'CustomerReadOnly' => false\n ];\n try{\n $response = $this->client->createTransaction(\\Eway\\Rapid\\Enum\\ApiMethod::RESPONSIVE_SHARED, $transaction);\n //var_dump($response);\n// echo $response->SharedPaymentUrl;\n //sleep(20);\n }catch(Exception $ex){\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', 'Debug Error: '.$ex->getMessage());\n }\n //manage response\n \n if (!$response->getErrors()) {\n // Redirect to the Responsive Shared Page\n header('Location: '.$response->SharedPaymentUrl);\n //die();\n } else {\n foreach ($response->getErrors() as $error) {\n //echo \"Response Error: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n return Redirect::route('dashboard')\n\t\t\t \t ->with('alertError', 'Error! '.\\Eway\\Rapid::getMessage($error));\n }\n }\n\t}", "public function update(Request $request, sale $sale)\n {\n //\n }", "public function refund(Request $request)\n {\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(env('ANET_API_LOGIN_ID'));\n $merchantAuthentication->setTransactionKey(env('ANET_TRANSACTION_KEY'));\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($request->cc_number);\n $creditCard->setExpirationDate($request->input('expiry_year') . \"-\" . $request->input('expiry_month'));\n\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n //create a transaction\n $transactionRequest = new AnetAPI\\TransactionRequestType();\n $transactionRequest->setTransactionType(\"refundTransaction\");\n $transactionRequest->setAmount($request->amount);\n $transactionRequest->setPayment($paymentOne);\n $transactionRequest->setRefTransId($request->transactionReference);\n\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequest);\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(ANetEnvironment::PRODUCTION);\n\n if ($response != null) {\n $tresponse = $response->getTransactionResponse();\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n if ($tresponse != null && $tresponse->getMessages() != null) {\n $message_text = $tresponse->getMessages()[0]->getDescription() . \", Response code: \" . $tresponse->getResponseCode() . \", Refund SUCCESS: \" . $tresponse->getTransId();\n $msg_type = \"successMessage\";\n return redirect()->route('orderList')->with($msg_type, $message_text);\n } else {\n $message_text = \"Transaction Failed\";\n $msg_type = \"errorMessage\";\n if ($tresponse->getErrors() != null) {\n $message_text = $tresponse->getErrors()[0]->getErrorText();\n $msg_type = \"errorMessage\";\n }\n }\n } else {\n if ($tresponse != null && $tresponse->getErrors() != null) {\n $message_text = $tresponse->getErrors()[0]->getErrorText();\n } else {\n $message_text = $response->getMessages()->getMessage()[0]->getText();\n }\n $msg_type = \"errorMessage\";\n }\n } else {\n $message_text = \"No response returned\";\n $msg_type = \"errorMessage\";\n }\n\n return redirect()->route('refundView')->with($msg_type, $message_text);\n }", "public function update(Request $request,Lead $lead)\n {\n $input = $request->all();\n\n $validator = Validator::make($input, [\n 'name' => 'required',\n 'email' => 'required',\n 'mobile_no' => 'required',\n 'phone' => 'required',\n // 'subscription_tier_id' => 'required',\n // 'subscription_fees' => 'required',\n 'leads_status' => 'required',\n // 'lead_owner_id' => 'required',\n 'comments' => 'required',\n // 'organization_id' => 'required',\n ]);\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors());\n }\n\n $lead->name = $input['name'];\n $lead->email = $input['email'];\n $lead->mobile_no = $input['mobile_no'];\n $lead->phone = $input['phone'];\n $lead->leads_status = $input['leads_status'];\n $lead->organization_id = isset($input['organization_id'])?$input['organization_id']:0;\n if($input['leads_status'] == 3){\n $lead->source = $input['source']; \n }\n // $lead->lead_owner_id = $input['lead_owner_id'];\n $lead->comments = $input['comments'];\n\n $addressData = array(\n 'address_line1'=>$input['address_line1'],\n 'address_line2'=>$input['address_line2'],\n 'city'=>$input['city'],\n 'state'=>$input['state'],\n 'country_id'=>$input['country_id'],\n 'postal_code'=>$input['postal_code'],\n );\n\n $address = Address::create($addressData);\n $lead->address_id = $address->id;\n\n // $subscriptionData = array(\n // 'subscription_id'=>$input['subscription_tier_id'],\n // 'subscription_fees'=>$input['subscription_fees'],\n // 'is_active'=>1,\n // );\n // $userSubscription = UserSubscription::create($subscriptionData);\n // $lead->user_subscription_id = $userSubscription->id;\n\n $lead->save();\n\n return $this->sendResponse(new LeadResource($lead), 'Lead updated successfully.');\n }", "function addVako($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedVakoIdOnMarketplace_'.rand(1000, 9999); \n}", "public function convertSaleItemsData();", "public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }", "public function returnSellPost(Request $request)\n { \n $transactionId = $request->get('transaction_id');\n $transaction = Transaction::find($transactionId);\n \n if (!$transaction) {\n return redirect()->back()->withMessage('Transaction was not found.');\n }\n\n $previousTotal = $transaction->total;\n $previosInvoiceTax = $transaction->invoice_tax;\n //$previosProductTax = $transaction->total_tax - $previosInvoiceTax;\n\n $total = 0;\n $updatedCostPrice = 0;\n $total_product_tax = 0;\n $total_return_quantity = 0;\n\n $client = Client::find($transaction->client_id);\n $due = $client->transactions->sum('net_total') - $client->payments->where('type', 'credit')->sum('amount');\n\n foreach ($transaction->sells as $sell) {\n\n $returnQuantity = intval($request->get('quantity_'. $sell->id)) ?: 0;\n $total_return_quantity += $returnQuantity;\n\n //new\n $unitProductTax = $sell->product_tax / $sell->quantity;\n \n if ($returnQuantity === 0) {\n $total = $total + $sell->sub_total;\n $total_product_tax = $total_product_tax + $sell->product_tax;\n continue;\n }\n\n $returnUnitPrice = floatval($request->get('unit_price_'. $sell->id));\n \n $sellId = $request->get('sell_'. $sell->id);\n\n $sell = Sell::find($sellId);\n\n if($returnQuantity > $sell->quantity){\n $warning = \"Return Quantity (\".$returnQuantity.\") Can't be greater than the Selling Quantity (\".$sell->quantity.\")\";\n return redirect()->back()->withWarning($warning);\n }\n\n $updatedSellQuantity = $sell->quantity - $returnQuantity;\n $updatedProductTax = $unitProductTax * $updatedSellQuantity;\n $subTotal = $updatedSellQuantity * $returnUnitPrice;\n\n if($previosInvoiceTax > 1){\n if(settings('invoice_tax_type') == 1){\n $return_tax_amount = (settings('invoice_tax_rate') * ($returnQuantity * $returnUnitPrice)) / 100;\n }else{\n $return_tax_amount = settings('invoice_tax_rate');\n }\n }else{\n $return_tax_amount = 0;\n }\n\n $sell->quantity = $updatedSellQuantity;\n $sell->sub_total = $subTotal;\n $sell->product_tax = $updatedProductTax;\n $sell->save();\n\n //update the cost price to deduct from transaction table\n $updatedCostPrice += $returnQuantity * $sell->unit_cost_price;\n\n $product = $sell->product;\n $currentStock = $product->quantity;\n $product->quantity = $currentStock + $returnQuantity;\n $product->save();\n \n $total += $subTotal;\n $total_product_tax = $total_product_tax + $updatedProductTax;\n\n // Save Return statement\n $return = new ReturnTransaction;\n $return->sells_id = $sell->id;\n $return->client_id = $sell->client_id;\n $return->return_vat = $unitProductTax * $returnQuantity;\n $return->sells_reference_no = $sell->reference_no;\n $return->return_units = $returnQuantity;\n $return->return_amount = ($returnQuantity * $returnUnitPrice) + $return_tax_amount + ($unitProductTax * $returnQuantity);\n $return->returned_by = \\Auth::user()->id;\n $return->save();\n }\n\n //invoice tax\n if($previosInvoiceTax > 1){\n if(settings('invoice_tax_type') == 1){\n $invoice_tax = (settings('invoice_tax_rate') * $total) / 100;\n }else{\n $invoice_tax = settings('invoice_tax_rate');\n }\n }else{\n $invoice_tax = 0;\n }\n //ends\n\n if($total_return_quantity <= 0){\n $quantityerror = \"You Can't return Zero Quantity\";\n return redirect()->back()->withQuantityerror($quantityerror);\n }\n \n //update transaction for this return\n $transaction->total = $total;\n $transaction->invoice_tax = $invoice_tax;\n $transaction->total_tax = $total_product_tax + $invoice_tax;\n $transaction->net_total = $total + $invoice_tax + $transaction->labor_cost + $total_product_tax;\n $transaction->total_cost_price = $transaction->total_cost_price - $updatedCostPrice;\n $transaction->return = true;\n $transaction->save();\n\n $diff = ( $previousTotal + $previosInvoiceTax /*+ $previosProductTax*/) - ($total + $invoice_tax + $total_product_tax);\n\n //if difference is greater than due amount then we need to return some money to the customer\n if ($diff > $due) {\n $payment = new Payment;\n $payment->client_id = $client->id;\n $payment->amount = $due < 0 ? $diff : $diff - $due;\n $payment->method = 'cash';\n $payment->type = \"return\";\n $payment->reference_no = $transaction->reference_no;\n $payment->note = \"Return for \".$transaction->reference_no;\n $payment->save();\n }\n\n return redirect()->route('sell.index');\n }", "public function get_SalesCycle2() {\n\t\tif($this->session->userdata('uid')){\n\t\t\t$owner_id = $this->session->userdata('uid');\n\t\t\t$json = file_get_contents(\"php://input\");\n\t\t\t$obj = json_decode($json);\n\n\t\t\t$opportunity_id = '';\n\t\t\t$dt = date('YmdHis');\n\t\t\t$opportunity_id .= $dt;\n\t\t\t$opportunity_id = uniqid($opportunity_id);\n\t\t\t$data['opportunity_id'] = $opportunity_id;\n\t\t\t$data['opportunity_name'] = $obj->opportunity_name;\n\t\t\t$data['target'] = $obj->target;\n\t\t\t$data['lead_cust_id'] = $obj->lead_cust_id;\n\t\t\t$data['opportunity_contact'] = implode(':',$obj->opportunity_contact);\n\t\t\t$data['product_id'] = $obj->product_list;\n\t\t\t$data['currency_id'] = $obj->currency_list;\n\t\t\t$data['industry_id'] = $obj->industry_list;\n\t\t\t$data['location_id'] = $obj->location_list;\n\t\t\t$data['opp_remarks'] = $obj->opp_remarks;\n\t\t\t$data['sell_type'] = $obj->sell_type;\n\t\t\t$data['manager_id'] = '';\n\t\t\t$isManager = $this->session->userdata('manager');\n\t\t\t$isSales = $this->session->userdata('sales');\n\t\t\tif (($isManager != '-') && ($isSales != '-')) { //he has both manager and sales\n\t\t\t\t$data['manager_id'] = $owner_id;\n\t\t\t} else {\n\t\t\t\t$data['manager_id'] = $this->session->userdata('reporting_to');\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t//$can_create_opp = $this->opp_common->validate_oppo_params($data);\n\t\t\t\t$can_create_opp = $this->opp_common->isValidOppName($data);\n\t\t\t\tif ($can_create_opp == 0) {\n\t\t\t\t\t$returnArray= array(\n\t\t\t\t\t\t'message' => 'An Opportunity with same name already exists.',\n\t\t\t\t\t\t'status'=>false,\n\t\t\t\t\t\t'qualifier'=>false);\n\t\t\t\t\techo json_encode($returnArray);\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\n\t\t\t\t$data1 = $this->opp_common->fetch_SalesCycle_firstStage($data);\n\t\t\t\tif (count($data1) == 0) {\n\t\t\t\t\t$returnArray= array(\n\t\t\t\t\t\t'message' => 'No sales cycle found for the selected combination. Please contact admin.',\n\t\t\t\t\t\t'status'=>false,\n\t\t\t\t\t\t'qualifier'=>false);\n\t\t\t\t\techo json_encode($returnArray);\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\t$data['cycle_id'] = $data1[0]->cycle_id;\n\t\t\t\t$data['stage_id'] = $data1[0]->stage_id;\n\t\t\t\tif ($data['stage_id'] == null) {\n\t\t\t\t\t$returnArray= array(\n\t\t\t\t\t\t'message' => 'Opportunity could not be created as Sales cycle does not have a proper stage. Contact admin.',\n\t\t\t\t\t\t'status'=>false,\n\t\t\t\t\t\t'qualifier'=>false);\n\t\t\t\t\techo json_encode($returnArray);\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\t$salesStageAttributes = $this->opp_common->fetch_stageAttributes($data['cycle_id'], $data['stage_id']);\n\t\t\t\t$allocation_list_exists = false;\n\t\t\t\t$qualifier_exists = false;\n\t\t\t\t$allocation_list = '';\n\t\t\t\tforeach ($salesStageAttributes as $attribute) {\n\t\t\t\t\tif ($attribute->attribute_name == 'allocation_matrix') {\n\t\t\t\t\t\t$allocation_list_exists = true;\n\t\t\t\t\t\t$allocation_list = $attribute->attribute_value;\n\t\t\t\t\t}\n\t\t\t\t\tif ($attribute->attribute_name == 'qualifier') {\n\t\t\t\t\t\t$qualifier_exists = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//if allocation list attribute is enabled for stage -\n\t\t\t\tif ($allocation_list_exists) {\n\t\t\t\t\t$allocation_list_users = explode(':', $allocation_list);\n\t\t\t\t\t//if my name is not in list - return an error saying you can't proceed\n\t\t\t\t\tif (in_array($owner_id, $allocation_list_users) == false) {\n\t\t\t\t\t\t$returnArray= array(\n\t\t\t\t\t\t\t'message' => 'You cannot create this opportunity as we could not find your name in allocation list',\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'qualifier' => false\n\t\t\t\t\t\t);\n\t\t\t\t\t\techo json_encode($returnArray);\n\t\t\t\t\t\treturn ;\n\t\t\t\t\t}\n\t\t\t\t}\n else{\n $returnArray= array(\n\t\t\t\t\t\t\t'message' => 'You cannot create this opportunity as Allocation List is not defined',\n\t\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t\t'qualifier' => false\n\t\t\t\t\t);\n\t\t\t\t\techo json_encode($returnArray);\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tif ($qualifier_exists) {\n\t\t\t\t\t$qualifier_data = $this->opp_common->check_qualifiers($data['stage_id']);\n\t\t\t\t\t$returnArray= array(\n\t\t\t\t\t\t'message' => 'Answer this qualifier to proceed further.',\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'qualifier' => true,\n\t\t\t\t\t\t'qualifier_data' => $qualifier_data,\n\t\t\t\t\t\t'opp_data' => $data\n\t\t\t\t\t);\n\t\t\t\t\techo json_encode($returnArray);\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\techo $this->opp_sales->addOpportunity($data, $owner_id);\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "function setupDirectDebitMandate($payerName, $payerEmail, $payerPhone, $payerBankCode, $payerAccount, $requestId, $amount, $startDate, $endDate, $mandateType, $maxNoOfDebits ) {\n\n $hash = hash('sha512', $GLOBALS['merchantID']. $GLOBALS['ServiceTypeID']. $requestId. $amount. $GLOBALS['apiKey']);\n\n $mandateData = array(\n\n 'merchantId' => $GLOBALS['merchantID'],\n 'serviceTypeId' => $GLOBALS['ServiceTypeID'],\n 'hash' => $hash,\n 'payerName' => $payerName,\n 'payerEmail' => $payerEmail,\n 'payerPhone' => $payerPhone,\n 'payerBankCode' => $payerBankCode,\n 'payerAccount' => $payerAccount,\n 'requestId' => $requestId,\n 'amount' => $amount,\n 'startDate' => $startDate,\n 'endDate' => $endDate,\n 'mandateType' => $mandateType,\n 'maxNoOfDebits' => $maxNoOfDebits);\n //echo json_encode($mandateData);\n $response = callRemitaApiPost($GLOBALS['apiMandateSetupURL'], $mandateData);\n return json_decode(removeJSONP($response), TRUE);\n}", "public function transferTo(Request $request)\n {\n $address = $request->input('address');\n $date_time = $request->input('date_time');\n $land_mark = $request->input('land_mark');\n $contactNum = $request->input('contactNum');\n $employee_list = $request->input('employee_list');\n $way_bill = $request->input('way_bill');\n $deliveryMode = $request->input('deliveryMode');\n $saveStatus = [];\n $id = $request->input('lead_id');\n $employee = $request->input('employee');\n $documentdetIdArray = $request->input('docDetid');\n $leadDetails = LeadDetails::find($id);\n $referencenumber = $leadDetails->referenceNumber;\n $casemanagerid = $leadDetails->caseManager['id'];\n $casemanager = User::find($casemanagerid);\n $caseemail = $casemanager->email;\n $casename = $casemanager->name;\n $custname = $leadDetails->customer['name'];\n $uniq_id = uniqid();\n $leads = $leadDetails['dispatchDetails']['documentDetails'];\n foreach ($leads as $count => $reply) {\n if (in_array($reply['id'], $documentdetIdArray)) {\n if ($reply['DocumentCurrentStatus'] == '8' || $reply['DocumentCurrentStatus'] == '15') {\n $saveStatus[] = $this->saveDocumentStatus($id, $count, '14');\n LeadDetails::where(\n '_id',\n new ObjectId($id)\n )->update(array('dispatchDetails.documentDetails.' . $count . '.uniqTransferId' => $uniq_id));\n }\n if ($reply['DocumentCurrentStatus'] == '2' || $reply['DocumentCurrentStatus'] == '17' || $reply['DocumentCurrentStatus'] == '6') {\n $saveStatus[] = $this->saveDocumentStatus($id, $count, '9');\n LeadDetails::where(\n '_id',\n new ObjectId($id)\n )->update(array('dispatchDetails.documentDetails.' . $count . '.uniqTransferId' => $uniq_id));\n }\n }\n }\n $this->saveTabStatus($id);\n $this->setDispatchStatus($id);\n $employee_details = User::find($employee);\n $link = url('/dispatch/employee-view-list/');\n $caselink = url('/dispatch/receptionist-list/');\n $name = $employee_details->name;\n $email = $employee_details->email;\n SendTransferleads::dispatch($name, $email, $referencenumber, $link, $custname, Auth::user()->name);\n $transfer = new \\stdClass();\n $transfer->id = new ObjectId($employee_details->_id);\n $transfer->uniqval = $uniq_id;\n $transfer->name = $employee_details->name;\n $transfer->empCode = $employee_details->empID;\n $transfer->transferById = new ObjectId(Auth::id());\n $transfer->transfered_documents = $documentdetIdArray;\n $transfer->transferByName = Auth::user()->name;\n $transfer->transferDate = date('d/m/Y');\n $transfer->status = 'Transferred';\n $transferStatus = $transfer;\n if (isset($leadDetails->employee)) {\n LeadDetails::where('_id', new ObjectId($id))->unset('employee');\n }\n if (isset($leadDetails->deliveryMode)) {\n LeadDetails::where('_id', new ObjectId($id))->unset('deliveryMode');\n }\n $emp_object = new \\stdClass();\n $employeeListDetails = User::find($employee_list);\n $emp_object->id = new ObjectId($employeeListDetails->_id);\n $emp_object->name = $employeeListDetails->name;\n $emp_object->empId = $employeeListDetails->empID;\n $leadDetails->employee = $emp_object;\n\n $delivery = DeliveryMode::find($deliveryMode);\n $deliveryObject = new \\stdClass();\n $deliveryObject->id = new ObjectID($delivery->_id);\n $deliveryObject->deliveryMode = $delivery->deliveryMode;\n if ($way_bill != '') {\n $deliveryObject->wayBill = $request->input('way_bill');\n }\n $leadDetails->deliveryMode = $deliveryObject;\n $comment_submit_time = date('H:i:s');\n $comment_submit_object = new \\stdClass();\n $comment_submit_object->comment = 'Transferred from reception' . ',' . 'Message' . ' : ' . ucfirst(ucwords($request->input('action_transfer_comment')));\n $comment_submit_object->commentBy = Auth::user()->name;\n $comment_submit_object->commentTime = $comment_submit_time;\n $comment_submit_object->id = new ObjectId(Auth::id());\n $comment_submit_object->date = date('d/m/Y');\n $comment_submit_array[] = $comment_submit_object;\n $leadDetails->push('comments', $comment_submit_array);\n\n $data = array(\n 'dispatchDetails.address' => $address,\n 'dispatchDetails.date_time' => $date_time,\n 'dispatchDetails.land_mark' => $land_mark,\n 'contactNumber' => $contactNum,\n 'dispatchDetails.contactNum' => $contactNum\n );\n if (isset($leadDetails->schedulerejectstatus)) {\n LeadDetails::where('_id', new ObjectId($id))->unset('schedulerejectstatus');\n }\n LeadDetails::where('_id', new ObjectID($id))->update($data, ['multiple' => true]);\n Sendcasemangerleads::dispatch($casename, $caseemail, $referencenumber, $name, $caselink, $custname, Auth::user()->name);\n LeadDetails::where('_id', $id)->push(['transferTo' => $transferStatus]);\n $leadDetails->save();\n Session::flash('status', 'Lead is transferred to ' . $employee_details->name);\n return 'success';\n //\t }\n }", "function documentdetails($data,$type,$client_brand){ \n\t\ttry{\n\t\t\tif($type == 'email'){\n\t\t\t\t$uri = \"https://rightsignature.com/api/documents.json?recipient_email=\".$data;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$uri = \"https://rightsignature.com/api/documents/\".$data.\".json\";\n\t\t\t}\n\t\t\t\n\t\t\t// get the secure token from db\n\t\t\t$secure_token = TblAcaBrands::find()->where(['brand_id'=>$client_brand])->One();\n\t\t/*\tif(!empty($secure_token->secure_token)){\n\t\t\t\t$token = $secure_token->secure_token;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{*/\n\t\t\t\t\n\t\t\t\t$token='nNVOqQXgEziK6AhOJ1QmV3CNvBDDs5IC2V133rQM';\n\t\t\t/*}*/\n\t\t\t\n\t\t\t//$headers = array(\"Content-type: application/json\", \"api-token: tPHIJhDqqcXz8yRhcYvFmclj11DyJta4RmIbXYD5\");\n\t\t\t$headers = array(\"Content-type: application/json\", \"api-token: \".$token);\n\t\t\t\t\t \n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 300);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t\t\t \n\t\t\t$curl_response = curl_exec ($ch);\n\t\t\t\n\t\t\treturn json_decode($curl_response);\n\t\t\n\t\t} catch ( \\Exception $e ) {\n\t\t\treturn '';\n\t\t}\n\t}", "public function setOrderReferenceDetails($requestParameters = array());", "function SAP_set_order_multy($rec_id)\n{\n/*\n\tThis FUNCTION posts SD order \n\tINPUT: id of invoice\n\tOUTPUT:\n\t\t\t- \"ID\" of SD order\n\t\t\tOR \"0\" - if failed\n*/\n\tinclude(\"login_re.php\");\n\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\n\t//THESE PARAMS ARE FIXED NOW\n\t$cond_type='ZPR0';\t\n\t\n\t$service_mode='SO_C';\t// CREATE\t\n\t$req = new Request();\n\t \n\t\t\t//Setting up the object\n\t\t\t$item= new Item();\n\t\t\n\t\t//Set up mySQL connection\n\t\t\t$db_server = mysqli_connect($db_hostname, $db_username,$db_password);\n\t\t\t$db_server->set_charset(\"utf8\");\n\t\t\tIf (!$db_server) die(\"Can not connect to a database!!\".mysqli_connect_error($db_server));\n\t\t\tmysqli_select_db($db_server,$db_database)or die(mysqli_error($db_server));\n\t//1.\t\n\t\t// LOCATE data for the invoice\n\t\t\t$invoice_sql=\"SELECT invoice.date,invoice.value,contract.id_SAP,currency.code,invoice.month,invoice.year \n\t\t\t\t\t\t\tFROM invoice \n\t\t\t\t\t\t\tLEFT JOIN contract ON invoice.contract_id=contract.id \n LEFT JOIN currency ON invoice.currency=currency.id\n\t\t\t\t\t\t\tWHERE invoice.id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql=mysqli_query($db_server,$invoice_sql);\n\t\t\t\t\n\t\t\tif(!$answsql) die(\"Database SELECT TO invoice table failed: \".mysqli_error($db_server));\t\n\t\t\tif (!$answsql->num_rows)\n\t\t\t{\n\t\t\t\techo \"WARNING: No invoice found for a given ID in invoice TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t$i_data= mysqli_fetch_row($answsql);\n\t\t\t\t\n\t\t\t\n\t//2.\t\n\t\t\t// Prepare request for SAP ERPclass Item\n\t\n\t\t\t// Set up params\n\t\t\t\n\t\t\t$c_date=$i_data[0];\n\t\t\t$val=$i_data[1];\n\t\t\t$contract_id=$i_data[2];\n\t\t\t$curr=$i_data[3];\t// Currency in invoice\n\t\t\t$c_month=$i_data[4];\n\t\t\t$c_year=$i_data[5];\n\t\t\t$srv_date='';\n\t\t\t$m_date='';\n\t\t\t//SET UP SERVICE DATE - END OF THE BILLING PERIOD\n\t\t\tswitch($c_month)\n\t\t\t{\n\t\t\t\tcase '1':\n\t\t\t\t$m_date='-01-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t$m_date='-02-28';\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t$m_date='-03-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t$m_date='-04-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t$m_date='-05-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '6':\n\t\t\t\t$m_date='-06-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '7':\n\t\t\t\t$m_date='-07-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '8':\n\t\t\t\t$m_date='-08-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '9':\n\t\t\t\t$m_date='-09-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '10':\n\t\t\t\t$m_date='-10-31';\n\t\t\t\tbreak;\n\t\t\t\tcase '11':\n\t\t\t\t$m_date='-11-30';\n\t\t\t\tbreak;\n\t\t\t\tcase '12':\n\t\t\t\t$m_date='-12-31';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$srv_date='20'.$c_year.$m_date;\n\t\t\t\n\t\t\t// Preparing Items for Invoice\n\t\t\t\n\t\t\t// LOCATE POSITIONS for the invoice\n\t\t\t$positions_sql=\"SELECT service_id,quantity,service.id_SAP \n\t\t\t\t\t\t\tFROM invoice_reg \n\t\t\t\t\t\t\tLEFT JOIN service ON invoice_reg.service_id=service.id\n\t\t\t\t\t\t\tWHERE invoice_id=$rec_id\";\n\t\t\t\t\n\t\t\t$answsql1=mysqli_query($db_server,$positions_sql);\n\t\t\t\t\n\t\t\tif(!$answsql1) die(\"Database SELECT TO invoice_reg table failed: \".mysqli_error($db_server));\t\n\t\t\t$count_in=$answsql1->num_rows;\n\t\t\tif (!$count_in)\n\t\t\t{\n\t\t\t\techo \"WARNING: No POSITIONS found for a given ID in invoice_reg TABLE <br/>\";\n\t\t\t\treturn 0;\n\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$items=new ItemList();\n\t\t\t\tfor($it=0;$it<$count_in;$it++)\n\t\t\t\t{\t\n\t\t\t\t\t$pos_data= mysqli_fetch_row($answsql1);\n\t\t\t\t\t$item1 = new Item();\n\t\t\t\t\t// 1. Item number\n\t\t\t\t\t$item_num=($it+1).'0';\n\t\t\t\t\t$item1->ITM_NUMBER=$item_num;\n\t\t\t\n\t\t\t\t\t// 2. Material code\n\t\t\t\t\t$item1->MATERIAL=$pos_data[2];\n\t\t\t\n\t\t\t\t\n\t\t\t\t// 3. Currency ?? - need it?\n\t\t\t\t\t$item1->CURRENCY=$curr;\n\t\t\t\t\n\t\t\t\t\t// 4. SD conditions\n\t\t\t\t\t$item1->COND_TYPE=$cond_type;\n\t\t\t\t\t$item1->COND_VALUE=$val;\n\t\t\t\t\n\t\t\t\t\t// 4. Quantity\n\t\t\t\t\t$item1->TARGET_QTY=$pos_data[1];; \n\t\t\t\t\n\t\t\t\n\t\t\t\t\t//Inserting into Item List\n\t\t\t\n\t\t\t\t\t$items->item[$it] = $item1;\n\t\t\t\t}\n\t\t\t\n\t\t// GENERAL SECTION (HEADER)\n\t\t\n\t\t\t$req->ID_SALESCONTRACT = $contract_id;\t\n\t\t\t$req->SERVICEMODE = $service_mode; \t\t\n\t\t\t$req->BILLDATE=$c_date;\n\t\t\t$req->SALES_ITEMS_IN=$items;\n\t\t\t$req->SERVICEDATE=$srv_date;\n\t\t\t$req->RETURN2 = '';\n\t\t\t//echo \"SENDING TO SAP\";\n\t\t\t$order=SAP_connector($req);\n\t\t\tif ($order->RETURN2->item->MESSAGE==\"SUCCESS\")\n\t\t\t\t$doc_id=$order->RETURN2->item->MESSAGE_V4;\n\t\t\telse\n\t\t\t\t$doc_id=0;\n\t\t\t\n\tmysqli_close($db_server);\n\treturn $doc_id;\n}", "public function refer($shelter_id, $investigation_id) {\n\t\t$investigation = $this->Investigation->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Investigation.id' => $investigation_id\n\t\t\t)\n\t\t));\n\n\n\t\tif ($this->request->is('post')) {\n\n\n\t\t\t$note = $this->request->data('Investigation.note');\n\n\t\t\t//$investigation = $this->Investigation->refer($shelter_id, $investigation_id);\n\t\t\t$investigation = $this->Investigation->refer(1, $investigation_id);\n\n\t\t\t$this->loadModel('Shelter');\n\t\t\t$shelter = $this->Shelter->read(null, $shelter_id);\n\n\t\t\tif($this->request->data('Investigation.message_shelter')) {\n\t\t\t\tSendSMS::go($shelter['Shelter']['phone'], $note);\n\t\t\t}\n\n\t\t\t// create history item\n\t\t\t$this->loadModel('History');\n\t\t\t$this->History->markAsReferred($investigation_id);\n\n\t\t\t$this->redirect('/investigations/agency');\n\t\t}\n\n\t\t$this->set(compact('investigation'));\n\t}", "public function store(Request $request)\n {\n {\n $client = Member::find($request->client);\n $divisi = [];\n $sales = [\n 'name' => $client['sales'][0]['name'],\n 'detail' => $client['sales'][0]['detail'][count($client['sales'][0]['detail']) - 1],\n ];\n\n if (isset($request->divisi)) {\n $get_divisi = $client['divisi'][(int)$request->divisi];\n $get_divisi['index'] = (int)$request->divisi;\n $divisi = [\n $get_divisi,\n ];\n $sales = [\n '_id' => $client['divisi'][(int) $request->divisi]['sales'][0]['_id'],\n 'name' => $client['divisi'][(int) $request->divisi]['sales'][0]['name'],\n 'detail' => $client['divisi'][(int) $request->divisi]['sales'][0]['detail'][0],\n ];\n }\n\n $so = new SalesOrder();\n $so->code = $this->generateSO();\n $so->client = [\n $client->toArray(),\n ];\n $so->sales = [$sales];\n $so->divisi = $divisi;\n $so->billing = $request->billing;\n $so->shipping = $client['shipping_address'][(int) $request->shipping]['address'];\n $so->TOP = $request->TOP;\n\n if ($request->whiteLabel == ''){\n $so->white_label = 'Tidak';\n }else{\n $so->white_label = 'Ya';\n }\n\n $deliverys=Carriers::where('_id', $request->delivery)->get();\n $so->delivery = $deliverys->toArray();\n\n if ($request->packkayu == '') {\n $so->pack_kayu = 'Tidak';\n }else{\n $so->pack_kayu = 'Ya';\n /*$so->pack_kayu = $request->packkayu;*/\n }\n\n $so->notes = $request->notes;\n $arrProduct = [];\n $total_kg = 0;\n $total_realisasi = 0;\n foreach ($request->arrProduct as $key) {\n $product = Product::find($request->input('product' . $key));\n $total_kg = $total_kg + (((double) $request->input('total' . $key)) * 1000);\n $total_realisasi = $total_realisasi + (((double) $request->input('realisasi' . $key)) * 1000);\n $arrProduct[] = [\n \"product_id\" => $product['_id'],\n \"name\" => $product['name'] . \" - \" . $product['type'],\n \"product_detail\" => [$product->toArray()],\n \"package\" => $request->input('package' . $key),\n \"quantity\" => $request->input('quantity' . $key),\n \"weight\" => (double) $request->input('weight' . $key),\n \"total\" => ((double) $request->input('total' . $key)) * 1000,\n \"realisasi\" => ((double) $request->input('realisasi' . $key)) * 1000,\n \"tunggu\" => null,\n \"petugas_produksi\" => null,\n \"petugas_qc\" => null,\n \"status_produksi\" => null,\n \"mulai_proses\"=>null,\n \"selesai_proses\"=>null,\n \"tgl_pass\"=>null,\n \"tgl_reject\"=>null,\n \"note_reject\"=>null\n ];\n }\n $so->products = $arrProduct;\n $so->total_product = count($request->arrProduct);\n $so->total_kg = $total_kg;\n $so->total_realisasi = $total_realisasi;\n\n /*$checks=user::where('_id', $request->check)->get();\n $so->check=$checks->toArray();\n\n $produksis=user::where('_id', $request->produksi)->get();\n $so->produksi=$produksis->toArray();*/\n\n $so->status = \"order\";\n\n $so->save();\n\n if($request->targetUrl){\n return redirect('/')->with('toastr', 'order');\n }else{\n return redirect()->route('sales-order.index')->with('toastr', 'order');\n }\n\n /*return dd($so);*/\n }\n }", "public function transaction($type = '') {\n if ($this->checkLogin('C') == '') {\n redirect(COMPANY_NAME);\n } else {\n $invoice_id = $this->input->post('invoice_id');\n $transaction_id = $this->input->post('transaction_id');\n $paid_date = $this->input->post('paid_date');\n $paid_details = $this->input->post('paid_details');\n $billingArr = $this->revenue_model->get_all_details(BILLINGS, array('invoice_id' => floatval($invoice_id)));\n if ($billingArr->num_rows() > 0) {\n $driver_id = $billingArr->row()->driver_id;\n $txn_type = '';\n $billArr = array();\n if ($type == 'received') {\n $amount = $billingArr->row()->driver_pay_amount;\n $txn_type = 'CREDIT';\n $billArr = array('driver_paid' => 'Yes');\n } else if ($type == 'paid') {\n $amount = $billingArr->row()->site_pay_amount;\n $txn_type = 'DEBIT';\n $billArr = array('site_paid' => 'Yes');\n }\n $txn_date = strtotime($paid_date);\n\n if ($txn_type != '') {\n $txn_arr = array('invoice_id' => (string) $invoice_id,\n 'driver_id' => (string) $driver_id,\n 'txn_type' => (string) $txn_type,\n 'txn_id' => (string) $transaction_id,\n 'txn_date' => MongoDATE($txn_date),\n 'txn_details' => (string) $paid_details,\n );\n $this->revenue_model->simple_insert(PAYMENT_TRANSACTION, $txn_arr);\n if (!empty($billArr)) {\n $this->revenue_model->update_details(BILLINGS, $billArr, array('_id' => MongoID((string) $billingArr->row()->_id)));\n }\n $this->setErrorMessage('success', 'transaction updated successfully','admin_revenue_transaction_update');\n }else{\n\t\t\t\t\t$this->setErrorMessage('error', 'transaction updation failed','admin_revenue_transaction_update_failed');\n\t\t\t\t}\n } else {\n $this->setErrorMessage('error', 'transaction updation failed','admin_revenue_transaction_update_failed');\n }\n echo \"<script>window.history.go(-1);</script>\";\n exit;\n }\n }", "function init_sale_parameters($transact)\n {\n $transact->setSecret($this->secret_id);\n $transact->setAlg($this->alg);\n\n // Required: set ID of who gets paid\n $transact->setRecipient($this->recipient_id);\n\n // Required: Set the price of the sale\n //todo: what is max value?\n $transact->setPrice($this->price);\n\n // Required: Set PROD to use real money, TEST for testing\n $transact->setClass($this->env);\n\n // Required: set URL associated with this puchase\n // User should be able to return to this URL\n $transact->setURL($this->article_url);\n\n // Recommended: Title for customer to read for the purchase\n $transact->setTitle($this->article_title);\n\n $transact->setMethod($this->method); // Optional: by default close the popup\n\n\n // Unique code for seller to set to what they want\n // This could be a code for the item your selling\n $transact->setItem($this->item_id);\n\n // Optional Unique ID of this sale\n $transact->setUid($this->sales_id);\n\n // Set Affiliated if exists\n $transact->setAffiliate($this->affiliate);\n\n // Set your own meta data\n // Note you must keep this short to avoid going over the 1024 byte limt\n // of the token URL\n //todo: what ist his?\n $transact->setMeta(array(\n 'your' => 'data',\n 'anything' => 'you want'\n ));\n }", "public function actionGenerateDirectPurchaseRequisition($project,$seller)\n {\n $newProject_id = new \\MongoDB\\BSON\\ObjectID($project);\n\n $collection = Yii::$app->mongo->getCollection('project');\n $model = $collection->aggregate([\n [\n '$unwind' => '$sellers'\n ],\n [\n '$match' => [\n '_id' => $newProject_id,\n 'sellers.seller' => $seller,\n ]\n ],\n\n ]); \n\n\n $collection = Yii::$app->mongo->getCollection('project');\n $arrUpdate = [\n '$set' => [\n 'date_update' => date('Y-m-d h:i:s'),\n 'update_by' => Yii::$app->user->identity->id,\n 'sellers.$.status' => 'Request Approval',\n\n ]\n \n ];\n $collection->update(['_id' => $newProject_id,'sellers.seller' => $seller],$arrUpdate);\n\n return $this->redirect(['request/index']);\n\n }", "#[CustomOpenApi\\Operation(id: 'leadStore', tags: [Tags::Lead, Tags::V1])]\n #[OpenApi\\Parameters(factory: DefaultHeaderParameters::class)]\n #[CustomOpenApi\\RequestBody(request: CreateLeadRequest::class)]\n #[CustomOpenApi\\Response(resource: LeadWithLatestActivityResource::class, statusCode: 201)]\n #[CustomOpenApi\\ErrorResponse(exception: SalesOnlyActionException::class)]\n public function store(CreateLeadRequest $request): LeadWithLatestActivityResource\n {\n if (!tenancy()->getUser()->is_sales) throw new SalesOnlyActionException();\n\n $data = array_merge($request->validated(), [\n 'channel_id' => tenancy()->getActiveTenant()->id,\n 'user_id' => tenancy()->getUser()->id,\n 'status' => LeadStatus::GREEN()\n ]);\n\n $lead = Lead::create($data);\n $lead->queueStatusChange();\n $lead->refresh()->loadMissing(self::load_relation);\n\n return $this->show($lead);\n }", "public function storeRequestSaleInLine(Request $request)\n {\n\n $id_tran = 0;\n $id_dia = $request->get('id');\n $fec_tra = '06/07/2023';\n $usr_cre = 'linea';\n $gestion = '2023';\n \\Log::info($request);\n \n $id_request = $request->get('request');\n $dataRequest = $request->get('dataRequest');\n $dataDetailRequest = $request->get('dataDetailRequest');\n $boucherRequest = $request->get('boucherRequest');\n $extractRequest = $request->get('extractRequest');\n\n $ci_per = strtoupper($dataRequest['ci_per']);\n $des_per = strtoupper($dataRequest['des_per']);\n $idc = strtoupper($dataRequest['idc']);\n $tip_tra = '10';\n\n foreach ($dataDetailRequest as $item) {\n # code...\n $cod_val = $item['cod_val'];\n $can_val = $item['can_val'];\n $pre_uni = $item['imp_val'];\n //$imp_val = $item['imp_val'];\n $imp_val = $can_val * $pre_uni;\n $marker = Treasure::addStoreRequestSaleInLine($id_dia, $cod_val, $can_val, $pre_uni, $fec_tra, $usr_cre, $idc, $ci_per, $des_per, $tip_tra, $gestion);\n $id_tran = $marker[0]->{'id_tran'};\n //$data = Treasure::addProcedureByStudents($id_dia, $id_tran, -1, $cod_val, $ci_per, $des_per, -1, $gestion, $des_tra, $pre_uni);\n $id_tran = 0;\n }\n foreach ($extractRequest as $item) {\n # code...\n $id = $item['id'];\n $marker = Treasure::storeChangeStateExtract($id, 'Verificado', $id_dia);\n $id_tran = 0;\n }\n $data = Treasure::storeChangeStateRequest($id_request, 'Verificado');\n return json_encode($marker);\n }", "public function access_content($msisdn,$invoiceNo,$aggreedPayDate){\n $curl = curl_init();\n $url='http://10.12.36.130:8080/services/DcPaServices';\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => '',\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => array(\n 'SOAPAction: Adjustment',\n 'Content-Type: text/xml;charset=UTF-8'),\n CURLOPT_CUSTOMREQUEST => 'POST',\n CURLOPT_POSTFIELDS =>'<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n xmlns:bmp=\"http://cbs.huawei.com/dc/wsservice/bmpinterface\"\n xmlns:cbs=\"http://www.huawei.com/bme/cbsinterface/cbscommon\">\n<soapenv:Header/>\n <soapenv:Body>\n <bmp:CreatePARequestMsg>\n <RequestHeader>\n <cbs:Version>1</cbs:Version>\n <!--Optional:-->\n <cbs:BusinessCode>CreatePA</cbs:BusinessCode>\n <cbs:MessageSeq>'.time().'</cbs:MessageSeq>\n <!--Optional:-->\n <cbs:OwnershipInfo>\n <cbs:BEID>101</cbs:BEID>\n <!--Optional:-->\n </cbs:OwnershipInfo>\n <cbs:AccessSecurity>\n <cbs:LoginSystemCode>hissam</cbs:LoginSystemCode>\n <cbs:Password>Q9nmbqOehHWjysXzmQiabeI0Saa2V3WHEsw+xF7PnxM=</cbs:Password>\n </cbs:AccessSecurity>\n </RequestHeader>\n <CreatePARequest>\n <bmp:AcctAccessCode>\n <!--You have a CHOICE of the next 3 items at this level-->\n <bmp:PrimaryIdentity>'.$msisdn.'</bmp:PrimaryIdentity>\n </bmp:AcctAccessCode>\n <!--Optional:-->\n <bmp:PAExternalID>?</bmp:PAExternalID>\n <bmp:PAType>1</bmp:PAType>\n <bmp:PARequestDate>'.date(\"Ymd\").'000000</bmp:PARequestDate>\n <!--1 or more repetitions:-->\n <bmp:PADetailInfo>\n <bmp:AgreedPaidDate>'.$aggreedPayDate.'000000</bmp:AgreedPaidDate>\n <!--Optional:-->\n <bmp:CurrencyId>1153</bmp:CurrencyId>\n </bmp:PADetailInfo>\n <!--Zero or more repetitions:-->\n <bmp:PAInvoiceInfo>\n <bmp:InvoiceNo>'.$invoiceNo.'</bmp:InvoiceNo>\n </bmp:PAInvoiceInfo>\n <bmp:PAReminderFlag>N</bmp:PAReminderFlag>\n </CreatePARequest>\n </bmp:CreatePARequestMsg>\n </soapenv:Body>\n </soapenv:Envelope>',));\n //Convert XML to JSON\n $response = curl_exec($curl);\n \n return $response;\n //return $response;\n }", "public function callback(){\n $data = Rave::verifyTransaction(request()->txref);\n dd($data); // view the data response\n if ($data->status == 'success') {\n if(session()->get($this->requestVar)['']['page_type'] == 'cart'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n } \n \n \n \n //Payment from basket checkout page\n \n if(session()->get($this->requestVar)['']['page_type'] == 'basket'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n \n }\n \n }\n }", "function convert_transaction_detail( &$obj )\n\t{\n\n\t\t// shop object\n\t\tif ( isset( $obj->shop_id )) {\n\t\t\t$tmp_shop = $this->CI->Shop->get_one( $obj->shop_id );\n\n\t\t\t$this->convert_shop( $tmp_shop );\n\n\t\t\t$obj->shop = $tmp_shop;\n\t\t}\n\t\t\n\t}", "public function update(Request $request, Sale $sale)\n {\n //\n }", "public function update(Request $request, Sale $sale)\n {\n //\n }", "public function update(Request $request, Sale $sale)\n {\n //\n }", "public function update(Request $request, Sale $sale)\n {\n //\n }", "public function update(Request $request, Sale $sale)\n {\n //\n }", "public function update(Request $request, Sale $sale)\n {\n //\n }", "public function update(Request $request, Sale $sale)\n {\n //\n }", "public function CreatePOS(Request $request)\n {\n $this->authorizeForUser($request->user('api'), 'Sales_pos', Sale::class);\n\n request()->validate([\n 'client_id' => 'required',\n 'warehouse_id' => 'required',\n 'payment.amount' => 'required',\n ]);\n\n $item = \\DB::transaction(function () use ($request) {\n $helpers = new helpers();\n $role = Auth::user()->roles()->first();\n $view_records = Role::findOrFail($role->id)->inRole('record_view');\n $order = new Sale;\n\n $order->is_pos = 1;\n $order->date = Carbon::now();\n $order->Ref = app('App\\Http\\Controllers\\SalesController')->getNumberOrder();\n $order->client_id = $request->client_id;\n $order->warehouse_id = $request->warehouse_id;\n $order->tax_rate = $request->tax_rate;\n $order->TaxNet = $request->TaxNet;\n $order->discount = $request->discount;\n $order->shipping = $request->shipping;\n $order->GrandTotal = $request->GrandTotal;\n $order->statut = 'completed';\n $order->user_id = Auth::user()->id;\n\n $order->save();\n\n $data = $request['details'];\n foreach ($data as $key => $value) {\n\n $unit = Unit::where('id', $value['sale_unit_id'])\n ->first();\n $orderDetails[] = [\n 'date' => Carbon::now(),\n 'sale_id' => $order->id,\n 'sale_unit_id' => $value['sale_unit_id'],\n 'quantity' => $value['quantity'],\n 'product_id' => $value['product_id'],\n 'product_variant_id' => $value['product_variant_id'],\n 'total' => $value['subtotal'],\n 'price' => $value['Unit_price'],\n 'TaxNet' => $value['tax_percent'],\n 'tax_method' => $value['tax_method'],\n 'discount' => $value['discount'],\n 'discount_method' => $value['discount_Method'],\n ];\n\n if ($value['product_variant_id'] !== null) {\n $product_warehouse = product_warehouse::where('warehouse_id', $order->warehouse_id)\n ->where('product_id', $value['product_id'])->where('product_variant_id', $value['product_variant_id'])\n ->first();\n\n if ($unit && $product_warehouse) {\n if ($unit->operator == '/') {\n $product_warehouse->qte -= $value['quantity'] / $unit->operator_value;\n } else {\n $product_warehouse->qte -= $value['quantity'] * $unit->operator_value;\n }\n $product_warehouse->save();\n }\n\n } else {\n $product_warehouse = product_warehouse::where('warehouse_id', $order->warehouse_id)\n ->where('product_id', $value['product_id'])\n ->first();\n if ($unit && $product_warehouse) {\n if ($unit->operator == '/') {\n $product_warehouse->qte -= $value['quantity'] / $unit->operator_value;\n } else {\n $product_warehouse->qte -= $value['quantity'] * $unit->operator_value;\n }\n $product_warehouse->save();\n }\n }\n }\n\n SaleDetail::insert($orderDetails);\n\n $sale = Sale::findOrFail($order->id);\n // Check If User Has Permission view All Records\n if (!$view_records) {\n // Check If User->id === sale->id\n $this->authorizeForUser($request->user('api'), 'check_record', $sale);\n }\n\n try {\n\n $total_paid = $sale->paid_amount + $request['amount'];\n $due = $sale->GrandTotal - $total_paid;\n\n if ($due === 0.0 || $due < 0.0) {\n $payment_statut = 'paid';\n } else if ($due != $sale->GrandTotal) {\n $payment_statut = 'partial';\n } else if ($due == $sale->GrandTotal) {\n $payment_statut = 'unpaid';\n }\n\n if($request['amount'] > 0){\n if ($request->payment['Reglement'] == 'credit card') {\n $Client = Client::whereId($request->client_id)->first();\n Stripe\\Stripe::setApiKey(config('app.STRIPE_SECRET'));\n\n $PaymentWithCreditCard = PaymentWithCreditCard::where('customer_id', $request->client_id)->first();\n if (!$PaymentWithCreditCard) {\n // Create a Customer\n $customer = \\Stripe\\Customer::create([\n 'source' => $request->token,\n 'email' => $Client->email,\n ]);\n\n // Charge the Customer instead of the card:\n $charge = \\Stripe\\Charge::create([\n 'amount' => $request['amount'] * 100,\n 'currency' => 'usd',\n 'customer' => $customer->id,\n ]);\n $PaymentCard['customer_stripe_id'] = $customer->id;\n\n } else {\n $customer_id = $PaymentWithCreditCard->customer_stripe_id;\n $charge = \\Stripe\\Charge::create([\n 'amount' => $request['amount'] * 100,\n 'currency' => 'usd',\n 'customer' => $customer_id,\n ]);\n $PaymentCard['customer_stripe_id'] = $customer_id;\n }\n\n $PaymentSale = new PaymentSale();\n $PaymentSale->sale_id = $order->id;\n $PaymentSale->Ref = app('App\\Http\\Controllers\\PaymentSalesController')->getNumberOrder();\n $PaymentSale->date = Carbon::now();\n $PaymentSale->Reglement = $request->payment['Reglement'];\n $PaymentSale->montant = $request['amount'];\n $PaymentSale->change = $request['change'];\n $PaymentSale->notes = $request->payment['notes'];\n $PaymentSale->user_id = Auth::user()->id;\n $PaymentSale->save();\n\n $sale->update([\n 'paid_amount' => $total_paid,\n 'payment_statut' => $payment_statut,\n ]);\n\n $PaymentCard['customer_id'] = $request->client_id;\n $PaymentCard['payment_id'] = $PaymentSale->id;\n $PaymentCard['charge_id'] = $charge->id;\n PaymentWithCreditCard::create($PaymentCard);\n\n // Paying Method Cash\n } else {\n\n PaymentSale::create([\n 'sale_id' => $order->id,\n 'Ref' => app('App\\Http\\Controllers\\PaymentSalesController')->getNumberOrder(),\n 'date' => Carbon::now(),\n 'Reglement' => $request->payment['Reglement'],\n 'montant' => $request['amount'],\n 'change' => $request['change'],\n 'notes' => $request->payment['notes'],\n 'user_id' => Auth::user()->id,\n ]);\n\n $sale->update([\n 'paid_amount' => $total_paid,\n 'payment_statut' => $payment_statut,\n ]);\n }\n }\n\n } catch (Exception $e) {\n return response()->json(['message' => $e->getMessage()], 500);\n }\n\n return $order->id;\n\n }, 10);\n\n return response()->json(['success' => true, 'id' => $item]);\n\n }", "public function prosesSalesOrder($invId = 0,$invNo = 0,$soNo = 0){\n //print('Test OK! '.$invId.' - '.$invNo.' - '.$soNo);\n $inv = new Invoice();\n $hsl = $inv->PostSoDetail2Invoice($invId,$invNo,$soNo);\n if ($hsl > 0){\n print(\"OK\");\n }else{\n print(\"ER\");\n }\n }", "public function createSalesTransaction(InvoiceContract $invoice, string $refreshToken, string $officeCode);", "function getConvertSoToInvoice($focus, $so_focus, $soid) {\n\tglobal $log,$current_user;\n\t$log->debug('> getConvertSoToInvoice '.get_class($focus).','.get_class($so_focus).','.$soid);\n\t$fields = array(\n\t\t'bill_street','bill_city','bill_code','bill_pobox','bill_country','bill_state',\n\t\t'ship_street','ship_city','ship_code','ship_pobox','ship_country','ship_state'\n\t);\n\tforeach ($fields as $fieldname) {\n\t\tif (getFieldVisibilityPermission('SalesOrder', $current_user->id, $fieldname) != '0') {\n\t\t\t$so_focus->column_fields[$fieldname] = '';\n\t\t}\n\t}\n\t$focus->column_fields['salesorder_id'] = $soid;\n\t$focus->column_fields['subject'] = isset($so_focus->column_fields['subject']) ? $so_focus->column_fields['subject'] : '';\n\t$focus->column_fields['customerno'] = isset($so_focus->column_fields['customerno']) ? $so_focus->column_fields['customerno'] : '';\n\t$focus->column_fields['duedate'] = isset($so_focus->column_fields['duedate']) ? $so_focus->column_fields['duedate'] : '';\n\t$focus->column_fields['contact_id'] = isset($so_focus->column_fields['contact_id']) ? $so_focus->column_fields['contact_id'] : '';\n\t$focus->column_fields['account_id'] = isset($so_focus->column_fields['account_id']) ? $so_focus->column_fields['account_id'] : '';\n\t$focus->column_fields['exciseduty'] = isset($so_focus->column_fields['exciseduty']) ? $so_focus->column_fields['exciseduty'] : '';\n\t$focus->column_fields['salescommission'] = isset($so_focus->column_fields['salescommission']) ? $so_focus->column_fields['salescommission'] : '';\n\t$focus->column_fields['purchaseorder'] = isset($so_focus->column_fields['vtiger_purchaseorder']) ? $so_focus->column_fields['vtiger_purchaseorder'] : '';\n\t$focus->column_fields['bill_street'] = isset($so_focus->column_fields['bill_street']) ? $so_focus->column_fields['bill_street'] : '';\n\t$focus->column_fields['ship_street'] = isset($so_focus->column_fields['ship_street']) ? $so_focus->column_fields['ship_street'] : '';\n\t$focus->column_fields['bill_city'] = isset($so_focus->column_fields['bill_city']) ? $so_focus->column_fields['bill_city'] : '';\n\t$focus->column_fields['ship_city'] = isset($so_focus->column_fields['ship_city']) ? $so_focus->column_fields['ship_city'] : '';\n\t$focus->column_fields['bill_state'] = isset($so_focus->column_fields['bill_state']) ? $so_focus->column_fields['bill_state'] : '';\n\t$focus->column_fields['ship_state'] = isset($so_focus->column_fields['ship_state']) ? $so_focus->column_fields['ship_state'] : '';\n\t$focus->column_fields['bill_code'] = isset($so_focus->column_fields['bill_code']) ? $so_focus->column_fields['bill_code'] : '';\n\t$focus->column_fields['ship_code'] = isset($so_focus->column_fields['ship_code']) ? $so_focus->column_fields['ship_code'] : '';\n\t$focus->column_fields['bill_country'] = isset($so_focus->column_fields['bill_country']) ? $so_focus->column_fields['bill_country'] : '';\n\t$focus->column_fields['ship_country'] = isset($so_focus->column_fields['ship_country']) ? $so_focus->column_fields['ship_country'] : '';\n\t$focus->column_fields['bill_pobox'] = isset($so_focus->column_fields['bill_pobox']) ? $so_focus->column_fields['bill_pobox'] : '';\n\t$focus->column_fields['ship_pobox'] = isset($so_focus->column_fields['ship_pobox']) ? $so_focus->column_fields['ship_pobox'] : '';\n\t$focus->column_fields['description'] = isset($so_focus->column_fields['description']) ? $so_focus->column_fields['description'] : '';\n\t$focus->column_fields['terms_conditions'] = isset($so_focus->column_fields['terms_conditions']) ? $so_focus->column_fields['terms_conditions'] : '';\n\t$focus->column_fields['currency_id'] = isset($so_focus->column_fields['currency_id']) ? $so_focus->column_fields['currency_id'] : '';\n\t$focus->column_fields['conversion_rate'] = isset($so_focus->column_fields['conversion_rate']) ? $so_focus->column_fields['conversion_rate'] : '';\n\tif (vtlib_isModuleActive('Warehouse')) {\n\t\t$focus->column_fields['whid'] = $so_focus->column_fields['whid'];\n\t}\n\t$cbMapid = GlobalVariable::getVariable('BusinessMapping_SalesOrder2Invoice', cbMap::getMapIdByName('SalesOrder2Invoice'));\n\tif ($cbMapid) {\n\t\t$cbMap = cbMap::getMapByID($cbMapid);\n\t\t$focus->column_fields = $cbMap->Mapping($so_focus->column_fields, $focus->column_fields);\n\t}\n\t$log->debug('< getConvertSoToInvoice');\n\treturn $focus;\n}", "function achivedTarget($arrDetails) {\n $objCountryPortal = new CountryPortal();\n $objCore = new Core;\n $varWhids = $objCountryPortal->getAdminWholesalers($arrDetails['frmUserID']);\n $arrDet = array('whids' => $varWhids, 'salesTarget' => $arrDetails['frmSalesTarget'], 'fromDate' => $objCore->serverDateTime($arrDetails['frmStartDate'], DATE_FORMAT_DB), 'toDate' => $objCore->serverDateTime($arrDetails['frmEndDate'], DATE_FORMAT_DB));\n\n $arrRes = $objCountryPortal->countryPortalRevenue($arrDet);\n return $arrRes;\n }", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "public function fetchLedgerMaster(Request $request){\n\n\t\t// check for the header authentication\n\t\t$auth_token = $request->header('auth');\n\n\t\tif( !$this->checkAuthentication($auth_token) ){\n\t\t\t$finalResponse = array(\n\t\t\t\t'message'\t=> 'Invalid authentication! Call aborted',\n\t\t\t\t'status'\t=> 'failed',\n\t\t\t\t'code'\t\t=> '400'\n\t\t\t);\n\n\t\t\treturn $finalResponse;\n\t\t}\n \n $compnayFromInput \t= str_replace(\"&\", \"&amp;\", $request->input('companyName'));\n\t\t// Get Company Name\n\t\t$currentCompanyName = trim($compnayFromInput);\n\t\tif($currentCompanyName==\"\"){\n\t\t\t$currentCompanyName = $this->objTallyConnector->getCompanyName();\n\t\t}\n\n\t\t// Prepare XML to Fetch Ledger Master\n\t\t$requestXML = '\n\t\t\t\t<ENVELOPE>\n\t\t\t\t\t<HEADER>\n\t\t\t\t\t\t<VERSION>1</VERSION>\n\t\t\t\t\t\t<TALLYREQUEST>EXPORT</TALLYREQUEST>\n\t\t\t\t\t\t<TYPE>COLLECTION</TYPE>\n\t\t\t\t\t\t<ID>Remote Ledger Coll</ID>\n\t\t\t\t\t</HEADER>\n\t\t\t\t\t<BODY>\n\t\t\t\t\t\t<DESC>\n\t\t\t\t\t\t\t<STATICVARIABLES>\n\t\t\t\t\t\t\t\t<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>\n\t\t\t\t\t\t\t\t<SVCURRENTCOMPANY>'.$currentCompanyName.'</SVCURRENTCOMPANY>\n\t\t\t\t\t\t\t</STATICVARIABLES>\n\t\t\t\t\t\t\t<TDL>\n\t\t\t\t\t\t\t\t<TDLMESSAGE>\n\t\t\t\t\t\t\t\t\t<COLLECTION NAME=\"Remote Ledger Coll\" ISINITIALIZE=\"Yes\">\n\t\t\t\t\t\t\t\t\t\t<TYPE>Ledger</TYPE>\n\t\t\t\t\t\t\t\t\t\t<NATIVEMETHOD>Name</NATIVEMETHOD>\n\t\t\t\t\t\t\t\t\t\t<NATIVEMETHOD>OpeningBalance</NATIVEMETHOD>\n\t\t\t\t\t\t\t\t\t\t<NATIVEMETHOD>Parent</NATIVEMETHOD>\n\t\t\t\t\t\t\t\t\t</COLLECTION>\n\t\t\t\t\t\t\t\t</TDLMESSAGE>\n\t\t\t\t\t\t\t</TDL>\n\t\t\t\t\t\t</DESC>\n\t\t\t\t\t</BODY>\n\t\t\t\t</ENVELOPE>';\n\n\t\t// call CURL function to get tally response\n\t\t$tallyFinalResponse = $this->objTallyConnector->executeTallyCURL($requestXML, 1);\n\n\t\t// Convert Data into Proper Array Format\n\t\t$tallyAllLedger = array();\n\t\tif( isset($tallyFinalResponse['BODY']['DATA']['COLLECTION']['LEDGER']) ){\n\t\t\t$tallyFinalResponse = $tallyFinalResponse['BODY']['DATA']['COLLECTION']['LEDGER'];\n\t\t\t$loop_couneter=0;\n\t\t\tforeach($tallyFinalResponse as $data){\n\t\t\t\t$tallyAllLedger[$loop_couneter]['LedgerName'] = $data['@attributes']['NAME'];\n\t\t\t\t$tallyAllLedger[$loop_couneter]['ParentName'] = $data['PARENT'];\n\t\t\t\t$loop_couneter++;\n\t\t\t}\t\t\t\n\t\t}\n\n\t\t// call the method to add logg in MongoDB\n\t\t$inputData = array();\n\n\t\t// Get IP Address\n\t\t$requestIPAddress = request()->ip();\n\t\t//$this->objTallyLogger->addTallyTransactionLog($requestIPAddress, $inputData, \"\",'Fetch','LEDGER_MASTER');\n\n\t\t// Making the final response\n\t\t$finalResponse = array(\n\t\t\t'message'\t=> 'Ledger Imported Successfully!',\n\t\t\t'status'\t=> 'Success',\n\t\t\t'code'\t\t=> '200',\n\t\t\t'data'\t\t=> $tallyAllLedger\n\t\t);\n\n\t\treturn $finalResponse;\n\t}", "public function actionGenerateSpotPurchaseRequisition($project,$seller)\n {\n $newProject_id = new \\MongoDB\\BSON\\ObjectID($project);\n\n $collection = Yii::$app->mongo->getCollection('project');\n $model = $collection->aggregate([\n [\n '$unwind' => '$sellers'\n ],\n [\n '$match' => [\n '_id' => $newProject_id,\n 'sellers.seller' => $seller,\n ]\n ],\n\n ]); \n\n\n $collection = Yii::$app->mongo->getCollection('project');\n $arrUpdate = [\n '$set' => [\n 'date_update' => date('Y-m-d h:i:s'),\n 'update_by' => Yii::$app->user->identity->id,\n 'sellers.$.status' => 'Request Approval',\n\n ]\n \n ];\n $collection->update(['_id' => $newProject_id,'sellers.seller' => $seller],$arrUpdate);\n\n return $this->redirect(['request/index']);\n\n\n }", "private function reformateInput(){\n\n\n $articlegroupId = $this->searchKey('articleGroupId', $this->jsonBody);\n\n if($articlegroupId === null){\n $response = $this->unprocessableEntityResponse();\n return $response;\n }else{\n\n $articleName = $this->invoiceModel->getArticleName($articlegroupId);\n \n if($articleName === null){\n $response = $this->unprocessableEntityResponse();\n return $response;\n }elseif ($articleName == 'uriError') {\n \n $response = $this->badGatwayResponse();\n return $response;\n }\n\n $results=$this->readJson($this->jsonBody);\n\n $items = array(\n 'plu' => $results['values'][5],\n 'articleGroup' => $articleName,\n 'name' => $results['values'][7],\n 'price' => $results['values'][8]/100,\n 'quantity' => $results['values'][9],\n 'totalPrice' => $results['values'][10]/100);\n\n $responseJson= array(\n 'invoice' => $this->jsonBody['number'],\n 'date' => $this->jsonBody['date'],\n 'items' => [$items]);\n \n $responseJson = json_encode($responseJson);\n //print_r($responseJson);\n\n \n //initialized curl\n $ch = curl_init($this->toSendURL);\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $responseJson);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n // Return response instead of outputting\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n //if success the result will be empty\n if($result !== false){\n $response = $this->badGatwayResponse();\n return $response;\n \n }\n else{\n $response['status_code_header'] = 'HTTP/1.1 200 OK';\n $response['body'] = $responseJson;\n //$response['body'] = $result;\n return $response;\n }\n\n\n // Close cURL resource\n curl_close($ch);\n \n \n }\n\n \n }", "function lndauto($lead_data,$multiple)\n {\n $objLeads_submit = ORM::factory('leadsubmit');\n $url_1 = 'https://ping.wnog.com/admin/PingPost/ping'; \n $url_2 = 'https://ping.wnog.com/admin/PingPost/post';\n $header = 'Content-Type: application/x-www-form-urlencoded';\n $price = 'PPPPPP';\n\n $ssn = str_pad($lead_data->ssn, 9 , 0,STR_PAD_LEFT);\n $home_address_zip = $lead_data->zip;\n $monthly_income = $lead_data->monthly_income;\n $first_name = $lead_data->fname;\n $last_name = $lead_data->lname;\n $email_address = $lead_data->email;\n $res_address1 = $lead_data->address;\n $res_city = $lead_data->city;\n $res_state = $lead_data->state;\n $home_phone = $lead_data->phone;\n $work_phone = $lead_data->work_number;\t\n $mobile_phone =$lead_data->mobile;\n list($birth_year , $birth_month , $birth_day) = explode(\"-\",$lead_data->birth_date);\n\n $monthsAtResidence = (int)$lead_data->month_residence;\n $yearsAtResidence = (int) $lead_data->year_residence;\n $residence_status = strtolower($lead_data->rent_own);\n $yearsAtEmployer = (int) substr($lead_data->month_with_company,0 , 2);\n $monthsAtEmployer = (int) substr($lead_data->month_with_company,3 , 2);\n $employer_name = $lead_data->employer;\n $job_title = $lead_data->job_title;\n //$monthly_payment = $lead_data->home_pay;\n $bankruptcy = 'False';\n if($lead_data->cosigner == 'yes')\n $cosigner = 'True';\n elseif($lead_data->cosigner == 'no')\n $cosigner = 'False';\n $opt_in = '1';\n $ip_address = $lead_data->ip_address;\n $date_of_birth = $lead_data->birth_date;\n $dob = date('m/d/Y',strtotime($date_of_birth));\n $time_of_contact = $lead_data->time_to_contact;\n $loan_type = 'loan';\n $cid = '1516';\n $ping_data = 'zip='.$home_address_zip\n .'&subid='.$lead_data->lead_auto_id\n .'&ssn='.$ssn\n .'&monthly_income='.$monthly_income\n .'&cid='.$cid;\t\n\n $post_data = 'offerId=RRRRRRR'\n .'&firstname='.trim($first_name)\n .'&lastname='.$last_name \n .'&email='.$email_address \n .'&address1='.$res_address1 \n .'&address2='.$res_address2 \n .'&city='.$res_city\n .'&home_phone1='.$home_phone1\n .'&home_phone2='.$home_phone2\n .'&home_phone3='.$home_phone3\n .'&work_phone1='.$work_phone1\n .'&work_phone2='.$work_phone2\n .'&work_phone3='.$work_phone3\n .'&mobile_phone1=&mobile_phone2=&mobile_phone3=&bday='.$birth_day\n .'&bmonth='.$birth_month\n .'&byear='.$birth_year\n .'&ownrent='.$residence_status\n .'&timeatresidence='.$yearsAtResidence \n .'&timeatjob='.$yearsAtEmployer\n .'&employer='.$employer_name\n .'&occupation='.$job_title\n .'&monthlypayment='.$monthly_payment\n .'&bankrupt='.$bankruptcy\n .'&cosign='.$cosigner\n .'&optin='.$opt_in\n .'&ipaddress='.$ip_address\n .'&timetocontact='.$time_of_contact\n .'&loantype='.$loan_type\n .'&timeatjobmonths='.$monthsAtEmployer\n .'&timeatresidencemonths='.$monthsAtResidence;\n\n $res_1 = $this->curlposting($url_1, $ping_data, $header);\n preg_match('/<result>(.*)<\\/result>/' , $res_1 , $successful_1);\n preg_match('/<offerId>(.*)<\\/offerId>/' , $res_1 , $confirmation );\n preg_match('/<price>(.*)<\\/price>/' , $res_1 , $price);\n\n $myFile_ping_response = \"ping_post_request/ping_lndauto\".$lead_data->lead_auto_id.\".txt\";\n $fh = fopen($myFile_ping_response, 'w') or die(\"can't open file\");\n $file_string = \"Ping URL::>\".$url_1.\"\\n\\n\";\n $file_string.= \"Ping Data::>\".$ping_data.\"\\n\\n\";\n $file_string.= \"Ping Response::>\".$res_1.\"\\n\\n\";\n fwrite($fh, $file_string);\n fclose($fh);\n\n if($successful_1[1] == 'true') // Ping Successfull\n {\n $post_data = str_replace('RRRRRRR' , $confirmation[1], $post_data);\n $res_2 = $this->curlposting($url_2, $post_data, $header);\n preg_match('/<result>(.*)<\\/result>/' , $res_2 , $successful_2);\n preg_match('/<reason>(.*)<\\/reason>/' , $res_2 , $message_2);\n preg_match('/<price>(.*)<\\/price>/' , $res_2 , $price);\n\n $myFile_post = \"ping_post_request/post_lndauto\".$lead_data->lead_auto_id.\".txt\";\n $fh_post = fopen($myFile_post, 'w') or die(\"can't open file\");\n $file_string_post = \"Post URL::>\".$url_2.\"\\n\\n\";\n $file_string_post.= \"Post Data::>\".$post_data.\"\\n\\n\";\n $file_string_post.= \"Post Result::>\".$res_2.\"\\n\\n\"; \n fwrite($fh_post, $file_string_post);\n fclose($fh_post);\n\n $ping_response ='Accepted with Price:'.$price;\n $post_request = '<a href=\"'.Kohana::$base_url.$myFile_post.'\" target=\"_blank\">View Request</a>';\n $return_ping = 0;\n $objLeads_submit->ping_response ='Success';\n\n if($successful_2[1] == 'true'){ // Post Sucess\t\t\t\n $post_response = 'L&D-Accepted Price:' . $price[1];\n $objLeads_submit->post_response ='Success';\n $objLeads_submit->price = $price[1];\n\n }else{\n $post_response = 'L&D-Rejected';\n $return_post = true;//Call the other function\n $objLeads_submit->post_response ='Fail';\n $objLeads_submit->price = 0;\n $leadassign = 1;\n }\t\n }\n else // Lead Rejected\n {\n $ping_response ='Ping Rejected';\n $comment_admin = ', L&D-Rejected';\n $post_response = 'N/A';\n $post_request = '-';\n $leadassign = 1;\n $return_ping = true;//Call the other function\n $objLeads_submit->ping_response ='Fail';\n $objLeads_submit->post_response ='Fail';\n }\n $objLeads_submit->lead_id =$lead_data->lead_auto_id;\n $objLeads_submit->client_id =25;\n $objLeads_submit->lead_types='Auto';\n $objLeads_submit->save();\n if($multiple!=1)\n {\n echo '<tr>\n <td width=\"1%\"><a href=\"#\">'.$lead_data->lead_auto_id.'</a></td>\n <td>Auto</td>\n <td>'.$email_address.'</td>\n <td>'.$home_phone.'</td>\n <td>'.$ssn.'</td>\n <td>'.$ping_response.' <a class=\"tag red\" href=\"'.Kohana::$base_url.$myFile_ping_response.'\" target=\"_blank\">View</a></td>\n <td>'.$post_request.'</td>\n <td>'.$post_response.'</td>\n <td>'.$price[1].'</td>\n </tr>';\n }\n else\n {\n $return_array['ping_response'] = $return_ping;\n $return_array['post_response'] = $return_post;\n $return_array['price'] = $price[1];\n return $return_array;\n }\n\n }", "public function store(LeadRequest $request)\n {\n $lead = ClientAccount::updateOrCreate(['id' => $request->id],$this->createLead($request));\n $lead->address()->updateOrCreate(['addressable_id' => $lead->id,'addressable_type' => ClientAccount::DEFAULT_ADDRESS_TYPE],$this->createAddress($request));\n $lead->address;\n return $this->showOne($lead);\n }", "public function postPraposalFinsummary(Request $request)\n {\n\n $input = Input::all();\n $loanId = isset($input['loanId']) ? $input['loanId'] : null;\n $loanType = isset($input['type']) ? $input['type'] : null;\n $amount = isset($input['loan_amount']) ? $input['loan_amount'] : null;\n $loanTenure = isset($input['loan_tenure']) ? $input['loan_tenure'] : null;\n $endUseList = isset($input['end_use']) ? $input['end_use'] : null;\n //if loan is selected\n $companySharePledged = isset($input['companySharePledged']) ? $input['companySharePledged'] : null;\n $bscNscCode = isset($input['bscNscCode']) ? $input['bscNscCode'] : null;\n //$id = $input['id'];\n $loan = null;\n $fieldsArr = [];\n $rulesArr = [];\n $messagesArr = [];\n $user = Auth::getUser();\n $userProfile = Auth::getUser()->userProfile();\n\n $validator = Validator::make($fieldsArr, $rulesArr, $messagesArr);\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator)->withInput();\n } else {\n //$user = Auth::getUser();\n //$userProfile = Auth::getUser()->userProfile();\n $input['user_id'] = $user->id;\n if (isset($loanId)) {\n if (isset($loans)) {\n $salesAreaDetailId = $loans->id;\n } else {\n $salesAreaDetailId = null;\n }\n }\n\n $user = Auth::user();\n if (isset($user)) {\n $userID = $user->id;\n $userEmail = $user->email;\n }\n if (isset($userID)) {\n $mobileAppEmail = DB::table('mobile_app_data')->where('Email', $userEmail)\n ->where('status', 0)\n ->first();\n }\n }\n\n\n // $redirectUrl = $this->generateRedirectURL('loans/praposal/checklist', $endUseList, $loanType, $amount, $loanTenure, $companySharePledged, $bscNscCode, $loanId);\n $redirectUrl = $this->generateRedirectURL('loans/praposal/checklist', $endUseList, $loanType, $amount, $loanTenure, $companySharePledged, $bscNscCode, $loanId);\n\n return Redirect::to($redirectUrl);\n }", "public function sales_return_complete()\n {\n $sales_return_no = trim($this->input->post('sales_return_no'));\n $sales_return_date = date_to_db(trim($this->input->post('sales_return_date')));\n\n $sales_return = $this->MSales_return_master->get_by_sales_return_no($sales_return_no);\n $this->MSales_return_master->update($sales_return[0]['id']);\n $this->MSales_return_master->update_tax_info($sales_return_no);\n\n /** Check if previous sales return journal exist then Remove sales return journal details else make new sales return journal master */\n $sales_return_journal = $this->MAc_journal_master->get_by_doc('Sales Return', $sales_return_no);\n if (count($sales_return_journal) > 0)\n {\n $sales_return_journal_no = $sales_return_journal['journal_no'];\n $this->MAc_journal_details->delete_by_journal_no($sales_return_journal_no);\n }\n else\n {\n $sales_return_journal_no = $this->MAc_journal_master->get_journal_number();\n $this->MAc_journal_master->create_by_doc($sales_return_journal_no, $sales_return_date, 'Sales Return', 'Sales Return', $sales_return_no);\n }\n\n $settings = $this->MSettings->get_by_company_id($this->session->user_company);\n $total_price = $this->MSales_return_details->get_total_price_by_sales_return_no($sales_return_no);\n\n /** Calculate COGS */\n $total_cogs = $this->MSales_return_details->get_total_cogs($sales_return_no);\n\n /** Calculate Sales Tax */\n $tax_amount = 0;\n $tax_percent = $settings['tax_rate'];\n if ($tax_percent > 0)\n {\n $tax_amount = ($total_price * $tax_percent) / 100;\n }\n\n /** Calculate Dues */\n $total_paid = $this->input->post('paid_amount');\n $dues = ((float)$total_price + (float)$tax_amount) - (float)$total_paid;\n\n /** Sales Return Journal details entry */\n if ($dues == 0)\n {\n /** Cash credit (gross amount) */\n $this->MAc_journal_details->create_by_inventory($sales_return_journal_no, $settings['ac_cash'], NULL, $total_paid);\n /** Sales revenue debit (net sale amount) */\n $this->MAc_journal_details->create_by_inventory($sales_return_journal_no, $settings['ac_inventory'], $total_price);\n /** Tax payable debit (tax amount) */\n if ($tax_amount > 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_return_journal_no, $settings['ac_tax'], $tax_amount);\n }\n }\n else\n {\n /** Accounts payable / Customer account credit (dues amount) */\n $customer = $this->MCustomers->get_by_id($this->input->post('customer_id'));\n $this->MAc_journal_details->create_by_inventory($sales_return_journal_no, $customer['ac_id'], NULL, $dues);\n /** Cash credit (paid amount if any) */\n if ((float)$total_paid != 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_return_journal_no, $settings['ac_cash'], NULL, $total_paid);\n }\n /** Sales revenue debit (net sale amount) */\n $this->MAc_journal_details->create_by_inventory($sales_return_journal_no, $settings['ac_inventory'], $total_sales);\n /** Tax payable debit (tax amount) */\n if ($tax_amount > 0)\n {\n $this->MAc_journal_details->create_by_inventory($sales_return_journal_no, $settings['ac_tax'], $tax_amount);\n }\n }\n\n /** Check if previous expense journal exist then Remove expense journal details else make new expense journal master */\n // $expense_journal = $this->MAc_journal_master->get_by_doc( 'Expense', $sales_no );\n // if( count($expense_journal) > 0 ){\n // $expense_journal_no = $expense_journal['journal_no'];\n // $this->MAc_journal_details->delete_by_journal_no( $expense_journal_no );\n // } else {\n // $expense_journal_no = $this->MAc_journal_master->get_journal_number();\n // $this->MAc_journal_master->create_by_doc( $expense_journal_no, $sales_date, 'Direct Sales', 'Expense', $sales_no );\n // }\n // $this->MAc_journal_details->create_by_inventory( $expense_journal_no, $settings['ac_cogs'], $total_sales );\n // $this->MAc_journal_details->create_by_inventory( $expense_journal_no, $settings['ac_inventory'], NULL, $total_sales );\n\n /** Auto Money Receipt if partial or full cash paid */\n // if ( (float) $total_paid != 0 ) {\n // $mr = $this->MAc_money_receipts->get_latest();\n // if (count($mr) > 0) {\n // $mr_no = (int) $mr['mr_no'] + 1;\n // } else {\n // $mr_no = 1001;\n // }\n // $this->MAc_money_receipts->create_by_sales( $mr_no, $total_paid, $sales_no );\n // }\n\n echo 'inventory/sales-return-list';\n }", "public function store(FixedAssets $fixed_asset)\n {\n define(\"A_YEAR\", 12);\n define(\"DEPRECIACION\", 8);\n\n $type_assets = TypesAssets::find($fixed_asset->type_asset_id);\n $depreciation_calculation = new DepreciationCalculation();\n $depreciation_calculation->process_year = date('Y');\n $depreciation_calculation->process_month = date('m');\n $depreciation_calculation->fixed_asset_id = $fixed_asset->id;\n $depreciation_calculation->parchuse_account = $type_assets->accounting_accounts_purchase;\n $depreciation_calculation->depreciation_account = $type_assets->accounting_accounts_depreciation;\n $depreciation_calculation->process_date = date('d-m-Y');\n\n //Calculate Depreciation\n //Depreciation based on a FIXED amount of time of one Year\n $monthly_depreciation = $fixed_asset->amount / A_YEAR;\n\n $depreciation_calculation->despised_amount = $monthly_depreciation;\n $depreciation_calculation->save();\n\n $accumulated_depreciation = $fixed_asset->accumulated_depreciation + $monthly_depreciation;\n $fixed_asset->accumulated_depreciation = $accumulated_depreciation;\n $fixed_asset->save();\n\n //Send info to Accountants\n\n\n $response = (new Client)->request('POST', 'http://accountingintegration.azurewebsites.net/api/accountingentry', [\n 'json' => [\n \"description\" => \"Depreciacion de activo Fijo [{$fixed_asset->description}]\",\n \"auxiliary\" => [ \n \"id\" => DEPRECIACION\n ],\n \"transactions\" => [\n [\n \"accountingAccount\" => [\n \"id\" => 65\n ],\n \"origin\" => \"CREDIT\",\n \"amount\" => $monthly_depreciation\n\n ],\n [\n \"accountingAccount\" => [\n \"id\" => 66\n ],\n \"origin\" => \"DEBIT\",\n \"amount\" => $monthly_depreciation\n ]\n ]\n ]\n ]);\n $transactionId = (string) $response->getBody();\n\n return redirect('/calculo-depreciaciones?success=' . $transactionId);\n }", "public function store(Request $request)\n {\n if (!$request->input('price'))\n throw new ApiException(\n ApiException::EXCEPTION_NOT_FOUND_404,\n 'کاربر گرامی ، وارد کردن مبلغ اجباری می باشد.'\n );\n if (!$request->input('ref'))\n throw new ApiException(\n ApiException::EXCEPTION_NOT_FOUND_404,\n 'کاربر گرامی ، وارد کردن شماره پیگیری اجباری می باشد.'\n );\n if (!$request->input('supplier_id'))\n throw new ApiException(\n ApiException::EXCEPTION_NOT_FOUND_404,\n 'کاربر گرامی ، وارد کردن عرضه کننده اجباری می باشد.'\n );\n if (!$supplier = Supplier::where(['id' => $request->input('supplier_id')])->first())\n throw new ApiException(\n ApiException::EXCEPTION_NOT_FOUND_404,\n 'کاربر گرامی ، وارد کردن عرضه کننده اجباری می باشد.'\n );\n if (!SupplierWallet::where(['id' => $request->input('supplier_id')])->exists())\n throw new ApiException(\n ApiException::EXCEPTION_NOT_FOUND_404,\n 'کاربر گرامی ، وارد کردن عرضه کننده اجباری می باشد.'\n );\n $price = intval($this->help->priceNumberDigitsToNormal($request->input('price')));\n if ($supplier->income < $price)\n throw new ApiException(\n ApiException::EXCEPTION_NOT_FOUND_404,\n 'کاربر گرامی ، مبلع مورد نظر کمتر از موجودی عرضه کننده می باشد.'\n );\n $wallet = SupplierWallet::where('supplier_id', $supplier->id)->first();\n $walletPaymentTokenSupplierCount = SupplierWalletInvoice::count();\n $walletPaymentTokenSupplier = \"SW-\" . ++$walletPaymentTokenSupplierCount;\n SupplierWalletInvoice::create([\n 'supplier_id' => $supplier->id,\n 'wallet_id' => $wallet->id,\n 'price_before' => $supplier->income,\n 'price' => $price,\n 'price_after' => intval($supplier->income - $price),\n 'price_all' => $price,\n 'type_status' => Constants::INVOICE_TYPE_STATUS_INCOME_DECREMENT,\n 'status' => Constants::INVOICE_STATUS_SUCCESS,\n 'type' => Constants::INVOICE_TYPE_INCOME_DECREMENT_SUPPLIER,\n 'invoice_status' => Constants::INVOICE_INVOICE_STATUS_INCOME_DECREMENT_SUPPLIER . \" - \" . Constants::INVOICE_INVOICE_STATUS_WITHDRAW,\n 'payment_token' => $walletPaymentTokenSupplier,\n 'ref_id' => $request->input('ref'),\n 'market' => Constants::INVOICE_MARKET_INCOME_SUPPLIER,\n 'info' => ['wallet' => $wallet],\n ]);\n Supplier::where('id', $supplier->id)->update([\n 'income' => intval($supplier->income - $price)\n ]);\n return $this->respond([\"status\" => \"success\"]);\n }", "function storePayment($agent_id,$month,$amount){\n \n\n if(request()->status == 0){\n\n $user = User::where([['userable_id', $agent_id],['role_id', env('AGENT')]] )\n ->first();\n\n $invoice = env('IRS_CODE').date('Ymd').$user->userable_id.random_int(0,9).strtotime(date('Ymdhsi',time()));\n\n $remittance = Remittance::create([\n 'agent_id'=> $user->userable_id,\n 'lga_id'=> $user->lga_id,\n 'amount'=> $amount,\n 'month'=> $month,\n 'payment_type'=> 'bank',\n 'transaction_reference'=> request()->reference,\n 'invoice'=> $invoice,\n 'mac_id'=> request()->ip()\n ]);\n\n\n return redirect( env('APP_URL').'/home#/remittance')->with('message', request()->reference.' has initialized!');\n\n\n }\n else if(request()->status == 1){\n\n \n DB::beginTransaction();\n try {\n\n $remits = Remittance::where('transaction_reference', request()->reference )->firstorFail();\n\n if($remits->status == 'success' )\n {\n return response()->json([\n 'status' => 'error',\n 'message' => 'transaction has updated before'\n ]);\n }\n \n//\n// $remit->update([\n// 'status' => 'success',\n// 'mac_id'=> request()->ip()\n// ]);\n\n $res = '';\n $curl = curl_init();\n\n $reference= request()->reference;\n $type='bank';\n $string = $reference.$type; //concatenate these values\n $mac = env('MAC_KEY');\n $hash = hash_hmac('sha512',$string,$mac, false);\n \t$token = env('MONETA_TOKEN');\n\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => env('MONETA_URL').\"/transaction/verify/bank/\".$reference.\"?hash=\".$hash,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Authorization: Bearer $token\",\n \t\t\t\t\t\t \"Accept: application/json\"\n ),\n ));\n \n\n $response = curl_exec($curl);\n\n $err = curl_error($curl);\n curl_close($curl);\n \n if ($err) {\n return response()->json([\n 'status' => 'error',\n 'message' => 'error occurred!'\n ]);\n\n }\n\n $result = json_decode($response, true);\n\n\n if($result['status'] == 'success'){\n\n $payment_date = $result['customer']['updated_at'];\n if($result['customer']['Status'] == 1){\n\n $bank = $result['transaction']['BankName'].' '.$result['transaction']['BranchName'];\n\n\n $unremitObj = UnremittedCash::where([['agent_id', $remits->agent_id],['month',$remits->month]]);\n\n $unremitObj->decrement('amount', $result['customer']['AmountDue']);\n\n $unremit = $unremitObj->first();\n\n // $remittance->update(['invoice_id'=>$unremit->invoice_id]);\n\n $remits->status = 'success';\n $remits->mac_id = request()->ip();\n $remits->timestamps = false;\n $remits->bank = $bank;\n $remits->updated_at = date(\"Y-m-d H:i:s\", strtotime($payment_date));\n $remits->invoice_id = $unremit->invoice_id;\n $res = $remits->save();\n\n // set invoice id of unremitted to empty\n $unremitObj->update(['invoice_id'=>'']);\n//\n// if($response)\n// echo 'success';\n// else\n// echo 'failed';\n\n\n\n } else {\n\n return response()->json([\n 'status' => 'error',\n 'message' => 'Unpaid transaction reference.'\n ]);\n }\n\n } else {\n return response()->json([\n 'status' => 'error',\n 'message' => $result['message']\n ]);\n\n\n }\n\n\n\n\n DB::commit();\n //return 'success';\n if($res)\n return 'success';\n else \n return 'failed';\n\n\n }\n catch(\\Exception $ex){\n\n if (isset($ex->errorInfo[2])) {\n $msg = $ex->errorInfo[2];\n } else {\n $msg = $ex->getMessage();\n }\n\n // rollback operation for failure\n DB::rollback();\n\n // return $msg;\n return response()->json([\n 'status' => 'error',\n 'data' => $msg\n ]);\n\n }\n\n\n\n\n }\n\n\n }", "public function sendRequest($quote, $transactionType, $creditCardDetails){\n\t\t\n\t\t$totals = $quote->getTotals();\n\t\t$startDate = new \\DateTime('NOW');\n\t\t\n\t\tif($transactionType == self::TRANSACTION_TYPE_PURCHASE){\n\t\t\t$preparedRequest = array(\n\t\t\t\t'VERSION' => $this->apiVersion,\n\t\t\t\t'SIGNATURE' => $this->apiSignature,\n\t\t\t\t'USER' => $this->apiUsername ,\n\t\t\t\t'PWD' => $this->apiPassword,\n\t\t\t\t'METHOD' => 'DoDirectPayment',\n\t\t\t\t'PAYMENTACTION' => 'Sale',\n\t\t\t\t'IPADDRESS' => $_SERVER['REMOTE_ADDR'],\n\t\t\t\t'AMT' => (string)$totals['total'], //cannot be more than 10,000\n\t\t\t\t'CREDITCARDTYPE' => $creditCardDetails['creditcard_type'],\n\t\t\t\t'ACCT' => $creditCardDetails[\"credit_card_number\"],\n\t\t\t\t'EXPDATE' => $creditCardDetails[\"expiry_date_day\"] . $creditCardDetails[\"expiry_date_year\"],\n\t\t\t\t'CVV2' => $creditCardDetails[\"cvv2\"], // has to be exactly 3 digits or 4 digits for American Express\n\t\t\t\t'FIRSTNAME' => $quote->getUser()->getName(),\n\t\t\t\t'LASTNAME' => '',\n\t\t\t\t'STREET' => $quote->getBillingDetails()->getStreet(),\n\t\t\t\t'ZIP' => $quote->getBillingDetails()->getPostalCode(),\n\t\t\t\t'CURRENCYCODE' => 'USD',\n\t\t\t\t'DESC' => $quote->getItems()->get(0)->getName()\n\t\t\t);\n\t\t\tif($quote->getBillingDetails()->getGeolocation()) {\n\t\t\t\t$preparedRequest['CITY'] = $quote->getBillingDetails()->getGeolocation()->getCity()->getName();\n\t\t\t\t$preparedRequest['STATE'] = $quote->getBillingDetails()->getGeolocation()->getCity()->getState();\n\t\t\t\t$preparedRequest['COUNTRYCODE'] = $quote->getBillingDetails()->getGeolocation()->getCity()->getCountry()->getCode2();\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($transactionType == self::TRANSACTION_TYPE_RECURRING){\n\t\t\t\n\t\t\t $preparedRequest = array(\n\t\t\t\t'VERSION' => $this->apiVersion,\n\t\t\t\t'SIGNATURE' => $this->apiSignature,\n\t\t\t\t'USER' => $this->apiUsername ,\n\t\t\t\t'PWD' => $this->apiPassword,\n\t\t\t\t'METHOD' => 'CreateRecurringPaymentsProfile',\n\t\t\t\t'CREDITCARDTYPE' => $creditCardDetails['creditcard_type'],\n\t\t\t\t'ACCT' => $creditCardDetails[\"credit_card_number\"],\n\t\t\t\t'EXPDATE' => $creditCardDetails[\"expiry_date_day\"] . $creditCardDetails[\"expiry_date_year\"],\n\t\t\t\t'CVV2' => $creditCardDetails[\"cvv2\"], \n\t\t\t\t'FIRSTNAME' => $quote->getUser()->getName(),\n\t\t\t\t'LASTNAME' => '',\n\t\t\t\t'CURRENCYCODE' => 'USD',\n\t\t\t\t'PROFILESTARTDATE' => $startDate->format('c'),\n\t\t\t\t'DESC' => $quote->getItems()->get(0)->getName(), \t\t\t\t\t\t\t\t\n\t\t\t\t'BILLINGPERIOD' => 'Month',\n\t\t\t\t'BILLINGFREQUENCY' => '1',\n\t\t\t\t'AMT' => (string)$totals['total'], \n\t\t\t\t'EMAIL' => $quote->getUser()->getEmail(),\n\t\t\t\t//'L_PAYMENTREQUEST_0_ITEMCATEGORY0' => 'Digital', // There was following error \"You are not signed up to accept payment for digitally delivered goods\"\n\t\t\t\t'L_PAYMENTREQUEST_0_NAME0' => $quote->getItems()->get(0)->getName(),\n\t\t\t\t'L_PAYMENTREQUEST_0_AMT0' => (string)$totals['total'],\n\t\t\t\t'L_PAYMENTREQUEST_0_QTY0' => '1'\n\t\t\t); \n\t\t}\n\n\t\tif($transactionType == self::TRANSACTION_TYPE_AUTHORIZATION){\n\t\t\t$request = array(\n\t\t\t// some code here\t\t\n\t\t\t);\n\t\t}\n\t\t\n\t\t$response = $this->request($preparedRequest);\n\t\tif($response == self::RESPONSE_OK){\n\t\t\treturn self::RESPONSE_OK;\n\t\t} \n\t\telse {\n\t\t\treturn $response;\n\t\t}\t\n\t}", "public function store(SaleRequest $request)\n {\n $sale = new Sale ;\n $sale->user_id = $request->user_id;\n $sale->client_id = $request->client_id;\n $sale->project_id = $request->project_id;\n $sale->project_slab_id = $request->project_slab_id;\n $sale->meeting_id = $request->meeting_id;\n $sale->price = $request->price;\n $sale->save();\n \n try {\n $client = Client::findOrFail($request->client_id);\n $sales = Sale::where('id',$sale->id)->with('project')->with('client')->first();\n $client->notify(new SaleNotification($sales));\n }\n catch (\\Exception $e) {\n return \"fail\";\n }\n \n\n\n }", "public function update(Request $request, sale $sale)\n {\n $input = $request->all();\n \n \n \n \n \n \n \n $sal= $sale->update([\n 'client_id'=>$request->client_id,\n 'driver_id'=>$request->driver_id,\n 'product_id'=>$request->product_id,\n 'delivery_location'=>$request->delivery_location,\n 'qunatity'=>$request->quantity,\n 'total'=>product::find($request->product_id)->price*$request->quantity,\n ]);\n \n \n return $this->sendResponse(new saleResource($sal), 'sale updated successfully.');\n }", "public function reportRe()\n{\n print_r($this->requestReport(\n \"campaigns\",\n array(\"reportDate\" => \"20190501\",\n \"campaignType\" => \"sponsoredProducts\",\n \"metrics\" => \"impressions,clicks,cost\")));\n\n // amzn1.clicksAPI.v1.m1.5CD444B4.e3c2f999-14b0-4385-bf71-41f8538f712a\n \n \n}", "public function getObtainFinancialReference()\n {\n return $this->obtainFinancialReference;\n }", "public function saveRoyalty($saleId, $vehicleId, $productId, $dateTime, $quantity, $royaltyAccountId, $royaltyOwnerAccountId)\n {\n if(empty($saleId) || empty($vehicleId) || empty($productId) || empty($dateTime) || empty($quantity) || empty($royaltyAccountId) || empty($royaltyOwnerAccountId)) {\n return 1;\n }\n\n $vehicle = Vehicle::find($vehicleId);\n if(!empty($vehicle) && !empty($vehicle->id)) {\n $vehicleNumber = $vehicle->reg_number;\n $vehicleType = $vehicle->vehicleType->name;\n //$royaltyRecord = RoyaltyChart::where('vehicle_type_id', $vehicle->vehicle_type_id)->where('product_id', $productId)->first();\n $vehicleTypeRecord = VehicleType::where('id', $vehicle->vehicle_type_id)->with('products')->first();\n if(!empty($vehicleTypeRecord) && !empty($vehicleTypeRecord->id)) {\n foreach($vehicleTypeRecord->products as $product) {\n if($product->id == $productId) {\n $royaltyAmount = ($product->pivot->amount * $quantity);\n }\n }\n } else {\n return 2;\n }\n } else {\n return 3;\n }\n\n $royaltyTransaction = new Transaction;\n $royaltyTransaction->debit_account_id = $royaltyAccountId; //royalty account id\n $royaltyTransaction->credit_account_id = $royaltyOwnerAccountId;\n $royaltyTransaction->amount = !empty($royaltyAmount) ? $royaltyAmount : '0';\n $royaltyTransaction->date_time = $dateTime;\n $royaltyTransaction->particulars = \"Royalty credited for \". $quantity .\" Load. :\".$vehicleNumber.\" - \".$vehicleType.\"[sale \". $saleId .\"]\";\n $royaltyTransaction->status = 1;\n $royaltyTransaction->created_user_id = Auth::user()->id;\n if($royaltyTransaction->save()) {\n $royalty = new Royalty;\n $royalty->transaction_id = $royaltyTransaction->id;\n $royalty->sale_id = $saleId;\n $royalty->vehicle_id = $vehicleId;\n $royalty->date_time = $dateTime;\n $royalty->amount = $royaltyAmount;\n $royalty->status = 1;\n if($royalty->save()) {\n return 0;\n } else {\n //delete the transaction if associated royalty saving failed.\n $royaltyTransaction->delete();\n\n return 4;\n }\n } else {\n return 5;\n }\n }", "public function store(Request $request, $link, $id)\n {\n $property = Property::findorFail($this->property);\n\n $request->validate([\n 'oincome_type' => 'required',\n 'amount' => 'nullable',\n 'note' => 'nullable',\n 'to_bill' => 'required',\n ]);\n\n // Check if default lease price was overriden\n if ($request->amount == null) {\n $oincome_price_default = OtherIncomeType::where('id', $request->oincome_type)->first();\n $oincome_amount = $oincome_price_default->amount;\n } else {\n $oincome_amount = floatval($request->amount);\n }\n\n // Creating other income\n $oincome_stored = OtherIncome::create([\n 'leasing_agreement_details_id' => $id,\n 'other_income_type_id' => $request->oincome_type,\n 'to_bill' => $request->to_bill,\n 'total_amount' => $oincome_amount,\n 'note' => $request->note,\n ]);\n\n if (!$oincome_stored) {\n Alert::error('Encountered an error', 'Oops')->persistent('Close');\n return redirect()->back();\n } else {\n Alert::success('Other income creation complete', 'Success')->persistent('Close');\n return redirect()->route('oincome.group.lease', [$link, $id]);\n }\n }", "public function bookPayment($invoiceDocNo, $amount, $discount=0, $restOk = false, $date='', $additionalNote='', $fromCreditAmount=0) {\n trace('[METHOD] '.__METHOD__);\n \n $date = tx_ptgsaaccounting_div::convertDateToMySqlFormat($date);\n trace($additionalNote,0,'$additionalNote'); \n $note = $additionalNote != '' ? $invoiceDocNo . ' ' . $additionalNote : $invoiceDocNo;\n if ($date == '') {\n throw new tx_pttools_exception('Wrong DateFormat', 3, 'Date '.$date.' has no valid Format. Allowed Formats are \\'Y-m-d\\' \\'d.m.Y\\' \\'d.m.y\\'');\n }\n $invoiceDocUpdateFieldsArr = array(); \n $paymentUpdateFieldsArr = array(); \n \n $gsaAccountingTransactionAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n $gsaShopTransactionAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n $invoiceDocFieldsArr = $gsaShopTransactionAccessorObj->selectTransactionDocumentData($invoiceDocNo); // get complete transaction document data\n \n trace($amount,0,'$amount');\n trace($discount,0,'$discount');\n\n // get related customer object, set booking data\n $customerObj = new tx_ptgsauserreg_customer($invoiceDocFieldsArr['ADRINR']);\n \n // update the related customer's transaction volume (\"Umsatz\"): ADRESSE.KUMSATZ, KUNDE.UMSATZ, KUNDE.SALDO, KUNDE.LETZTERUMSATZ\n $customerObj->registerTransactionPayment($amount, $discount); \n\n $invoiceDocFieldsArr['BEZSUMME'] += (double)$amount;\n $invoiceDocFieldsArr['SKONTOBETRAG'] += (double)$discount;\n\n $invoiceDocUpdateFieldsArr['BEZSUMME'] = $invoiceDocFieldsArr['BEZSUMME'];\n $invoiceDocUpdateFieldsArr['SKONTOBETRAG'] = $invoiceDocFieldsArr['SKONTOBETRAG'];\n $invoiceDocUpdateFieldsArr['LETZTERUSER'] = 'Online-Shop Bezahlgenerator'; // data type: varchar(30)\n $invoiceDocUpdateFieldsArr['LETZTERUSERDATE'] = date('Y-m-d H:i:s');\n \n $payed = $invoiceDocFieldsArr['BEZSUMME'] + $invoiceDocFieldsArr['GUTSUMME'] + $invoiceDocFieldsArr['SKONTOBETRAG'];\n trace($payed,0,'payed');\n if ($restOk || (bcsub($payed,$invoiceDocFieldsArr['ENDPRB'],$this->precision) )>=0) {\n trace('Auftrag Ok');\n $invoiceDocUpdateFieldsArr['RESTOK'] = 1; \n $invoiceDocUpdateFieldsArr['AUFTRAGOK'] = 1; \n }\n $gsaShopTransactionAccessorObj->updateTransactionDocument($invoiceDocNo, $invoiceDocUpdateFieldsArr);\n \n /*\n * Example XML Part from GSAUFTRAG Tabelle ZAHLUNG TODO: Delete if it works \n <ZAHLUNG>\n <NUMMER>11</NUMMER>\n <AUFINR>2049</AUFINR>\n <OPNUMMER>50000061</OPNUMMER>\n <BETRAG>40.2100</BETRAG>\n <DATUM>2007-08-28</DATUM>\n <BEMERKUNG>RE-200708/00090</BEMERKUNG>\n <BANK>Volksbank</BANK> aus configArray\n <FIBUKTO>1800</FIBUKTO> aus configArray \n <EURO>1</EURO>\n <AUSGUTSCHRIFTEN>0.0000</AUSGUTSCHRIFTEN> TODO: whats that\n </ZAHLUNG>\n */\n $gsaTextfileDataAccessor = tx_ptgsasocket_textfileDataAccessor::getInstance();\n $paymentUpdateFieldsArr['NUMMER'] = 0; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['OPNUMMER'] = 0; // will be overwritten/set by insertPayment()\n $paymentUpdateFieldsArr['BETRAG'] = (double)$amount;\n $paymentUpdateFieldsArr['DATUM'] = $date;\n $paymentUpdateFieldsArr['AUFINR'] = $invoiceDocFieldsArr['NUMMER'];\n $paymentUpdateFieldsArr['BEMERKUNG'] = $note;\n $paymentUpdateFieldsArr['BANK'] = $this->classConfigArr['shopOperatorBankName'];\n $paymentUpdateFieldsArr['EURO'] = '1';\n $paymentUpdateFieldsArr['AUSGUTSCHRIFTEN'] = $fromCreditAmount;\n if ($this->classConfigArr['shopOperatorFinanceAccount']) {\n $paymentUpdateFieldsArr['FIBUKTO'] = $this->classConfigArr['shopOperatorFinanceAccount'];\n }\n trace($paymentUpdateFieldsArr,0,'$paymentUpdateFieldsArr'); //TODO: whats that\n $gsaAccountingTransactionAccessorObj->insertPayment($paymentUpdateFieldsArr);\n }", "public function multipleCreditSaleRegisterAction(MultipleCreditSaleRegistrationRequest $request)\n {\n $saveFlag = 0;\n\n $vehicleId = $request->get('vehicle_id');\n $purchaserAccountId = $request->get('purchaser_account_id');\n $date = $request->get('date');\n $time = $request->get('time');\n $productId = $request->get('product_id');\n $quantity = $request->get('quantity');\n $rate = $request->get('rate');\n $billAmount = $request->get('bill_amount');\n\n $salesAccount = Account::where('account_name','Sales')->first();\n if(!empty($salesAccount) && !empty($salesAccount->id)) {\n $salesAccountId = $salesAccount->id;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details. Try again after reloading the page!<small class='pull-right'> #02/29</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $royaltyAccount = Account::where('account_name','Sale Royalty')->first();\n if(!empty($royaltyAccount) && !empty($royaltyAccount->id)) {\n $royaltyAccountId = $royaltyAccount->id;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/30</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $royaltyOwnerAccount = Account::where('relation', 'royalty owner')->first();\n if($royaltyOwnerAccount && !empty($royaltyOwnerAccount->id)) {\n $royaltyOwnerAccountId = $royaltyOwnerAccount->id;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/31</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $vehicle = Vehicle::where('id', $vehicleId)->first();\n if($vehicle && !empty($vehicle->id)) {\n $vehicleNumber = $vehicle->reg_number;\n $vehicleType = $vehicle->vehicleType->name;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/31/01</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n if(($quantity * $rate) != $billAmount) {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/32</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n //converting date and time to sql datetime format\n $dateTime = date('Y-m-d H:i:s', strtotime($date.' '.$time.':00'));\n\n $transaction = new Transaction;\n $transaction->debit_account_id = $purchaserAccountId;\n $transaction->credit_account_id = $salesAccountId; //sale account id\n $transaction->amount = !empty($billAmount) ? $billAmount : 0;\n $transaction->date_time = $dateTime;\n $transaction->particulars = $purchaserAccountId != 1 ? (\"Credit sale - \". $quantity .\" Load - \".$vehicleNumber.\" - \".$vehicleType) : (\"Cash sale - \". $quantity .\" Load - \".$vehicleNumber.\" - \".$vehicleType);\n $transaction->status = 1;\n $transaction->created_user_id = Auth::user()->id;\n if($transaction->save()) {\n $sale = new Sale;\n $sale->transaction_id = $transaction->id;\n $sale->vehicle_id = $vehicleId;\n $sale->date_time = $dateTime;\n $sale->product_id = $productId;\n $sale->measure_type = 3;\n $sale->quantity = $quantity;\n $sale->rate = $rate;\n $sale->discount = 0;\n $sale->total_amount = $billAmount;\n $sale->status = 1;\n \n if($sale->save()) {\n $royaltyFlag = $this->saveRoyalty($sale->id, $vehicleId, $productId, $dateTime, $quantity, $royaltyAccountId, $royaltyOwnerAccountId);\n if($royaltyFlag == 0) {\n return redirect()->back()->with(\"message\",\"Successfully saved.\")->with(\"alert-class\",\"alert-success\");\n } else {\n //delete the sale and transaction if associated sale royality saving failed.\n $transaction->delete();\n $sale->delete();\n\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/33/\".$royaltyFlag.\"</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n } else {\n //delete the transaction record if associated sale saving failed.\n $transaction->delete();\n\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/34</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/35</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n }", "public function saveOtherSale(Request $request)\r\n {\r\n try {\r\n $business_id = $request->session()->get('business.id');\r\n\r\n $settlement_exist = $this->createSettlementIfNotExist($request);\r\n $data = array(\r\n 'business_id' => $business_id,\r\n 'settlement_no' => $settlement_exist->id,\r\n 'store_id' => $request->store_id,\r\n 'product_id' => $request->product_id,\r\n 'price' => $request->price,\r\n 'qty' => $request->qty,\r\n 'balance_stock' => $request->balance_stock,\r\n 'discount' => $request->discount,\r\n 'discount_type' => $request->discount_type,\r\n 'discount_amount' => $request->discount_amount,\r\n 'sub_total' => $request->sub_total\r\n );\r\n $other_sale = OtherSale::create($data);\r\n\r\n $output = [\r\n 'success' => true,\r\n 'other_sale_id' => $other_sale->id,\r\n 'msg' => __('petro::lang.success')\r\n ];\r\n } catch (\\Exception $e) {\r\n \\Log::emergency('File: ' . $e->getFile() . 'Line: ' . $e->getLine() . 'Message: ' . $e->getMessage());\r\n $output = [\r\n 'success' => false,\r\n 'msg' => __('messages.something_went_wrong')\r\n ];\r\n }\r\n\r\n return $output;\r\n }", "public function store(LeadRequest $request)\n {\n // $lead = new Lead($request->validated());\n // $lead->pipeline_dispatch = 'no';\n // $lead->table_name = 'calificados';\n // $lead->save();\n\n //refactoring\n $lead = Lead::create($request->validated());\n \n return new LeadResource($lead);\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $TxnLineID = $this->request->getPost(\"TxnLineID\");\n $salesorderlinedetail = Salesorderlinedetail::findFirstByTxnLineID($TxnLineID);\n\n if (!$salesorderlinedetail) {\n $this->flash->error(\"salesorderlinedetail does not exist \" . $TxnLineID);\n\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'index'\n ]);\n\n return;\n }\n\n $salesorderlinedetail->setTxnlineid($this->request->getPost(\"TxnLineID\"));\n $salesorderlinedetail->setItemrefListid($this->request->getPost(\"ItemRef_ListID\"));\n $salesorderlinedetail->setItemrefFullname($this->request->getPost(\"ItemRef_FullName\"));\n $salesorderlinedetail->setDescription($this->request->getPost(\"Description\"));\n $salesorderlinedetail->setQuantity($this->request->getPost(\"Quantity\"));\n $salesorderlinedetail->setUnitofmeasure($this->request->getPost(\"UnitOfMeasure\"));\n $salesorderlinedetail->setOverrideuomsetrefListid($this->request->getPost(\"OverrideUOMSetRef_ListID\"));\n $salesorderlinedetail->setOverrideuomsetrefFullname($this->request->getPost(\"OverrideUOMSetRef_FullName\"));\n $salesorderlinedetail->setRate($this->request->getPost(\"Rate\"));\n $salesorderlinedetail->setRatepercent($this->request->getPost(\"RatePercent\"));\n $salesorderlinedetail->setClassrefListid($this->request->getPost(\"ClassRef_ListID\"));\n $salesorderlinedetail->setClassrefFullname($this->request->getPost(\"ClassRef_FullName\"));\n $salesorderlinedetail->setAmount($this->request->getPost(\"Amount\"));\n $salesorderlinedetail->setInventorysiterefListid($this->request->getPost(\"InventorySiteRef_ListID\"));\n $salesorderlinedetail->setInventorysiterefFullname($this->request->getPost(\"InventorySiteRef_FullName\"));\n $salesorderlinedetail->setSerialnumber($this->request->getPost(\"SerialNumber\"));\n $salesorderlinedetail->setLotnumber($this->request->getPost(\"LotNumber\"));\n $salesorderlinedetail->setSalestaxcoderefListid($this->request->getPost(\"SalesTaxCodeRef_ListID\"));\n $salesorderlinedetail->setSalestaxcoderefFullname($this->request->getPost(\"SalesTaxCodeRef_FullName\"));\n $salesorderlinedetail->setInvoiced($this->request->getPost(\"Invoiced\"));\n $salesorderlinedetail->setIsmanuallyclosed($this->request->getPost(\"IsManuallyClosed\"));\n $salesorderlinedetail->setOther1($this->request->getPost(\"Other1\"));\n $salesorderlinedetail->setOther2($this->request->getPost(\"Other2\"));\n $salesorderlinedetail->setCustomfield1($this->request->getPost(\"CustomField1\"));\n $salesorderlinedetail->setCustomfield2($this->request->getPost(\"CustomField2\"));\n $salesorderlinedetail->setCustomfield3($this->request->getPost(\"CustomField3\"));\n $salesorderlinedetail->setCustomfield4($this->request->getPost(\"CustomField4\"));\n $salesorderlinedetail->setCustomfield5($this->request->getPost(\"CustomField5\"));\n $salesorderlinedetail->setCustomfield6($this->request->getPost(\"CustomField6\"));\n $salesorderlinedetail->setCustomfield7($this->request->getPost(\"CustomField7\"));\n $salesorderlinedetail->setCustomfield8($this->request->getPost(\"CustomField8\"));\n $salesorderlinedetail->setCustomfield9($this->request->getPost(\"CustomField9\"));\n $salesorderlinedetail->setCustomfield10($this->request->getPost(\"CustomField10\"));\n $salesorderlinedetail->setCustomfield11($this->request->getPost(\"CustomField11\"));\n $salesorderlinedetail->setCustomfield12($this->request->getPost(\"CustomField12\"));\n $salesorderlinedetail->setCustomfield13($this->request->getPost(\"CustomField13\"));\n $salesorderlinedetail->setCustomfield14($this->request->getPost(\"CustomField14\"));\n $salesorderlinedetail->setCustomfield15($this->request->getPost(\"CustomField15\"));\n $salesorderlinedetail->setIdkey($this->request->getPost(\"IDKEY\"));\n $salesorderlinedetail->setGroupidkey($this->request->getPost(\"GroupIDKEY\"));\n \n\n if (!$salesorderlinedetail->save()) {\n\n foreach ($salesorderlinedetail->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'edit',\n 'params' => [$salesorderlinedetail->getTxnlineid()]\n ]);\n\n return;\n }\n\n $this->flash->success(\"salesorderlinedetail was updated successfully\");\n\n $this->dispatcher->forward([\n 'controller' => \"salesorderlinedetail\",\n 'action' => 'index'\n ]);\n }", "public function store(Request $request)\n {\n $user_id = $request->user_id;\n $status = $request->status;\n\n $new_expense = [];\n $new_expense['account_id'] = $request->account_id_source;\n $new_expense['paid_at'] = $request->paid_at;\n $new_expense['amount'] = $request->amount;\n $new_expense['description'] = $request->description;\n $new_expense['category_id'] = $request->category_id;\n $new_expense['reference'] = $request->reference;\n $new_expense['user_id'] = $user_id;\n $new_expense['status'] = $status;\n // $new_expense['supplier_id'] = $request->supplier_id;\n $new_expense['payment_method'] = $request->payment_method;\n $request_expense = new Request($new_expense);\n\n $new_revenue = [];\n $new_revenue['account_id'] = $request->account_id_destination;\n $new_revenue['paid_at'] = $request->paid_at;;\n $new_revenue['amount'] = $request->amount;\n $new_revenue['description'] = $request->description;\n $new_revenue['category_id'] = $request->category_id;\n $new_revenue['reference'] = $request->reference;\n $new_revenue['same_bank'] = 1;\n $new_revenue['user_id'] = $user_id;\n $new_revenue['status'] = $status;\n // $new_revenue['customer_id'] = $request->customer_id;\n $new_revenue['payment_method'] = $request->payment_method;\n $request_revenue = new Request($new_revenue);\n\n // var_dump($request_expense->all());\n // echo '<br><br>';\n // var_dump($request_revenue->all());\n\n // dd($nuevo->all());\n\n\n $transfer = $this->saveTransfer($request_revenue, $request_expense);\n\n\n if ($transfer[0] < 0) {\n Session::flash('message', $transfer[1]);\n Session::flash('alert-class', 'alert-error');\n return Redirect::back()->withInput();\n }\n\n Session::flash('message', trans('transfers.save_ok'));\n\n return redirect('banks/transfers');\n }", "public static function adSiteContact($idCompany, $nmPerson, $dsEmail, $nuPhone = NULL, $dsApproach = NULL, $idProperty = NULL, $idBookie = NULL, $tpContactPreference = NULL) {\n//put your code here\n $url = 'https://genimo.com.br/api/site/addSiteContact';\n $fields = array(\n 'idCompany' => urlencode($idCompany),\n 'nmPerson' => urlencode($nmPerson),\n 'dsEmail' => urlencode($dsEmail),\n 'nuPhone' => urlencode($nuPhone),\n 'dsApproach' => urlencode($dsApproach),\n 'idProperty' => urlencode($idProperty),\n 'idBookie' => urlencode($idBookie),\n 'tpContactPreference' => urlencode($tpContactPreference)\n );\n echo $url;\n $fields_string = null;\n//url-ify the data for the POST\n foreach ($fields as $key => $value) {\n $fields_string .= $key . '=' . $value . '&';\n }\n rtrim($fields_string, '&');\n\n//open connection\n $ch = curl_init();\n\n//set the url, number of POST vars, POST data\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, count($fields));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n\n//execute post\n $result = curl_exec($ch);\n\n//close connection\n curl_close($ch);\n\n\n return $result;\n }", "public function store(Request $request)\n {\n //CHEC DE VALIDACION PARA FINANCIAMIENTO\n $sale_chec = $request->input('chec');\n //RECOGER DATOS DE FORMULRIO\n $id_customer = $request->input('id_customer');\n $sale_target = $request->input('sale_target');\n $sale_date = $request->input('sale_date');\n $sale_description = $request->input('sale_description');\n $sale_price = $request->input('sale_price');\n $initial_fee = $request->input('initial_fee');\n $no_fees = $request->input('no_fees');\n $field_price_array = $_REQUEST['field_price'];\n $field_date_array = $_REQUEST['field_date'];\n\n //cargar objrto\n $sale = new sale();\n $sale->customer_id = $id_customer;\n $sale->sale_target = $sale_target;\n $sale->sale_date = $sale_date;\n $sale->sale_description = $sale_description;\n $sale->sale_price = $sale_price;\n $sale->sale_file = '';\n\n //var_dump($sale_chec);die();\n if ($sale_chec) {\n $sale->sale_credit = 'SI';\n $sale->initial_fee = $initial_fee;\n $sale->no_fees = $no_fees;\n $sale->financed_price = $sale_price - $initial_fee;\n $sale->sale_status = 'PAGO';\n //guardar venta\n $sale->save();\n $id_sale = $sale->id;\n //guardar cuota inicial pagada en tabla crditos\n $credit = new credit();\n $credit->sale_id = $id_sale;\n $credit->no_fee = 'CUOTA INICIAL';\n $credit->statu_fee = 'PAGO';\n $credit->date_expiration_fee = $sale_date;\n $credit->price_fee = $initial_fee;\n $credit->save();\n } else {\n $sale->sale_credit = 'NO';\n $sale->initial_fee = $sale_price;\n $sale->no_fees = 0;\n $sale->financed_price = 0;\n $sale->sale_status = 'PAGO';\n //guardar venta\n $sale->save();\n $id_sale = $sale->id;\n //guardar venta de contado en tabla crditos\n $credit = new credit();\n $credit->sale_id = $id_sale;\n $credit->no_fee = 'VENTA DE CONTADO';\n $credit->statu_fee = 'PAGO';\n $credit->date_expiration_fee = $sale_date;\n $credit->price_fee = $sale_price;\n $credit->save();\n };\n\n if ($sale_chec){\n foreach ($field_price_array as $value => $item) {\n $fee_aux = $value+1;\n $fee = $value;\n $credit = new credit();\n $credit->sale_id = $id_sale;\n $credit->no_fee = 'Cuota '. $fee_aux;\n $credit->statu_fee = 'PENDIENTE';\n $credit->date_expiration_fee = $field_date_array[$fee];\n $credit->price_fee = $item;\n $credit->save();\n }\n }\n\n return redirect()->route('ventas')->with(['message' => 'Venta guardada correcatemente']);\n }", "function submit_refund_to_taxamo( $payment_id, $new_status, $old_status ) {\n\n global $edd_options;\n\n if ( 'refunded' != $new_status )\n return;\n\n\n // Get Taxamo Tansaction Key.\n $payment_meta = edd_get_payment_meta( $payment_id );\n $taxamo_transaction_lines = $payment_meta['taxamo_transaction_lines'];\n $transaction_key = $payment_meta['taxamo_transaction_key'];\n\n // Get Order Total and create an array for it.\n foreach ( $taxamo_transaction_lines as $taxamo_transaction_line ) {\n $line_key = $taxamo_transaction_line['taxamo_line_key'];\n $amount = $taxamo_transaction_line['taxamo_total_amount'];\n\n $taxamo_body_array = array( \"total_amount\"=>$amount,\n \"line_key\" => $line_key );\n $taxamo_body_json = json_encode( $taxamo_body_array );\n\n // Create Taxamo Object and Submit a refund\n $private_key = $edd_options['taxedd_private_token'];\n $refundtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n $resp = $refundtaxamo->createRefund( $transaction_key, $taxamo_body_array );\n }\n }", "function delArticleCrossselling($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the article with $object->reference->ShopId */ \n}", "public function payAction()\n\t{\n\t\t$paylanedirectdebit = Mage::getSingleton(\"paylanedirectdebit/standard\");\n\t\t$data = $paylanedirectdebit->getPaymentData();\n\t\t\n\t\tif (is_null($data))\n\t\t{\n\t\t\tMage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl(\"/\"));\n\t\t}\n\t\t\n\t\techo \"Your payment is being processed...\";\n\t\t\n\t\t// connect to PayLane Direct System\t\t\n\t\t$paylane_client = new PayLaneClient();\n\t\t\n\t\t// get login and password from store config\n\t\t$direct_login = Mage::getStoreConfig('payment/paylanedirectdebit/direct_login');\n\t\t$direct_password = Mage::getStoreConfig('payment/paylanedirectdebit/direct_password');\n\t\t\n\t\t$status = $paylane_client->connect($direct_login, $direct_password);\n\t\tif ($status == false)\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$result = $paylane_client->multiSale($data);\n\t\tif ($result == false)\n\t\t{\n\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment(\"Error processing your payment... Please try again later.\", true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->ERROR))\n\t\t{\n\t\t\t// an error message\n\t \t$paylanedirectdebit->addComment($result->ERROR->error_description, true);\n\t\n\t \t$this->_redirect('checkout/onepage/failure');\n\t \treturn;\n\t\t}\n\t\t\n\t\tif (isset($result->OK))\n\t\t{\n\t\t\t$paylanedirectdebit->setPendingStatus($result->OK->id_sale);\n\t\n\t \tsession_write_close(); \n\t \t$this->_redirect('checkout/onepage/success');\n\t \treturn;\n\t\t}\n\t}", "public function creditSaleRegisterAction(CreditSaleRegistrationRequest $request)\n {\n $saveFlag = 0;\n\n $vehicleId = $request->get('vehicle_id');\n $purchaserAccountId = $request->get('purchaser_account_id');\n $date = $request->get('date');\n $time = $request->get('time');\n $productId = $request->get('product_id');\n $measureType = $request->get('measure_type');\n $quantity = $request->get('quantity');\n $rate = $request->get('rate');\n $billAmount = $request->get('bill_amount');\n $discount = $request->get('discount');\n $deductedTotal = $request->get('deducted_total');\n\n $salesAccount = Account::where('account_name','Sales')->first();\n if(!empty($salesAccount) && !empty($salesAccount->id)) {\n $salesAccountId = $salesAccount->id;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details. Try again after reloading the page!<small class='pull-right'> #02/01</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $royaltyAccount = Account::where('account_name','Sale Royalty')->first();\n if(!empty($royaltyAccount) && !empty($royaltyAccount->id)) {\n $royaltyAccountId = $royaltyAccount->id;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/02</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $royaltyOwnerAccount = Account::where('relation', 'royalty owner')->first();\n if($royaltyOwnerAccount && !empty($royaltyOwnerAccount->id)) {\n $royaltyOwnerAccountId = $royaltyOwnerAccount->id;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/03</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n $vehicle = Vehicle::where('id', $vehicleId)->first();\n if($vehicle && !empty($vehicle->id)) {\n $vehicleNumber = $vehicle->reg_number;\n $vehicleType = $vehicle->vehicleType->name;\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/03/01</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n\n if($measureType == 1) {\n if(($quantity * $rate) != $billAmount) {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/04</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n if(($billAmount - $discount) != $deductedTotal) {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/05</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n }\n\n //converting date and time to sql datetime format\n $dateTime = date('Y-m-d H:i:s', strtotime($date.' '.$time.':00'));\n\n $transaction = new Transaction;\n $transaction->debit_account_id = $purchaserAccountId;\n $transaction->credit_account_id = $salesAccountId; //sale account id\n $transaction->amount = !empty($deductedTotal) ? $deductedTotal : '0';\n $transaction->date_time = $dateTime;\n $transaction->particulars = (\"Credit sale :\".$vehicleNumber.\" - \".$vehicleType.\" - [1 Load]\".(($measureType == 2) ? ' (Weighment pending)' : ''));\n $transaction->status = 1;\n $transaction->created_user_id = Auth::user()->id;\n if($transaction->save()) {\n $sale = new Sale;\n $sale->transaction_id = $transaction->id;\n $sale->vehicle_id = $vehicleId;\n $sale->date_time = $dateTime;\n $sale->product_id = $productId;\n $sale->measure_type = $measureType;\n if($measureType == 1) {\n $sale->quantity = $quantity;\n $sale->rate = $rate;\n $sale->discount = $discount;\n $sale->total_amount = $deductedTotal;\n } else {\n $sale->quantity = 0;\n $sale->rate = 0;\n $sale->discount = 0;\n $sale->total_amount = 0;\n }\n $sale->status = 1;\n \n if($sale->save()) {\n $royaltyFlag = $this->saveRoyalty($sale->id, $vehicleId, $productId, $dateTime, 1, $royaltyAccountId, $royaltyOwnerAccountId);\n if($royaltyFlag == 0) {\n return redirect()->back()->with(\"message\",\"Successfully saved.\")->with(\"alert-class\",\"alert-success\");\n } else {\n //delete the sale and transaction if associated sale royality saving failed.\n $transaction->delete();\n $sale->delete();\n\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/06/\".$royaltyFlag.\"</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n } else {\n //delete the transaction record if associated sale saving failed.\n $transaction->delete();\n\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/07</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n } else {\n return redirect()->back()->withInput()->with(\"message\",\"Failed to save the sale details.Try again after reloading the page!<small class='pull-right'> #02/08</small>\")->with(\"alert-class\",\"alert-danger\");\n }\n }", "function resend_invoice($details) {\n\t\t\t\t$name = $details[0]->ai_first_name . \" \" . $details[0]->ai_last_name;\n\t\t\t\t$invoiceid = $details[0]->booking_id;\n\t\t\t\t$refno = $details[0]->booking_ref_no;\n\t\t\t\t$sendto = $details[0]->accounts_email;\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"Dear \" . $name . \",<br>\";\n\t\t\t\t$message .= \"You may review your invoice by visiting at: <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\n\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Invoice');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}" ]
[ "0.5790548", "0.55706275", "0.5533347", "0.5354467", "0.5312333", "0.5291092", "0.51997423", "0.5199499", "0.51843894", "0.51842844", "0.5169691", "0.5126315", "0.51175696", "0.5116143", "0.50976104", "0.50721633", "0.50475425", "0.5041361", "0.5025934", "0.50159216", "0.50107247", "0.4997678", "0.4996168", "0.49909216", "0.49752173", "0.49656138", "0.4963739", "0.49630365", "0.4955365", "0.49510106", "0.495019", "0.49477485", "0.49459168", "0.49391204", "0.4913897", "0.49135312", "0.4908926", "0.49063337", "0.490407", "0.49036103", "0.48979172", "0.489456", "0.48903477", "0.48849708", "0.48595664", "0.48426497", "0.48416573", "0.48376575", "0.48373148", "0.48332182", "0.48179016", "0.48144138", "0.48120904", "0.4806939", "0.48037848", "0.47995198", "0.47989643", "0.47983727", "0.47983727", "0.47983727", "0.47983727", "0.47983727", "0.47983727", "0.47983727", "0.47978798", "0.47942734", "0.47934693", "0.47914073", "0.47905132", "0.4787159", "0.47843474", "0.47731805", "0.47657877", "0.476219", "0.47607794", "0.4756436", "0.47524", "0.4744974", "0.47441727", "0.47438464", "0.47429454", "0.47400618", "0.47377485", "0.47373024", "0.47353604", "0.47352114", "0.4734412", "0.47266147", "0.47210196", "0.47178048", "0.4716575", "0.4712501", "0.47106364", "0.4709088", "0.4708846", "0.47064444", "0.4701153", "0.46980187", "0.46980172", "0.46904424" ]
0.54173577
3
Generate Hash to send via Request Headers String to hash YourAPIToken:CurrentDateInUTCFormat:APIActionValue:YourAPISecret
protected function generateHash($actionVerb, $timestamp) { $stringToHash = $this->token . ':' . $timestamp . ':' . $actionVerb . ':' . $this->secret; return hash("sha256", $stringToHash); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateAPIAuth()\n {\n $ts = time();\n return '&ts='.$ts.'&apikey='.getenv('PUBLIC_KEY').'&hash='.md5($ts.getenv('PRIVATE_KEY').getenv('PUBLIC_KEY'));\n }", "function apiGenerateKey( $http_method, $url, $query, $headers )\n {\n // ordered and scrubbed headers: date,content-type,content-length;\n $canonicalizedHeaders = '';\n $desiredHeaders = array('date','content-type','content-length');\n $headerData = array();\n rsort($headers);\n foreach ( $headers as $header )\n {\n $pos = strpos($header,':');\n if ( $pos )\n {\n $name = strtolower(trim(substr($header,0,$pos)));\n $value = substr($header,$pos+1);\n $headerData[$name] = trim($value);\n if ( in_array($name,$desiredHeaders) )\n {\n $canonicalizedHeaders .= $name .':'. trim(str_replace(array('\\n','\\r'),' ',$value)).\"\\n\";\n }\n }\n }\n $canonicalizedHeaders = trim($canonicalizedHeaders);\n\n // just the clean url path - JS LOGIC IS DIFF - gets up to ? OR all url - this is prob wrong on zack's part, ignoring fragment\n // js logic would include fragment if no ? is found\n $url_parts = $this->parseUrl($url);\n $canonicalizedResource = ( !empty($url_parts) && !empty($url_parts['path']) ) ? trim($url_parts['path']) : '';\n\n // array of: date,content-type,http method;\n $requestMethod = strtoupper($http_method);\n\n /// hash of the body - md5\n $hashedData = md5($query);\n $signingString = \"{$requestMethod}\\n\".\n \"{$hashedData}\\n\".\n \"{$canonicalizedHeaders}\\n\".\n \"{$canonicalizedResource}\";\n $computedHash = base64_encode(hash_hmac('md5', $signingString, $this->api['key_secret'], true ));\n\n /// share public key are our hash\n return \"{$this->api['key_public']}:{$computedHash}\";# \\n\\n header order: $h \\n\\n Signing String:\\n $signingString\";\n }", "protected function generateSignature()\n {\n // set the expire time to 5 minutes\n $expires = time() + 300;\n\n // put the parameters in a different line\n $stringToSign = $this->accessID.\"\\n\".$expires;\n\n // get the binary output of the hmac has\n $binarySignature = hash_hmac('sha1', $stringToSign, $this->secretKey, true);\n\n // Base64-encode and url-encode\n $urlSafeSignature = urlencode(base64_encode($binarySignature));\n\n return array('expires' => $expires, 'signature' => $urlSafeSignature);\n }", "function createHmacAuth($method, $path, $timestamp) {\n\tglobal $key, $secret;\n\t$str = $method . ' ' . $path . $timestamp;\n\t$hash = hash_hmac('sha1', $str, $secret);\n\treturn $key . ':' . $hash;\n}", "public function getHash(): string\n {\n return hash_hmac('sha256', $this->token, Config::SECRET_KEY);\n }", "private function generateHeader() {\n $rounds = $this->rounds;\n $flag = (($this->sha1 == true AND function_exists(\"sha1\")) ? 1 : 0) << 7;\n \n return substr(base64_encode(pack(\"N*\", $rounds | $flag << 24)), 0, 6);\n }", "protected function _generateHash()\n {\n //$formattedDateTime = $datetime->format(\"Y-m-d H:i:s\");\n $formattedDateTime = $this->udate('Y-m-d H:i:s.u T');\n $hash = $this->_getHash($formattedDateTime);\n return $hash;\n }", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "public function generateHash($input) {\n\t\treturn md5(json_encode($input));\n\t}", "protected function _genRequestKey()\n {\n $hash = sprintf(\"%u\", crc32(serialize($this->_request)));\n $this->_setLastRequestKey($hash);\n return $hash;\n }", "function createAuthHeader($method, $url) {\n $time = time()*1000;\n\n $data = \"$method $url $time\";\n $sig = sha1(\"$data {$this->secret}\");\n\n return \"Authorization: SprdAuth apiKey=\\\"{$this->key}\\\", data=\\\"{$data}\\\", sig=\\\"$sig\\\"\";\n }", "private function _generateHash($aRequest)\n {\n return hash('sha256', ($aRequest['auth_code'] . $aRequest['product'] . $aRequest['tariff'] . $aRequest['amount'] . $aRequest['test_mode'] . $aRequest['uniqid'] . strrev($this->oSession->getVariable('sNovalnetAccessKey'))));\n }", "protected function generate()\n\t{\n\t\t$hash = bin2hex( random_bytes( 16 ) );\n\n\t\t$timeHi = hexdec( substr( $hash, 12, 4 ) ) & 0x0fff;\n\t\t$timeHi &= ~( 0xf000 );\n\t\t$timeHi |= 4 << 12;\n\n\t\t$clockSeqHi = hexdec( substr( $hash, 16, 2 ) ) & 0x3f;\n\t\t$clockSeqHi &= ~( 0xc0 );\n\t\t$clockSeqHi |= 0x80;\n\n\t\t$params = [\n\t\t\tsubstr( $hash, 0, 8 ),\n\t\t\tsubstr( $hash, 8, 4 ),\n\t\t\tsprintf( '%04x', $timeHi ),\n\t\t\tsprintf( '%02x', $clockSeqHi ),\n\t\t\tsubstr( $hash, 18, 2 ),\n\t\t\tsubstr( $hash, 20, 12 )\n\t\t];\n\n\t\treturn vsprintf( '%08s-%04s-%04s-%02s%02s-%012s', $params );\n\t}", "public function generateToken()\n {\n if (empty($this->username) || empty($this->api_token)) {\n throw new \\Exception(\"Username and Api Token must be set\");\n }\n $time = time();\n return hash_hmac(\"sha256\", $this->username . \"::\" . $this->api_token . \"::\" . $time, $this->api_token);\n }", "private function _create_hash($key=''){\n\t\t$secret_key = 'gL0b3-E$sT4te'.date('m-d-y');\n\t\treturn md5($key.$secret_key);\n\t}", "function _cr_hs_generate_token() {\n $load_avg = sys_getloadavg();\n $time = time();\n $hash = hash_init('sha256');\n hash_update($hash, implode('', $load_avg));\n hash_update($hash, time());\n return hash_final($hash);\n}", "public static function generateSignature($params)\n {\n $queryParams = $params . getenv('API_KEY') . getenv('API_SECRET');\n $signature = md5($queryParams);\n\n return $signature;\n }", "function getEncodedSignature($hostName,$digestEncoded,$SS_KEY,$path)\r\n{\r\n $signatureString = \"host: \".$hostName.\"\\n(request-target): post \".$path.\"\\n\".\"digest: SHA-256=\".$digestEncoded.\"\\n\".\"v-c-merchant-id: starlock01\";\r\n $signatureByteString = utf8_encode($signatureString);\r\n $decodeKey = base64_decode($SS_KEY);\r\n $signature = base64_encode(hash_hmac(\"sha256\", $signatureByteString,\r\n $decodeKey, true));\r\n return $signature;\r\n}", "public function generateHash()\n {\n $userContext = new UserContext();\n\n foreach ($this->providers as $provider) {\n $provider->updateUserContext($userContext);\n }\n\n $parameters = $userContext->getParameters();\n\n // Sort by key (alphanumeric), as order should not make hash vary\n ksort($parameters);\n\n return hash('sha256', serialize($parameters));\n }", "public function getHash() : string {\n\t\t// sha256 = 64 characters\n\t\treturn hash_hmac('sha256', $this->token, getenv('ENCRYPTION_KEY'));\n\t}", "public function makeAuthHeader() {\r\n\t\t$this->timestamp = $this->timestamp ? $this->timestamp : $this->getEdgeGridTimestamp();\r\n\t\t$this->nonce = $this->nonce ? $this->nonce : $this->makeNonce();\r\n\r\n\t\t$auth_header = 'EG1-HMAC-SHA256 ' .\r\n\t\t\t\t'client_token=' . $this->client_token . ';' .\r\n\t\t\t\t'access_token=' . $this->access_token . ';' .\r\n\t\t\t\t'timestamp=' . $this->timestamp . ';' .\r\n\t\t\t\t'nonce=' . $this->nonce . ';';\r\n\r\n\t\t$this->verbose('auth_header', $auth_header);\r\n\r\n\t\tswitch ($this->method) {\r\n\t\t\tcase 'POST':\r\n\t\t\t\t$this->body_to_sign = $this->body;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'PUT':\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$this->body = null;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t$this->verbose('body_to_sign', $this->body_to_sign);\r\n\r\n\t\t$signed_auth_header = $auth_header . 'signature=' . $this->signRequest($auth_header);\r\n\t\t$this->verbose('signed_auth_header', $signed_auth_header);\r\n\r\n\t\treturn $signed_auth_header;\r\n\t}", "private function getSignature()\n\t{\n\t\t$string_to_sign = mb_convert_encoding(\n\t\t\t$this->http_verb . $this->uri . $this->timestamp . $this->nonce,\n\t\t\t'UTF-8'\n\t\t);\n\t\treturn base64_encode(\n\t\t\thash_hmac(\n\t\t\t\t'sha1',\n\t\t\t\t$string_to_sign,\n\t\t\t\t$this->secret,\n\t\t\t\ttrue\n\t\t\t)\n\t\t);\n\t}", "function generate_token()\n {\n $this->load->helper('security');\n $res = do_hash(time().mt_rand());\n $new_key = substr($res,0,config_item('rest_key_length'));\n return $new_key;\n }", "public function createKey()\n {\n return md5('Our-Calculator') . (time() + 60);\n }", "private function generateApiKey(){\n\n return md5(uniqid(rand(), true));\n\n }", "function onesignin_client_hash($data) {\n if (is_array($data)) {\n $data = implode(':', $data);\n }\n $hash = base64_encode(hash('sha512', $data, TRUE));\n return strtr($hash, array('+' => '-', '/' => '_', '=' => ''));\n}", "private function _gen_curl_header($str_params = '') {\n if(is_string($str_params) && trim($str_params) != ''){\n return array('AUTHORIZATION:Voxy ' . $this->_voxy_key . ':' . hash('sha256', ($this->_voxy_api_secret . $str_params)));\n } else {\n return array('AUTHORIZATION:Voxy ' . $this->_voxy_key . ':' . hash('sha256', ($this->_voxy_api_secret)));\n }\n }", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "public function generate()\n {\n\n try {\n\n //$hash = RandomHash::generate(32);\n $randomHash = new RandomHash();\n $hash = $randomHash->generate(101);\n Log::info(\"Create new hash: \".$hash);\n //return successful response\n return response()->json(['hash' => $hash], 200);\n\n } catch (Exception $e) {\n //return error message\n return response()->json(['message' => \"An error while creating hash\"], 503);\n }\n\n }", "function payment_sign($query, $api_key) {\n $clear_text = '';\n ksort($query);\n foreach ($query as $key => $value) {\n if (substr($key, 0, 2) === \"x_\") {\n $clear_text .= $key . $value;\n }\n }\n $hash = hash_hmac(\"sha256\", $clear_text, $api_key);\n return str_replace('-', '', $hash);\n }", "private static function oauth_header($URL, $method, $authorization)\n {\n $param = array();\n $DST = \"OAuth \";\n\n // For the purposes of the signature, no need for anything beyond '?'\n $tmp = explode(\"?\", $URL);\n $URL = $tmp[0];\n\n // Setup default values\n $param['oauth_timestamp'] = time();\n $param['oauth_consumer_key'] = rabkTwttr::$consumer_key;\n $param['oauth_nonce'] = base64_encode(str_shuffle(MD5(microtime())));\n $param['oauth_version'] = '1.0';\n $param['oauth_signature_method'] = 'HMAC-SHA1';\n $param['oauth_token'] = '';\n\n // Add (or overwrite) parameters with given values\n foreach($authorization as $key => $value)\n $param[$key] = $value;\n $param = array_filter($param);\n\n // ---- Sign the HTTP request ------------------------------------------\n $oauth_signature_base = \"\";\n\n $param2 = $param;\n // Step 1: Percent-encode keys and values and sort alphabetically by key\n foreach($param2 as $key => $value)\n $param2[ rawurlencode($key) ] = rawurlencode($value);\n ksort($param2);\n\n // Step 2: Create signature base\n foreach($param2 as $key => $value)\n $oauth_signature_base .= $key . '=' . $value . '&';\n $oauth_signature_base = strtoupper($method) . '&' . rawurlencode($URL) . '&' . rawurlencode(rtrim($oauth_signature_base, '&'));\n\n // Step 3: Create signing key and sign\n $oauth_signing_key = rawurlencode(rabkTwttr::$consumer_secret) . '&' . @rawurlencode($_SESSION['access_token_secret']);\n $param['oauth_signature'] = base64_encode(hash_hmac('sha1', $oauth_signature_base, $oauth_signing_key, true));\n\n // ---- Create header --------------------------------------------------\n foreach($param as $key => $value)\n if(preg_match('/oauth_/', $key))\n $DST .= rawurlencode($key) . '=\"' . rawurlencode($value) . '\", ';\n $DST = rtrim($DST, \", \");\n\n return $DST;\n }", "public static function hash($value)\n {\n return hash_hmac('sha1', $value, Config::get('app.key'));\n }", "function sign($param,$key){\n\n $sign = \"\";\n foreach($param as $k => $v){\n $sign .= $k.\"=\".$v.\"&\";\n }\n\n $sign .= \"key=\".$key;\n $sign = strtoupper(md5($sign));\n return $sign;\n\n}", "function create_token()\n {\n $secretKey = \"B1sm1LLAH1rrohmaan1rroh11m\";\n\n // Generates a random string of ten digits\n $salt = mt_rand();\n\n // Computes the signature by hashing the salt with the secret key as the key\n $signature = hash_hmac('sha256', $salt, $secretKey, false);\n // $signature = hash('md5', $salt.$secretKey);\n\n // return $signature;\n return urlsafeB64Encode($signature);\n }", "public function getHash()\n {\n return \"{$this->getPatternForUri()} [$this->_httpMethod]\";\n }", "private static function getHash($string)\n\t{\n\t\treturn base64_encode(extension_loaded('hash') ?\n\t\thash_hmac('sha1', $string, self::$__secretKey, true) : pack('H*', sha1(\n\t\t(str_pad(self::$__secretKey, 64, chr(0x00)) ^ (str_repeat(chr(0x5c), 64))) .\n\t\tpack('H*', sha1((str_pad(self::$__secretKey, 64, chr(0x00)) ^\n\t\t(str_repeat(chr(0x36), 64))) . $string)))));\n\t}", "private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }", "private function generateApiKey()\n {\n return md5(uniqid(rand(), true));\n }", "private function buildSigningBase(): string {\r\n $parameterString = http_build_query($this->clientParams);\r\n return \"$this->httpMethod&\" . urlencode($this->host . $this->endpoint) . \"&\" . urlencode($parameterString);\r\n }", "function createExtendedHash($chargetotal, $currency) {\r\n// Please change the store Id to your individual Store ID\r\n$storeId = \"8112000002241\";\r\n// NOTE: Please DO NOT hardcode the secret in that script. For example read it from a database.\r\n$sharedSecret = \"NM6ub#8|zX\";\r\n$separator = \"|\";\r\n$stringToHash = $storeId . $separator . getDateTime() . $separator . $chargetotal . $separator . $currency;\r\n$hashSHA256 = CryptoJS.HmacSHA384(hashWithAllStrings, sharedSecret);\r\n$hash = CryptoJS.enc.Base64.stringify($hashSHA256);\r\nreturn $hash;\r\n}", "protected function generateFingerprint()\n {\n $fingerprint = '';\n if(!empty($_SERVER['HTTP_USER_AGENT'])) {\n $fingerprint .= $_SERVER['HTTP_USER_AGENT'];\n }\n if(!empty($_SERVER['HTTP_ACCEPT_ENCODING'])) {\n $fingerprint .= $_SERVER['HTTP_ACCEPT_ENCODING'];\n }\n if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\n $fingerprint .= $_SERVER['HTTP_ACCEPT_LANGUAGE'];\n }\n if(empty($fingerprint)) {\n $fingerprint = 'NO FINGERPRINT AVAILABLE';\n }\n return hash('sha256', $fingerprint);\n }", "private function generateApiKey() {\n return md5(uniqid(rand(), true));\n }", "private function generateApiKey() {\n return md5(uniqid(rand(), true));\n }", "private function makeSigningKey() {\r\n\t\t$signing_key = $this->makeBase64HmacSha256($this->timestamp, $this->client_secret);\r\n\t\t$this->verbose('signing_key', $signing_key);\r\n\t\treturn $signing_key;\r\n\t}", "private function amazon_hmac($stringToSign) \n {\n // helper function binsha1 for amazon_hmac (returns binary value of sha1 hash)\n if (!function_exists('binsha1'))\n { \n if (version_compare(phpversion(), \"5.0.0\", \">=\")) { \n function binsha1($d) { return sha1($d, true); }\n } else { \n function binsha1($d) { return pack('H*', sha1($d)); }\n }\n }\n\n global $aws_secret;\n\n if (strlen($aws_secret) == 40)\n $aws_secret = $aws_secret.str_repeat(chr(0), 24);\n\n $ipad = str_repeat(chr(0x36), 64);\n $opad = str_repeat(chr(0x5c), 64);\n\n $hmac = binsha1(($aws_secret^$opad).binsha1(($aws_secret^$ipad).$stringToSign));\n return base64_encode($hmac);\n }", "public static function basic_cache_key_generator(Rest_Request $request)\n\t{\n\t\t$uri = $request->get_uri();\n\t\t$query = $request->query();\n\t\t$headers = $request->headers();\n\t\treturn sha1($uri . '?' . http_build_query($query, NULL, '&') . '~' . implode('~', $headers));\n\t}", "public function getHash() {}", "function gen_token(){\n\t\t$secretKey = \"BismILLAHirrohmaanirrohiim\";\n\n\t\t// Generates a random string of ten digits\n\t\t$salt = mt_rand();\n\n\t\t// Computes the signature by hashing the salt with the secret key as the key\n\t\t$signature = hash_hmac('sha256', $salt, $secretKey, true);\n\n\t\t// base64 encode...\n\t\t$encodedSignature = base64_encode($signature);\n\n\t\t// urlencode...\n\t\t$encodedSignature = urlencode($encodedSignature);\n\n\t\treturn $encodedSignature;\n\t}", "function apiToken($session_uid)\n{\n $key=md5('SITE_KEY'.$session_uid);\n return hash('sha256', $key);\n}", "final public function getHash() {}", "private function generateToken()\n {\n return hash('SHA256', uniqid((double) microtime() * 1000000, true));\n }", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function testManualHMAC() {\n\t\t$base_string = 'GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf'\n\t\t\t. '43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestam'\n\t\t\t. 'p%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal';\n\t\t$key = 'kd94hf93k423kf44&pfkkdhi9sl3r4s00';\n\t\t$hmac = HMAC_Test::test_manual_hmac('sha1', $base_string, $key);\n\n\t\t$this->assertEquals('tR3+Ty81lMeYAr/Fid0kMTYa/WM=', base64_encode($hmac));\n\t}", "function sri_checksum($input)\n{\n $algorithm = settings::algorithm();\n $hash = hash($algorithm, $input, true);\n $hash_base64 = base64_encode($hash);\n\n return \"$algorithm-$hash_base64\";\n}", "private function _generateSignature($params, $request_method = 'GET', $url = self::API_REST_URL)\n {\n uksort($params, 'strcmp');\n $params = self::url_encode_rfc3986($params);\n\n // Make the base string\n $base_parts = array(\n strtoupper($request_method),\n $url,\n urldecode(http_build_query($params, '', '&'))\n );\n $base_parts = self::url_encode_rfc3986($base_parts);\n $base_string = implode('&', $base_parts);\n\n // Make the key\n $key_parts = array(\n $this->_consumer_secret,\n ($this->_token_secret) ? $this->_token_secret : ''\n );\n $key_parts = self::url_encode_rfc3986($key_parts);\n $key = implode('&', $key_parts);\n\n // Generate signature\n return base64_encode(hash_hmac('sha1', $base_string, $key, true));\n }", "public function generateHash()\n {\n $this->hash = sha1(serialize($this->toArray()));\n }", "public function makeCacheHash() {}", "function wp_hash($data, $scheme = 'auth')\n {\n }", "function generate_fingerprint() \n\t{\n\t\t//We don't use the ip-adress, because it is subject to change in most cases\n// \t\tforeach(array('ACCEPT_CHARSET', 'ACCEPT_ENCODING', 'ACCEPT_LANGUAGE', 'USER_AGENT') as $name) {\n// \t\t\t$key[] = empty($_SERVER['HTTP_'. $name]) ? NULL : $_SERVER['HTTP_'. $name];\n// \t\t}\n// \t\t//Create an MD5 has and return it\n// \t\treturn md5(implode(\"\\0\", $key));\n\t\t$secure_word = 'a39ccdef11305d5999dbccddcf4';\n\t\treturn md5($secure_word.$_SERVER['HTTP_USER_AGENT']);\t\t\n\t}", "static public function getRequestString($params)\n {\n // Create token header as a JSON string\n $header = json_encode(['alg' => 'HS256', 'typ' => 'JWT']);\n\n // Encode Header to Base64Url String\n $base64UrlHeader = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($header));\n\n $payload = json_encode($params);\n\n // Encode Payload to Base64Url String\n $base64UrlPayload = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($payload));\n\n // Create Signature Hash\n $signature = hash_hmac('sha256', $base64UrlHeader . \".\" . $base64UrlPayload, getenv('AMTEL_SECRET'), true);\n\n // Encode Signature to Base64Url String\n $base64UrlSignature = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($signature));\n\n // Create JWT\n return $base64UrlHeader . \".\" . $base64UrlPayload . \".\" . $base64UrlSignature;\n }", "protected function generateUpdateToken()\n\t{\n\t\t$length = 8;\n\t\t$bytes = function_exists('random_bytes') ? random_bytes($length) : openssl_random_pseudo_bytes($length);\n\n\t\treturn substr(bin2hex($bytes), 0, $length);\n\t}", "function CreateUserHash() {\n// if (isset($_SERVER['REMOTE_ADDR'])) $remAd = $_SERVER['REMOTE_ADDR'];\n// else $remAd = NULL;\n// if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $forvFor = $_SERVER['HTTP_X_FORWARDED_FOR'];\n// else $forvFor = NULL;\n if (isset($_SERVER['HTTP_USER_AGENT']))\n $userAgent = $_SERVER['HTTP_USER_AGENT'];\n else\n $userAgent = NULL;\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n $accLang = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n else\n $accLang = NULL;\n// if (isset($_SESSION['session_id'])) $sesId = $_SESSION['session_id'];\n// else $sesId = NULL;\n // обработка локали\n if ($accLang) {\n if (is_array($accLang))\n $accLang = $accLang[0];\n $pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})' .\n '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)' .\n '(?P<quantifier>\\d\\.\\d))?$/';\n $splits = array();\n preg_match($pattern, $accLang, $splits);\n $accLang = $splits['primarytag'];\n }\n\n //echo '<br>$remAd='.$remAd.' $forvFor='.$forvFor.' $userAgent='.$userAgent.' $accLang='.$accLang;\n return md5($userAgent . $accLang);\n //return md5($remAd.$forvFor.$userAgent.$accLang.$sesId);\n }", "private static function create_hash() {\n $hash = md5( rand(0,1000) );\n return $hash;\n }", "abstract public function build_signature($request, $consumer, $token);", "abstract public function build_signature($request, $consumer, $token);", "public static function genServiceHash($url, array $queryVars = array())\n {\n $queryParams = array();\n $baseUrl = $url;\n $query = '';\n\n if (strpos('?', $url)) {\n list($baseUrl, $query) = explode('?', $url);\n }\n\n parse_str($query, $queryParams);\n\n foreach ($queryParams as $key => $value) {\n $queryVars[ mb_strtolower($key) ] = trim($value);\n }\n\n // remove default request\n unset($queryVars[\"request\"]);\n\n if (!isset($queryVars[\"service\"])) {\n $queryVars[\"service\"] = \"WMS\";\n }\n\n if (!isset($queryVars[\"version\"])) {\n $queryVars[\"version\"] = \"1.1.1\";\n }\n\n $details = parse_url($baseUrl);\n\n asort($queryVars);\n\n return md5($details['host'] . $details[\"path\"] . \"?\" . http_build_query($queryVars));\n }", "public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}", "public function getHash();", "public function getHashSignedById(): string;", "public function generateApiKey() {\n return md5(uniqid(rand(), true));\n }", "private static function signRequest($key, $secret, $method, $request_url, $bodyHash, $timestamp, $nonce)\n {\n $signature = base64_encode(hash_hmac(\"sha256\", self::normalizeRequest($key, $method, $request_url, $bodyHash, $timestamp, $nonce), $secret, True));\n return $signature;\n }", "private function _generateHash($input, $day)\n\t{\n\t\t// Add date:\n\t\t$input .= $day . date('ny');\n\n\t\t// Get MD5 and reverse it\n\t\t$enc = strrev(md5($input));\n\n\t\t// Get only a few chars out of the string\n\t\t$enc = substr($enc, 26, 1) . substr($enc, 10, 1) . substr($enc, 23, 1) . substr($enc, 3, 1) . substr($enc, 19, 1);\n\n\t\treturn $enc;\n\t}", "protected function generateHash() {\r\n\t\t$relevantData = array('company','country','firstname','lastname','jobstatus');\r\n\t\tforeach($relevantData as $relevantField) {\r\n\t\t\t$getterMethod = 'get_'. ucfirst($relevantField);\r\n\t\t\t$badgeDataString = '';\r\n\t\t\t\r\n\t\t\tif(method_exists($this, $getterMethod)) {\r\n\t\t\t\t$badgeDataString .= $this->$getterMethod();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn md5($badgeDataString);\r\n\t}", "function salt_hmac($size1=4,$size2=6) {\n$hprand = rand(4,6); $i = 0; $hpass = \"\";\nwhile ($i < $hprand) {\n$hspsrand = rand(1,2);\nif($hspsrand!=1&&$hspsrand!=2) { $hspsrand=1; }\nif($hspsrand==1) { $hpass .= chr(rand(48,57)); }\nif($hspsrand==2) { $hpass .= chr(rand(65,70)); }\n++$i; } return $hpass; }", "function _generateHash($aArgs) {\n $sPrehash = $aArgs['stwfull'] ? 'a' : 'c';\n $sPrehash .= $aArgs['stwxmax'].'x'.$aArgs['stwymax'];\n if ($aArgs['stwnrx']) {\n $sPrehash .= 'b'.$aArgs['stwnrx'].'x'.$aArgs['stwnry'];\n }\n $sPrehash .= $aArgs['stwinside'];\n\n $aReplace = array('http', 'https', 'ftp', '://');\n $sUrl = str_replace($aReplace, '', $aArgs['stwurl']);\n\n return md5($sPrehash.$aArgs['stwsize'].$aArgs['stwq'].$sUrl);\n }", "protected function setHeader()\n {\n $time = (int)time();\n\n $data = $time . config('opCache.header.key');\n\n $signature = hash_hmac('sha1', $data, config('opCache.header.secret'));\n\n return [\n config('opCache.key_column').': '.config('opCache.header.key'),\n config('opCache.signature_column') .': '. $signature,\n config('opCache.timestamp_column') .': '. $time\n ];\n }", "protected function generateHeader()\n\t{\n\t\t$header \t= [];\n\t\t$header[] \t= 'Authorization: Basic '.$this->credentials;\n\t\t$header[] \t= 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8';\n\n\t\treturn $header;\n\t}", "private function getSignature(): string {\r\n return base64_encode(hash_hmac(\"sha1\", $this->buildSigningBase(), $this->buildSigningKey(), true));\r\n }", "private static function getUrlHash() {\n $queryStr = self::getUrlQueryString();\n return strRightFrom($queryStr, '#', 1, true);\n }", "function generateCandiToken($name){\t\n\t$mydate = getdate();\n\t$token = sha1($name.\"candidate\");\n\treturn $token;\n}", "public function test_getHashIsCalled_publicKeyPrivateKeyAndTimestamp_returnHash()\n {\n $sut = new Authentication('private_key', 'public_key', 'timestamp');\n $authenticationParams = $sut->getAuthenticationUrlParams();\n $expected = '&ts=timestamp&apikey=public_key&hash=' . md5('timestamp' . 'private_key' . 'public_key');\n $this->assertEquals($expected, $authenticationParams);\n }", "public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }", "static function controlHash($mixed){\n\t\t$data = json_encode($mixed);\n\t\tif(json_last_error()!=JSON_ERROR_NONE) $data = $mixed;\n\t\treturn sha1(md5($data).APP_CONTROL_SECRET);\n\t}", "function verify_webhook($data, $hmac_header)\n{\n $calculated_hmac = base64_encode(hash_hmac('sha256', $data, SHOPIFY_APP_SECRET, true));\n return hash_equals($hmac_header, $calculated_hmac);\n}", "protected function createCanonicalRequest()\n {\n $allheaders = array_merge($this->options[\"headers\"], $this->headers);\n\n // get all parts\n $method = $this->options[\"method\"];\n $path = $this->encodePath($this->options[\"path\"]);\n $query = $this->createQueryString($this->options[\"query\"]);\n $headers = $this->createHeaderString($allheaders);\n $this->signedHeaders = $this->createSignedHeaderString($allheaders); // save to $this as it will be used later\n $body = hash($this->algo, $this->options[\"body\"]);\n\n $canonical = \"{$method}\\n{$path}\\n{$query}\\n{$headers}\\n{$this->signedHeaders}\\n{$body}\";\n\n return hash($this->algo, $canonical);\n }", "protected function calculateHash()\n {\n return md5((string)$this->toCookie());\n }", "public static function genSign($array){\n // 获取排序\n ksort($array);\n $stringA = \"\";\n foreach($array as $key => $val){\n if($val != NULL){\n $stringA = $stringA . \"$key=$val&\";\n }\n }\n $mch_key = WxAppInfo::get(1)->mch_key;\n $stringA = $stringA . \"key=$mch_key\";\n return strtoupper(md5($stringA));\n }", "public function generateActiveApiToken($validToken)\n {\n return Hash::make($validToken);\n }", "protected function create_cache_key()\n\t{\n\t\treturn hash($this->config['hash'], serialize($this->options));\n\t}", "public function createSignature($base, $key)\r\n\t{\r\n\t\tif (function_exists('hash_hmac'))\r\n\t\t{\r\n\t\t\treturn base64_encode(hash_hmac('sha1', $base, $key, true));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn base64_encode($this->hmacsha1('sha1', $base, $key));\r\n\t\t}\r\n\t}", "public function generateAuthorizationHeader($method, $url, $serviceName, $postParams=array()) {\n \n $app = Dataface_Application::getInstance();\n $baseUrl = $url;\n if (strpos($baseUrl, '?') !== false) {\n $baseUrl = substr($baseUrl, 0, strpos($baseUrl, '?'));\n }\n $queryString = substr($url, strlen($baseUrl));\n $params = array();\n foreach ($postParams as $k=>$v) {\n $params[$k] = $v;\n }\n if ($queryString) {\n if ($queryString[0] == '?') {\n $queryString = substr($queryString, 1);\n }\n parse_str($queryString, $tmpParams);\n foreach ($tmpParams as $k=>$v) {\n $params[$k] = $v;\n }\n }\n \n $serviceConfig =& $app->_conf['oauth_'.$serviceName];\n $isTokenRequest = $serviceConfig['request_token_url'] == $url;\n \n $params['oauth_consumer_key'] = $serviceConfig['client_id'];\n $params['oauth_nonce'] = md5(mt_rand());\n $params['oauth_signature_method'] = 'HMAC-SHA1';\n $params['oauth_timestamp'] = time();\n $params['oauth_version'] = '1.0';\n //print_r($_SERVER);exit;\n //print_r($_SESSION);\n $oauthToken = $this->getOauthToken($serviceName);\n if (!isset($params['oauth_token']) and isset($oauthToken) and !$isTokenRequest) {\n $params['oauth_token'] = $oauthToken;\n }\n \n $tmp = array();\n foreach ($params as $k=>$v) {\n $tmp[rawurlencode($k)] = rawurlencode($v);\n }\n $params = $tmp;\n ksort($params);\n \n $paramString = '';\n $first = true;\n foreach ($params as $k=>$v) {\n if ($first) {\n $first = false;\n } else {\n $paramString .= '&';\n }\n $paramString .= $k . '=' . $v;\n }\n $baseUrl = $url;\n if (strpos($url, '?') !== false) {\n $baseUrl = substr($url, 0, strpos($url, '?'));\n }\n $signatureBase = strtoupper($method).'&'.rawurlencode($baseUrl).'&'.rawurlencode($paramString);\n //echo \"Signature base: \".$signatureBase;exit;\n $signingKey = rawurlencode($serviceConfig['client_secret']).'&';\n $tokenSecret = $this->getOauthTokenSecret($serviceName);\n if (isset($tokenSecret) and !$isTokenRequest) {\n $signingKey .= rawurlencode($tokenSecret);\n }\n //echo \"<br>Signing Key: \".$signingKey;exit;\n $signature = base64_encode(hash_hmac(\"sha1\", $signatureBase, $signingKey, true));\n //echo \"<br>Signature \".$signature;exit;\n $oauth_keys = array(\n 'oauth_consumer_key', 'oauth_nonce', 'oauth_signature_method', 'oauth_timestamp', 'oauth_token', 'oauth_version', 'oauth_callback'\n );\n \n $auth_params = array();\n foreach ($oauth_keys as $k) {\n if (isset($params[$k])) {\n $auth_params[$k] = $params[$k];\n }\n }\n $auth_params['oauth_signature'] = rawurlencode($signature);\n \n $DST = 'OAuth ';\n $first = true;\n foreach ($auth_params as $k=>$v) {\n if ($first) {\n $first = false;\n } else {\n $DST .= ', ';\n }\n $DST .= $k.'=\"'.$v.'\"';\n }\n //echo $DST;exit;\n return $DST;\n \n \n }", "public function hash(): string;", "protected function createToken()\n {\n $currentServerIp = $this->request->server('SERVER_ADDR');\n\n $secretKey = $this->config['doublespark_contaobridge_secret_key'];\n\n return md5('phpbbbridge'.date('d/m/Y').$currentServerIp.$secretKey);\n }", "function buildHostRequest() {\r\n\t\t$strRequest = \"\";\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->amt ) > 0) {\r\n\t\t\t\t$strRequest .= \"amt=\" . $this->amt . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->action ) > 0) {\r\n\t\t\t\t$strRequest .= \"action=\" . $this->action . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->responseURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"responseURL=\" . $this->responseURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->errorURL ) > 0) {\r\n\t\t\t\t$strRequest .= \"errorURL=\" . $this->errorURL . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->trackId ) > 0) {\r\n\t\t\t\t$strRequest .= \"trackid=\" . $this->trackId . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf1 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf1=\" . $this->udf1 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf2 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf2=\" . $this->udf2 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf3 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf3=\" . $this->udf3 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf4 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf4=\" . $this->udf4 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf5 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf5=\" . $this->udf5 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf6 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf6=\" . $this->udf6 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf7 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf7=\" . $this->udf7 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf8 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf8=\" . $this->udf8 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf9 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf9=\" . $this->udf9 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf10 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf10=\" . $this->udf10 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf11 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf11=\" . $this->udf11 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf12 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf12=\" . $this->udf12 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf13 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf13=\" . $this->udf13 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf14 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf14=\" . $this->udf14 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf15 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf15=\" . $this->udf15 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf16 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf16=\" . $this->udf16 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf17 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf17=\" . $this->udf17 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf18 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf18=\" . $this->udf18 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf19 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf19=\" . $this->udf19 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf20 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf20=\" . $this->udf20 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf21 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf21=\" . $this->udf21 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf22 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf22=\" . $this->udf22 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf23 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf23=\" . $this->udf23 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf24 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf24=\" . $this->udf24 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf25 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf25=\" . $this->udf25 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf26 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf26=\" . $this->udf26 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf27 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf27=\" . $this->udf27 . \"&\";\r\n\t\t\t}\r\n\t\t\tif (strlen ( $this->udf28 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf28=\" . $this->udf28 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf29 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf29=\" . $this->udf29 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf30 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf30=\" . $this->udf30 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf31 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf31=\" . $this->udf31 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->udf32 ) > 0) {\r\n\t\t\t\t$strRequest .= \"udf32=\" . $this->udf32 . \"&\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (strlen ( $this->currency ) > 0) {\r\n\t\t\t\t$strRequest .= \"currencycode=\" . $this->currency . \"&\";\r\n\t\t\t}\r\n\t\t\tif ($this->language != null && strlen ( $this->language ) > 0) {\r\n\t\t\t\t$strRequest .= \"langid=\" . $this->language . \"&\";\r\n\t\t\t}\r\n\t\t\treturn $strRequest;\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t/*\r\n\t\t * finally{\r\n\t\t * $strRequest = null;\r\n\t\t * }\r\n\t\t */\r\n\t}", "function timehash ($post_id,$timestamp) {\r\n\t// Make a hash out of stuff that shouldn't change between requests\r\n\treturn md5(get_option('cf_salt').$post_id.date('yzH',$timestamp).$_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']);\r\n}", "public static function generateParamsHashKey($params): string\n {\n return md5(serialize($params));\n }", "public function url_call_generator($cgi_values,$md5_hash) \n\t{\n \t$output = 'http://api.issuu.com/1_0';\n \t$output .= $cgi_values.'&signature='.$md5_hash;\n\n \treturn $output;\n\t}", "public function calculateHash()\n {\n return hash(\"sha512\", $this->index.$this->previousHash.$this->timestamp.((string)$this->data).$this->nonce);\n }" ]
[ "0.67492115", "0.66450167", "0.632441", "0.6276922", "0.6161643", "0.6136154", "0.61314887", "0.60488755", "0.594551", "0.5944946", "0.59313273", "0.5909808", "0.5879961", "0.585834", "0.5826071", "0.5821901", "0.5813614", "0.5765507", "0.5716442", "0.5716295", "0.5703858", "0.5701591", "0.56977236", "0.56848246", "0.5642233", "0.5640869", "0.56329393", "0.56277287", "0.5626752", "0.56266296", "0.56069064", "0.5599865", "0.55946976", "0.55868953", "0.5585413", "0.55839735", "0.5564353", "0.5564353", "0.55590594", "0.5553765", "0.5546548", "0.55373204", "0.55373204", "0.5533544", "0.55292934", "0.55199224", "0.55142796", "0.5502455", "0.5493782", "0.5478151", "0.54769355", "0.54669076", "0.54669076", "0.54669076", "0.54669076", "0.5459441", "0.54483575", "0.54421276", "0.54401165", "0.542753", "0.5419921", "0.5408907", "0.5408069", "0.5407454", "0.5401023", "0.54004973", "0.53927773", "0.53927773", "0.5390898", "0.5389123", "0.53851473", "0.53848463", "0.5371917", "0.53679985", "0.5364495", "0.53623164", "0.53619444", "0.5359929", "0.53594685", "0.53584564", "0.53490883", "0.53476113", "0.5341906", "0.53321445", "0.53286177", "0.53193545", "0.5311691", "0.530851", "0.5291216", "0.52871835", "0.527976", "0.527915", "0.527788", "0.52716154", "0.52686405", "0.5268075", "0.526766", "0.52645063", "0.52625126", "0.5253373", "0.5250985" ]
0.0
-1
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('ALTER TABLE clients ADD FOREIGN KEY (cp) REFERENCES evaluations(id)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n\t{\n Laravel\\Database\\Schema::create(\"orbs\", function($table){\n $table->increments(\"id\");\n $table->string(\"name\");\n $table->string(\"description\");\n $table->integer(\"coins\");\n $table->integer(\"points\");\n $table->integer(\"min_level\");\n $table->integer(\"max_level\");\n $table->integer(\"owner_character\");\n $table->integer(\"acquisition_time\");\n $table->integer(\"last_attacker\");\n $table->integer(\"last_attack_time\");\n $table->string(\"image\");\n });\n\t}" ]
[ "0.80062366", "0.79145443", "0.79145443", "0.79145443", "0.7572342", "0.756089", "0.75283176", "0.7498379", "0.7493237", "0.7453656", "0.74463314", "0.7433381", "0.74307704", "0.7427088", "0.741794", "0.73779047", "0.7374933", "0.7370453", "0.73637444", "0.73505706", "0.7329024", "0.7313519", "0.7298817", "0.72950184", "0.72917736", "0.7291469", "0.72913444", "0.72849613", "0.72839737", "0.7272078", "0.7271878", "0.72659117", "0.7262893", "0.7261672", "0.7256839", "0.72505474", "0.7249633", "0.72441125", "0.724062", "0.72376186", "0.7218244", "0.72177947", "0.72046006", "0.7203395", "0.7196059", "0.7191219", "0.7189963", "0.7177052", "0.71761394", "0.7167738", "0.7164105", "0.7164105", "0.7159096", "0.7147647", "0.7136521", "0.7129768", "0.7124664", "0.7123368", "0.71168584", "0.7104628", "0.7104628", "0.7104618", "0.7097006", "0.70931643", "0.70886755", "0.7087018", "0.7086326", "0.70830804", "0.70829463", "0.70780045", "0.70702124", "0.70690626", "0.7066111", "0.7062268", "0.7058938", "0.705882", "0.70556235", "0.70549136", "0.7054758", "0.70498437", "0.70483595", "0.7047308", "0.7045881", "0.70445794", "0.7043173", "0.703882", "0.7038126", "0.703674", "0.7033728", "0.7032356", "0.7031423", "0.70257956", "0.70142514", "0.70101255", "0.7006208", "0.6988486", "0.6984963", "0.69629973", "0.69612974", "0.69587934", "0.6957519" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE composer (id INT AUTO_INCREMENT NOT NULL, id_eleve INT NOT NULL, id_salle INT NOT NULL, id_formateur INT NOT NULL, id_materiel INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('CREATE TABLE evaluer (id INT AUTO_INCREMENT NOT NULL, id_formateur INT NOT NULL, id_eleve INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('CREATE TABLE lier (id INT AUTO_INCREMENT NOT NULL, libelle VARCHAR(255) NOT NULL COLLATE utf8mb4_unicode_ci, nb INT NOT NULL, prix INT NOT NULL, id_commande INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('CREATE TABLE passer (id INT AUTO_INCREMENT NOT NULL, id_client INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); $this->addSql('CREATE TABLE proposer (id INT AUTO_INCREMENT NOT NULL, id_catalogue INT NOT NULL, id_formation INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB COMMENT = \'\' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
Lists all Users fileds exclude token and pass.
public function fields() { $fields = parent::fields(); // unset secret fileds from responce from server unset($fields['pass'], $fields['token']); return $fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listUsers($fields = null);", "public function index()\n {\n return User::where([['id' ,'!=', JWTAuth::parseToken()->toUser()->id]])->get();\n }", "public function getUsersList()\n {\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function admin_user_list() {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array('User.created' => 'desc' ),\n 'conditions' => array('User.status' => 1),\n );\n $data = $this->paginate('User');\n $this->set('user', $data);\n $this->render('/Users/user_list');\n }", "public function listUser() {\n\t\t$users = new Model_Users();\n\t\t$listeUsers = $users->listUsers();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/liste_users.php\");\n\t}", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}", "public function index_get()\n {\n $response = $this->UserM->all_user();\n $this->response($response);\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function index()\n {\n $this->user_list();\n }", "public function user_lists(){\n return get_instance()->ecl('Instance')->mod('lists', 'user_lists', [get_instance()->ecl('Instance')->user(),'email']);\n }", "public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}", "public function allUsers()\n {\n $users = $this->user->findAll();\n $this->show('admin/allusers', ['users' => $users]);\n }", "public function index()\n {\n $users = User::all()->except(Auth::id());\n return view('admin.users.index', compact('users'));\n }", "function listUsers() {\n return $this->users;\n }", "public static function listUsers()\n {\n //Init curl\n $curl = new curl\\Curl();\n\n // GET request to api\n $response = $curl->get(Yii::$app->params['listUsers']);\n\n $records = json_decode($response, true);\n\n foreach($records as $users){\n foreach($users as $user){\n $list[$user['id']] = $user['name'] . ' ' . $user['last_name'];\n }\n }\n\n return $list;\n }", "public function all_londontec_users(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/viewusers';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'londontec LMS users lists',\n\t\t\t'userslist' => $this->setting_model->Get_All('londontec_users'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function index()\n {\n $this->userlist();\n }", "function wfSpecialListusers( $par = null ) {\n\tglobal $wgRequest;\n\n\tlist( $limit, $offset ) = wfCheckLimits();\n\n\n\t$slu = new ListUsersPage();\n\t\n\t/**\n\t * Get some parameters\n\t */\n\t$groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' );\n\t$slu->requestedGroup = $groupTarget;\n\t$slu->requestedUser = $wgRequest->getVal('username');\n\n\treturn $slu->doQuery( $offset, $limit );\n}", "public function listofUser()\n {\n return view('Admin.ShowallUser');\n }", "function index() {\n $url = base_url() . \"index.php/users\";\n $total_records = count($this->musers->get_users());\n $config = $this->paginate($url, $total_records);\n $this->pagination->initialize($config);\n $data = $this->get_videos();\n $data['sys_users'] = $this->musers->get_users($config['per_page'], $this->uri->segment(3));\n $this->template->load('default', 'listUsers', $data);\n }", "public function users_list()\n \t{\t\n \t\t$all_users_details = User::where(['deleted' => '0'])->orderBy('id','DESC')->get();\n // print_r($all_users_details);die;\n \t\treturn view('Admin.Users.users_list',compact('all_users_details'));\n \t}", "public function getList() {\n\t\t$this->request = array('uri' => array('path' => 'users.json'));\n\n\t\treturn $this->find('all');\n\t}", "public function index()\n {\n return $this->user->all();\n }", "public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }", "public function getUsers()\n {\n if (!is_null($this->db)) {\n $users = $this->db->getUsers();\n foreach ($users as $user) {\n $this->users[$user->name] = $user->password;\n }\n }\n return array_map(function($v) {\n return \"hidden\";\n }, $this->users);\n }", "public function index()\n { \n $data['getUserList']=User::where('role','!=','1')->get(); \n return view('auth::users')->with($data);\n }", "public function index() {\n \t$users = User::all()->except(Auth::user()->id);\n\n\t return view('users', compact('users'));\n }", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "public function listUsers() {\n\t\t$users = Common::loadJSON(\"users\");\n\t\t$temp = array();\n\n\t\t//Remove the user in session.\n\t\tforeach ($users as $username => $data) {\n\t\t\tif ($username == $this->activeUser) continue;\n\t\t\t$temp[] = $username;\n\t\t}\n\n\t\treturn $temp;\n\t}", "public function listUsers()\n {\n $users = $this->apiHeaderNav();\n return view('user.userListAll',['data'=>$users]);\n }", "static function getAllUsers(){\n $users = User::where('email','<>','admin')->paginate(4);\n\n if(count($users) != 0){\n return view('partials.adminUsersList')->with('users',$users);\n } else {\n echo \"Aún no hay usuarios registrados.\";\n }\n\n }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function userLists()\n {\n\n try {\n if (isset($_REQUEST['AuthToken'])) {\n $AuthToken = $_REQUEST['AuthToken'];\n } else {\n $AuthToken = '';\n }\n if (!Master::check_master_token($AuthToken)) {\n return response([\n 'message' => \"Token Expired\",\n 'status' => 'TokenExpired'\n ], 400);\n }\n\n $offset = ($_GET['page'] - 1) * $_GET['per_page'];\n $sort_field = (isset($_GET['sort_field'])) ? $_GET['sort_field'] : \"id\";\n $sort_order = (isset($_GET['sort_order'])) ? $_GET['sort_order'] : \"desc\";\n\n $data = array();\n $data_count = 0;\n\n if (Schema::hasTable('admin_users')) {\n $sql = DB::table('admin_users');\n //search conditions\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $sql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data = $sql->offset($offset)->limit($_GET['per_page'])->orderBy($sort_field, $sort_order)->get();\n\n //count of total tasks\n $csql = DB::table('admin_users');\n //search conditions for count\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $csql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data_count = $csql->count();\n }\n\n //response\n return response([\n 'message' => \"\",\n 'pgData' => $data,\n 'totalRows' => $data_count,\n ], 200);\n } catch (Exception $e) {\n return response([\n 'message' => $e->getMessage()\n ], 400);\n }\n }", "public function getUserList(): array {\n\t\t$sql = 'SELECT u.id, u.login, u.mail, r.name role FROM users u\n\t\t\t\tINNER JOIN roles r ON u.role = r.id\n\t\t\t\tWHERE u.login != :mylogin';\n\n\t\treturn $this->queryRows($sql, ['mylogin' => $_SESSION['user']['login']]);\n\t}", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function index()\n\t{\n\t\t// $users = $this->userRepo->getPaginatedWhere(3, 'disabled', 1);\n\n\t\t$users = $this->userRepo->getUserIndex(Input::all());\n\n\t\treturn View::make('user.index')->with('users', $users);\n\t}", "public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }", "public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}", "public function getList()\n\t{\n\t\t//\n\t\t$user = Auth::user();\n\t\t\n\t\t$disableChange = DEFAULT_0;\n\t\t$headerShop = AuthController::checkUserURL();\n\t\tif ( empty($headerShop) ) {\n\t\t\treturn View::make('admin.manage.user.user', compact('user', 'disableChange'));\n\t\t} else {\n\t\t\treturn View::make('admin.manage.user.user', compact('headerShop', 'user', 'disableChange'));\n\t\t}\n\t}", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }", "public static function listUser()\n {\n $self = new self();\n\n $where = '';\n $limit = self::LIMIT;\n\n\n $search = isset($_GET['search']) ? $_GET['search'] : '';\n\n $page = (isset($_GET['page']) && $_GET['page'] >= 0) ?\n (int)$_GET['page'] : 1;\n\n if ($search != '')\n $where .= \" WHERE name LIKE '%$search%' \";\n\n $from = ($page == 1) ? 1 : ($page - 1) * $limit;\n\n $sql = \"SELECT * FROM user \" . $where . \" ORDER BY id DESC LIMIT $from, $limit\";\n\n $result = $self->db->query($sql);\n $result = $result->fetchAll();\n\n $countSql = \"SELECT count(*) FROM user \" . $where;\n\n $resultCount = $self->db->query($countSql);\n $resultCount = $resultCount->count();\n\n return [\n 'items' => $result,\n 'current_page' => $page,\n 'limit' => $limit,\n 'total' => $resultCount,\n 'keysearch' => $search,\n 'from' => $from\n ];\n }", "public function getUserList($limit = 0) {\n $params = array_merge([\n 'token' => $this->bot_token,\n 'pretty' => true,\n ]);\n\n return $this->get($params, 'users.list');\n }", "public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}", "public function list ()\n {\n if (User::isLoggedIn() && User::getLoggedInUser()->is_admin === true) {\n\n // Alle User aus der DB laden\n $users = User::all();\n\n // Passenden View laden und User übergeben\n View::load('admin/users', [\n 'users' => $users\n ]);\n } else {\n \n // Wenn kein User eingeloggt ist, dann leider wir auf die Login Seite \n header(\"Location: login\");\n }\n }", "function get_users()\n {\n //Unimplemented\n }", "public function users_list() {\n return response()->json(User::latest()->get());\n }", "public function getUserList() {\n return $this->users;\n }", "public function index()\n {\n\n return User::with('roles')->get()->transform(function($value,$key){\n unset($value->api_token);\n return $value;\n });\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "public function viewAll($params){\n $token = $this->require_authentication();\n\n if ($token == null) {\n $this->error404($params[0]);\n return;\n }\n $db = $this->getDBConn();\n\n // Fetch the user list\n $users = User::fetchAll($db);\n $currUser = $token->getUser();\n $follow = new Following();\n if ($users == null) {\n $this->addFlashMessage(\"Unable to fetch users: Unknown Error\", self::FLASH_LEVEL_SERVER_ERR);\n $this->redirect('/');\n }\n\n\n include_once \"app/views/user/users.phtml\";\n }", "public function route_userlist(array $args) {\n\t\tif (!self::$ctrl->get_user_data())\n\t\t\treturn self::$core::pj([Error::USER_NOT_LOGGED_IN], 401);\n\t\treturn self::$core::pj(\n\t\t\tself::$manage->list($args['get']), 403);\n\t}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public static function all() {\n try {\n $db = Database::getInstance();\n $sql = \"SELECT username, is_admin, token, token_expiration FROM `User`\";\n $stmt = $db->prepare($sql);\n $stmt->execute();\n \n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function usersList()\n {\n // hacer query a la DB para pedir los users \n // DB -> USER -> Compact (users) \n $users = User::all() ;\n //dd($users);\n return View('userList', compact(['users']));\n \n\n }", "public function userList() \n { \n $user = User::get(); \n return response([ 'data' => ToArray::collection($user), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "public static function getUsersLists(){\n \t$data = Doctrine_Query::create()\n \t// ->distinct('u.DeviceToken')\n \t->select(\"u.firstName, u.DeviceToken\")\n \t->from(\"User u\")\n \t->where('u.deleted=0')\n \t->andWhere(\"u.roleId=2\")\n \t->andWhere('u.DeviceToken!= \"NULL\"')\n\t->andWhere(\"u.DeviceToken!= '(null)'\")\n \t->andWhere('u.DeviceToken!=\"\"')\n \t->groupBy('u.DeviceToken')\n \t//->getSqlQuery();\n\t->fetchArray();\n \t\n return $data;\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public function getAllUser(){\n return $this->users;\n }", "public function actionIndex()\n {\n $request = Yii::$app->request;\n\n $params = ArrayHelper::merge($request->get(), [\n 'perPage' => $request->get('perPage', Yii::$app->params['per_pages'][0]),\n 'orderCol' => $request->get('orderCol', 'id'),\n 'orderDir' => $request->get('orderDir', 'asc')\n ]);\n\n $pageTitle = Yii::t('app', 'List of users');\n\n $breadcrumbs = [\n ['url' => ['/admin'], 'label' => Yii::t('app', 'Admin panel'), ],\n ['url' => ['/admin/user/list'], 'label' => $pageTitle, 'class' => 'active']\n ];\n\n $data = User::getList($params);\n\n return $this->render('/admin/user/list.twig', [\n 'params' => $params,\n 'pages' => $data['pages'],\n 'users' => $data['models'],\n 'pageTitle' => $pageTitle,\n 'breadcrumbs' => $breadcrumbs,\n ]);\n }", "public function indexAdmin ()\n {\n $listOfUsers = $this->userRequest->usersIndexForAdmin();\n return $listOfUsers;\n }", "public function listUsers() {\n \t$data['users'] = User::all();\n \treturn view('backend.users.index', $data);\n }", "public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}", "public function getAllUsers($parameters = array());", "function userslist(){\n\t\t\tif(!Auth::check()){\n\t\t\t\tReturn Redirect::to('login');\n\t\t\t}\n\t\t\t$users = AdminUser::where('user_role_id',0)->orderBy('id','desc')->get();\n\t\t\treturn view('admin.pages.users.index', ['records' => $users]);\n\t\t}", "public function indexAction(){\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $perpage = 2;\n $count = \\R::count('user');\n $pagination = new Pagination($page, $perpage, $count);\n $start = $pagination->getStart();\n $users = \\R::findAll('user', \"LIMIT $start, $perpage\");\n\n $this->setMeta('All users');\n $this->setData(compact('users', 'pagination', 'count'));\n }", "public function user_list()\n {\n \n \t$users = User::all();\n\n $data = array('users' => $users);\n\n return view('manage.user_list')->with($data);;\n }", "public function index()\n {\n // show list user\n }", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "public function index()\n {\n\n return User::all();\n }", "public function showAllUsers()\n {\n // añadir condicion de if para admins y clients\n $tipo = request()->get('tipo');\n if (isset($tipo))\n {\n if ($tipo == 'administradores') {\n $users = User::all()->where('is_admin', 1);\n } else {\n $users = User::all()->where('is_admin', 0);\n }\n } else {\n $users = User::all();\n }\n return view('users.list', compact('users'));\n }", "public function index()\n {\n $users = User::all();\n }", "public function showListAction() {\n $users = $this->getDoctrine()\n ->getRepository(User::class)\n ->findAll();\n return $this->render(':Security\\User:users.html.twig', [\n 'users' => $users\n ]);\n }", "function users($limit = 20) {\n $this->auth(SUPPORT_ADM_LEVEL);\n $this->load->view('admin/support/v_list_users');\n }", "public function getUserList() {\n $users = DB::select(\"select * from users\");\n $count = DB::table(\"users\") -> count();\n $data = [];\n foreach ($users as $user) {\n array_push($data, array(\n \"id\" => $user -> id,\n \"role\" => ($user -> role == 0)?\"Inactive\":($user -> role == 1?\"Active\":'[ Admin ]'),\n \"fname\" => $user -> fname,\n \"lname\" => $user -> lname,\n \"affiliation\" => $user -> affiliation,\n \"email\" => $user -> email,\n \"created_at\" => $user -> created_at,));\n };\n return array(\"code\" => 0, \"msg\" => \"\", \"count\" => $count, \"data\" => $data);\n }", "public function getUsersListAttribute()\n {\n return User::orderBy('name')->get();\n }", "public function get_users()\n\t{\n\t\t$sql=\"SELECT * FROM waf_users WHERE 1=1\";\n\t\t$result=$this->db->LIST_Q($sql);\n\t\treturn $result;\n\t}", "public function index() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$this->User->recursive = 0;\n\t\t$this->set('users', $this->paginate());\n\t\t$this->set('userId', $user['User']['id']);\n\t\t$this->set('userType', $user['User']['type']);\n\t}", "public function index()\n {\n return User::all(['id','name','email','created_at','updated_at']);\n }", "public function index()\n {\n return User::all();\n }", "public function index()\n {\n return User::all();\n }", "public function index()\n {\n return User::all();\n }", "public function index()\n {\n return User::all();\n }", "public function index()\n {\n return User::all();\n }", "public function index()\n {\n return User::all();\n }", "public function index()\n {\n return User::all();\n }", "public function index()\n {\n return User::all();\n }", "public function userList(){\n $this->db->select(\"ui.user_id,\n CONCAT(ui.lname, ', ' ,ui.fname, ' ', ui.mname) name, u.user_type,\n ui.fname f_name,ui.lname l_name, ui.mname m_name , ui.email, \n u.username, u.password, uat.article_type_id, at.type article_type\n \")\n ->from(\"tbl_user_info ui\")\n ->join(\"tbl_user u\",\"ON u.id = ui.user_id\",\"inner\")\n ->join(\"tbl_user_article_type uat\",\"ON uat.user_id = ui.user_id\",\"left\")\n ->join(\"tbl_article_type at\",\"ON at.id = uat.article_type_id\",\"left\");\n $this->db->where(\"u.status\", \"saved\");\n $this->db->order_by(\"ui.lname\");\n $query = $this->db->get();\n \n foreach($query->result() as $each){\n $each->password = $this->encryptpass->pass_crypt($each->password, 'd');\n }\n\n return $query->result();\n }", "public function index()\n {\n\n\n $list = users::where('status', '!=', '2')\n ->paginate(10);\n // dd($list);\n // ->get();\n $data = [\n 'pagename' => $this->pagename,\n 'route' => $this->route,\n 'list' => $list\n ];\n return view('backend.user.list', $data);\n }", "function getUsers(){\n }" ]
[ "0.72395873", "0.71046424", "0.70753527", "0.70731527", "0.69113433", "0.6899771", "0.68216395", "0.67829466", "0.67573076", "0.671585", "0.6709147", "0.6706507", "0.67060643", "0.66968596", "0.6685866", "0.6677646", "0.66743845", "0.6670111", "0.6657667", "0.66421187", "0.66253537", "0.6614522", "0.6574015", "0.6571305", "0.65644515", "0.6553635", "0.65466845", "0.6544553", "0.6542476", "0.65400755", "0.65333045", "0.65263695", "0.6517555", "0.6506791", "0.65065104", "0.649894", "0.6495209", "0.649303", "0.64892936", "0.6483982", "0.64794755", "0.64789534", "0.6478548", "0.64704835", "0.6451633", "0.6451458", "0.64434", "0.6438174", "0.6435924", "0.6429212", "0.64287317", "0.6427218", "0.6427191", "0.6404937", "0.6402149", "0.6400758", "0.6397974", "0.638946", "0.6386807", "0.63847494", "0.6384432", "0.638432", "0.638432", "0.638432", "0.6376995", "0.63742584", "0.63708955", "0.63699406", "0.6367753", "0.63639456", "0.6358422", "0.635819", "0.63542366", "0.6345913", "0.63407964", "0.6340107", "0.6339528", "0.6334493", "0.63195044", "0.6318933", "0.63097006", "0.630808", "0.63058466", "0.6303034", "0.6300398", "0.62994635", "0.6291738", "0.6288697", "0.6284382", "0.62825865", "0.62790626", "0.62790626", "0.62790626", "0.62790626", "0.62790626", "0.62790626", "0.62790626", "0.62790626", "0.6278806", "0.6275583", "0.627357" ]
0.0
-1
return $this>getAuthKey() === $authKey;
public function validateAuthKey($authKey): bool { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isAuth() {}", "public function getAuthKey(){\n\t\treturn $this->authKey;\n\t}", "function aCAuth($r)\t{\n\t\tif ($this->authCode && !strcmp($this->authCode,$this->authCode($r)))\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function getAuthKey()\n {\n }", "public function getAuthKey()\n {\n }", "public function getAuthKey()\n {\n }", "public function getAuthKey()\n {\n }", "public function getAuthKey()\n {}", "public function validateAuthKey($authKey): bool;", "public function isAuth();", "public function getAuthKey()\n {\n return $this->auth_key;\n }", "public function getAuthKey()\n {\n return $this->auth_key;\n }", "public function getAuthKey()\n {\n return $this->authKey;\n }", "public function isAuthenticated() : bool;", "protected function authenticate()\n\t{\n\t\t$config = $this->getConfig();\n\n\t\tif(empty($config->api->auth->username) && empty($config->api->auth->password))\n\t\t\treturn true;\n\n\t\t$key = $this->getRequest()->getPost('key');\n\t\t$serviceKey = md5($config->api->auth->username . ':' . $config->api->auth->password);\n\t\tif($key && $key == $serviceKey)\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public function getAuthKey() {\n return $this->auth_key;\n }", "public function isAuthenticated() {\n\t}", "public function validateAuthKey($authKey){\n }", "public function isAuthenticated() {return $this->isauthenticated;}", "function authenticated() {\n return $_SESSION['auth'] == md5(config('security.password.hash') . $_SESSION['user']['id']);\n}", "public function checkAuth();", "public function checkAuth();", "function check_auth_key($auth_key)\n\t{\n\t\t$sql = \"\n\t\t\t\tSELECT *\n\t\t\t\tFROM users\n\t\t\t\tWHERE auth_key = '$auth_key'\n\t\t\t\tLIMIT 1\n\t\t\t\";\n\t\t$dbdata = $this->conn->prepare($sql);\n\t\t$dbdata->execute();\n\n\t\treturn $dbdata->fetchObject();\n\t}", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "public function validateAuthKey($authKey)\n {\n return $authKey === $this->getAuthKey();\n }", "function getAuth() {\n parent::getAuth(); // load company!\n $au = $this->getAuthUser();\n if (!$au) {\n $this->jerr(\"Not authenticated\", array('authFailure' => true));\n }\n if ($au->company()->comptype != 'OWNER') {\n $this->jerr(\"Permission Denied\" );\n }\n $this->authUser = $au;\n return true;\n }", "public function isAuth() {\n\t\tif($this->auth === null) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn true;\n\t\t}\n\t}", "public function authentic()\n {\n return $this->authentic === true;\n }", "public function isAuthenticated(){\n return $this->authenticated;\n }", "private function needs_auth($key) {\r\n $needs_auth = (phpsaaswrapper()->needs_auth($key) == 'true') ? true : false;\r\n if($needs_auth) {\r\n return true;\r\n }\r\n return false;\r\n }", "public function isAuth()\n {\n return !empty($this->getAuth());\n }", "function auth()\n\t{\n\t\t$_aok_ = $_COOKIE['_aok_'];\n\t\tif (isset($_aok_))\n\t\t{\n\t\t\t$query = mysql_query(\"SELECT sessionId FROM auth WHERE sessionId = '$_aok_'\");\n\t\t\tif (mysql_num_rows($query) > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isAuthenticated()\r\n {\r\n return true; \r\n }", "public function getAuthKey()\n {\n // TODO: Implement getAuthKey() method.\n }", "public function getAuthKey()\n {\n // TODO: Implement getAuthKey() method.\n }", "public function getAuthKey()\n {\n // TODO: Implement getAuthKey() method.\n }", "public function validateAuthKey($authKey) {\n return $this->getAuthKey() === $authKey;\n }", "public function IsAuthenticated()\n {\n $acronym = isset($_SESSION['user']) ? $_SESSION['user']->acronym : null;\n\n if($acronym) \n {\n $this->IsAuthenticated = true;\n }\n else \n {\n $this->IsAuthenticated = false;\n }\n \n return $this->IsAuthenticated;\n }", "public static function getAuth()\n {\n if( !isset($_SESSION['FOXY_userid']) ) {\n return false;\n }\n return true;\n }", "public function is_user_auth(){\n if($this->user_id==auth()->user()->id){\n return true;\n }else{\n return false;\n }\n }", "function isAuth()\n {\n $db = $this->getDatabaseConnection();\n $sesPrefix = $db->dsn['database'];\n if (empty($_SERVER['PHP_AUTH_USER'])) {\n @session_start();\n }\n if (!empty($_SESSION[__CLASS__][$sesPrefix .'-auth'])) {\n // in session...\n $a = unserialize($_SESSION[__CLASS__][$sesPrefix .'-auth']);\n $u = DB_DataObject::factory('core_company');\n if ($u->get($a->id)) { //&& strlen($u->passwd)) {\n return true;\n }\n $_SESSION[__CLASS__][$sesPrefix .'-auth'] = '';\n \n }\n // not in session or not matched...\n \n \n return false;\n \n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function hasKey(){\n return $this->_has(1);\n }", "public function getAuthKey()\n {\n // TODO: Implement getAuthKey() method.\n return $this->auth_key;\n }", "public function isAuthenticated(): bool;", "public function isAuthenticated(): bool;", "private function check_auth() {\n if (empty($this->user_id) || empty($this->privatekey)) {\n $this->send_error('AUTH_FAIL');\n exit;\n } elseif ($this->users_model->validate_privatekey($this->user_id, $this->privatekey)) {\n return true;\n }\n }", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "public function getTokenAuth()\n {\n \treturn $this->_token_auth;\n }", "public static function hasAuth() {\n\t\treturn (self::$__accessKey !== null && self::$__secretKey !== null);\n\t}", "static function tokenGatekeeper() {\n $token = getInput(\"token\");\n $session_token = Cache::get(\"token\", \"session\");\n if ($token == $session_token) {\n return true;\n }\n return false;\n }", "private function isAuth()\n\t{\n\t\treturn $this->session->userdata('auth') ? true : false;\n\t}", "public function validateAuthKey($authKey)\n {\n return false;\n }", "public function isAuth(){\n\t\t$sess = Core::getSingleton(\"system/session\");\n\t\tif( $sess->has(\"account\") ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function authenticateRequest($autho_key){\n $api_autho_key_model = new ApiAuthoKeysModel($this->cnx);\n $api_autho_key = $api_autho_key_model->getByAuthoKey($autho_key);\n if(!$api_autho_key){\n return false;\n }\n if($api_autho_key->autho_key !== $autho_key){\n return false;\n }\n return true;\n }", "public function validateAuthKey($authKey)\n {\n return $this->getAuthKey() === $authKey;\n }", "public function validateAuthKey($authKey)\n {\n return $this->getAuthKey() === $authKey;\n }", "public function validateAuthKey($authKey)\n {\n return $this->getAuthKey() === $authKey;\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function validateAuthKey($authKey)\n {\n }", "public function checkAuth(){\n if( isset($_COOKIE['Auth']) ) {\n $result = $this->select(array(\"hash\"=>$_COOKIE['Auth']));\n if(!empty($result)){\n return $result[0];\n } else {\n return false;\n }\n \n } else {\n return false;\n }\n }", "public static function isAuth() : bool\n {\n return null !== self::$fullUser;\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function validateAuthKey($authKey) {\n }", "public function isAuthenticated(){\n return $_SESSION['loggedIn'];\n }", "function auth($user, $key) {\n\tglobal $mgmtd;\n\t$sql = \"SELECT \t`mgmt`.`user_pw`, \n\t\t\t\t\t`mgmt`.`user_id`, \n\t\t\t\t\t`mgmt`.`user_username`, \n\t\t\t\t\t`mgmt`.`user_email` \n\t\t\tFROM \t`mgmt`.`user` \n\t\t\tWHERE \t`mgmt`.`user_pw` = '$key' \n\t\t\tLIMIT \t1;\";\n\tif ( $r = $mgmtd->query($sql) ) {\n\t\tif ( $r->num_rows == 1 ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function auth(){\n\tif(@!$_SESSION['auth']){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "public function getAuth() {\n\t\treturn $this->auth;\n\t}", "public function isAuth() {\n $connector = Mage::getSingleton('vidtest/connector')->getApiModel($this->getApiModelCode());\n return $connector->isLoggedIn();\n }", "public function isAuth( ) {\n\t\tif( $this->getName() == null || $this->getId() == -1 ) {\n\t\t\treturn false;\n\t\t} elseif( isset($_SESSION) ) {\n\t\t\t// Make sure we have all the required session values.\n\t\t\tforeach( $this->SESSION_KEYS_USED as $key ){\n\t\t\t\tif( ! array_key_exists($key, $_SESSION) ){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function _isAuthenticated()\n\t{\n\t\treturn true;\n\t}", "public function auth(){\n\t\tif( !isset($_SESSION) || !isset($_SESSION['userId']) ) {\n\t\t\treturn false;\n\t\t} elseif( !parent::fetchFromDB($_SESSION['userId']) ){\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn ( $this->checkIp() && $this->checkSessionId() );\n\t\t}\n\t}", "function isLoggedIn(){\n return $this->auth->isLoggedIn();\n }", "function authGet() { }", "public function validateAuthKey($authKey)\n {}", "function isUniqueKey(): bool;", "public function getAuth();", "public function getAuth();", "public function isAuthed(): bool\n {\n return ($this->status == self::STATUS_AUTHED);\n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "static function check()\n\t{\n\t\t$session = App::get('session');\n\t\treturn $session->get('auth');\n\t}", "public function is_auth()\r\n\t{\r\n\t\tstatic $authorized = null;\r\n\r\n\t\tif(isset($authorized))\r\n\t\t\treturn $authorized;\r\n\r\n\t\t$authorized = false;\r\n\t\t$token = Options::get('picasa_token_' . User::identify()->id);\r\n\r\n\t\tif($token != null)\r\n\t\t\t$authorized = true;\r\n\r\n\t\treturn $authorized;\r\n\t}", "public function validateAuthKey($authKey)\n {\n return $this->salt === $authKey;\n }", "function isAuthorized($username, $password) {\nreturn $this->isAuthorized;\n}", "public function isAuthenticated()\n {\n return $this->authenticated;\n }", "public static function AuthID()\r\n {\r\n if (!isset($_SESSION[\"ed\"])) {\r\n (new CodeFlirt\\Handlers)->trackUser();\r\n echo '<meta http-equiv=\"refresh\" content=\"0; url=' . (new CodeFlirt\\Handlers)->path(\"login\") . '\">';\r\n return false;\r\n }\r\n if (isset($_SESSION[\"ed\"]) && !empty($_SESSION[\"ed\"])) {\r\n //Import from Encryption\r\n $Encryption = new Encryption();\r\n\r\n $user_public_key = $_SESSION[\"ed\"];\r\n\r\n //Here _Profilepage_ is a decryption key\r\n $user_email_address = md5($Encryption->decrypt($user_public_key, \"_ProfilePage_\"));\r\n\r\n $user_private_key = (new CodeFlirt\\Fetch)->data('users', 'user_private_key', \"user_email_address='$user_email_address'\");\r\n\r\n if ($user_private_key == false) {\r\n echo '<meta http-equiv=\"refresh\" content=\"0; url=' . (new CodeFlirt\\Handlers)->path(\"login\") . '\">';\r\n return;\r\n } else {\r\n return $user_private_key;\r\n }\r\n } else {\r\n echo '<meta http-equiv=\"refresh\" content=\"0; url=' . (new CodeFlirt\\Handlers)->path(\"login\") . '\">';\r\n return;\r\n }\r\n }" ]
[ "0.6863292", "0.68452394", "0.6752266", "0.67054564", "0.67054564", "0.67054564", "0.67054564", "0.6666182", "0.66564894", "0.66139495", "0.6494552", "0.6494552", "0.648136", "0.6445514", "0.6444086", "0.64160955", "0.63905144", "0.6383275", "0.63648295", "0.6345686", "0.6335938", "0.6335938", "0.6333063", "0.63005406", "0.627469", "0.6269358", "0.6262628", "0.6256517", "0.62503713", "0.62491345", "0.6240277", "0.62279296", "0.6224327", "0.61981213", "0.61981213", "0.61981213", "0.6194145", "0.6191142", "0.6190506", "0.61863303", "0.61715615", "0.6165729", "0.6165729", "0.6165729", "0.6165729", "0.6165729", "0.6165729", "0.6165729", "0.6165729", "0.6165729", "0.61617804", "0.6129703", "0.6129703", "0.6119458", "0.6112432", "0.6112432", "0.6112432", "0.6101902", "0.6097848", "0.6095954", "0.60938966", "0.60907394", "0.6068996", "0.6068996", "0.6068996", "0.6061221", "0.6061221", "0.6061221", "0.6061221", "0.6061221", "0.6061221", "0.6041923", "0.6040266", "0.6039426", "0.6039426", "0.6039426", "0.6039426", "0.60387015", "0.6035072", "0.6019081", "0.6013857", "0.6012844", "0.60056585", "0.5993365", "0.5984615", "0.5984311", "0.5980362", "0.59665847", "0.59424245", "0.5941322", "0.5936236", "0.5936236", "0.5931227", "0.5924596", "0.59139836", "0.59065115", "0.5901744", "0.58904046", "0.58899003", "0.58868146" ]
0.6538215
10
the absolute directory path where uploaded
protected function getUploadRootDir() { // documents should be saved return __DIR__.'/../../../web/'.$this->getUploadDir(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getUploadDir()\n {\n return 'uploads';\n }", "protected function getUploadDir() {\n return '/uploads';\n }", "public function getRelativeUploadPath(): string;", "protected function getUploadRootDir()\r\n {\r\n // the absolute directory path where uploaded documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/';\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../uploads/user/';\n }", "protected function getUploadRootDir()\n {\n// documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir() {\r\n return 'uploads/documents';\r\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "private function getUploadRootDir(){\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n return 'upload/files';\n }", "public function getUploadRootDir(){\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n\t{\n\t\t// get rid of the __DIR__ so it doesn't screw when displaying uploaded doc/image\n\t\t// in the view.\n\t\treturn 'uploads/mybudget';\n\t}", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/';\n }", "public function getUploadDir(){\n return dirname(_FILE_). \"/img/\";\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/ads/images';\n }", "protected function getUploadDir()\r\n {\r\n // when displaying uploaded doc/image in the view.\r\n return 'uploads/images';\r\n }", "protected function getUploadDir()\r\n\t{\r\n\t\treturn 'uploads/documents';\r\n\t}", "protected function getUploadDir()\n {\n \t// when displaying uploaded doc/image in the view.\n \treturn 'uploads/imagen';\n }", "public function getUploadDir()\n {\n // image profile should be saved\n return __DIR__.'/../../../../web/uploads/evento/'.$this->id;\n }", "public function getUploadRootDir() {\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "public function basePathUpload() {\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t$pathupload = realpath ( APPLICATION_PATH . '/../public/data/uploads' );\n\t\t\t\t\t\treturn $pathupload;\n\t\t\t\t\t}", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "public function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'web/images';\n }", "protected function getUploadRootDir()\r\n {\r\n // documents should be saved\r\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents';\n }", "function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads/contact/contactlist/images';\n }", "protected function getUploadDir() {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads';\n }", "protected function getUploadRootDir()\n {\n \t// guardar los archivos cargados\n \treturn 'uploads/registros/labels';\n }", "protected function getUploadRootDir()\r\n\t{\r\n\t\treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\r\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/documents/images/profile';\n }", "protected function getUploadRootDir()\n {\n //$racine = sudo chmod ;\n return __DIR__.'/../../../web/ressources/uploads/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n \t// documents should be saved\n \treturn __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n return __DIR__ . '/../../../../web' . $this->getFilesPath();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user';\n }", "public function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../'.$this->getUploadDir();\n }", "public function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "public function uploadPath();", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/user/images';\n }", "public static function uploadPath(): string {\n\t\treturn config('filesystems.upload_folder_name') . DIRECTORY_SEPARATOR . self::UPLOAD_FOLDER_NAME;\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/products';\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__ . '/../../../../web/' . self::UPLOAD_ROOT;\n }", "public function getUploadPath()\n {\n return Yii::$app->params['upload_dir'] . DIRECTORY_SEPARATOR . $this->path;\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/articles';\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../public/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/tracks';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/guide';\n }", "protected function getUploadRootDir() {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "public function getUploadedPath()\n {\n return $this->getUploadsFolder() . '/' . $this->getRootUploadedPath();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadRootDir()\n {\n // documents should be saved\n return __DIR__.'/../../../../web/'.$this->getUploadDir();\n }", "protected function getUploadDir()\n {\n return 'uploads/serie';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/photos';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/users';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/lots';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/images/agancy';\n }", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/subtitles';\n }" ]
[ "0.8005355", "0.7987917", "0.7977486", "0.7972477", "0.7971831", "0.79548585", "0.79398304", "0.79366845", "0.79297465", "0.79209554", "0.79197216", "0.7911412", "0.79051995", "0.7900123", "0.78990775", "0.78984356", "0.7878848", "0.7877958", "0.7873649", "0.7871114", "0.78659314", "0.7860999", "0.78587663", "0.784893", "0.784893", "0.784228", "0.783905", "0.78387475", "0.78387475", "0.78387475", "0.78387475", "0.78387475", "0.78387475", "0.78387475", "0.78387475", "0.78337854", "0.78283346", "0.78276676", "0.78252786", "0.77940327", "0.7790331", "0.77822876", "0.77822226", "0.778128", "0.7772334", "0.7765161", "0.7764409", "0.7764109", "0.7762933", "0.776068", "0.7760562", "0.77553666", "0.77527744", "0.7751979", "0.7751979", "0.7751144", "0.7750238", "0.7746246", "0.77439815", "0.7736735", "0.7734539", "0.7733748", "0.77334726", "0.7732609", "0.7732609", "0.7732609", "0.7732609", "0.7732609", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7732573", "0.7729239", "0.7728543", "0.77217096", "0.7720741", "0.7715466", "0.77076936" ]
0.77277666
95
the file property can be empty if the field is not required
public function upload() { if (null === $this->getFile()) { return false; } // use the original file name here but you should // sanitize it at least to avoid any security issues // move takes the target directory and then the // target filename to move to $this->getFile()->move( $this->getUploadRootDir(), $this->getFile()->getClientOriginalName() ); // set the path property to the filename where you've saved the file $this->url = $this->getFile()->getClientOriginalName(); // clean up the file property as you won't need it anymore $this->file = null; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function configureFileField() {}", "public function file_required(): static\r\n {\r\n if (empty($this->is_file['name'])) $this->message(\"is required\");\r\n return $this;\r\n }", "function zen_draw_file_field($name, $required = false) {\n $field = zen_draw_input_field($name, '', ' size=\"50\" ', 'file');\n\n return $field;\n }", "static function checkForEmptyFileField($fieldname) {\n if (!isset($_FILES[$fieldname]['name'])) {\n new SystemMessage(\"File field cannot be left empty\")\n\n ;\n forward();\n }\n }", "private function fileFields()\n {\n $disk = 'public';\n\n if ($this->jsonData['disk']) {\n $disk = $this->jsonData['disk'];\n }\n\n $newData = [\n 'type' => $this->jsonData['type'],\n 'component' => 'file-field',\n 'vue' => $this->getCorrectVueComponent('form-file-field'),\n 'deletable' => true,\n 'downloadable' => false,\n 'deletable' => false,\n 'previewUrl' => null,\n 'thumbnailUrl' => null,\n 'disk' => $disk,\n 'textAlign' => 'center',\n ];\n\n $this->data = array_merge($this->data, $newData);\n }", "function validate_filename($object = null, $value)\n\t{\n\t\tif (isset($value) == false || empty($value) ) {\n\t\t\treturn Localized::ModelValidation(\n\t\t\t\t$this->tableName(),\n\t\t\t\tMedia::filename,\n\t\t\t\t\"FIELD_EMPTY\"\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}", "public function rules()\n {\n return [\n 'file' => 'required|file'\n ];\n }", "public function getFields()\n {\n return [\n 'value' => 'name:Obrázok|type:file|image|required',\n ];\n }", "public function rules()\n {\n return [\n 'file' => 'required|image|max:20000', //REQUIRED MONO AN TO DEFAULT EINAI EMPTY ETSI OSTE NA MI SKAEI ERROR STO PEOPLE\n 'filename' => '',\n ];\n }", "protected static function isEmptyFileUpload($value) {\n return (\n isset($value['name']) && '' === $value['name'] &&\n isset($value['type']) && '' === $value['type'] &&\n isset($value['tmp_name']) && '' === $value['tmp_name'] &&\n isset($value['error']) && UPLOAD_ERR_NO_FILE === $value['error'] &&\n isset($value['size']) && 0 === $value['size']\n );\n }", "public function rules()\n {\n return [\n\n\n\n\n\n 'name' => 'required|string|max:100',\n 'fileable_id' => 'required',\n 'fileable_type' => 'required',\n 'description' => 'max:1000',\n 'file'=>'required|file|max:100000'\n\n\n\n ];\n }", "public function rules()\n {\n return [\n 'file' => 'nullable|required|image|max:2048'\n ];\n }", "function _field_file($val) \n {\n $res = \"\";\n $size = $this->_get_field_size();\n $size -= 12; // compensate for Browse.. button\n\n if (isset($this->attribs['ws_path'])) {\n $path = $this->attribs['ws_path'];\n }\n\n\n $res .= sprintf(\"<input type=\\\"file\\\" name=\\\"%s\\\" id=\\\"%s\\\" size=\\\"%d\\\" maxlength=\\\"%d\\\" class=\\\"%s\\\" %s/>\\n\",\n $this->fname,\n $this->fname,\n $size,\n $this->attribs['maxlength'],\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n\n if (isset($this->attribs['show_current']) and !empty($val)) {\n $res .= sprintf('<br /><span style=\"font-size: 9px\">current file: <a href=\"%s/%s\" target=\"flashWin\">%s</a></span>', $path, $val, $val);\n }\n\n return $res;\n }", "function acf_file_input($attrs = array())\n{\n}", "private function build_file_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true, $_is_pricing_rule = \"no\") {\r\n /*\r\n * Show as value option not available for FILE field\r\n * since file field not supported for Admin Field */\r\n \r\n $_index .= (isset($_meta[\"multi_file\"]) && $_meta[\"multi_file\"] == \"yes\") ? \"[]\" : \"\";\r\n $accept = (isset($_meta[\"filetypes\"]) && ! empty($_meta[\"filetypes\"])) ? ('accept=\"' . esc_attr(trim($_meta[\"filetypes\"])) . '\"') : '';\r\n $multifile = (isset($_meta[\"multi_file\"]) && $_meta[\"multi_file\"] == \"yes\") ? 'multiple=\"multiple\"' : '';\r\n $maxsize = (isset($_meta[\"max_file_size\"]) && ! empty($_meta[\"max_file_size\"])) ? ('max-size=\"' . esc_attr(trim($_meta[\"max_file_size\"])) . '\"') : '';\r\n $preview = (isset($_meta[\"img_is_prev\"]) && $_meta[\"img_is_prev\"] == \"yes\") ? \"yes\" : \"no\";\r\n $preview_width = (isset($_meta[\"img_is_prev_width\"]) && $_meta[\"img_is_prev_width\"] != \"\") ? $_meta[\"img_is_prev_width\"] : \"65px\";\r\n $has_field_rules = isset( $_meta[\"field_rules\"] ) && is_array( $_meta[\"field_rules\"] ) && count( $_meta[\"field_rules\"] ) != 0 ? \"yes\" : \"no\";\r\n /* Construct the field */\r\n $html = '<input type=\"file\" data-has_field_rules=\"'.$has_field_rules.'\" data-has_pricing_rules=\"'.$_is_pricing_rule.'\" ' . $maxsize . ' data-fkey=\"'. $_meta[\"key\"] .'\" class=\"' . $_ptype . '-field ' . $_class . '\" name=\"' . esc_attr($_meta[\"key\"] . $_index) . '\" ' . $accept . ' ' . $multifile . ' data-field-type=\"'. $_meta[\"type\"] .'\" ' . $_ptype . '-pattern=\"mandatory\" ' . $_ptype . '-mandatory=\"' . $_meta[\"required\"] . '\" ' . $_cloneable . ' ' . $_readonly . ' data-preview=\"'. $preview .'\" data-preview-width=\"'. $preview_width .'\" />';\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }", "public function rules()\n {\n return [\n 'certificado' => 'required|file|filled',\n ];\n }", "public function rules()\n {\n return array(\n array('file', 'file'),\n //array('file', 'file', 'types' => 'jpg, png, gif, jpeg', 'on'=>'create'),\n //array('file', 'file', 'allowEmpty' => true, 'types' => 'jpg, png, gif, jpeg', 'on' => 'update'),\n );\n }", "function validateUploadData(&$model, $fieldData, $fieldName, $allowEmpty = true) {\n if ($allowEmpty == false || !empty($fieldData[$fieldName]['tmp_name'])) {\n \n # validate against provided values\n if (!empty($fieldData[$fieldName]['error']) && $fieldData[$fieldName]['error'] != 0) return false;\n if (empty($fieldData[$fieldName]['size']) || $fieldData[$fieldName]['size'] == 0) return false;\n \n # validate the temporary uploaded file using PHPs built-in method\n if (!is_uploaded_file($fieldData[$fieldName]['tmp_name'])) return false;\n }\n \n return true;\n }", "public function requires_file_upload_message() {\n\n\t\t// Generate form editor URL.\n\t\t$url = add_query_arg( array( 'view' => null, 'subview' => null ) );\n\n\t\treturn sprintf(\n\t\t\tesc_html__( \"You must add a File Upload field to your form before creating a feed. Let's go %sadd one%s!\", 'gravityformsdropbox' ),\n\t\t\t'<a href=\"' . esc_url( $url ) . '\">', '</a>'\n\t\t);\n\n\t}", "protected function checkProperty(/**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$value, /**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$validators, /**\n * File upload validation.\n *\n * If a $_FILES array is found in the request data,\n * iterate over all requested files and validate each\n * single file.\n */\n$propertyName) {}", "public function testFileValue() : void {\n\t\t$this->assertEquals('kc_file', PostType::File->value);\n\t}", "public function rules()\n {\n return [\n [['file_id'], 'required'],\n [['file_id','ukuran'],'integer'],\n [['tgl_upload', 'tgl_proses'], 'safe'],\n [['namafile'], 'file','skipOnEmpty' => false, 'extensions' => 'xlsx', 'on' => 'create'],\n [['file_id'], 'unique'],\n ];\n }", "protected function getFileFieldSettings() { ?>\n\t\t<div class=\"form-group\" v-if=\"['job_logo', 'job_cover', 'job_gallery'].indexOf(field.slug) <= -1\">\n\t\t\t<label>Allowed file types</label>\n\t\t\t<select multiple=\"multiple\" v-model=\"field.allowed_mime_types_arr\" @change=\"editFieldMimeTypes($event, field)\">\n\t\t\t\t<?php foreach ( (array) get_allowed_mime_types() as $extension => $mime ): ?>\n\t\t\t\t\t<option value=\"<?php echo \"{$extension} => {$mime}\" ?>\"><?php echo $mime ?></option>\n\t\t\t\t<?php endforeach ?>\n\t\t\t</select>\n\t\t\t<br><br>\n\t\t\t<label><input type=\"checkbox\" v-model=\"field.multiple\" class=\"form-checkbox\"> Allow multiple files?</label>\n\t\t</div>\n\t\t<div class=\"form-group\" v-show=\"field.multiple\">\n\t\t\t<label>Maximum number of uploads allowed</label>\n\t\t\t<input type=\"number\" v-model=\"field.file_limit\" style=\"width: 100px; margin: 0;\">\n\t\t</div>\n\t<?php }", "public function isUploadedFile() {}", "public function testFilesEmpty()\n {\n $this->assertArrayEmpty($this->get_reflection_property_value('files'));\n }", "function userfile_check()\n\t\t{\n\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('userfile_check', 'The {field} file is required');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "public function rules()\n {\n return [\n 'logo' => ['required', 'file'],\n ];\n }", "public function set_file($file){\n //error checking\n if(empty($file) || !$file || !is_array($file)){\n $this->errors[] =\"There was no file uploaded here\";\n return false; \n // Check if the file is uploaded \n }elseif($file['error'] !==0){\n \n $this->error[] = $this->upload_errors_array[$file['error']];\n return false;\n \n }else {\n //Submit data \n $this->user_image = basename($file['name']); //basename is function\n $this->tmp_path = $file['tmp_name'];\n $this->type = $file ['type'];\n $this->size = $file ['size'];\n }\n }", "public function checkInlineFileTypeAccessForFieldForFieldNoFiletypesReturnsTrue() {}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('file', 'required'),\n\t\t\tarray('file','file','types'=>'jpg png'),\n\t\t);\n\t}", "protected function checkFileUploadEnabled() {}", "public function canSetFileable();", "function FileFormField ($name, $description, $optional=false, $options=NULL) {\n $defaultoptions = array(\n 'type' => 'file'\n ,'title' => 'file'\n ,'placeholder' => 'file.ext'\n // Limit how crazy the file name can be\n ,'pattern' => \"/^(\\\\w| |[-_\\\\.]){1,64}$/\"\n ,'directory' => 'files'\n ,'maxsize' => 8388608\n );\n $options = $options ? array_merge($defaultoptions, $options) : $defaultoptions;\n parent::PatternFormField($name, $description, $optional, $options);\n $this->directory = $options['directory'];\n $this->maxsize = $options['maxsize'];\n }", "function acf_get_file_input($attrs = array())\n{\n}", "public function isMandatorySave()\n\t{\n\t\treturn $_FILES ? true : false;\n\t}", "public function isMandatorySave()\n\t{\n\t\treturn $_FILES ? true : false;\n\t}", "public function getWholeFile()\n {\n \treturn isset($_FILES) ? $_FILES : null;\n }", "public function file() { return $this->input_file; }", "public function rules()\n {\n return [\n 'archivo'=>'required|file|between:1,14800|mimes:pdf',\n 'f_estudiante'=>'required_if:bandera,1',\n ];\n }", "public function rules()\n\t{\n\t\treturn [\n\t\t\t//\n\t\t\t'nama' => 'required',\n\t\t\t'file' => 'required|mimes:pdf,doc,docx|max:5120',\n\t\t];\n\t}", "public function renderField()\n\t{\n\t\tif ($this->hasModel()) {\n\t\t\techo \\CHtml::activeFileField($this->model, $this->attribute, $this->options);\n\n\t\t} else {\n\t\t\techo \\CHtml::fileField($this->options['name'], $this->value, $this->options);\n\t\t}\n\t}", "public function setFile($file=null){\r\n if(is_array($file)){\r\n $this->file=$file;\r\n }else{\r\n $this->file = null;\r\n }\r\n }", "public function rules()\n {\n return [\n 'name_file' => 'required|file|max:10000,mimes:csv'\n ];\n }", "abstract protected function validateFile() : object;", "function file_field($object, $field, $options = array()) {\n $form = new FormHelper($object, $field);\n return $form->to_input_field_tag(\"file\", $options);\n}", "function FileVar($name, $default_value = false) {\r\n if (!isset($_FILES))\r\n return false;\r\n if (isset($_FILES[$name]['name'])) {\r\n if (!get_magic_quotes_gpc())\r\n return InjectSlashes($_FILES[$name]['name']);\r\n return $_FILES[$name]['name'];\r\n }\r\n return $default_value;\r\n}", "function validateUploadField(&$model, $fieldData, $fieldName) {\n if (empty($fieldData[$fieldName]) || !is_array($fieldData[$fieldName])) return false;\n return true;\n }", "public function rules()\n\t{\n\t\treturn [\n\t\t\t'company_name' => 'required',\n\t\t\t'company_logo_small' => 'file|image|mimes:jpeg,jpg,png,gif|max:200',\n\t\t];\n\t}", "private function _file()\n {\n return Html::getAttributeValue($this->model, $this->attribute);\n }", "public function hasFile()\n {\n \treturn empty($_FILES) ? false : true;\n }", "public function rules()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t// username and password are required\r\n\t\t\tarray('file', 'required'),\r\n\t\t\t// rememberMe needs to be a boolean\t\r\n\t\t\tarray('file', 'file',\r\n 'types'=>'jpg,csv',\r\n 'maxSize'=>1024 * 1024 * 1, // 1MB\r\n 'tooLarge'=>'The file was larger than 1MB. Please upload a smaller file.',\r\n ),\t\r\n array('file', 'safe'),\t\r\n\t\t);\r\n\t}", "public function file ( \\r8\\Form\\File $field )\n {\n $this->addField( \"file\", $field );\n }", "public function rules()\n {\n return [\n 'importedFile' => 'required',\n ];\n }", "public function fileData($key)\n {\n \treturn isset($_FILES[$key]) ? $_FILES[$key] : null;\n }", "public function rules()\n {\n return [\n 'photo_id'=>'required|mimes:jpeg,png,jpg,svg|max:10240'\n ];\n }", "public function rules()\n {\n return [\n 'file' => 'required|mimes:pdf|max:10240',\n 'description' => 'required|max:255',\n ];\n }", "public function rules()\n {\n return [\n\t\t\t'name' => 'required',\n 'file' => 'required|image|mimes:jpeg,png,jpg|max:2048' \n ];\n }", "public function hasFile()\n {\n foreach ($this->fields() as $field) {\n if ($field instanceof Field\\File) {\n return true;\n }\n }\n\n return false;\n }", "public function getValue(){\r\n\t\tif(\r\n\t\t\tisset($_FILES[$this->name]['tmp_name'])\r\n\t\t\t&& (strlen($_FILES[$this->name]['tmp_name']) > 0)\r\n\t\t\t&& ($_FILES[$this->name]['size'] > 0)\r\n\t\t\t&& ($_FILES[$filedataName]['error'] == UPLOAD_ERR_OK)\r\n\t\t){\r\n\t\t\treturn $_FILES[$this->name]['name'];\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "function tf_file_upload_option_customizer_get_value() {\r\n\r\n if ( ! empty( $_POST['nonce'] ) && ! empty( $_POST['id'] ) ) {\r\n\r\n $nonce = sanitize_text_field( $_POST['nonce'] );\r\n $attachmentID = sanitize_text_field( $_POST['id'] );\r\n // $size = sanitize_text_field( $_POST['size'] );\r\n\r\n if ( wp_verify_nonce( $nonce, 'tf_file_upload_option_nonce' ) ) {\r\n $attachment = $attachmentID;\r\n if ( ! empty( $attachment ) ) {\r\n wp_send_json_success( $attachment );\r\n }\r\n }\r\n }\r\n\r\n // Instead of doing a wp_send_json_error, send a blank value instead so.\r\n // Javascript adjustments still get executed.\r\n wp_send_json_success( '' );\r\n }", "function validate_expense_file() {\n return validate_post_file($this->input->post(\"file_name\"));\n }", "public function getUploadedFilePath()\n {\n return !empty($this->filepath) ? $this->filepath : \n (!empty($this->filename) ? (Yii::$app->params['uploadPath'] . $this->filename) : null);\n }", "public function validateCanUpload()\n {\n //do not allow upload for active session\n if (StreamSession::activeExists($this->shop->getId())) {\n $this->addError('file', Yii::t('app', 'You cannot upload products while Live Stream is active'));\n }\n }", "private function isFormFile(array $value)\n\t{\n\t\tif ($value['size'] !== 0 && $value['type'] !== '' && $value['tmp_name'] !== '') {\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function rules()\n {\n return [\n 'file' => 'required|mimes:jpg,jpeg,png,bmp'\n ];\n }", "public function verifyFile(){\n if (isset($_POST[\"submitbutton\"])){//if submit button is pressed\n if ($_FILES[\"fileSelectField\"][\"type\"] != \"application/pdf\"){//checks file type\n return \"File must be a pdf file\";\n }\n else if ($_FILES[\"fileSelectField\"][\"size\"] > 100000){//checks file size\n return \"File is too big\";\n }\n else {//runs function to add file if no problems\n return $this->addFile();\n }\n }\n }", "function validate() {\r\n\t\t$post_ok = isset($this->params['form']['Filedata']);\r\n\t\t$upload_error = $this->params['form']['Filedata']['error'];\r\n\t\t$got_data = (is_uploaded_file($this->params['form']['Filedata']['tmp_name']));\r\n\t\t\r\n\t\tif (!$post_ok){\r\n\t\t\t$this->setError(2000, 'Validation failed.', 'Expected file upload field to be named \"Filedata.\"');\r\n\t\t}\r\n\t\tif ($upload_error){\r\n\t\t\t$this->setError(2500, 'Validation failed.', $this->getUploadErrorMessage($upload_error));\r\n\t\t}\r\n\t\treturn !$upload_error && $post_ok && $got_data;\r\n\t}", "public function rules()\n {\n return [\n 'file_description' => 'string',\n 'file_title' => 'string',\n 'file_orig_name' => 'required|string',\n 'cat_id' => 'required|numeric'\n ];\n }", "protected function isFile() {}", "public function get_file_params()\n {\n }", "public function set_file($file){\n\t\tif(empty($file) || !$file || !is_array($file)){\n\t\t$this->errors[] = \"There Was No File Uploaded\";\n\t\treturn false;\t\n\t\t}elseif($file['error']!=0){\n\t\t\t$this->errors[]\t= $this->upload_errors_array[$file['error']];\n\t\t}else{\n\t\t\t$this->user_image = basename($file['name']);\n\t\t\t$this->tmp_path = $file['tmp_name'];\n\t\t\t$this->type = $file['type'];\n\t\t\t$this->size = $file['size'];\n\t\t}\n\t}", "public function it_shows_file_input_on_type_of_file()\n {\n // configure\n $inputs = [\n [\n 'type' => 'file',\n 'name' => 'tc',\n 'label' => 'Upload Terms and Conditions'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"file\"', false);\n }", "protected function validateRequired($value){\n\t\tif (is_null($value)){\n\t\t\treturn false;\n\t\t}elseif (is_string($value) && trim($value) === ''){\n\t\t\treturn false;\n\t\t}elseif ((is_array($value) || $value instanceof \\Countable) && count($value) < 1){\n\t\t\treturn false;\n\t\t}elseif ($value instanceof File){\n\t\t\treturn (string) $value->getPath() != '';\n\t\t}\n\t\treturn true;\n\t}", "public function getFile() {}", "public function getFile() {}", "public function rules()\n {\n return [\n 'image'=>'required|mimes:jpeg,jpg,png,gif|image|max:6000'\n ];\n }", "public function getFilename()\n {\n return null;\n }", "function validateUploadPath(&$model, $fieldData) {\n $path = WWW_ROOT . 'files' .DS;\n \n if (!is_writable($path)) return false;\n \n return true;\n }", "function oa_export_blueprint_import_form_validate($form, &$form_state) {\n if (!$_FILES['files']['name']['file']) {\n drupal_set_message(t('Please upload a file to import.'), 'error');\n form_set_error('', NULL);\n }\n}", "public function createInput()\n {\n $file = new File();\n $this->assertEquals('file', $file->getAttribute('type'));\n }", "public function getImageFile():?File\n {\n return $this->imageFile;\n }", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function getFileSpecification() {}", "public function store(Request $request)\n{\n //\n $rules =[\n 'testFile'=>'required'\n ];\n\n $msg=[\n 'testFile.required'=>'Java File must not empty'\n ];\n\n $validator=Validator::make($request->all(),$rules,$msg);\n\n //jika data ada yang kosong\n if ($validator->fails()) {\n\n //refresh halaman\n return Redirect::to('admin/testfiles/create/'.$request->get('topic'))\n ->withErrors($validator);\n\n }else{\n $file = $request->file('testFile');\n $filename = $file->getClientOriginalName();\n $strpath = 'TestFiles/'.$request->get('topic');\n $testFile=$file->store('testfiles','public');\n\n $entity=new \\App\\TestFiles;\n\n $entity->taskid=$request->get('taskid');\n $entity->fileName=$filename;\n $entity->topic=$request->get('topic');\n $entity->content=$testFile;\n $entity->save();\n\n Session::flash('message','A New Test File Stored');\n\n //return \"Add new topic is success\";\n return Redirect::to('admin/testfiles?topicList='.$request->get('topic'));\n }\n}", "function validateFileExtension(&$model, $fieldData, $fieldName, $allowedExts = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $extension = strtolower(pathinfo($fieldData[$fieldName]['name'], PATHINFO_EXTENSION));\n \n if (!is_array($allowedExts) || (!in_array('*', $allowedExts) && !in_array($extension, $allowedExts))) return false;\n \n return true;\n }", "public function rules()\n {\n return [\n 'file' => 'required|mimes:xslx'\n ];\n }", "public function rules()\n {\n return array(\n array('cameraImage','image','file',\n 'types'=>'jpg, gif, png, jpeg',\n 'maxSize'=>1024 * 1024 * 2,\n 'tooLarge'=>'File has to be smaller than 50MB'\n )\n\n );\n\n\n }", "public function rules()\n {\n return [\n 'name' => 'required|max:255',\n 'alias' => 'required|max:255',\n 'description' => 'max:255',\n 'file' => 'mimes:doc,docx,dot,pdf,xlsx,xls,xlm,xla,xlc,xlt,xlw,xlam,xlsb,xlsm,xltm,csv|max:20480',\n 'link' => 'required_if:file,' . null . '|nullable|max:255|url',\n ];\n }", "function form_file($name = '') {\n\n\tif ($name == 'attachment') {\n\t\tunset($name);\n\t\t$name = \"\";\n\t}\n\n\t$value = html_form_escape($value, $override);\n\n\t$name = 'attachment' . $name;\n\treturn \"<input type=\\\"file\\\" name=\\\"$name\\\" />\";\n\n}", "public function getCleanFile()\n {\n return $this->_getCleanProperty('file');\n }", "protected function prepareEnvForEmptyFile()\n {\n $file = 'magento_empty.jpg';\n\n /** @var \\Magento\\Framework\\Filesystem $filesystem */\n $filesystem = $this->objectManager->get(\\Magento\\Framework\\Filesystem::class);\n $tmpDirectory = $filesystem->getDirectoryWrite(\\Magento\\Framework\\App\\Filesystem\\DirectoryList::SYS_TMP);\n $filePath = $tmpDirectory->getAbsolutePath($file);\n\n $_FILES['options_1_file'] = [\n 'name' => 'test.jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => $filePath,\n ];\n }", "public function isFileOperationAllowed() {}", "public function rules()\n {\n return [\n 'private' => 'boolean',\n 'name' => 'string|max:150|required',\n 'cover' => 'file|max:10240|nullable|mimes:jpeg,jpg,png',\n 'file' => 'file|max:204800|required|mimes:mp3'\n ];\n }", "function _webform_submission_display_file($data, $component, $enabled = FALSE) {\r\n $filedata = unserialize($data['value'][0]);\r\n $form_item = _webform_render_file($component);\r\n if (!$enabled) {\r\n $form_item['#type'] = 'textfield';\r\n $form_item['#tree'] = TRUE;\r\n $form_item['#attributes']['readonly'] = 'readonly';\r\n $form_item['#default_value'] = empty($filedata['filepath']) ? $filedata['error'] : $filedata['filepath'];\r\n }\r\n if (!empty($filedata['filename'])) {\r\n $form_item['#suffix'] = ' <a href=\"'. webform_file_url($filedata['filepath']) .'\">Download '. webform_file_name($filedata['filepath']) .'</a>'. $form_item['#suffix'];\r\n if ($enabled) {\r\n $form_item['#description'] = t('Uploading a new file will replace the current file.');\r\n $form_item['existing'] = array(\r\n '#type' => 'value',\r\n '#value' => $filedata,\r\n );\r\n }\r\n }\r\n return $form_item;\r\n}", "public function rules()\n\t{\n\t\treturn array(\n\t\t\tarray('pdf_file', 'file', 'types'=>'pdf'),\n\t\t);\n\t}", "function haveFileUploadField()\n\t{\n\t\t$haveUploadField = false;\n\t\tforeach ($this->elementList as $element)\n\t\t{\n\t\t\tif ($element->type == 'uploadfile') {\n\t\t\t\t$haveUploadField = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $haveUploadField;\n\t}", "public function rules() {\n return array(\n array('file', 'file'),\n );\n }", "public function setFileSingle($field, $value)\n {\n\n if (Session::has('upload.' . $this->config . '.' . $field)) {\n $value = Request::session()->pull('upload.' . $this->config . '.' . $field);\n $value = end($value);\n Request::session()->save();\n } elseif (!empty($value)) {\n $value = $value;\n } elseif (Request::has($field)) {\n $value = Request::get($field);\n } else {\n return;\n }\n\n if (empty($value)) {\n $value = [];\n }\n\n $this->setAttribute($field, $value);\n }" ]
[ "0.6987462", "0.6811598", "0.6588868", "0.65699726", "0.65216774", "0.6491254", "0.63153064", "0.6295755", "0.6212579", "0.61824673", "0.6164055", "0.6144368", "0.6141305", "0.60929865", "0.6085833", "0.60772556", "0.60756683", "0.60717565", "0.6047275", "0.6042965", "0.6032395", "0.60298973", "0.6029436", "0.60192996", "0.5963955", "0.5954131", "0.5936431", "0.5922908", "0.59091735", "0.59089476", "0.5876061", "0.5854493", "0.5846315", "0.58368677", "0.5830337", "0.5830337", "0.5806008", "0.5780851", "0.57799345", "0.5758897", "0.5756643", "0.57361376", "0.57290864", "0.5727749", "0.5711464", "0.5705188", "0.56911093", "0.5678024", "0.5670142", "0.5654699", "0.56452715", "0.5641451", "0.56352973", "0.56237507", "0.5619481", "0.56181633", "0.561768", "0.56077594", "0.56001323", "0.55953956", "0.5585123", "0.5574006", "0.557118", "0.5568814", "0.5563423", "0.55563295", "0.5551212", "0.55477643", "0.5539651", "0.5528664", "0.55259705", "0.55212855", "0.55177987", "0.551702", "0.551601", "0.54977924", "0.54957205", "0.5491059", "0.548404", "0.5481827", "0.54787034", "0.5474855", "0.5474385", "0.5474385", "0.5474385", "0.54737306", "0.54723674", "0.54713595", "0.5470402", "0.54692876", "0.5466335", "0.5462855", "0.5462702", "0.5461201", "0.5458531", "0.5453732", "0.54446936", "0.54445595", "0.5442589", "0.544169", "0.5438738" ]
0.0
-1
Create new page in current document
public function createPage() { $this->currentPage++; $this->currentIndex++; $this->resetProps(); /* Create page */ if ($this->landscape) { // A4 format in Landscape orientation $this->pdf->begin_page_ext(0, 0, "width=a4.height height=a4.width"); } else { // A4 format in Portrait orientation3. $this->pdf->begin_page_ext(0, 0, "width=a4.width height=a4.height"); } empty($this->createPageTrigger) || call_user_func_array($this->createPageTrigger, $this->createPageTriggerArgs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n //for the PAGE on which to create\n }", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "function createPage();", "function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public function createPageAndCopyLiveParentPage() {}", "public static function createByPage(\\SetaPDF_Core_Document_Page $page) {}", "public function createPageAndCopyDraftParentPage() {}", "public function createContentAndCopyLivePage() {}", "public function createContentAndCopyDraftPage() {}", "private function createPage()\n {\n sleep(1);\n\n $response = $this->pages->create([\n 'name' => 'My Super Awesome Post '.uniqid(),\n 'content_group_id' => 351076997,\n ]);\n\n $this->assertEquals(201, $response->getStatusCode());\n\n return $response;\n }", "function createPage($name) {\n //Keep track of the new page's location.\n $location = $_SERVER['DOCUMENT_ROOT'] . \"/pages/\" . $name . \".php\";\n //Check to make sure the file doesn't already exist.\n if(file_exists($location)) {\n //If it does exist, just load into that page.\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }\n //Create a new php page in the pages folder.\n $newPage = fopen($location, \"w\");\n //Ensure that the user can write, and that anyone can read it.\n //If need be, put this in an \"if\" statement in case it throws an error.\n chmod($location, 0644);\n //Add the default stuff like header.php\n $defaultText = '<?php\n include ($_SERVER[\\'DOCUMENT_ROOT\\'] . \"/php/header.php\");\n?>\n<head>\n</head>\n<body id=\"body\" class=\"nested\">\n</body>';\n //Write the default text into the new page.\n fwrite($newPage, $defaultText);\n //Close editing\n fclose($newPage);\n //Load the new page\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }", "public function createpage(){\n\n if($this->check() == true){\n if(isset($_POST['submit']))\n {\n $link = $_POST['link'];\n $header = htmlentities($_POST['header'], ENT_QUOTES);\n $this->admindb->insert(\"pages\", array(\n \"linkname\" => $link,\n \"header\" => $header\n ))->get();\n }\n $this->view(\"admin/pagecreate\");\n }\n\n }", "public function createNestedPagesAndCopyLiveParentPage() {}", "public function createPageUsingTemplateObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\n\t\t$form = $this->initTemplateSelectionForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$a_page = $_POST[\"page\"];\n\t\t\t$this->object->createWikiPage($a_page, (int) $_POST[\"page_templ\"]);\n\n\t\t\t// redirect to newly created page\n\t\t\t$ilCtrl->setParameterByClass(\"ilwikipagegui\", \"page\", ilWikiUtil::makeUrlTitle(($a_page)));\n\t\t\t$ilCtrl->redirectByClass(\"ilwikipagegui\", \"edit\");\n\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function addNewPage($data) \n {\n // Create new Page entity.\n $page = new Page();\n $page->setTitle($data['title']);\n $page->setContent($data['content']);\n $page->setStatus($data['status']);\n $currentDate = date('Y-m-d H:i:s');\n $page->setDateCreated($currentDate); \n \n // Add the entity to entity manager.\n $this->entityManager->persist($page);\n \n // Add tags to page\n $this->addTagsToPage($data['tags'], $page);\n \n // Apply changes to database.\n $this->entityManager->flush();\n }", "public function createNestedPagesAndCopyDraftParentPage() {}", "private function AddNewPage(){\n try{\n // Updated Time\n $this -> _data['UpdatedTime'] = $GLOBALS['_NOW_'] -> clockDateTime;\n // Encrypt Password\n if (!empty($this -> _data['password'])){\n if ($this -> _data['password'] == \"^Delete\"){\n $this -> _data['password'] = \"\";\n }else{\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashKey($this -> _data['password']);\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashEncryptedWithSalt($this -> _data['password']);\n }\n }\n $this -> db -> Insert('Function', $this -> _data, \"SELECT `FunctionName` FROM `Function` WHERE (`PageUrl` = :pageUrl OR `PageUrl` = :PageUrlIndex)\", \n array(\n \":pageUrl\" => $this -> _data['pageUrl'],\n \":PageUrlIndex\" => $this -> _data['pageUrl'].'/index'\n )\n );\n\n $lastId = $this -> db -> lastInsertId();\n\n $this -> db -> CreateObjectAcl('Function', $lastId, Cores\\_Session::Get('loggedUser') -> id);\n return true;\n }catch (\\Exception $e){\n return $e -> getMessage();\n }\n \n }", "static public function createPage() {\n $session = Application::getInstance(\"session\");\n $config = Application::getConfig();\n\n if (isset($config[\"system\"][\"customPageClass\"])) {\n require $config[\"system\"][\"pages-folder\"] . \"/\" . $config[\"system\"][\"customPageClass\"] . \".php\";\n }\n\n include_once $config[\"system\"][\"pages-folder\"] . \"/\" . $session->currentPage . \".page.php\";\n $pageClass = $config[\"system\"][\"namespace\"] . \"\\\\pages\\\\Page\" . ucfirst($session->currentPage);\n\n\n $page = new $pageClass();\n\n Application::setInstance(\"page\", $page);\n }", "public function addPage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\n\t\t// Validation of $_POST. URL, title and template must exist and != false.\n\t\tif ($url && ($Page = $this->Automad->getPage($url))) {\n\t\n\t\t\t$subpage = Request::post('subpage');\n\n\t\t\tif (is_array($subpage) && !empty($subpage['title'])) {\n\t\t\n\t\t\t\t// Check if the current page's directory is writable.\n\t\t\t\tif (is_writable(dirname($this->getPageFilePath($Page)))) {\n\t\n\t\t\t\t\tCore\\Debug::log($Page->url, 'page');\n\t\t\t\t\tCore\\Debug::log($subpage, 'new subpage');\n\t\n\t\t\t\t\t// The new page's properties.\n\t\t\t\t\t$title = $subpage['title'];\n\t\t\t\t\t$themeTemplate = $this->getTemplateNameFromArray($subpage, 'theme_template');\n\t\t\t\t\t$theme = dirname($themeTemplate);\n\t\t\t\t\t$template = basename($themeTemplate);\n\t\t\t\t\t\n\t\t\t\t\t// Save new subpage below the current page's path.\t\t\n\t\t\t\t\t$subdir = Core\\Str::sanitize($title, true, AM_DIRNAME_MAX_LEN);\n\t\t\t\t\t\n\t\t\t\t\t// If $subdir is an empty string after sanitizing, set it to 'untitled'.\n\t\t\t\t\tif (!$subdir) {\n\t\t\t\t\t\t$subdir = 'untitled';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add trailing slash.\n\t\t\t\t\t$subdir .= '/';\n\t\t\t\t\t\n\t\t\t\t\t// Build path.\n\t\t\t\t\t$newPagePath = $Page->path . $subdir;\n\t\t\t\t\t$suffix = FileSystem::uniquePathSuffix($newPagePath);\n\t\t\t\t\t$newPagePath = FileSystem::appendSuffixToPath($newPagePath, $suffix); \n\t\t\t\t\t\n\t\t\t\t\t// Data. Also directly append possibly existing suffix to title here.\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\tAM_KEY_TITLE => $title . ucwords(str_replace('-', ' ', $suffix)),\n\t\t\t\t\t\tAM_KEY_PRIVATE => (!empty($subpage['private']))\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ($theme != '.') {\n\t\t\t\t\t\t$data[AM_KEY_THEME] = $theme;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set date.\n\t\t\t\t\t$data[AM_KEY_DATE] = date('Y-m-d H:i:s');\n\t\t\t\t\t\n\t\t\t\t\t// Build the file name and save the txt file. \n\t\t\t\t\t$file = FileSystem::fullPagePath($newPagePath) . str_replace('.php', '', $template) . '.' . AM_FILE_EXT_DATA;\n\t\t\t\t\tFileSystem::writeData($data, $file);\n\t\t\t\t\t\n\t\t\t\t\t$output['redirect'] = $this->contextUrlByPath($newPagePath);\n\t\t\t\t\t\n\t\t\t\t\t$this->clearCache();\n\t\t\n\t\t\t\t} else {\n\t\t\t\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . '<p>' . dirname($this->getPageFilePath($Page)) . '</p>';\n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\t} else {\n\t\n\t\t\t\t$output['error'] = Text::get('error_page_title');\n\t\n\t\t\t}\t\n\t\n\t\t} else {\n\t\n\t\t\t$output['error'] = Text::get('error_no_destination');\n\t\n\t\t}\t\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "static public function createPages() {\n\t\treturn false;\n\t}", "function createSpace()\t{\n\n\t\t// Change title on this\n\t\t$newTitle = trim(t3lib_div::_GP('title'));\n\t\tif($newTitle != \"\") {\n\n\t\t\t// Use the TCEmain for copying the template\n\t\t\t$tce = t3lib_div::makeInstance('t3lib_TCEmain');\n\t\t\t$tce->stripslashes_values = 0;\n\t\t\t$tce->copyTree = 4;\n\t\t\t$tce->copyWhichTables = \"*\";\n\t\t\t$cmd['pages'][$this->templateUid]['copy'] = -1 * $this->templateUid;\n\t\t\t$tce->start(array(), $cmd);\n\t\t\t$tce->process_cmdmap();\n\n\t\t\t// This is our new page\n\t\t\t$newPage = $tce->copyMappingArray_merged['pages'][$this->templateUid];\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery(\"pages\", \"uid='\" . $newPage . \"'\", array('title' => $newTitle, 'hidden' => 0));\n\t\t\t\n\t\t\tt3lib_BEfunc::getSetUpdateSignal('updatePageTree');\n\t\t\t\n\t\t\t// Redirect to edit mode\n\t\t\t$goTo = $this->doc->backPath . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv(\"REQUEST_URI\"));\n\t\t\t$goTo .= '&edit[pages][' . $newPage . ']=edit';\n\n\t\t\t// All good: redirect to edit page\n\t\t\theader('Location: ' . $goTo);\n\t\t\texit();\n\t\t\t\n\t\t} else {\n\t\t\t $this->error[] = $GLOBALS['LANG']->getLL('titleError');\n\t\t\treturn false;\t\n\t\t}\n\n\t\t\n\t\t\n\t\treturn true;\n\t}", "public function actionCreate() {\n $model = new page();\n if ($model->load(Yii::$app->request->post())) {\n $slug = str_replace(' ', '-', $_POST['page']['pageName']);\n $model->pageDateCreated = date('y-m-d h:i:s');\n $model->slug = $slug;\n if ($model->save()) {\n Yii::$app->session->setFlash('item', 'Page has been created successfully!');\n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function xh_createDocument()\r\n\t{\r\n\t}", "public function create()\n {\n return view(\"pages.create\");\n }", "function addPage()\n {\n // Reuse the atkAddHandler for the addPage.\n $handler = atknew(\"atk.handlers.atkaddhandler\");\n $handler->setNode($this->m_node);\n return $handler->invoke(\"addPage\");\n }", "public function create()\n\t\t{\n\t\treturn view('page.create');\n\t}", "function createSamplePage(){\n\tif(the_slug_exists('custom-page')==false)\n\t{\n\t\tglobal $user_ID;\n\t $new_post = array(\n 'post_title' => 'Custom Page',\n 'post_content' => 'Sample content here',\n 'post_status' => 'publish',\n 'post_date' => date('Y-m-d H:i:s'),\n 'post_author' => $user_ID,\n 'post_type' => 'page',\n );\n $post_id = wp_insert_post($new_post);\n\t}\n}", "public function create()\n {\n\n // Using an empty model to allow the form to operate properly.\n $page = new ehPage();\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // Reset the display areas to defaults and pull the page info from Pages\n ehLayout::initLayout();\n\n ehLayout::setOptionBlock(false);\n ehLayout::setDynamic(false);\n ehLayout::setAttention(false);\n ehLayout::setWhenAdding(true);\n\n $linkbar = new ehLinkbar();\n ehLayout::setLinkbar($linkbar->getLinkbar());\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // Set up Save button based on this user's permissions.\n ehLayout::setStandardButtons('save');\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // Pull the $form array to pass to the template.\n $form['layout'] = ehLayout::getLayout();\n\n\n // Set the form action -- NOTE: POST to /groups calls groups.store\n $form['layout']['form_action'] = config('app.url').'/pages';\n $form['layout']['form_method']='POST';\n\n // Signal to template to leave certain elements out during a new record add.\n $form['layout']['when_adding'] = true;\n\n ////////////////////////////////////////////////////////////////////////////////////////////\n return view('ecoHelpers::pages.page-detail',[\n 'form' => $form,\n 'page' => $page\n ]);\n }", "public function addPage()\n\t{\n\t\tglobal $cfg;\n\t\t$data = $cfg['data'];\n\n\t\t// Load the content model\n\t\t$content = $this->load_model('Content');\n\n\t\t// Get all the available pages from database\n\t\t$pages[0] = '- New Page -'; \n\t\tforeach ($content->get_pages() as $key) \n\t\t{\n\t\t\t$pages[$key['id']] = $key['name'];\n\t\t}\n\n\t\t// Get all the available regions from the database\n\t\tforeach ($content->get_regions() as $key) {\n\t\t\t$regions[$key['id']] .= $key;\n\t\t}\n\n\t\t$form = new Form();\n\n\t\t$form->set_validate_rules(\"page\", \"Page name\", \"required\");\n\n\t\tif($form->validate())\n\t\t{\n\t\t\t$content = $this->load_model(\"Content\");\n\n\t\t\tif($_POST['page_id'] == 0)\n\t\t\t\t$content->insertPage();\n\t\t\telse\n\t\t\t\t$content->updatePage();\n\n\t\t\tredirect(\"content\");\n\t\t}\n\n\t\t$data['content']['main'] = \"<fieldset class='clearfix inline-block'><legend>New page</legend>\";\n\t\t$data['content']['main'] .= $form->start();\n\t\t$data['content']['main'] .= \"<lable>Parent page</lable>\";\n\t\t$data['content']['main'] .= $form->select($pages, array('style' => 'width:100%', 'name' => 'page_id'));\n\t\t$data['content']['main'] .= \"<lable>Page name</lable>\";\n\t\t$data['content']['main'] .= $form->input('text', array('style' => 'width:100%', 'name' => 'page'));\n\t\t$data['content']['main'] .= $form->input('submit', array('value' => 'Save', 'style' => 'width:100%'));\n\t\t$data['content']['main'] .= \"</form></fieldset>\";\n\t\t$data['content']['main'] .= $form->validate_error();\n\n\t\t$this->load_view('default', $data);\n\t}", "public function create_page(ModelClass $object, $parentselector = '') {\n\n }", "public static function createByPageNo(\\SetaPDF_Core_Document $document, $pageNumber) {}", "function newPage()\n {\n $this->lastPageNumber ++;\n if ($this->lastPageNumber != 1)\n $this->documentBuffer .= \"<br clear=\\\"all\\\" style=\\\"page-break-before: always;\\\">\";\n return $this->lastPageNumber;\n }", "function thumbwhere_contentcollection_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollection');\n return $controller->addPage();\n}", "public function createAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/create\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a item\",\n ]);\n }", "function create_pages() {\r\n\r\n $wpc_pages = $this->pre_set_pages();\r\n\r\n $wpc_client_page = get_page_by_title( 'Portal' );\r\n\r\n if ( !isset( $wpc_client_page ) || 0 >= $wpc_client_page->ID ) {\r\n\r\n $current_user = wp_get_current_user();\r\n //Construct args for the new page\r\n $args = array(\r\n 'post_title' => 'Portal',\r\n 'post_status' => 'publish',\r\n 'post_author' => $current_user->ID,\r\n 'post_content' => '[wpc_redirect_on_login_hub]',\r\n 'post_type' => 'page',\r\n 'ping_status' => 'closed',\r\n 'comment_status' => 'closed'\r\n );\r\n $parent_page_id = wp_insert_post( $args );\r\n }\r\n\r\n $settings = get_option( 'wpc_settings' );\r\n\r\n foreach( $wpc_pages as $wpc_page ) {\r\n\r\n $wpc_client_page = get_page_by_title( $wpc_page['name'] );\r\n\r\n if ( !isset( $wpc_client_page ) || 0 >= $wpc_client_page->ID ) {\r\n\r\n $current_user = wp_get_current_user();\r\n //Construct args for the new page\r\n $args = array(\r\n 'post_title' => $wpc_page['name'],\r\n 'post_status' => 'publish',\r\n 'post_author' => $current_user->ID,\r\n 'post_content' => $wpc_page['content'],\r\n 'post_type' => 'page',\r\n 'ping_status' => 'closed',\r\n 'comment_status' => 'closed',\r\n 'post_parent' => $parent_page_id,\r\n );\r\n $page_id = wp_insert_post( $args );\r\n\r\n $settings['pages'][$wpc_page['id']] = $page_id;\r\n }\r\n\r\n\r\n }\r\n\r\n update_option( 'wpc_settings', $settings );\r\n\r\n }", "public function canCreateNewPages() {}", "function create_custom_pages() {\n $custom_pages = array(\n 'issues' => 'Issues',\n 'weeklies' => 'Weeklies',\n 'artists' => 'Artists',\n 'contributors' => 'Contributors',\n 'incubator' => 'Incubator',\n 'about' => 'About',\n 'shop' => 'Shop',\n 'contribute' => 'How to Contribute',\n 'contact' => 'Contact Us',\n 'faq' => 'FAQ',\n 'definitions' => 'Definitions',\n 'terms-and-conditions' => 'Terms & Conditions',\n 'bag' => 'Bag',\n );\n foreach($custom_pages as $page_name => $page_title) {\n $page = get_page_by_path($page_name);\n if( empty($page) ) {\n wp_insert_post( array(\n 'post_type' => 'page',\n 'post_title' => $page_title,\n 'post_name' => $page_name,\n 'post_status' => 'publish'\n ));\n }\n }\n}", "public function create($data)\n {\n return Page::create($data);\n }", "public function testPageCreate()\n {\n $faker = Faker::create();\n $response = $this\n ->actingAs(User::whereNotNull(\"verified\")->inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('POST', \"/api/pages/\", [\n \"data\" => [\n \"name\" => $faker->sentence(4, true),\n ],\n \"relationships\" => [\n \"body\" => [\n \"data\" => [\n \"content\" => $faker->paragraphs(4, true),\n ],\n ],\n ],\n ]);\n $response\n ->assertStatus(201);\n }", "#[@test]\n function testCreation() {\n $doc= &new PDFDocument();\n $root= &$doc->getRootPage();\n $root->addChild(new PDFPage());\n }", "public function actionCreate()\n\t{\n\t\t$model = new Page;\n\n\t\tif(isset($_POST['Page']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Page'];\n\t\t\tif (isset($_POST['tags']))\n\t\t\t\t$model->setTags($_POST['tags']);\n\t\t\tif($model->save())\n\t\t\t\t$this->redirectModel($model);\n\t\t}\n\t\telse if(isset($_GET['key']))\n\t\t\t$model->key = $_GET['key'];\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreatePages()\n {\n $model = new Pages();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view-pages', 'id' => $model->id]);\n } else {\n return $this->render('pages/create', [\n 'model' => $model,\n ]);\n }\n }", "public function createAction() : object\n {\n $title = \"Skapa nytt innehåll\";\n\n // Check if not logged in, redirect to login page\n if (!$this->app->session->get('user')) {\n return $this->app->response->redirect(\"content/login\");\n }\n\n if (hasKeyPost(\"doSave\")) {\n $title = getPost(\"contentTitle\");\n\n $sql = \"INSERT INTO content (title) VALUES (?);\";\n $this->app->db->execute($sql, [$title]);\n\n return $this->app->response->redirect(\"content\");\n }\n\n // Add and render page to add content\n $this->app->page->add(\"content/create\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "public function create()\n\t{\n\t\t$pageID = 'create';\n\t\treturn View::make('pages.create')->with('pageID', $pageID);\n\t}", "public function testIndexNewPublicPage()\n {\n\n // Add a public page.\n $page = $this->_simplePage(true);\n\n // Should add a Solr document.\n $this->_assertRecordInSolr($page);\n\n }", "function customcert_add_page($data) {\n global $DB;\n\n // Set the page number to 1 to begin with.\n $pagenumber = 1;\n // Get the max page number.\n $sql = \"SELECT MAX(pagenumber) as maxpage\n FROM {customcert_pages} cp\n WHERE cp.customcertid = :customcertid\";\n if ($maxpage = $DB->get_record_sql($sql, array('customcertid' => $data->id))) {\n $pagenumber = $maxpage->maxpage + 1;\n }\n\n // Store time in a variable.\n $time = time();\n\n // New page creation.\n $page = new stdClass();\n $page->customcertid = $data->id;\n $page->width = '210';\n $page->height = '297';\n $page->pagenumber = $pagenumber;\n $page->timecreated = $time;\n $page->timemodified = $time;\n\n // Insert the page.\n $DB->insert_record('customcert_pages', $page);\n}", "public function create()\n {\n\treturn view('pages.create');\n }", "public function create()\n {\n return view('backend::page.create');\n }", "public function create()\n {\n $thread = new Thread;\n $comment = new Comment;\n $page = Param::get('page_next', 'create');\n $username = $_SESSION['username'];\n\n switch ($page) {\n case 'create':\n break;\n case 'create_end';\n $thread->title = Param::get('title');\n $comment->username = $username;\n $comment->body = Param::get('body');\n try {\n $thread->create($comment);\n } catch (ValidationException $e) {\n $page = 'create';\n }\n break;\n default:\n throw new NotFoundException(\"{$page} is not found\");\n break;\n }\n\n $this->set(get_defined_vars());\n $this->render($page);\n }", "function createPages() {\n\t// drop pages table (for development only)\n\tDB::exec(\"DROP TABLE IF EXISTS pages\");\n\n\t// `name` should be unique and cannot be null\n\t// `route` must be unique but can be null (e. g. when a page shouldn't be accessible via an URL)\n\t// `layout` is a foreign key that references ANOTHER row in the pages table,\n\t// \tif the referenced row is deleted the value will be set to NULL\n\tDB::exec(\"CREATE TABLE pages (\n\t\tid INT NOT NULL AUTO_INCREMENT PRIMARY KEY,\n\t\tname VARCHAR(50) NOT NULL UNIQUE,\n\t\troute VARCHAR(50) NULL UNIQUE,\n\t\tcontent TEXT NULL\n\t)\");\n\n\toutput(RESULT_INFO, \"Pages setup successfully completed\");\n\treturn 1;\n}", "public function testCreatePage()\n {\n // 1. Create Page\n $this->createPage();\n\n // 2. Test if content is created\n $this->assertTrue(Content::first() ? true : false);\n }", "function create(&$a_pg_obj, $a_hier_id)\n\t{\n\t\t$this->node = $this->createPageContentNode();\n\t}", "public function create()\n {\n $user_id = auth()->user()->id;\n return view(\"pages.create\")->with(\"user\", $user_id);\n }", "public function run()\n {\n \\App\\Models\\Page::create([\n 'title' => 'Terms',\n 'body' => $this->terms(),\n 'post_type' => 'page',\n 'author_id' => 1\n ]);\n\n \\App\\Models\\Page::create([\n 'title' => 'Policy',\n 'body' => $this->privacy(),\n 'post_type' => 'page',\n 'author_id' => 1\n ]);\n\n \\App\\Models\\Page::create([\n 'title' => 'Contact',\n 'body' => null,\n 'post_type' => 'page',\n 'author_id' => 1\n ]);\n }", "function page_generatePage($page_id=0,$offset=0,$extravars=array()) {\n\tglobal $Auth,$input_language,$previewMode;\n\n\t## prepare the multiclient support\n\t$client_id = $Auth->auth[\"client_id\"];\t\n\n\t## get the page info- and the homepage if we don't have a page\n\t$pageInfo = frontend_getPageInfo($page_id,$client_id);\n\t$page_id \t\t= intval($pageInfo[\"page_id\"]);\n\t$menu_id \t\t= isset($pageInfo[\"id\"]) ? $pageInfo[\"id\"] : 0;\t\t\n\t$template_id\t= $pageInfo[\"template_id\"];\n\n\t## try to fetch the cached scaffold page\n\t$cached_scaffold = pagecache_getCacheFile($page_id);\n\n\t## check if we have a scaffold\n\tif($cached_scaffold === false) {\n\t\t## we need to create a new scaffold file\n\t\t$cached_scaffold = page_generateScaffold($pageInfo,$offset,$extravars);\n\t}\n\t\t\t\n\t$dbConnection = new DB_Sql();\n\t\t\t\t\n\t## grab the information for this page\n\t$select_query = \"SELECT basename FROM \".PAGE_TEMPLATE.\" WHERE template_id='$template_id' AND client_id='$client_id'\";\n\t$result_pointer = $dbConnection->query($select_query);\n\t\n\tif($dbConnection->next_record()) {\n\t\t$filename = $dbConnection->Record[\"basename\"];\n\t\t$xmlFile = $filename.\".xml\";\n\t\t$filename = $filename.\".tpl\";\n\t} else {\n\t\t## maybe we can come with some good default behavior\n\t\texit();\n\t}\n\n\t## for the body we need to examine the xml file- to find out \n\t## what type of form elements we need to position\n\t$wt = new xmlparser(HTML_DIR.$xmlFile);\n\t$wt->parse();\n\t\n\t## okay we scanned in the xml file- so we now loop through all the elements\n\t$elements = $wt->getCacheElements();\t\n\t$objects = $wt->getCacheObjects();\t\n\t\n\t## we should get the page content\n\t$page_record = page_getPage($page_id,$objects);\n\t\n\t$counter = 0;\n\t$num_elements = count($elements);\n\t\n\twhile($counter < $num_elements) {\n\t\t## okay first we try to find out what type we have\n\t\t## we wrap this up in a switch statemnt- this way we can extend it more easily\n\t\t$element_type = $elements[$counter]['TYPE'];\n\t\t$element_name = $elements[$counter]['NAME'];\t\n\t\tswitch($element_type) {\n\t\t\tcase 'TEXT':\n\t\t\tcase 'COPYTEXT':\n\t\t\tcase 'DATE': \n\t\t\tcase 'LINK' :\n\t\t\tcase 'FILE':\n\t\t\tcase 'IMAGE': \n\t\t\tcase 'LINKLIST': \n\t\t\tcase 'BOX':\n\t\t\t\t## get the data and set the var in the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\teval(\"\\$element = output_\".$target.\"(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,$page_id);\");\t\n\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase 'INCLUDE' : {\n\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t## and the output the results to the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\t\n\t\t\t\teval(\"\\$element = output_\".$target.\"('',\\$elements[\\$counter],$menu_id,$page_id);\");\n\t\t\t\t\n\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t$varvals = array();\n\t\t\t\t\n\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t}\t\t\t\t\n\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t} else {\n\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t\tdefault: {\n\t\t\t\t## we need to check if we have a module for this datatype\n\t\t\t\t$target = strtolower($element_type);\n\t\t\t\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(\"datatypes/extra_\".$target.\"/\".$target.\".php\");\n\t\t\t\t## now we check if the function exists\n\t\t\t\t\n\t\t\t\tif(function_exists($target.\"_output\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\t## check if the page_record entry is defined\n\t\t\t\t\t## if not we need to pass the whole record\n\t\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,\\$page_id);\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t##var_dump(eval();\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record,\\$elements[\\$counter],\\$layout_template,\\$menu_id,\\$page_id);\");\n\t\t\t\t\t}\t\n\t\t\t\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\n\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$counter++;\n\t}\n\n\t## finally strip all empty tags\n\t$cached_scaffold = preg_replace('/{[^ \\t\\r\\n}]+}/', \"\", $cached_scaffold); \n\n\t## this is it- so we will flush the template here\t\t\n\treturn $cached_scaffold;\n}", "function ax_create_document() {\n\t$root = ax_indirect_dictionary('Root');\n\t$root['Pages'] = ax_indirect_dictionary('Pages');\n\t$info = ax_indirect_dictionary();\n\t$info['Creator'] = AX_ACROSTIX_CREATOR_STRING;\n\t$info['CreationDate'] = ax_date(time());\n\t$trailer = array();\n\t$trailer['Root'] =& $root;\n\t$trailer['Info'] =& $info;\t\n\t\n\t$doc_obj = new AxDocument;\n\t$doc_obj->pages = array();\n\t$doc_obj->info =& $info;\n\t$doc_obj->PDFStructure = $trailer;\t\n\treturn $doc_obj;\n}", "public function actionCreate()\n {\n $model = new LandingPage();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $page = new Page;\n $pages = Page::where('id', '!=', $page->id)->get();\n $auth = Auth::user();\n $users = User::get();\n $templates = Template::get();\n $image = null;\n $imagefiles = null;\n foreach($users as $user) {\n if($auth->id == $user->id) {\n $user->loggedin = true;\n break;\n }\n }\n return view('admin.pages.create')\n ->with(compact('page',$page))\n ->with(compact('pages',$pages))\n ->with(compact('users',$users))\n ->with(compact('image',$image))\n ->with(compact('imagefiles',$imagefiles))\n ->with(compact('templates',$templates));\n }", "public function addPage($app)\n\t{\n\t\t// check if te same title with dashes exists\n\t\t// if exists append 1 or 2 or whatever\n\t\t// the title added should be added as alias\n\t\t// the route should also be same as the title.\n\t\t// the content of the page should be added to a new file. if no content then just create a file\n\t\t// save draft only save the page \n\t\t// publish would display the page also\n\t\t\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\n\t\t$app->get('POST')['title'] = strtolower(str_replace(' ','-',$app->get('POST')['title']));\n\n\t\tif(!($cms_page->findIf(\"title = '{$app->get('POST')['title']}'\"))) {\n\n\t\t// \t$values = array_merge( $app->get('POST'), \n\t\t// \t\tarray(\n\t\t// \t\t\t'filename' => md5($app->get('POST')['title']),\n\t\t// \t\t\t'route' => '/'.strtolower($app->get('POST')['title'])\n\t\t// \t\t\t)\n\t\t// \t\t);\n\t\t\n\t\t// \t$added = $cms_page->addNew($values);\n\t\t\t\n\t\t// \tif($added) {\n\t\t// \t\tif(!file_exists($app->get('UI').\"website/\".$values['filename'].\".html\"))\n\t\t// \t\t\t$file = fopen($app->get('UI').\"website/\".$values['filename'].\".html\",\"w\");\n\t\t// \t\telse\n\t\t// \t\t\techo \"The File already exists\";\n\t\t// \t}\n\t\t// \tfclose($file);\n\t\t// }\n\t}\n\tpublic function showEditForm($app)\n\t{\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\t\t$cms_pages = $cms_page->getById($app->get('PARAMS.id'));\n\t\t$app->set('DATA',$cms_pages[0]);\n\n\t\t$app->set('CMS_PAGE',\\View::instance()->render('website/'.$app->get('DATA')['filename'].\".html\"));\n\n\t\t//echo $app->get('CMS_PAGE');\n\n\t\techo \\Template::instance()->render('admin/cms/editPage.html');\n\t}\n\tpublic function editPage($app)\n\t{\n\t// \t$cms_page = new CMS_PAGE($app->get('DB'));\n\t// \t$app->post\t\n\t}\n\tpublic function deletePage()\n\t{\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\t\t$cms_page->delete();\n\t}\n\tpublic function updatePage($app)\n\t{\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\t\t$updated = $cms_page->updateStatus($app->get('PARAMS'));\n\n\t\tif($updated)\n\t\t\t$app->reroute('@admin_cms');\n\t}\n\tpublic function __toString()\n\t{\n\t\treturn __CLASS__;\n\t}\n}", "public function startNewPage()\n {\n }", "function add_page()\n\t{\n\t\tglobal $errors, $Cl_root_path, $basic_gui;\n\t\t\n\t\t// main check\n\t\tif ( !isset( $_POST[ 'submit_page' ] ) )\n\t\t{\n\t\t\t$errors->report_error( $this->lang[ 'Wrong_form' ], CRITICAL_ERROR );\n\t\t}\n\t\t\n\t\t// get data\n\t\t$title = ( isset( $_POST[ 'title' ] ) ) ? strval( $_POST[ 'title' ] ) : '';\n\t\t$lang = ( isset( $_POST[ 'language' ] ) ) ? strval( $_POST[ 'language' ] ) : '';\n\t\t$text = str_replace( '&nbsp;', ' ', $basic_gui->gennuline( ( isset( $_POST[ 'editor1' ] ) ) ? strval( $_POST[ 'editor1' ] ) : '' ) );\n\t\t$auth = ( isset( $_POST[ 'auth' ] ) ) ? intval( $_POST[ 'auth' ] ) : GUEST;\n\t\t\n// \t\t$text = str_replace( \"\\n\", '<br />', $text );\n\t\t\n\t\tif ( empty( $title ) || empty( $text ) )\n\t\t{ // need these\n\t\t\t$errors->report_error( $this->lang[ 'No_data' ], GENERAL_ERROR );\n\t\t}\n\t\t\n\t\t// save to the array\n\t\t$pag = array( 'content' => $text, 'auth' => $auth );\n\t\tif ( !is_array( $this->pages_array[ $lang ] ) )\n\t\t{ // make it an array, just to be sure\n\t\t\t$this->pages_array[ $lang ] = array();\n\t\t}\n\t\t$this->pages_array[ $lang ][ $title ] = $pag;\n\t\t\n\t\t// now write it\n\t\t$this->save_pages();\n\t\t\n\t\t$errors->report_error( $this->lang[ 'Added' ], MESSAGE );\n\t}", "function newp($page = 0)\r\n\t{\r\n\t\t$user = $this->user->get_main_user();\r\n\t\t$surveys = $this->survey->get_surveys_new($user, ONEPAGE_NUM, $page * ONEPAGE_NUM, $total);\r\n\t\t$meta = new Metaobj();\r\n\t\t$meta->setup_catalog_new();\r\n\t\t$pager = new Pagerobj(array ('parOnePage' => ONEPAGE_NUM, 'url' => PATH_NEW));\r\n\t\t$pager->doIt($total, $page);\r\n\t\t$this->load->view('head', array('meta' => $meta));\r\n\t\t$this->load->view('navbar', array('user' => $user));\r\n\t\t$this->load->view('title', array('title' => $meta->get_title(), 'offset' => 2));\r\n\r\n\t\t$this->load->view('catalognew', array ('surveys' => $surveys, 'pager' => $pager));\r\n\r\n\t\t$this->load->view('foot', array('user' => $user));\r\n\t}", "public function createPage()\n {\n echo $this->output;\n }", "function page_add_page($pagerec) {\n return page_edit_page($pagerec, 0, null, null);\n}", "public function create()\n {\n return view('admin.page.addpage');\n }", "function save_page() {\n \t$forceXHR = setXHRDebug($this, 0);\n $this->layout = null;\n $ret = 0;\n\t\tif ($this->data) {\n /*\n\t\t\t * COPIED FROM /pagemaker/save_page !!!\n * POST - save/append/delete PageGallery file\n */ \t\n // allow guest users to save\n $dest = $this->data['dest'];\t// dest\tfile, book\n if (isset($this->data['key']) && $this->data['key']!=='undefined') $secretKeyDest = $this->data['key'];\n\t\t\tif (empty($secretKeyDest)) {\n\t\t\t\t// NOTE: to save different stories for the same dest/filename, make sure key is empty\n\t\t\t\t$uuid = AppController::$userid ? AppController::$userid : String::uuid();\n\t\t\t\t$secretKeyDest = $this->__getSecretKey($uuid, $this->__getSeed($dest));\n\t\t\t}\n \tif ($secretKeyDest) {\t\n\t $content = $this->data['content'];\t\t// page content\n\t /*\n\t * read content from page\n\t */\n\t \t\tif (empty($content)) {\n\t \t\t\t$src = $this->data['src'];\t\t// source file, stored in /svc/pages\n\t \t\t\t$secretKeySrc = $this->__getSecretKey($uuid, $this->__getSeed($src));\n\t\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$src.'_'.$secretKeySrc.'.div';\n\t\t $content = @file_get_contents($File);\n\t \t\t}\n\t /*\n\t * append or write content to book\n\t */\n\t $File = Configure::read('path.svcroot').Configure::read('path.pageGalleryPrefix').DS.$dest.'_'.$secretKeyDest.'.div';\n\t // append page to book\n\t $mode = isset($this->data['reset']) ? 'w' : 'a';\n\t $Handle = fopen($File, $mode);\n\t fwrite($Handle, $content);\n\t fclose($Handle);\n\t // don't unlink\n\t $ret = 1;\n\t\t\t}\n\t\t} else {\n\t\t\t$ret = false;\n\t\t}\n\t\t$this->autoRender = false;\n\t\theader('Content-type: application/json');\n\t\theader('Pragma: no-cache');\n\t\theader('Cache-control: no-cache');\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); \t\t\n\t\t$success = $ret ? true : false;\n\t\tif ($success) {\n\t\t\theader(\"HTTP/1.1 201 CREATED\");\n\t\t\t$message = \"Your Story was saved.\";\n\t\t\t$response = array(\n\t\t\t\t'key'=>$secretKeyDest, \n\t\t\t\t'link'=>\"/gallery/story/{$dest}_{$secretKeyDest}\",\n\t\t\t);\n\t\t} else {\n\t\t\t$message = \"There was an error saving your Story. Please try again.\";\n\t\t\t$response = array();\n\t\t}\n\t\techo json_encode(compact('success', 'message', 'response'));\n\t\treturn;\n }", "public function actionCreate()\n {\n $page = new Page;\n $pageForm = new PageForm;\n $pageForm->setAttributes($page->getAttributes());\n\n if ($pageForm->load(Yii::$app->request->post()) && $pageForm->validate()) {\n $currentDatetime = gmdate('Y-m-d H:i:s');\n\n $page->setAttributes($pageForm->getAttributes());\n $page->generateSlug($pageForm->slug);\n $page->updated_at = $currentDatetime;\n $page->created_at = $currentDatetime;\n\n if ($page->save()) {\n return $this->redirect(Url::previous('actions-redirect'));\n }\n }\n\n return $this->render('create', [\n 'page' => $page,\n 'pageForm' => $pageForm,\n ]);\n }", "function eventon_create_page( $slug, $option, $page_title = '', $page_content = '', $post_parent = 0 ) {\n\tglobal $wpdb;\n\n\t$option_value = get_option( $option );\n\n\tif ( $option_value > 0 && get_post( $option_value ) )\n\t\treturn;\n\n\t$page_found = $wpdb->get_var( $wpdb->prepare( \"SELECT ID FROM \" . $wpdb->posts . \" WHERE post_name = %s LIMIT 1;\", $slug ) );\n\tif ( $page_found ) {\n\t\tif ( ! $option_value )\n\t\t\tupdate_option( $option, $page_found );\n\t\treturn;\n\t}\n\n\t$page_data = array(\n 'post_status' \t\t=> 'publish',\n 'post_type' \t\t=> 'page',\n 'post_author' \t\t=> 1,\n 'post_name' \t\t=> $slug,\n 'post_title' \t\t=> $page_title,\n 'post_content' \t\t=> $page_content,\n 'post_parent' \t\t=> $post_parent,\n 'comment_status' \t=> 'closed'\n );\n $page_id = wp_insert_post( $page_data );\n\n update_option( $option, $page_id );\n}", "function create_page($input_array)\n\t{\n\t\t$this->db->insert('red_diy_pages',$input_array);\n\t\treturn $this->db->insert_id();\n\t}", "public function createPage(string $text, ?EditInfo $editInfo = null): bool\n {\n if (!empty($this->page->getRevisions()->getLatest())) {\n throw new Exception('That page already exists');\n }\n\n $newContent = new Content($text);\n // $identifier = $this->page->getPageIdentifier()\n $title = new Title($this->title);\n $identifier = new PageIdentifier($title);\n $revision = new Revision($newContent, $identifier);\n\n return $this->wiki->newRevisionSaver()->save($revision, $editInfo);\n }", "function create(&$a_pg_obj, $a_hier_id, $a_pc_id = \"\")\n\t{\n\t\t$this->node = $this->createPageContentNode();\n\t\t$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);\n\t\t$this->tabs_node =& $this->dom->create_element(\"Tabs\");\n\t\t$this->tabs_node =& $this->node->append_child($this->tabs_node);\n\t}", "public function create()\n { \n $pages = page::all();\n return view('sections.create')\n ->with('pages', $pages);\n }", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "public function create()\n {\n return view('admin.page.create');\n }", "public function create()\n {\n return view('admin.page.create');\n }", "public function create()\n {\n $page = new Page();\n $page->created_at = date('Y-m-d H:i:s');\n\n $data['autoIncrement'] = get_autoincrement('content');\n $data['action'] = route('admin.pages.store');\n $data['page'] = $page;\n\n return view('admin.pages.form', $data)->with(['title' => 'Создание страницы']);\n }", "public function create()\n {\n return view('admin.pages.create');\n }", "public function create()\n {\n // $templates = $this->getPageTemplates();\n $orderPages = Page::all();\n return view('admin.pages.create')->with('orderPages', $orderPages);\n }", "function thumbwhere_contentcollectionitem_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollectionitem');\n return $controller->addPage();\n}", "public function create()\n {\n return view('backend.pages.create');\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page = new WikiPage;\n\n if ($this->createSlug) {\n $page->slug = $this->createSlug;\n }\n\n return view('cms-wiki::wiki.edit', [\n 'creating' => true,\n 'page' => $page,\n 'previousUrl' => $this->getPreviousUrl(),\n ]);\n }", "public function importPages() {\n\t\t$deletedPages = $this->db->run_query(\"DELETE FROM pages\");\n\t\t$this->debugPrint($deletedPages, \"pages deleted from new database\");\n\t\t\n\t\t$numExistingRecords = $this->importDb->run_query(\"SELECT * FROM pages\");\n\t\t$oldData = $this->importDb->farray_fieldnames();\n\t\t\n\t\t$oldPk = null;\n\t\t$firstRecord = $oldData[array_keys($oldData)[0]];\n\t\t\n\t\t$oldById = array();\n\t\t\n\t\tif(isset($firstRecord['page_id'])) {\n\t\t\t$oldPk = 'page_id';\n\t\t}\n\t\telseif(isset($firstRecord['id'])) {\n\t\t\t$oldPk = 'id';\n\t\t}\n\t\t\n\t\tif(!is_null($oldPk)) {\n\t\t\tforeach($oldData as $k=>$v) {\n\t\t\t\t$oldById[$v[$oldPk]] = $v;\n\t\t\t}\n\t\t}\n//\t\texit;\n\t\t\n\t\t// create a test page.\n\t\t$pageObj = new page($this->db);\n\t\t$testId = $pageObj->insert(array('title'=>'test'));\n\t\t\n\t\t$queryRes = $this->db->run_query(\"SELECT * FROM pages WHERE page_id=\". $testId);\n\t\t\n\t\t$numImported = 0;\n\t\t\n\t\tif($queryRes == 1) {\n\t\t\t$templateRecord = $this->db->get_single_record();\n\t\t\t\n\t\t\t// get rid of the template record.\n\t\t\t$pageObj->delete($testId);\n\t\t\t\n\t\t\t$validColumns = array_keys($templateRecord);\n\n\t\t\tforeach($oldData as $k=>$v) {\n\t\t\t\t$createPage = true;\n\t\t\t\t$insertData = $this->_cleanRecord($validColumns, $v);\n\t\t\t\t\n\t\t\t\t// attempt to preserve ID's\n\t\t\t\tif(!is_null($oldPk)) {\n\t\t\t\t\t$insertData['page_id'] = $v[$oldPk];\n\t\t\t\t\t\n\t\t\t\t\tif(intval($v['parent_id']) > 0 && !isset($oldById[$v['parent_id']])) {\n\t\t\t\t\t\t$createPage = false;\n\t\t\t\t\t\tunset($insertData['parent_id']);\n\t\t\t\t\t}\n//\t\t\t\t\tif(isset($oldById))\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tunset($insertData['parent_id']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($createPage === true) {\n\t\t\t\t\t// now insert the data.\n\t\t\t\t\t$importId = $pageObj->insert($insertData);\n\t\t\t\t\t$numImported++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->debugPrint($queryRes, \"result of query\");\n\t\t\t$this->debugPrint($testId, \"No page found, ID created was\");\n\t\t\tthrow new Exception(\"No record found\");\n\t\t}\n\t\t$this->debugPrint(\"{$numImported}/{$numExistingRecords}\", \"imported/existing page records\", 1, 0);\n\t\t\n\t\treturn $numImported;\n\t}", "abstract protected function view_generatePageContent();", "protected function createDocument(\r\n\t\t$key,\r\n\t\t$controller,\r\n\t\t$action,\r\n\t\t$navigation_name,\r\n\t\t$parent,\r\n\t\t$title = '',\r\n\t\t$navigation_exclude = false\r\n\t) {\r\n\t\t$document = new Document_Page();\r\n\t\t$document->setParent($parent);\r\n\t\t$document->setParentId($parent->getId());\r\n\t\t$document->setKey($key);\r\n\t\t$document->setController($controller);\r\n\t\t$document->setAction($action);\r\n\t\tif ($title != '') {\r\n\t\t\t$document->setTitle($title);\r\n\t\t}\r\n\t\tif ($navigation_exclude) {\r\n\t\t\t$document->setProperty(\"navigation_exclude\", 'bool', true, false, false);\r\n\t\t}\r\n\t\tif ($navigation_name != '') {\r\n\t\t\t$document->setProperty(\"navigation_name\", 'text', $navigation_name, false, false);\r\n\t\t}\r\n\t\t$document->setPath($parent->getFullPath() . '/');\r\n\t\t$document->save();\r\n\r\n\t\treturn $document;\r\n\t}", "function create()\n\t{\n\t\tif ($_GET[\"obj_id\"] != \"\")\n\t\t{\n\t\t\t$this->setTabs();\n\t\t}\n\t\tparent::create();\n\t}", "public function run()\n\t{\n\t\tDB::table('pages')->delete();\n\t\tPage::create(array(\n\t 'heading1' => '<h2 class=\"red-title\"><span>Driving Network Solution</span></h2>',\n 'body1' => '<p>Established in 2000, OCK Group is principally involved in the provision of telecommunications network services. We are able to provide full turnkey services in that respect.</p>',\n 'heading2' => '',\n 'body2' => '', \n\t ));\n\t\t\n\t}", "public function create()\n {\n return view('backEnd.pages.create');\n }", "public function create()\n {\n\n $page = new Page();\n\n if (Request::isMethod(\"post\")) {\n\n $page->title = Request::get('title');\n $page->slug = Request::get('slug');\n $page->excerpt = Request::get('excerpt');\n $page->content = Request::get('content');\n $page->image_id = Request::get('image_id');\n $page->user_id = Auth::user()->id;\n $page->status = Request::get(\"status\", 0);\n $page->lang = app()->getLocale();\n\n // Fire saving action\n\n Action::fire(\"page.saving\", $page);\n\n if (!$page->validate()) {\n return Redirect::back()->withErrors($page->errors())->withInput(Request::all());\n }\n\n $page->save();\n $page->syncTags(Request::get(\"tags\"));\n\n // Fire saved action\n\n Action::fire(\"page.saved\", $page);\n\n return Redirect::route(\"admin.pages.edit\", array(\"id\" => $page->id))\n ->with(\"message\", trans(\"pages::pages.events.created\"));\n }\n\n $this->data[\"page_tags\"] = array();\n $this->data[\"page\"] = $page;\n $this->data['lang'] = app()->getLocale();\n\n return View::make(\"pages::edit\", $this->data);\n }", "public function create()\n {\n $page_category = PageCategory::all();\n $list_view = Storage::disk('views')->files();\n $this->viewData = array(\n 'title' => 'Page Manager | Page | Create',\n 'page_category' => $page_category,\n 'list_view' => $list_view\n );\n return view ( 'pages::admin.pages.create', $this->viewData );\n }", "public function create()\n {\n return view('pages.create');\n }", "public function create()\n {\n return view('pages.create');\n }", "public function create()\n {\n return view('pages.create');\n }", "public function create()\n {\n return view('pages.create');\n }", "function create_checkout_page() {\r\n\t\tglobal $current_site;\r\n\r\n\t //insert new page if not existing\r\n\t switch_to_blog( $current_site->blog_id );\r\n\t\t$page = get_post( $this->get_setting('checkout_page') );\r\n\t\tif ( !$page || $page->post_status == 'trashed' ) {\r\n\t $id = wp_insert_post( array('post_title' => $this->get_setting('rebrand'), 'post_status' => 'publish', 'post_type' => 'page', 'comment_status' => 'closed', 'ping_status' => 'closed', 'post_content' => stripslashes(get_site_option('supporter_message'))) );\r\n\t\t\t$this->update_setting('checkout_page', $id);\r\n\t\t\t$this->update_setting('checkout_url', get_permalink($id));\r\n\t } else {\r\n\t\t\t$this->update_setting('checkout_url', get_permalink($this->get_setting('checkout_page')));\r\n\t\t}\r\n\t restore_current_blog();\r\n\t}", "function createDocmanWikiPage($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $obsolescence_date, $content, $permissions, $metadata, $owner, $create_date, $update_date) {\n $extraParams['item']['wiki_page'] = $content;\n return _createDocmanDocument($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $obsolescence_date, PLUGIN_DOCMAN_ITEM_TYPE_WIKI, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams);\n}", "public function create() {\n\n //page settings\n $page = $this->pageSettings('create');\n\n //reponse payload\n $payload = [\n 'page' => $page,\n ];\n\n //show the form\n return new CreateResponse($payload);\n }", "public function run()\n {\n //\n $page = [\n [\n 'id' => 1,\n 'name' => 'home',\n 'url' => '/'\n ],\n [\n 'id' => 2,\n 'name' => 'service',\n 'url' => '/services'\n ],\n [\n 'id' => 3,\n 'name' => 'promotion',\n 'url' => '/promotions'\n ],\n [\n 'id' => 4,\n 'name' => 'event',\n 'url' => '/events'\n ]\n ];\n Page::insert($page);\n }", "public function create()\n {\n //获取公司简介信息\n $com = Page::where(\"type\",'=',1)->first();\n // 加载公司简介视图\n return view('admin.page.create')->with('jianjie',$com);\n }", "function lb_show_make_page() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'make_page',\n\t\t\t'pages' => lb_get_all_pages_from_pages(),\n\t\t)\n\t);\n}" ]
[ "0.7641419", "0.7630136", "0.7597068", "0.7238792", "0.7217941", "0.7099728", "0.7058461", "0.7043787", "0.68892604", "0.6834219", "0.67958134", "0.6762947", "0.67534626", "0.6618111", "0.6592643", "0.65925175", "0.65309864", "0.6521558", "0.65000516", "0.6456088", "0.6445667", "0.6430212", "0.6404824", "0.63913244", "0.6383049", "0.63640803", "0.6342257", "0.63361377", "0.63322264", "0.632722", "0.63228005", "0.63031393", "0.6290734", "0.6287092", "0.6255274", "0.62286854", "0.6226184", "0.6224608", "0.62226665", "0.6218611", "0.6215188", "0.6214859", "0.62125313", "0.6209965", "0.62086844", "0.6205101", "0.619997", "0.61908555", "0.6188209", "0.6184306", "0.6177665", "0.6177113", "0.6176157", "0.6170067", "0.61444074", "0.6142997", "0.61382407", "0.613502", "0.6134014", "0.6130942", "0.61283654", "0.6121636", "0.6117611", "0.610035", "0.6092537", "0.60916996", "0.6089816", "0.6085145", "0.6081056", "0.60783124", "0.6066051", "0.6046827", "0.60465103", "0.6042928", "0.6042928", "0.60397476", "0.6030919", "0.60256267", "0.6025162", "0.60242873", "0.6015712", "0.6012871", "0.60055244", "0.60031354", "0.59865105", "0.59839606", "0.5980401", "0.5979891", "0.5968358", "0.59663916", "0.59657776", "0.59657776", "0.59657776", "0.59657776", "0.59647155", "0.5964286", "0.59619355", "0.5957456", "0.5953309", "0.59502023" ]
0.6749907
13
Add text to current page and return it's coordinates Create new page if needed
public function addText($text = "", $x, $y, $opt = FONT_REGULAR_10, &$curPos = null) { /* Close current page and create new one if current position reach end of page */ if ($curPos && $curPos["y"] <= 10) { $this->endPage(); $this->createPage(); /* Add text to top of new page */ $this->pdf->fit_textline($text, $x, 800, $opt); } else { $this->pdf->fit_textline($text, $x, $y, $opt); } $curPos = array( "x" => $this->pdf->get_option("textx", ""), "y" => $this->pdf->get_option("texty", ""), ); return $curPos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function page_text($x, $y, $text, $font, $size, $color = array(0,0,0), $adjust = 0, $angle = 0) {\n $this->_pdf->close_object();\n $this->_pdf->page_text($x, $y, $text, $font, $size, $color, $adjust, $angle);\n $this->_pdf->reopen_object($this->_current_page_id);\n }", "function NewPage()\n {\n $ypos = $this->GetY();\n if ($ypos > 230){\n $this->AddPage();\n }\n }", "function newPage($pdf) {\r\n global $OrderId, $currentRow, $itemRowStart;\r\n\r\n $currentRow = $itemRowStart;\r\n\r\n $pdf->Addpage();\r\n $pdf->SetFont('Helvetica', 'B', 16);\r\n $pdf->Image('blissLogo.png');\r\n $pdf->Text(20, 43, \"OrderId:\");\r\n $pdf->Text(43, 43, $OrderId);\r\n $pdf->SetFont('Arial', 'I', 10);\r\n $pdf->SetY(266.5);\r\n $pdf->Cell(0, 10, 'Page ' . $pdf->PageNo(), 0, 0, 'C');\r\n $pdf->line( 12,245,190,245);\r\n$pdf->line( 12,267,190,267);\r\n\r\n \r\n}", "public function insertDocumentNumber(Zend_Pdf_Page $page, $text)\r\n {\r\n // get first page for number\r\n $page = reset($this->_getPdf()->pages);\r\n $page->setFillColor(new Zend_Pdf_Color_GrayScale(1));\r\n $this->_setFontRegular($page, 10);\r\n $docHeader = $this->getDocHeaderCoordinates();\r\n $page->drawText($text, 35, $docHeader[1] - 15, 'UTF-8');\r\n }", "public function pageWithText($page, $text)\n {\n return '';\n }", "function writePage($text) {\n //TODO: Write the text to the page.\n return 1;\n }", "public function add( $text ) {\n\t\t$this->page->append( $text );\n\t}", "private function nextPage() {\n $this->lastPage = array(\n \"vOffset\" => $this->vOffset,\n \"hOffset\" => $this->hOffset,\n );\n $footerToAppend = false;\n $this->currentPageNumber++;\n if (isset($this->pages[$this->currentPageNumber])) {\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = 0;\n } else {\n $this->pages[$this->currentPageNumber] = $this->haruDoc->addPage();\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->currentPage->setTextRenderingMode(\\HaruPage::FILL);\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = ($this->hOffset ? $this->hOffset : 0);\n $footerToAppend = true;\n }\n if ($this->currentFont && $this->currentFontSize && $this->currentFontColor) {\n $this->currentPage->setFontAndSize($this->currentFont, $this->currentFontSize);\n $this->setColor($this->currentFontColor[0], $this->currentFontColor[1], $this->currentFontColor[2]);\n }\n if ($footerToAppend && $this->currentPageNumber > 1) {\n $this->currentPage->beginText();\n $this->setFont(self::FONT_NORMAL, 12, array(0,0,0));\n $this->currentPage->textOut($this->PAGE_WIDTH - self::HMARGIN - $this->currentPage->getTextWidth($this->currentPageNumber),\n self::VMARGIN - 30, $this->currentPageNumber);\n $this->revertFont();\n $this->setFont(self::FONT_BOLD, 12, array(0,0,0));\n $this->currentPage->textOut(self::HMARGIN,\n self::VMARGIN - 30, $this->currentBookName);\n $this->revertFont();\n $this->currentPage->endText();\n\n }\n\n }", "public function appendOneLine($text) {\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n $this->currentPage->beginText();\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->currentPage->endText();\n return $text;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed)\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n\n return ($isLastLine ? null : $text);\n }", "public function drawText(Zend_Pdf_Page $page, $text, $x1, $y1, $x2 = null, $position = self::TEXT_ALIGN_LEFT, $encoding = null) {\n $bottom = $y1; // could do the same for vertical-centering\n\n switch ($position) {\n case self::TEXT_ALIGN_LEFT:\n $left = $x1;\n break;\n case self::TEXT_ALIGN_RIGHT:\n $text_width = $this->getTextWidth($text, $page->getFont(), $page->getFontSize());\n $left = $x1 - $text_width;\n break;\n case self::TEXT_ALIGN_CENTER:\n if (null === $x2) {\n throw new Exception(\"Cannot center text horizontally, x2 is not provided\");\n }\n $text_width = $this->getTextWidth($text, $page->getFont(), $page->getFontSize());\n $box_width = $x2 - $x1;\n $left = $x1 + ($box_width - $text_width) / 2;\n break;\n default:\n throw new Exception(\"Invalid position value \\\"$position\\\"\");\n }\n\n // display multi-line text\n foreach (explode(PHP_EOL, $text) as $i => $line) {\n $page->drawText($line, $left, $bottom - $i * $page->getFontSize(), $encoding);\n }\n return $this;\n }", "function addText($text);", "function addPageContent(& $page, & $parentElement) {\n\t\t$element = $parentElement->appendChild(\n\t\t\t$this->_document->createElement('pageContent'));\n\t\t\n\t\t$this->addCommonProporties($page, $element);\n\t\t\n\t\t$textElement = $element->appendChild($this->_document->createElement('text'));\n\t\t$textElement->appendChild(\n\t\t\t$this->_document->createCDATASection(urldecode($page->getField('text'))));\n\t\t\n\t\tif ($page->getField('location') == 'right')\n\t\t\t$element->setAttribute('location', 'right');\n\t\telse\n\t\t\t$element->setAttribute('location', 'left');\n\t}", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "function getPos($sourcefile_width,$sourcefile_height,$pos,$met_image=\"\"){\n if ($met_image){\n $insertfile_width = ImageSx($met_image);\n $insertfile_height = ImageSy($met_image);\n }else {\n $lineCount = explode(\"\\r\\n\",$this->met_text);\n $fontSize = imagettfbbox($this->met_text_size,$this->met_text_angle,$this->met_text_font,$this->met_text);\n $insertfile_width = $fontSize[2] - $fontSize[0];\n $insertfile_height = count($lineCount)*($fontSize[1] - $fontSize[5]);\n\t\t\t $fontSizeone =imagettfbbox($this->met_text_size,$this->met_text_angle,$this->met_text_font,'e');\n\t\t\t $fontSizeone = ($fontSizeone[2] - $fontSizeone[0])/2;\n }\n\t\tswitch ($pos){\n\t\t\tcase 0:\n\t\t\t $dest_x = ( $sourcefile_width / 2 ) - ( $insertfile_width / 2 );\n\t\t\t $dest_y = ( $sourcefile_height / 2 ) + ( $insertfile_height / 2 );\n\t\t\t break;\n\n\t\t\tcase 1:\n\t\t\t $dest_x = 0;\n\t\t\t $dest_y = $insertfile_height;\n\t\t\t break;\n\t\t\tcase 2:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width-$fontSizeone;\n\t\t\t $dest_y = $insertfile_height;\n\t\t\t break;\n\n\t\t\tcase 3:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width-$fontSizeone;\n\t\t\t $dest_y = $sourcefile_height - ($insertfile_height/4);\n\t\t\t break;\n\n\t\t\tcase 4:\n\t\t\t $dest_x = 0;\n\t\t\t $dest_y = $sourcefile_height - ($insertfile_height/4);\n\t\t\t break;\n\n\t\t\tcase 5:\n\t\t\t $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 );\n\t\t\t $dest_y = $insertfile_height;\n\t\t\t break;\n\n\t\t\tcase 6:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width -$fontSizeone;\n\t\t\t $dest_y = ( $sourcefile_height / 2 ) + ( $insertfile_height / 2 );\n\t\t\t break;\n\n\t\t\tcase 7:\n\t\t\t $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 );\n\t\t\t $dest_y = $sourcefile_height - ($insertfile_height/4);\n\t\t\t break;\n\n\t\t\tcase 8:\n\t\t\t $dest_x = 0;\n\t\t\t $dest_y = ( $sourcefile_height / 2 ) + ( $insertfile_height / 2 );\n\t\t\t break;\n\n\t\t\tdefault:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width;\n\t\t\t $dest_y = $sourcefile_height - $insertfile_height;\n\t\t\t break;\n\t\t}\t\n\t\tif($met_image){\n\t\t\t$dest_y=$dest_y-$insertfile_height;\n\t\t}\n return array(\"dest_x\"=>$dest_x,\"dest_y\"=>$dest_y);\n}", "function addPage($pdf,$font='freesans'){\n $pdf->AddPage();\n $pdf->SetXY(110,10);\n $pdf->SetFont($font, '', 20);\n $pdf->writeHTML('Relação de Vendas');\n $pdf->SetXY(10,24);\n $pdf->SetFont($font, 'B', 11);\n $pdf->writeHTMLCell(15, 0, $pdf->GetX(), $pdf->GetY(), '<b>Pedido</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>NF</b>');\n $pdf->writeHTMLCell(50, 0, $pdf->GetX(), $pdf->GetY(), '<b>Loja</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>Vendedor</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>Cliente</b>');\n $pdf->writeHTMLCell(25, 0, $pdf->GetX(), $pdf->GetY(), '<b>Data</b>');\n $pdf->writeHTMLCell(20, 0, $pdf->GetX(), $pdf->GetY(), '<b>Arred.</b>');\n $pdf->writeHTMLCell(25, 0, $pdf->GetX(), $pdf->GetY(), '<b>Desconto</b>');\n $pdf->writeHTMLCell(30, 0, $pdf->GetX(), $pdf->GetY(), '<b>Valor</b>');\n $pdf->Ln();\n $pdf->SetY($pdf->GetY()+2);\n $pdf->Line(10, $pdf->GetY(), 285, $pdf->GetY()); // Desenha uma linha\n $pdf->SetY($pdf->GetY()+2);\n }", "public function pageWithText(int $page, string $text, ?string $rel = null): string;", "public function appendText($text) {\n// if ($this->vOffset > $this->current[\"charOffset\"] + 3*LINE_SPACING + 3*$this->currentFontSize)\n// $this->vOffset = $this->current[\"charOffset\"] + 3*LINE_SPACING + 3*$this->currentFontSize;\n if ($this->appendToBuffer) {\n array_push($this->buffer, array(\n \"text\" => $text,\n \"font\" => $this->currentFont,\n \"size\" => $this->currentFontSize,\n \"color\" => $this->currentFontColor\n ));\n return;\n }\n\n $this->currentPage->beginText();\n do {\n // Clear the whitespace if it begins the line or if last char is a special char\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n // Number of chars allowed in the current line\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n $isLastLine = false;\n continue;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed) with align\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n if ($this->current[\"align\"] == \"center\") {\n $spacing = $this->PAGE_WIDTH - 2*self::HMARGIN -\n $this->permanentLeftSpacing - $this->permanentRightSpacing - $this->currentPage->getTextWidth($textToAppend);\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing + $spacing/2,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n } elseif ($this->current[\"align\"] == \"right\") {\n $spacing = $this->PAGE_WIDTH - 2*self::HMARGIN -\n $this->permanentLeftSpacing - $this->permanentRightSpacing - $this->currentPage->getTextWidth($textToAppend);\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing + $spacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n } else { // left\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n }\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n // Offsets for next line\n if (!$isLastLine) {\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n } else {\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n }\n\n }\n while(!$isLastLine); // While it remains chars to append\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n }", "function locationsAddLocation($text){\n array_push($text, array('key' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'parent' => '',\n 'text' => 'Locations - Add location'));\n \n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_NAME',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'New location'));\n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_SUBMIT',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'Add location'));\n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_ADDING',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'Adding a new location ...'));\n array_push($text, array('key' => 'LOCATIONS_ADD_LOCATION_SUCCESS',\n 'parent' => 'PARENT_LOCATIONS_ADD_LOCATION',\n 'text' => 'You have succesfully added a new location.'));\n \n return $text;\n }", "function do_text_text_content($textid, $only_body=true): void\n{\n // Text settings\n $record = get_text_data($textid);\n $title = $record['TxTitle'];\n $langid = (int)$record['TxLgID'];\n $ann = $record['TxAnnotatedText'];\n $pos = $record['TxPosition'];\n \n // Language settings\n $record = get_language_settings($langid);\n $wb1 = isset($record['LgDict1URI']) ? $record['LgDict1URI'] : \"\";\n $wb2 = isset($record['LgDict2URI']) ? $record['LgDict2URI'] : \"\";\n $wb3 = isset($record['LgGoogleTranslateURI']) ? $record['LgGoogleTranslateURI'] : \"\";\n $textsize = $record['LgTextSize'];\n $removeSpaces = $record['LgRemoveSpaces'];\n $rtlScript = (bool)$record['LgRightToLeft'];\n \n // User settings\n $showAll = getSettingZeroOrOne('showallwords', 1);\n $showLearning = getSettingZeroOrOne('showlearningtranslations', 1);\n \n /**\n * @var int $mode_trans \n * Annotation position between 0 and 4\n */\n $mode_trans = (int) getSettingWithDefault('set-text-frame-annotation-position');\n /**\n * @var bool $ruby \n * Ruby annotations\n */\n $ruby = $mode_trans==2 || $mode_trans==4;\n\n if (!$only_body) {\n // Start the page with a HEAD and opens a BODY tag \n pagestart_nobody($title);\n }\n ?>\n <script type=\"text/javascript\" src=\"js/jquery.hoverIntent.js\" charset=\"utf-8\"></script>\n <?php \n $visit_status = getSettingWithDefault('set-text-visit-statuses-via-key');\n if ($visit_status == '') {\n $visit_status = '0';\n }\n $var_array = array(\n // Change globals from jQuery hover\n 'ANN_ARRAY' => json_decode(annotation_to_json($ann)),\n 'DELIMITER' => tohtml(\n str_replace(\n array('\\\\',']','-','^'), \n array('\\\\\\\\','\\\\]','\\\\-','\\\\^'), \n getSettingWithDefault('set-term-translation-delimiters')\n )\n ),\n 'WBLINK1' => $wb1,\n 'WBLINK2' => $wb2,\n 'WBLINK3' => $wb3,\n 'RTL' => $rtlScript,\n 'TID' => $textid,\n 'ADDFILTER' => makeStatusClassFilter((int)$visit_status),\n 'JQ_TOOLTIP' => getSettingWithDefault('set-tooltip-mode') == 2 ? 1 : 0,\n // Add new globals\n 'ANNOTATIONS_MODE' => $mode_trans,\n 'POS' => $pos\n );\n do_text_text_javascript($var_array);\n do_text_text_style($showLearning, $mode_trans, $textsize, strlen($ann) > 0);\n ?>\n\n <div id=\"thetext\" <?php echo ($rtlScript ? 'dir=\"rtl\"' : '') ?>>\n <p style=\"margin-bottom: 10px;\n <?php echo $removeSpaces ? 'word-break:break-all;' : ''; ?>\n font-size: <?php echo $textsize; ?>%; \n line-height: <?php echo $ruby?'1':'1.4'; ?>;\"\n >\n <!-- Start displaying words -->\n <?php main_word_loop($textid, $showAll); ?></span>\n </p>\n <p style=\"font-size:<?php echo $textsize; ?>%;line-height: 1.4; margin-bottom: 300px;\">&nbsp;</p>\n </div>\n <?php \n if (!$only_body) { \n pageend(); \n }\n flush();\n}", "private function printTextToBlock(&$pdf, $text, $w, $h, $x, $y, $lpl = null, $line = 1, $align = 'L', $valign = 'M')\n {\n// $text = str_pad('', 9999, '成績の概要当期の営業');\n if (!is_null($lpl)) {\n if (mb_strlen($text, 'utf-8') > ($lpl * $line)) {\n $text = mb_substr($text, 0, ($lpl * $line), 'utf-8');\n }\n $lines = array();\n for ($i = 0; $i < $line; $i++) {\n if (mb_strlen($text, 'utf-8') > $lpl) {\n $lines[] = mb_substr($text, 0, $lpl, 'utf-8');\n $text = mb_substr($text, $lpl, null, 'utf-8');\n } else {\n $lines[] = $text;\n break;\n }\n }\n $text = implode(\"\\n\", $lines);\n }\n\n $pdf->MultiCell($w, $h, $text, 0, $align, false, 0, $x, $y, true, 0, false, true, $h, $valign);\n }", "function appendPage($pageName, $newPageBody)\n{\n $newPageBody = trim($newPageBody);\n $sFile = getPagePath($pageName);\n if($newPageBody != \"\")\n {\n $f = fopen($sFile, \"at\");\n fwrite($f, \"\\n\\n\\n\\n\");\n fwrite($f, $newPageBody);\n fclose($f);\n }\n else\n {\n @unlink($sFile);\n }\n}", "function updateTextPosition($p_id, $p_x, $p_y) {\n\t$con = open_connection();\n\tmysqli_query($con,\"UPDATE text SET x_coordinate = '\". $p_x .\"', y_coordinate = '\". $p_y .\"' WHERE text_id = '\". $p_id .\"'\");\n\tmysqli_close($con);\n}", "function NewPageHeader () {\n\tglobal $PageNumber,\n\t\t\t\t$pdf,\n\t\t\t\t$YPos,\n\t\t\t\t$YPos2,\n\t\t\t\t$YPos4,\n\t\t\t\t$Page_Height,\n\t\t\t\t$Page_Width,\n\t\t\t\t$Top_Margin,\n\t\t\t\t$FontSize,\n\t\t\t\t$Left_Margin,\n\t\t\t\t$XPos,\n\t\t\t\t$XPos2,\n\t\t\t\t$Right_Margin,\n\t\t\t\t$line_height;\n\t\t\t\t$line_width;\n\n\t/*PDF page header for GL Account report */\n\n\tif ($PageNumber > 1){\n\t\t$pdf->newPage();\n\t}\n$YPos= $Page_Height-$Top_Margin;\n\n\n\t\n\n\n}", "function printOtherInfos($pdf, $infosUtiles) {\n $pdf->setPrintFooter(true);\n $pdf->setPrintHeader(true);\n $pdf->AddPage();\n $pdf->Bookmark('Informations utiles', 2, 0, '', '', array(128, 0, 0));\n $pdf->SetTextColor(255, 255, 255);\n $pdf->SetFont('helvetica', '', 17);\n $pdf->SetXY(7, 25);\n $pdf->Cell(52, 0, \"Informations utiles \", 0, false, 'L', 1, '', 0, false, 'M', 'M');\n $pdf->SetXY(7, 35);\n preHTML($pdf);\n $pdf->writeHTML($infosUtiles, true, 0, true, 0);\n}", "function textOut($x, $y, $text)\r\n {\r\n $this->forceFont();\r\n echo \"$this->_canvas.drawString(\\\"$text\\\", $x, $y);\\n\";\r\n }", "protected function getActivePageWrapper($text)\n {\n return sprintf($this->activePageWrapper, $text);\n }", "function addText()\r\n {\r\n return null; //PEAR::raiseError(\"No addText method exists\", true);\r\n }", "function PDF_add_weblink($pdfdoc, $lowerleftx, $lowerlefty, $upperrightx, $upperrighty, $url)\n{\n}", "public function drawPage()\n\t\t{\n\t\t}", "public function main(){\n $pdf = new PDF();\n $pdf->AliasNbPages();\n $pdf->AddPage();\n $pdf->SetFont('Times','',12);\n for($i=1;$i<=40;$i++){\n $pdf->Cell(0,10,'Printing line number '.$i,0,1);\n }\n\n // First page\n $html = 'You can now<np> easily print text mixing different styles: <b>bold</b>, <i>italic</i>,\n <u>underlined</u>, or <b><i><u>all at once</u></i></b>!<br><br>You can also insert links on\n text, such as <a href=\"http://www.fpdf.org\">www.fpdf.org</a>, or on an image: click on the logo.';\n\n $pdf->AddPage();\n $pdf->SetFont('Arial','',20);\n // $pdf->Write(5,\"To find out what's new in this tutorial, click \");\n // $pdf->SetFont('','U');\n // $link = $pdf->AddLink();\n // $pdf->Write(5,'here',$link);\n // $pdf->SetFont('');\n // // Second page\n // $pdf->AddPage();\n // $pdf->SetLink($link);\n // $pdf->Image('logo.png',10,12,30,0,'','http://www.fpdf.org');\n $pdf->SetLeftMargin(15);\n $pdf->SetFontSize(14);\n $pdf->WriteHTML($html);\n\n $pdf->Output();\n\n }", "function render_text_left($im, $text,$font_size, $zone, $box){\n global $font_file;\n global $text_color;\n $type_space = imagettfbbox(($font_size), 0, $font_file, $text);\n $fw = $type_space[4];\n $fh = abs($type_space[7]);\n $px = $box->left_text_in_zone($fw,$fh,$zone);\n //pretty_dump($px);\n imagettftext($im ,$font_size, 0, $px->x, $px->y, $text_color, $font_file, $text);\n}", "function _transformAreaMap($text)\n\t{\n\t\t$view_url = $this->parse->getRenderConf('xhtml', 'freelink', 'view_url');\n\t\t$new_url = $this->parse->getRenderConf('xhtml', 'freelink', 'new_url');\n\t\t$pageList = $this->parse->getRenderConf('Xhtml', 'Freelink', 'pages');\n\t\t\n\t\t// treat every line as a free-linked line, with the\n\t\t// exception that we don't use any text after the first\n\t\t// pipe character.\n\t\t$text = htmlspecialchars(trim($text));\n\t\t$lines = explode(\"\\n\", $text);\n\t\t\n\t\t$pagelines = array();\n\t\tforeach ($lines as $line) {\n\t\t\t\n\t\t\t// count number of spaces at the beginning of the line\n\t\t\t// and set the level based on the count\n\t\t\tpreg_match('/^( {0,})(.*)/', $line, $matches);\n\t\t\t$level = strlen($matches[1]);\n\t\t\t$spaces = str_pad('', $level);\n\t\t\t\n\t\t\t// trim off the depth-level spaces\n\t\t\t$line = trim($line);\n\t\t\t\n\t\t\t// skip blank lines\n\t\t\tif ($line == '') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// split the line into its 'page' and 'after' parts; the\n\t\t\t// 'after' is the part after the first pipe character on the\n\t\t\t// line (including the pipe character itself).\n\t\t\t$pos = strpos($line, '|');\n\t\t\tif ($pos === false) {\n\t\t\t\t$page = $line;\n\t\t\t\t$after = '';\n\t\t\t} else {\n\t\t\t\t$page = trim(substr($line, 0, $pos));\n\t\t\t\t$after = substr($line, $pos);\n\t\t\t}\n\t\t\t\n\t\t\t// make the proper link...\n\t\t\tif (in_array($page, $pageList)) {\n\t\t\t\t// page exists\n\t\t\t\t$link = sprintf($view_url, $page);\n\t\t\t\t$pagelines[] = \"$spaces<a href=\\\"$link\\\">$page</a> $after\";\n\t\t\t} else {\n\t\t\t\t// page does not exist\n\t\t\t\t$link = sprintf($new_url, $page);\n\t\t\t\t$pagelines[] = \"$spaces$page<a href=\\\"$link\\\">?</a> $after\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$html = \"<pre><code>\" . implode(\"\\n\", $pagelines) . \"</code></pre>\";\n\t\treturn $html;\n\t}", "function transform($text, $page = null)\n\t{\n\t\tif (strtolower($page) == 'areamap') {\n\t\t\t$html = $this->_transformAreaMap($text);\n\t\t} else {\n\t\t\t$html = $this->parse->transform($text);\n\t\t}\n\t\t\n\t\treturn $html;\n\t}", "public function createPage($fullText) {\n\n $fullTextWrap = wordwrap($fullText, 2200, '----', false);\n $pages = explode('----', $fullTextWrap); \n\n return $pages;\n }", "function newPage()\n {\n $this->lastPageNumber ++;\n if ($this->lastPageNumber != 1)\n $this->documentBuffer .= \"<br clear=\\\"all\\\" style=\\\"page-break-before: always;\\\">\";\n return $this->lastPageNumber;\n }", "function\taddLine( $_text=\"\", $_par, $_noAutoLf=false) {\n\t\t$_par->getCharFmt()->activate( $this->myDoc->myfpdf) ;\n\t\t$textWidth\t=\t$this->textWidth( $_text) ;\n\t\tswitch ( $_par->getAlignment()) {\n\t\t\tcase\tBParaFmt::alignLeft\t:\n\t\t\t\t$this->myDoc->myfpdf->Text( $this->horOffs + $this->currHorPos,\n\t\t\t\t$this->verOffs + $this->currVerPos + $_par->getCharFmt()->getCharSize(),\n\t\t\t\t$_text) ;\n\t\t\t\t$this->currHorPos\t+=\t$textWidth ;\n\t\t\t\tbreak ;\n\t\t\tcase\tBParaFmt::alignCenter\t:\n\t\t\t\t$this->myDoc->myfpdf->Text( $this->horOffs + $this->currHorPos + ( $this->getWidth() - $textWidth) / 2,\n\t\t\t\t$this->verOffs + $this->currVerPos + $_par->getCharFmt()->getCharSize(),\n\t\t\t\t$_text) ;\n\t\t\t\t$this->currHorPos\t+=\t$textWidth ;\n\t\t\t\tbreak ;\n\t\t\tcase\tBParaFmt::alignRight\t:\n\t\t\t\t$this->myDoc->myfpdf->Text( $this->horOffs + $this->currHorPos + ( $this->getWidth() - $textWidth),\n\t\t\t\t$this->verOffs + $this->currVerPos + $_par->getCharFmt()->getCharSize(),\n\t\t\t\t$_text) ;\n\t\t\t\t$this->currHorPos\t+=\t$textWidth ;\n\t\t\t\tbreak ;\n\t\t}\n\t\tif ( ! $_noAutoLf) {\n\t\t\t$this->currHorPos\t=\t0 ;\n\t\t\t$this->currVerPos\t+=\t$_par->getCharFmt()->getCharSize() * $_par->getLineSpacing() ;\n\t\t}\n\t\t$this->currHorOffs\t=\t0 ;\n\t\t$this->remainingHeight\t=\t$this->height - $this->currVerPos ;\n\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"(...)\", \"height := \" . $this->height) ;\n\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"(...)\", \"currXXVerPos := \" . $this->currVerPos) ;\n\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"(...)\", \"remaining height := \" . $this->remainingHeight) ;\n\t\treturn $this->height - $this->currVerPos ;\n\t}", "protected function getActivePageWrapper($text)\n {\n return '<li class=\"current\"><a>'.$text.'</a></li>';\n }", "private function prepareInternalLinkAnnotation($text) {\n $this->appendText(\" \");\n $fromHOffset = $this->hOffset;\n $linkAreas = array(/* page, left, bottom, right, top */);\n\n // If more than one text line to append\n while ($text = $this->appendOneLine($text)) {\n // Create link\n $linkAreas[] = array($this->currentPage,\n self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n\n // Prepare the next line\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n $fromHOffset = $this->hOffset;\n }\n\n // Prepare link\n $linkAreas[] = array($this->currentPage,\n self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n\n return $linkAreas;\n }", "function\taddText( $_par, $_text=\"\", $_noAutoLf=false) {\n\t\tFDbg::begin( 1, basename( __FILE__), __CLASS__, __METHOD__.\"( ...)\") ;\n\t\t$_par->getCharFmt()->activate( $this->myDoc->myfpdf) ;\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $frm !== false) {\n\t\t\t$tok\t=\tstrtok( $_text, \" \");\n\t\t\t$buf\t=\t\"\" ;\n\t\t\twhile ( $tok !== false) {\n\t\t\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"()\", \"token '$tok'\") ;\n\t\t\t\t$bufWidth\t=\t$this->textWidth( $buf) ;\n\t\t\t\t$tokWidth\t=\t$this->textWidth( $tok) ;\n\t\t\t\t$totWidth\t=\t$bufWidth + $tokWidth ;\n\t\t\t\tif ( ( $bufWidth + $tokWidth) < $frm->remWidth()) {\n\t\t\t\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"()\", \"still under the line length [$totWidth/$buf/$tok]\") ;\n\t\t\t\t\tif ( strlen( $buf) > 0) {\n\t\t\t\t\t\t$buf\t.=\t\" \" ;\n\t\t\t\t\t}\n\t\t\t\t\t$buf\t.=\t$tok ;\n\t\t\t\t\t$tok\t=\t\"\" ;\n\t\t\t\t\t$tok\t=\tstrtok( \" \");\n\t\t\t\t} else {\n\t\t\t\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"()\", \"line length will be exceeded[%s/%s]\", $buf, $tok) ;\n\t\t\t\t\t$remHeight\t=\t$frm->addLine( $buf, $_par) ;\n\t\t\t\t\t$this->currVerPos\t+=\t( $_par->getCharFmt()->getCharSize() * $_par->lineSpacing) ;\n\t\t\t\t\t$this->currHorPos\t=\t0.0 ;\n\t\t\t\t\t$buf\t=\t\"\" ;\n\t\t\t\t\tif ( $remHeight < $this->saveZone) {\n\t\t\t\t\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"()\", \"creating new page in between (saveZone := \" . mmToPt( $this->saveZone) . \")\") ;\n\t\t\t\t\t\t$this->myDoc->newPage() ;\n\t\t\t\t\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( strlen( $buf) > 0) {\n\t\t\t\t$remHeight\t=\t$frm->addLine( $buf, $_par, $_noAutoLf) ;\n\t\t\t\tif ( $remHeight < $this->saveZone) {\n\t\t\t\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"()\", \"creating new page at the end\") ;\n\t\t\t\t\t$this->myDoc->newPage() ;\n\t\t\t\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tFDbg::end() ;\n\t\treturn 0 ;\n\t}", "function AddPage($orientation=''){\n\t\t\tif($this->state==0) $this->Open();\n\t\t\t$family=$this->FontFamily;\n\t\t\t$style=$this->FontStyle.($this->underline ? 'U' : '');\n\t\t\t$size=$this->FontSizePt;\n\t\t\t$lw=$this->LineWidth;\n\t\t\t$dc=$this->DrawColor;\n\t\t\t$fc=$this->FillColor;\n\t\t\t$tc=$this->TextColor;\n\t\t\t$cf=$this->ColorFlag;\n\t\t\tif($this->page>0)\n\t\t\t{\n\t\t\t\t//Page footer\n\t\t\t\t$this->InFooter=true;\n\t\t\t\t$this->Footer();\n\t\t\t\t$this->InFooter=false;\n\t\t\t\t//Close page\n\t\t\t\t$this->_endpage();\n\t\t\t}\n\t\t\t//Start new page\n\t\t\t$this->_beginpage($orientation);\n\t\t\t//Set line cap style to square\n\t\t\t$this->_out('2 J');\n\t\t\t//Set line width\n\t\t\t$this->LineWidth=$lw;\n\t\t\t$this->_out(sprintf('%.2f w',$lw*$this->k));\n\t\t\t//Set font\n\t\t\tif($family)\t$this->SetFont($family,$style,$size);\n\t\t\t//Set colors\n\t\t\t$this->DrawColor=$dc;\n\t\t\tif($dc!='0 G') $this->_out($dc);\n\t\t\t$this->FillColor=$fc;\n\t\t\tif($fc!='0 g') $this->_out($fc);\n\t\t\t$this->TextColor=$tc;\n\t\t\t$this->ColorFlag=$cf;\n\t\t\t//Page header\n\t\t\t$this->Header();\n\t\t\t//Restore line width\n\t\t\tif($this->LineWidth!=$lw)\n\t\t\t{\n\t\t\t\t$this->LineWidth=$lw;\n\t\t\t\t$this->_out(sprintf('%.2f w',$lw*$this->k));\n\t\t\t}\n\t\t\t//Restore font\n\t\t\tif($family)\t$this->SetFont($family,$style,$size);\n\t\t\t//Restore colors\n\t\t\tif($this->DrawColor!=$dc)\n\t\t\t{\n\t\t\t\t$this->DrawColor=$dc;\n\t\t\t\t$this->_out($dc);\n\t\t\t}\n\t\t\tif($this->FillColor!=$fc)\n\t\t\t{\n\t\t\t\t$this->FillColor=$fc;\n\t\t\t\t$this->_out($fc);\n\t\t\t}\n\t\t\t$this->TextColor=$tc;\n\t\t\t$this->ColorFlag=$cf;\n\t\t}", "function addPage($pdf, $font = 'freesans') {\n\t\t$pdf->AddPage();\n\t\t$pdf->SetXY(80, 0);\n\t\t$pdf->SetFont($font, '', 20);\n\t\t\n\t\t$pdf->write(30, \"Fluxo de Caixa\");\n\t\t//$pdf->writeHTML('Fluxo de Caixa');\n\t\t$pdf->SetXY(10, 24);\n\t\t$pdf->SetFont($font, 'B', 11);\n\t\t//$pdf->Cell(190, 10, \"Contas a Pagar\", 1, 1, \"C\");\n\t\t$pdf->Cell(100, 5, \"Título\", 1, 0, \"C\");\n\t\t$pdf->Cell(30, 5, \"Dt. Venc.\", 1, 0, \"C\");\n\t\t$pdf->Cell(30, 5, \"Valor\", 1,0, \"C\");\n\t\t$pdf->Cell(30, 5, \"Valor\", 1, 1, \"C\");\n\t}", "protected function _drawText()\n {\n $x = $this->_width*0.05;\n $y = $this->_height*0.96;\n\n $text_color=ImageColorAllocate($this->_image, 0x00, 0x00, 0x00);\n\n $fontsize = $this->scale*7;\n $kerning = $fontsize*1;\n\n for($i=0;$i<strlen($this->number);$i++)\n {\n imagettftext($this->_image, $fontsize, 0, $x, $y, $text_color, $this->font, $this->number[$i]);\n if($i==0 || $i==6)\n $x += $kerning*0.5;\n $x += $kerning;\n }\n }", "function getTextInside(){\n\t $myfile = fopen($this->pathFile, \"r\") or die(\"Unable to open file!\");\t\t//membuka file\n\t $this->textInside = fread($myfile, filesize($this->pathFile));\t\t\t\t//menyimpan text yang ada dalam file ke textInside\n\t fclose($myfile);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//menutup file\n\t}", "function createPage($pathToFolder, $pageArray){\n\n $preview = substr($pageArray[1].$pageArray[2], 0, 30); // retourne \"abcde\"\n $date = gmdate(\"Y-m-d\").\"T\".gmdate(\"H:i:s\").\"Z\";\n $page='<mediawiki xmlns=\"http://www.mediawiki.org/xml/export-0.10/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd\" version=\"0.10\" xml:lang=\"fr\">\n <page>\n <title>'.$pageArray[0].'</title>\n <ns>0</ns>\n <id>0</id>\n <revision>\n <id>0</id>\n <timestamp>'.$date.'</timestamp>'.'\n <contributor>\n <username>'.'Romain'.'</username>\n <id>1</id>\n </contributor>\n <comment>'.$preview.'</comment>\n <model>wikitext</model>\n <format>text/x-wiki</format>';\n $page=$page.'<text xml:space=\"preserve\" bytes=\"12\">';\n\n if($pageArray[1]!=\"\" || isset($pageArray[1]))\n $page=$page.$pageArray[1];\n if($_SESSION['viki']=='true'){\n $page=$page.'{{ #viki:pageTitles='.$pageArray[0].'}}';\n }\n \n if($pageArray[2]!=\"\" || isset($pageArray[2])){\n $page=$page.$pageArray[2];\n }\n\n else{\n $page=$page.$pageArray[2];\n }\n $page=$page.'</text>\n <sha1>753hugogitqwnlby9d3k5rdzsa58oj1</sha1>\n </revision>\n </page>\n </mediawiki>';\n\n $my_file = 'PageStorage/'.$pathToFolder.'/'.str_replace(\" \", \"\", $pageArray[0]).'.xml';\n $handle = fopen($my_file, 'w') or die('Cannot open file: '.$my_file);\n fwrite($handle, $page);\n fclose($handle);\n \n return $my_file;\n }", "function Footer()\n{\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n}", "public function header(){\n $header = '<html>\n <head>\n <style>\n @page{\n margin: 100px 25px;\n }\n header{\n position: absolute;\n top: -60px;\n left: 0px;\n right: 0px;\n height:20px;\n }\n .container-table{ \n margin:80px 0;\n width: 100%;\n }\n .fixed-footer{.\n width : 100%;\n position: fixed; \n bottom: -28; \n left: 0px; \n right: 0px;\n height: 50px; \n text-align:center;\n }\n .fixed-footer-right{\n position: absolute; \n bottom: -150; \n height: 0; \n font-size:13px;\n float : right;\n }\n .page-number:before {\n \n }\n </style>\n </head>\n /\n <script type=\"text/php\">\n if (isset($pdf)){\n $text = \"Page {PAGE_NUM} / {PAGE_COUNT}\";\n $size = 10;\n $font = $fontMetrics->getFont(\"Verdana\");\n $width = $fontMetrics->get_text_width($text, $font, $size) / 2;\n $x = ($pdf->get_width() - $width) / 2;\n $y = $pdf->get_height() - 35;\n $pdf->page_text($x, $y, $text, $font, $size);\n }\n </script>\n <body>\n <header>\n <p style=\"margin:0; position:left;\">\n <img src=\"images/logo.png\" width=\"200\" height=\"160\"/>\n </p>\n </header>'; \n return $header;\n }", "protected function insertAddress(&$page, $store = null)\r\n {\r\n $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));\r\n $font = $this->_setFontRegular($page, 10);\r\n $page->setLineWidth(0);\r\n $this->y = $this->y ? $this->y : 815;\r\n $top = 815;\r\n\r\n $collection = Mage::getModel('marketplace/userprofile')->getCollection()\r\n ->addFieldToFilter('mageuserid',array('eq'=>Mage::getSingleton('customer/session')->getCustomerId()));\r\n foreach ($collection as $row) {\r\n $address=$row->getOthersInfo();\r\n }\r\n\r\n foreach (explode(\"\\n\", $address) as $value){\r\n if ($value !== '') {\r\n $value = preg_replace('/<br[^>]*>/i', \"\\n\", $value);\r\n foreach (Mage::helper('core/string')->str_split($value, 45, true, true) as $_value) {\r\n $page->drawText(trim(strip_tags($_value)),\r\n $this->getAlignRight($_value, 130, 440, $font, 10),\r\n $top,\r\n 'UTF-8');\r\n $top -= 10;\r\n }\r\n }\r\n }\r\n $this->y = ($this->y > $top) ? $top : $this->y;\r\n }", "function locationsLocation($text){\n array_push($text, array('key' => 'PARENT_LOCATIONS_LOCATION',\n 'parent' => '',\n 'text' => 'Locations - Location'));\n \n array_push($text, array('key' => 'LOCATIONS_LOCATION_NAME',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Name'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_MAP',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Enter the address'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_ADDRESS',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Address'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_ALT_ADDRESS',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Alternative address'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_CALENDARS',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Add calendars to location'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_NO_CALENDARS',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'There are no calendars created. Go to <a href=\"%s\">calendars</a> page to create one.'));\n\t\t\n array_push($text, array('key' => 'LOCATIONS_LOCATION_SHARE',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Share your location with '));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_LINK',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Enter the link of your site'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_IMAGE',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Enter a link with an image'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESSES',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Select what kind of businesses you have at this location'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESSES_OTHER',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Enter businesses that are not in the list'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_LANGUAGES',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Enter the languages that are spoken in your business'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_EMAIL',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Your email'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_SHARE_SUBMIT',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Share to PINPOINT.WORLD'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_SHARE_SUBMIT_SUCCESS',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Your location has been sent to PINPOINT.WORLD'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_SHARE_SUBMIT_ERROR',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Please complete all location data. Only alternative address is mandatory and you need to select a businness or enter another business.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_SHARE_SUBMIT_ERROR_DUPLICATE',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'The location has already been submitted to PINPOINT.WORLD'));\n\t\t\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_APARTMENT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Appartment'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_BABY_SITTER', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Baby sitter'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_BAR', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Bar'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_BASKETBALL_COURT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Basketball court(s)'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_BEAUTY_SALON', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Beauty salon'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_BIKES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Bikes'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_BOAT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Boat'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_BUSINESS', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Business'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_CAMPING', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Camping'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_CAMPING_GEAR', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Camping gear'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_CARS', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Cars'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_CHEF', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Chef'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_CINEMA', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Cinema'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_CLOTHES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Clothes'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_COSTUMES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Costumes'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_CLUB', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Club'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_DANCE_INSTRUCTOR', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Dance instructor'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_DENTIST', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Dentist'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_DESIGNER_HANDBAGS', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Designer handbags'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_DOCTOR', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Doctor'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_ESTHETICIAN', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Esthetician'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_FOOTBALL_COURT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Football court(s)'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_FISHING', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Fishing'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_GADGETS', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Gadgets'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_GAMES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Games'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_GOLF', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Golf'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_HAIRDRESSER', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Hairdresser'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_HEALTH_CLUB', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Health club'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_HOSPITAL', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Hospital'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_HOTEL', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Hotel'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_HUNTING', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Hunting'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_LAWYER', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Lawyer'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_LIBRARY', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Library'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_MASSAGE', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Massage'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_MUSIC_BAND', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Music band'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_NAILS_SALON', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Nails salon'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PARTY_SUPPLIES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Party supplies'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PERSONAL_TRAINER', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Personal trainer'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PET_CARE', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Pet care'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PHOTO_EQUIPMENT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Photo equipment'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PHOTOGRAPHER', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Photographer'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PILLATES_INSTRUCTOR', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Pillates instructor'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PLANE_TICKETS', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Plane tickets'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_PLANES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Plane(s)'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_RESTAURANT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Restaurant'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_SHOES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Shoes'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_SNOW_EQUIPMENT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Snow equipment'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_SPA', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Spa'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_SPORTS_COACH', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Sports coach'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_TAXIES', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Taxies'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_TENIS_COURT', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Tenis court(s)'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_THEATRE', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Theatre'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_VILLA', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Villa'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_WEAPONS', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Weapons'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_BUSINESS_WORKING_TOOLS', \n\t\t\t\t\t'parent' => 'PARENT_LOCATIONS_LOCATION', \n\t\t\t\t\t'text' => 'Working tools'));\n \n array_push($text, array('key' => 'LOCATIONS_LOCATION_LOADED',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Location loaded.'));\n array_push($text, array('key' => 'LOCATIONS_LOCATION_NO_GOOGLE_MAPS',\n 'parent' => 'PARENT_LOCATIONS_LOCATION',\n 'text' => 'Google maps did not load. Please refresh the page to try again.'));\n \n return $text;\n }", "public function addToBottomOfThePage(string $addText, EditInfo $editInfo): bool\n {\n if (empty($this->page->getRevisions()->getLatest())) {\n throw new Exception('That page does not exist');\n }\n $oldText = $this->getText();\n $newText = $oldText . \"\\n\" . $addText;\n\n return $this->editPage($newText, $editInfo);\n }", "public function advanceLabelPage ()\r\n {\r\n $return = '';\r\n $this->label_column = 1;\r\n $this->label_row =1;\r\n ++$this->label_page;\r\n $return .= '\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"labelpage\">\r\n <div class=\"labelrow\">\r\n <div class=\"labelbody\">';\r\n return $return;\r\n }", "public static function addTextToImage($path, $text, $newNamePath, $option = array())\r\n {\r\n\r\n if(!empty($option[\"positionX\"]))\r\n $positionX = $option[\"positionX\"];\r\n else\r\n $positionX = 0;\r\n\r\n if(!empty($option[\"positionY\"]))\r\n $positionY = $option[\"positionY\"];\r\n else\r\n $positionY = 0;\r\n\r\n if(!empty($option[\"size\"]))\r\n $size = $option[\"size\"];\r\n else\r\n $size = 13;\r\n\r\n\r\n if(!empty($option[\"colorR\"]))\r\n $red = $option[\"colorR\"];\r\n else\r\n $red = 0;\r\n\r\n if(!empty($option[\"colorG\"]))\r\n $green = $option[\"colorG\"];\r\n else\r\n $green = 0;\r\n\r\n if(!empty($option[\"colorB\"]))\r\n $blue = $option[\"colorB\"];\r\n else\r\n $blue = 0;\r\n\r\n if(!empty($option[\"fontfile\"]))\r\n $fontfile = \"../../www/themes/default/fonts/\" . $option[\"fontfile\"];\r\n else\r\n $fontfile = \"../../www/themes/default/fonts/arial.ttf\";\r\n\r\n if(!empty($option[\"angle\"]))\r\n $angle = $option[\"angle\"];\r\n else\r\n $angle = 0;\r\n\r\n\r\n if(!empty($option[\"alignH\"])){\r\n $zoneWidth = 0;\r\n if(!empty($option[\"zoneWidth\"])){\r\n $zoneWidth = $option['zoneWidth'];\r\n }\r\n if($option[\"alignH\"]=='right'){\r\n list($left,, $right) = imageftbbox($size, 0, $fontfile, $text);\r\n $length = $right-$left;\r\n $positionX = $positionX - $length;\r\n }\r\n else if($option[\"alignH\"]=='center'){\r\n list($left,, $right) = imageftbbox($size, 0, $fontfile, $text);\r\n $center = ceil($zoneWidth / 2);\r\n $positionX = $positionX + $center - (ceil(($right-$left)/2));\r\n }\r\n }\r\n if(!empty($option[\"alignV\"])){\r\n $zoneHeight = 0;\r\n if(!empty($option[\"zoneHeight\"])){\r\n $zoneHeight = $option['zoneHeight'];\r\n }\r\n if($option[\"alignV\"]=='top'){\r\n list(,$bottom,,,,$top) = imageftbbox($size, 0, $fontfile, $text);\r\n $height = $bottom-$top;\r\n $positionY = $positionY - $zoneHeight + $height;\r\n }\r\n else if($option[\"alignV\"]=='middle'){\r\n list(,$bottom,,,,$top) = imageftbbox($size, 0, $fontfile, $text);\r\n $height = $bottom-$top;\r\n $center = ceil($zoneHeight / 2);\r\n $positionY = $positionY - $center + (ceil(($height)/2));\r\n }\r\n }\r\n\r\n $image['ext'] = strtolower(substr($path, strrpos($path, '.') + 1));\r\n list($image['width'], $image['height'], $image['type'], $image['attr']) = getimagesize($path);\r\n\r\n if($image['ext'] == 'jpeg' || $image['ext'] == 'jpg'){\r\n $newImage = imagecreatefromjpeg($path);\r\n $thumb = imagecreatetruecolor($image['width'],$image['height']);\r\n $text_color = imagecolorallocate($newImage, $red, $green, $blue);\r\n imagettftext($newImage, $size , $angle , $positionX, $positionY , $text_color , $fontfile , $text );\r\n imagecopyresampled($thumb,$newImage,0,0,0,0,$image['width'],$image['height'],$image['width'],$image['height']);\r\n imagejpeg($thumb, $newNamePath, 100);\r\n imagedestroy($newImage);\r\n }\r\n\r\n elseif($image['ext'] == 'gif'){\r\n $newImage = imagecreatefromgif($path);\r\n $thumb = imagecreate($image['width'],$image['height']);\r\n $text_color = imagecolorallocate($newImage, $red, $green, $blue);\r\n imagettftext($newImage, $size , $angle , $positionX, $positionY , $text_color , $fontfile , $text );\r\n $trans_color = imagecolorallocate($thumb, 255, 0, 0);\r\n imagecolortransparent($thumb, $trans_color);\r\n imagecopyresampled($thumb,$newImage,0,0,0,0,$image['width'],$image['height'],$image['width'],$image['height']);\r\n imagegif($thumb, $newNamePath);\r\n imagedestroy($newImage);\r\n }\r\n elseif($image['ext'] == 'png'){\r\n $image_source = imagecreatefrompng($path);\r\n $newImage = imagecreatetruecolor($image['width'],$image['height']);\r\n $text_color = imagecolorallocate($newImage, $red, $green, $blue);\r\n imagettftext($image_source, $size , $angle , $positionX, $positionY , $text_color , $fontfile , $text );\r\n if (function_exists('imagecolorallocatealpha')){\r\n imagealphablending($newImage, false);\r\n imagesavealpha($newImage, true);\r\n $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127);\r\n imagefilledrectangle($newImage, 0, 0, $image['width'], $image['height'], $transparent);\r\n imagecolortransparent($newImage, $transparent);\r\n }\r\n\r\n imagecopyresampled($newImage, $image_source, 0, 0, 0, 0, $image['width'],$image['height'],$image['width'],$image['height']);\r\n imagepng($newImage, $newNamePath);\r\n imagedestroy($newImage);\r\n }\r\n }", "public function position();", "function load_page_content($page) {\n //get text as html\n $pretext1 = html_entity_decode($page->text);\n\n //replace non-html tags with proper html tags\n // fix image tags\n $pretext2 = str_replace(array(\"<_image>\", \"</_image>\"), array(\"<img src=\\\"\", \"\\\"/>\"), $pretext1);\n // fix bullet point tags\n $pretext3 = str_replace(array(\"<_bullet>\", \"</_bullet>\"), array(\"<div>• \", \"</div>\"), $pretext2);\n // fix subtitle tags\n $text = str_replace(array(\"<subtitle>\", \"</subtitle>\"), array(\"<br/><br/><b>\", \"</b>\"), $pretext3);\n\n return $text;\n}", "protected function _drawText(\\SetaPDF_Core_Canvas $canvas, $x, $y) {}", "public function afterInsertDocumentNumber(\n \\Magento\\Sales\\Model\\Order\\Pdf\\AbstractPdf $subject,\n $result,\n $page,\n $text\n ) {\n if ($this->helper->isEnabled() && $this->helper->showGSTINOnPDF() && $this->helper->getGSTIN()) {\n $this->insertGSTIN($page, __('GSTIN: ') . $this->helper->getGSTIN(), $subject);\n }\n return $result;\n }", "function Footer()\n {\n $this->SetY(-15);\n //Select Arial Italic 8\n $this->SetFont('Arial','I',8);\n $this->SetX(86,5);\n $this->Write(5, '[ powered by '.$this->web_str.']',$this->web_str);\n //Print centered page number\n $this->Cell(0,10,$this->page_str.' '.$this->PageNo(),0,0);\n }", "public function beforeInsertDocumentNumber(\\Webkul\\Marketplace\\Model\\Order\\Pdf\\Invoice $pdfInvoice, $page, $text)\n {\n $invoiceArr = explode(__('Invoice # '), $text);\n $invoiceIncrementedId = $invoiceArr[1];\n $invoice = $pdfInvoice->getObjectManager()->create('Magento\\Sales\\Model\\Order\\Invoice')\n ->loadByIncrementId($invoiceIncrementedId);\n $payment = $invoice->getOrder()->getPayment();\n if (!empty($payment->getMethodInstance())) {\n $method = $payment->getMethodInstance();\n $paymentInfo = $method->getTitle();\n } else {\n $paymentData = $invoice->getOrder()->getPayment()->getData();\n if (!empty($paymentData['additional_information']['method_title'])) {\n $paymentInfo = $paymentData['additional_information']['method_title'];\n } else {\n $paymentInfo = $paymentData['method'];\n }\n }\n /* Payment */\n $yPayments = $pdfInvoice->y + 65;\n $helper = $pdfInvoice->getObjectManager()->create('Webkul\\Marketplace\\Helper\\Data');\n if ($helper->getSellerProfileDisplayFlag()) {\n if (!$invoice->getOrder()->getIsVirtual()) {\n $paymentLeft = 35;\n } else {\n $yPayments = $yPayments +15;\n $paymentLeft = 285;\n }\n } else {\n $paymentLeft = 35;\n }\n foreach ($pdfInvoice->getString()->split($paymentInfo, 45, true, true) as $_value) {\n $page->drawText(strip_tags(trim($_value)), $paymentLeft, $yPayments, 'UTF-8');\n $yPayments -= 15;\n }\n }", "function Footer()\r\n{\r\n $this->SetY(-15);\r\n // Select Arial italic 8\r\n $this->SetFont('Arial','I',8);\r\n // Print centered page number\r\n $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');\r\n}", "function Footer()\r\n{\r\n $this->SetY(-15);\r\n // Select Arial italic 8\r\n $this->SetFont('Arial','I',8);\r\n // Print centered page number\r\n $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');\r\n}", "function Footer()\n{\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial','I',8);\n // Print centered page number\n $this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');\n}", "function Footer()\n{\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial','I',8);\n // Print centered page number\n $this->Cell(0,10,'Page asdjlkasjdlfkjasdjlfkjkls'.$this->PageNo(),0,0,'C');\n}", "function Footer()\n{\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial','I',8);\n // Print centered page number\n $this->Cell(0,10,'Page asdjlkasjdlfkjasdjlfkjkls'.$this->PageNo(),0,0,'C');\n}", "function CreatePage($text)\n{\n\tglobal\t$FM_VERS;\n\n\techo \"<html>\";\n\techo \"<head>\";\n\techo \"</head>\";\n\techo \"<body>\";\n\techo nl2br($text);\n\techo \"<p><p><small>Your form submission was processed by formmail.php ($FM_VERS), available from <a href=\\\"http://www.tectite.com/\\\">www.tectite.com</a></small>\";\n\techo \"</body>\";\n\techo \"</html>\";\n}", "protected function getActivePageWrapper($text)\n {\n return '<span class=\"active item\">'.$text.'</span>';\n }", "function getPos($sourcefile_width,$sourcefile_height,$pos,$gz_image=\"\"){\n if ($gz_image){\n $insertfile_width = ImageSx($gz_image);\n $insertfile_height = ImageSy($gz_image);\n }else {\n $lineCount = explode(\"\\r\\n\",$this->gz_text);\n $fontSize = imagettfbbox($this->gz_text_size,$this->gz_text_angle,$this->gz_text_font,$this->gz_text);\n $insertfile_width = $fontSize[2] - $fontSize[0];\n $insertfile_height = count($lineCount)*($fontSize[1] - $fontSize[5]);\n\t\t\t $fontSizeone =imagettfbbox($this->gz_text_size,$this->gz_text_angle,$this->gz_text_font,'e');\n\t\t\t $fontSizeone = ($fontSizeone[2] - $fontSizeone[0])/2;\n }\n\t\tswitch ($pos){\n\t\t\tcase 0:\n\t\t\t $dest_x = ( $sourcefile_width / 2 ) - ( $insertfile_width / 2 );\n\t\t\t $dest_y = ( $sourcefile_height / 2 ) + ( $insertfile_height / 2 );\n\t\t\t break;\n\n\t\t\tcase 1:\n\t\t\t $dest_x = 0;\n\t\t\t $dest_y = $insertfile_height;\n\t\t\t break;\n\t\t\tcase 2:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width-$fontSizeone;\n\t\t\t $dest_y = $insertfile_height;\n\t\t\t break;\n\n\t\t\tcase 3:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width-$fontSizeone;\n\t\t\t $dest_y = $sourcefile_height - ($insertfile_height/4);\n\t\t\t break;\n\n\t\t\tcase 4:\n\t\t\t $dest_x = 0;\n\t\t\t $dest_y = $sourcefile_height - ($insertfile_height/4);\n\t\t\t break;\n\n\t\t\tcase 5:\n\t\t\t $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 );\n\t\t\t $dest_y = $insertfile_height;\n\t\t\t break;\n\n\t\t\tcase 6:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width -$fontSizeone;\n\t\t\t $dest_y = ( $sourcefile_height / 2 ) + ( $insertfile_height / 2 );\n\t\t\t break;\n\n\t\t\tcase 7:\n\t\t\t $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 );\n\t\t\t $dest_y = $sourcefile_height - ($insertfile_height/4);\n\t\t\t break;\n\n\t\t\tcase 8:\n\t\t\t $dest_x = 0;\n\t\t\t $dest_y = ( $sourcefile_height / 2 ) + ( $insertfile_height / 2 );\n\t\t\t break;\n\n\t\t\tdefault:\n\t\t\t $dest_x = $sourcefile_width - $insertfile_width;\n\t\t\t $dest_y = $sourcefile_height - $insertfile_height;\n\t\t\t break;\n\t\t}\t\n\t\tif($gz_image){\n\t\t\t$dest_y=$dest_y-$insertfile_height;\n\t\t}\n return array(\"dest_x\"=>$dest_x,\"dest_y\"=>$dest_y);\n}", "public function calculatePosition($text, $charactersCount);", "public function println($text) {\n $this->check_bounds();\n ncurses_mvaddstr($this->offset++, 0, $text);\n }", "function imagettftextSp($image, $size, $angle, $x, $y, $color, $font, $text, $spacing = 0){\n if ($spacing == 0) { imagettftext($image, $size, $angle, $x, $y, $color, $font, $text); }else{\n \t$temp_x = $x;\n \tfor ($i = 0; $i < strlen($text); $i++){\n \t\t$bbox = imagettftext($image, $size, $angle, $temp_x, $y, $color, $font, $text[$i]);\n \t\t$temp_x += $spacing + ($bbox[2] - $bbox[0]);\n \t}\n\t}\n}", "public function printAlignmentPage ()\r\n {\r\n $row_count = $this->number_of_rows;\r\n $col_count = $this->number_of_columns;\r\n $return = '';\r\n $test_block = '\r\n <div class=\"testpage\">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas diam purus, fermentum vitae, tempus id, placerat at, dui. Ut vel orci et enim pellentesque pretium. Duis aliquam nulla vel orci. Sed sit amet ante a sem sodales bibendum. Curabitur faucibus bibendum erat. Suspendisse dolor est, mollis sit amet, lobortis in, blandit ultricies, urna. Nulla mollis nunc ac quam. Duis id orci non turpis elementum iaculis. Sed porttitor tincidunt pede. Nulla non justo id augue pretium porttitor. Suspendisse potenti. Suspendisse blandit, elit sit amet consectetuer accumsan, turpis ante facilisis enim, nec pellentesque magna purus id orci.<br>\r\n Praesent tortor mauris, mollis non, tempor vitae, aliquet vitae, augue. Nullam diam. Vestibulum et urna. Nunc in sapien. In elementum est et diam. Vivamus nulla tellus, porta eget, tempus eget, fringilla sed, lacus. Suspendisse purus libero, consequat eu, lobortis non, luctus in, sapien. Aenean quam eros, rhoncus vel, iaculis et, scelerisque in, magna. Aenean hendrerit, odio id mollis varius, urna pede vulputate massa, ac blandit arcu justo laoreet purus. Integer et felis at lectus commodo consequat. Vestibulum a arcu. Donec est ligula, viverra ac, tempor sit amet, ultrices quis, pede.</div>';\r\n $return .= '<style>'.$this->getLabelCSS().'\r\n </style>';\r\n $return .= $this->beginLabelSheet();\r\n while (--$row_count > 0)\r\n {\r\n $return .= $test_block;\r\n $return .= $this->advanceLabelRow();\r\n }\r\n while (--$col_count > 0)\r\n {\r\n $return .= $test_block;\r\n $return .= $this->advanceLabel();\r\n }\r\n $return .= $test_block;\r\n $return .= $this->finishLabelSheet();\r\n return $return;\r\n }", "function addPage()\n {\n // Reuse the atkAddHandler for the addPage.\n $handler = atknew(\"atk.handlers.atkaddhandler\");\n $handler->setNode($this->m_node);\n return $handler->invoke(\"addPage\");\n }", "function createPage();", "public function getPageAndRootline() {}", "function pageToPDF($page, $template, $text) {\n $pdf = new concat_pdf('P','mm','Letter');\n $pdf->setFiles($page); //$files is an array with existing PDF files.\n $pdf->setInput($text,$template);\n $pdf->concat();\n $pdf->Output('boo.pdf','I');\n}", "private function appendUrlAnnotation($text, $url) {\n $this->appendText(\" \");\n $fromHOffset = $this->hOffset;\n\n // If more than one text line to append\n while ($text = $this->appendOneLine($text)) {\n // Trace the underline\n $this->currentPage->setLineWidth(1.0);\n $this->currentPage->setDash(null, 0);\n $this->currentPage->moveTo(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->lineTo(self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->stroke();\n\n // Create link\n $annotationArea = array(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n $this->currentPage->createURLAnnotation($annotationArea, $url)->setBorderStyle(0, 0, 0);\n\n // Prepare the next line\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n $fromHOffset = $this->hOffset;\n }\n\n // Trace the underline\n $this->currentPage->setLineWidth(1.0);\n $this->currentPage->setDash(null, 0);\n $this->currentPage->moveTo(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->lineTo(self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->stroke();\n\n // Create link\n $annotationArea = array(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n $this->currentPage->createURLAnnotation($annotationArea, $url)->setBorderStyle(0, 0, 0);\n\n }", "public function setPosition()\n {\n // get the current position\n $currentX = $this->_pdf->getX();\n $currentY = $this->_pdf->getY();\n\n // save it\n $this->value['xc'] = $currentX;\n $this->value['yc'] = $currentY;\n\n if ($this->value['position']=='relative' || $this->value['position']=='absolute') {\n if ($this->value['right']!==null) {\n $x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];\n if ($this->value['margin']['r']) $x-= $this->value['margin']['r'];\n } else {\n $x = $this->value['left'];\n if ($this->value['margin']['l']) $x+= $this->value['margin']['l'];\n }\n\n if ($this->value['bottom']!==null) {\n $y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];\n if ($this->value['margin']['b']) $y-= $this->value['margin']['b'];\n } else {\n $y = $this->value['top'];\n if ($this->value['margin']['t']) $y+= $this->value['margin']['t'];\n }\n\n if ($this->value['position']=='relative') {\n $this->value['x'] = $currentX + $x;\n $this->value['y'] = $currentY + $y;\n } else {\n $this->value['x'] = $this->_getLastAbsoluteX()+$x;\n $this->value['y'] = $this->_getLastAbsoluteY()+$y;\n }\n } else {\n $this->value['x'] = $currentX;\n $this->value['y'] = $currentY;\n if ($this->value['margin']['l']) $this->value['x']+= $this->value['margin']['l'];\n if ($this->value['margin']['t']) $this->value['y']+= $this->value['margin']['t'];\n }\n\n // save the new position\n $this->_pdf->setXY($this->value['x'], $this->value['y']);\n }", "public function add_text($text)\n {\n }", "function DrawOwnerText() {\n $iBlack = imagecolorallocate($this->oImage, 0, 0, 0);\n // get height of selected font\n $iOwnerTextHeight = imagefontheight(2);\n // calculate overall height\n $iLineHeight = $this->iHeight - $iOwnerTextHeight - 4;\n \n // draw line above text to separate from CAPTCHA\n imageline($this->oImage, 0, $iLineHeight, $this->iWidth, $iLineHeight, $iBlack);\n \n // write owner text\n imagestring($this->oImage, 2, 3, $this->iHeight - $iOwnerTextHeight - 3, $this->sOwnerText, $iBlack);\n \n // reduce available height for drawing CAPTCHA\n $this->iHeight = $this->iHeight - $iOwnerTextHeight - 5;\n }", "public function setText($text, $font, $position = array('top', 'left'), $size = 10, $margin = 0)\n {\n if (!$text && !$font && (!is_array($position) || count($position) != 2)) return; // TODO: Much better to throw an exception than just this check.\n \n $textArea = $this->_getWidth($this->layout) - ($margin * 2); // Consider both left and right edges.\n $lines = $this->_wrapText($text, $font, $size, $textArea);\n \n $position = array_map('strtolower', $position);\n // Reverse the lines if text is to be positioned at the bottom.\n if (in_array('bottom', $position)) {\n $lines = array_reverse($lines);\n }\n\n $lineHeight = 0;\n foreach ($lines as $line) {\n $bbox = imagettfbbox($size, 0, $font, $line);\n \n $x = null; \n $y = null;\n foreach ($position as $index => $value) {\n if (is_numeric($value)) {\n if (0 == $index) {\n $x = $value + $margin;\n } else {\n $y = $value + $bbox[1] + $margin - ($bbox[5] / 2) + $lineHeight;\n }\n } else {\n switch ($value) {\n case 'right':\n $x = floor($this->_getWidth($this->layout) - $bbox[2]) - $margin;\n break;\n case 'left':\n $x = $margin;\n break; \n case 'center':\n if ((0 == $index && !('left' == $position[1] || 'right' == $position[1])) || !empty($y)) {\n $x = $bbox[0] + ($this->_getWidth($this->layout) / 2) - ($bbox[4] / 2); \n } else {\n $y = $bbox[1] + ($this->_getHeight($this->layout) / 2) - ($bbox[5] / 2) + $lineHeight;\n }\n break;\n case 'bottom':\n $y = $this->_getHeight($this->layout) - ($bbox[1] + $margin - ($bbox[5] / 2) + $lineHeight);\n break;\n case 'top':\n $y = $bbox[1] + $margin - ($bbox[5] / 2) + $lineHeight;\n break;\n default:\n // TODO: Maybe throw another exception here.\n break;\n }\n }\n }\n $lineHeight += $bbox[1] - $bbox[7] + 5; // Set the line height for the next line of text.\n \n $black = imagecolorallocate($this->layout, 0, 0, 0);\n imagettftext($this->layout, $size, 0, $x, $y, $black, $font, $line);\n } \n }", "abstract protected function view_generatePageContent();", "private function build_text($im, $text, $x=6, $align='left', $y=12){\n\t\t// Font size\n\t\t$size = 8;\n\t\t// Sort out alignment\n\t\tif ($align=='right'){\n\t\t\t$dat = imagettfbbox($size, 0, \"visitor.ttf\", $text);\n\t\t\t$x -= $dat[2];\n\t\t}\n\t\t// Set up black and white colours\n\t\t$color2 = imagecolorallocate($im, 0, 0, 0);\n\t\t$color = imagecolorallocate($im, 255, 255, 255);\n\t\t// Write text border\n\t\timagettftext($im, $size, 0, $x-1, $y-1, $color2, \"visitor.ttf\", $text);\n\t\timagettftext($im, $size, 0, $x-1, $y, $color2, \"visitor.ttf\", $text);\n\t\timagettftext($im, $size, 0, $x-1, $y+1, $color2, \"visitor.ttf\", $text);\n\t\timagettftext($im, $size, 0, $x, $y+1, $color2, \"visitor.ttf\", $text);\n\t\timagettftext($im, $size, 0, $x, $y-1, $color2, \"visitor.ttf\", $text);\n\t\timagettftext($im, $size, 0, $x+1, $y-1, $color2, \"visitor.ttf\", $text);\n\t\timagettftext($im, $size, 0, $x+1, $y, $color2, \"visitor.ttf\", $text);\n\t\timagettftext($im, $size, 0, $x+1, $y+1, $color2, \"visitor.ttf\", $text);\n\t\t// Write text\n\t\timagettftext($im, $size, 0, $x, $y, $color, \"visitor.ttf\", $text);\n\t}", "protected function getActivePageWrapper($text)\n\t{\n\t\treturn '<li class=\"active\"><span>'.$text.'</span></li> ';\n\t}", "public function drawTextBox($text, $x, $y, $maxCharsPerLine = null, $textAlign = null,\n $charEncoding = null\n ) {\n $createdPages = array();\n $bodyHeight = $this->getBodyHeight();\n $startHeight = $y + $this->marginBottom;\n $lineHeight = $this->getFontSize() * $this->lineHeight;\n if (null === $maxCharsPerLine) {\n $maxCharsPerLine = 75;\n }\n if (null === $charEncoding) {\n $charEncoding = $this->charEncoding;\n }\n\n $lines = explode(\"\\n\", Zend_Text_MultiByte::wordWrap(\n $text, $maxCharsPerLine, \"\\n\", false, $charEncoding));\n\n foreach ($lines as $index => $line) {\n // Check if lines exceed the current page\n $resultHeight = $bodyHeight + ($y < $lineHeight ? $y + $lineHeight : $y);\n if ($resultHeight < $bodyHeight) {\n\n // Set max page lines for an empty page\n $maxPageLines = floor($bodyHeight / $lineHeight);\n\n $chunks = array_chunk($lines, $maxPageLines);\n foreach ($chunks as $chunk) {\n $page = new Pike_Pdf_Page();\n $page->drawTextBox(implode(\"\\n\", $chunk), $x, $this->getBodyHeight(), $maxCharsPerLine);\n $createdPages[] = $page;\n }\n\n break;\n }\n\n // Write line on the current page\n $this->drawText($line, $x, $y);\n unset($lines[$index]);\n $y -= $lineHeight;\n }\n\n return $createdPages;\n }", "function Footer()\n{\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial','I',8);\n // Print centered page number\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n}", "function add_page()\n\t{\n\t\tglobal $errors, $Cl_root_path, $basic_gui;\n\t\t\n\t\t// main check\n\t\tif ( !isset( $_POST[ 'submit_page' ] ) )\n\t\t{\n\t\t\t$errors->report_error( $this->lang[ 'Wrong_form' ], CRITICAL_ERROR );\n\t\t}\n\t\t\n\t\t// get data\n\t\t$title = ( isset( $_POST[ 'title' ] ) ) ? strval( $_POST[ 'title' ] ) : '';\n\t\t$lang = ( isset( $_POST[ 'language' ] ) ) ? strval( $_POST[ 'language' ] ) : '';\n\t\t$text = str_replace( '&nbsp;', ' ', $basic_gui->gennuline( ( isset( $_POST[ 'editor1' ] ) ) ? strval( $_POST[ 'editor1' ] ) : '' ) );\n\t\t$auth = ( isset( $_POST[ 'auth' ] ) ) ? intval( $_POST[ 'auth' ] ) : GUEST;\n\t\t\n// \t\t$text = str_replace( \"\\n\", '<br />', $text );\n\t\t\n\t\tif ( empty( $title ) || empty( $text ) )\n\t\t{ // need these\n\t\t\t$errors->report_error( $this->lang[ 'No_data' ], GENERAL_ERROR );\n\t\t}\n\t\t\n\t\t// save to the array\n\t\t$pag = array( 'content' => $text, 'auth' => $auth );\n\t\tif ( !is_array( $this->pages_array[ $lang ] ) )\n\t\t{ // make it an array, just to be sure\n\t\t\t$this->pages_array[ $lang ] = array();\n\t\t}\n\t\t$this->pages_array[ $lang ][ $title ] = $pag;\n\t\t\n\t\t// now write it\n\t\t$this->save_pages();\n\t\t\n\t\t$errors->report_error( $this->lang[ 'Added' ], MESSAGE );\n\t}", "function imageText($text, $font_file, $font_size = 12, $color = '#000000', $position = 'center', $x_offset = 0, $y_offset = 0, $stroke_color = null, $stroke_size = null, $alignment = null, $letter_spacing = 0) {\r\n $this->imageText = array(\"text\"=>$text, \"font_file\"=>$font_file, \"font_size\" =>$font_size, \"color\" => $color, \"position\" => $position, \"x_offset\" => $x_offset, \"y_offset\" => $y_offset, \"stroke_color\" => $stroke_color, \"stroke_size\" => $stroke_size, \"alignment\" => $alignment, \"letter_spacing\" => $letter_spacing);\r\n return $this;\r\n }", "public function getActivePageWrapper($text)\n {\n return '<a class=\"active item\">' . $text . '</a>';\n }", "function parrafo($text){\r\n return \"<p>$text</p>\";\r\n }", "function render_text_centered($im, $text,$font_size, $zone, $box){\n global $font_file;\n global $text_color;\n $type_space = imagettfbbox($font_size, 0, $font_file, $text);\n $fw = $type_space[4];\n $fh = abs($type_space[7]);\n $px = $box->center_text_in_zone($fw,$fh,$zone);\n imagettftext($im ,$font_size, 0, $px->x, $px->y, $text_color, $font_file, $text);\n}", "function entete_table($position_entete) {\n global $pdf;\n $pdf->SetDrawColor(183); // Couleur du fond RVB\n $pdf->setFillColor(89,133,255); // Couleur des filets RVB\n $pdf->SetTextColor(0); // Couleur du texte noir\n $pdf->SetY($position_entete);\n // position de colonne 1 (10mm à gauche)\n $pdf->SetX(5);\n $pdf->Cell(40,8,'Prestation',1,0,'C',1); // 60 >largeur colonne, 8 >hauteur colonne\n // position de la colonne 2 (70 = 10+60)\n $pdf->SetX(45);\n $pdf->Cell(40,8,'Date',1,0,'C',1);\n $pdf->SetX(85);\n $pdf->Cell(40,8,'Prix HT',1,0,'C',1);\n $pdf->SetX(125);\n $pdf->Cell(40,8,'Tva',1,0,'C',1);\n $pdf->SetX(165);\n $pdf->Cell(40,8,iconv(\"UTF-8\", \"CP1250//TRANSLIT\", \"Quantité/Durée\"),1,0,'C',1);\n\n // position de la colonne 3 (130 = 70+60)\n\n\n $pdf->Ln(); // Retour à la ligne\n}", "function idx_addPage($page){\n global $conf;\n\n // load known words and documents\n $page_idx = file($conf['cachedir'].'/page.idx');\n\n // get page id (this is the linenumber in page.idx)\n $pid = array_search(\"$page\\n\",$page_idx);\n if(!is_int($pid)){\n $page_idx[] = \"$page\\n\";\n $pid = count($page_idx)-1;\n // page was new - write back\n $fh = fopen($conf['cachedir'].'/page.idx','w');\n if(!$fh) return false;\n fwrite($fh,join('',$page_idx));\n fclose($fh);\n }\n\n // get word usage in page\n $words = idx_getPageWords($page);\n if($words === false) return false;\n if(!count($words)) return true;\n\n // Open index and temp file\n $idx = fopen($conf['cachedir'].'/index.idx','r');\n $tmp = fopen($conf['cachedir'].'/index.tmp','w');\n if(!$idx || !$tmp){\n trigger_error(\"Failed to open index files\", E_USER_ERROR);\n return false;\n }\n\n // copy from index to temp file, modifying were needed\n $lno = 0;\n $line = '';\n while (!feof($idx)) {\n // read full line\n $line .= fgets($idx, 4096);\n if(substr($line,-1) != \"\\n\") continue;\n\n // write a new Line to temp file\n idx_writeIndexLine($tmp,$line,$pid,$words[$lno]);\n\n $line = ''; // reset line buffer\n $lno++; // increase linecounter\n }\n fclose($idx);\n\n // add missing lines (usually index and word should contain\n // the same number of lines, however if the page contained\n // new words the word file has some more lines which need to\n // be added here\n $word_idx = file($conf['cachedir'].'/word.idx');\n $wcnt = count($word_idx);\n for($lno; $lno<$wcnt; $lno++){\n idx_writeIndexLine($tmp,'',$pid,$words[$lno]);\n }\n\n // close the temp file and move it over to be the new one\n fclose($tmp);\n return rename($conf['cachedir'].'/index.tmp',\n $conf['cachedir'].'/index.idx');\n}", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "public function setTextTranslate($x = 0, $y = 0) {}", "function displayMain(){\n $data='<div class=\"about\"><h2>About this tool</h2>\n<p>Graber Transcriptdb is an attempt to create an integrated transcript database of all the organisms and annotations found in UCSC,MGI,ENSEMBL,UNIPROT,and EBI databases. \n The database generates unique transcript_id and exon_id for all redundant transcripts and exons from various annotations for a given organism version.We store the start cordinates using the zero-base standard and the end cordinates using the one-base standard.\nBut we display all the cordinates using the one-base. \n</p>\n<h2>You can use the tool as followed</h2>\n <ul><list>You have genomic regions of interest or a gene and you would like to extract overlaping functional features</li>\n <list>You have a file containing genomic regions of interest or a list of genes or transcripts and you would like to extract overlaping functional features</li>\n </ul>\n <p> Database updates are ran monthly to synchronize both our data and external data sources.\n</p><hr/><h2>Good Practices:</h2>';\n$data.=getXmlUrl(\"Good Practices\");\n$data.='</div>';\n return $data;\n}", "protected function setUp()\n\t {\n\t\t$tex = \"\\\\documentclass[10pt]{article}\\n\";\n\t\t$tex .= \"\\\\usepackage{graphicx}\\n\";\n\t\t$tex .= \"\\\\usepackage[left=0mm,top=5mm,landscape,twoside=false]{geometry}\\n\";\n\t\t$tex .= \"\\\\special{papersize=220mm,110mm}\\n\";\n\t\t$tex .= \"\\\\setlength\\\\parskip{0pt}\\n\";\n\t\t$tex .= \"\\\\pagestyle{empty}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\begin{document}\\n\";\n\t\t$tex .= \" \\\\begin{minipage}[b]{100mm}\\n\";\n\t\t$tex .= \" \\\\footnotesize\\n\";\n\t\t$tex .= \" If undelivered please return to:\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \" Gefest Australia Pty Ltd\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \" 19 North Terrace\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \" Hackney SA 5069\\n\";\n\t\t$tex .= \" \\\\end{minipage}\\n\";\n\t\t$tex .= \" \\\\hfill\\n\";\n\t\t$tex .= \" \\\\begin{minipage}[b]{96mm}\\n\";\n\t\t$tex .= \" \\\\includegraphics[width=26mm,height=26mm]{\\$eps1\\$}\\n\";\n\t\t$tex .= \" \\\\end{minipage}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\vspace{1.0in}\\\\LARGE\\n\";\n\t\t$tex .= \"\\\\setlength\\\\parindent{60mm}\\n\";\n\t\t$tex .= \"\\\\textsf{JOE BLOGGS}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\textsf{BIG COMPANY PTY LTD}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\textsf{1 KING WILLIAM STREET}\\n\";\n\t\t$tex .= \"\\n\";\n\t\t$tex .= \"\\\\textsf{ADELAIDE SA 5000}\\n\";\n\t\t$tex .= \"\\\\end{document}\\n\";\n\n\t\t$this->object = new TeX($tex);\n\t }", "public function createPage()\n {\n $this->currentPage++;\n $this->currentIndex++;\n $this->resetProps();\n /* Create page */\n if ($this->landscape) {\n // A4 format in Landscape orientation\n $this->pdf->begin_page_ext(0, 0, \"width=a4.height height=a4.width\");\n } else {\n // A4 format in Portrait orientation3.\n $this->pdf->begin_page_ext(0, 0, \"width=a4.width height=a4.height\");\n }\n empty($this->createPageTrigger) || call_user_func_array($this->createPageTrigger, $this->createPageTriggerArgs);\n }", "function RotatedText($x, $y, $txt, $angle){\r $this->Rotate($angle,$x,$y);\r $this->Text($x,$y,$txt);\r $this->Rotate(0);\r }", "public function putText($locx, $locy, $content) {\r\n $sql = <<<SQL\r\n INSERT INTO writing (locx, locy, content) VALUES (\r\n $locx, $locy, '$content'\r\n )\r\nSQL;\r\n $result = $this->conn->prepare($sql);\r\n $result->execute();\r\n }", "function Footer()\n{\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n}", "function Footer()\n{\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n}", "function subWrite($h, $txt, $link='', $subFontSize=12, $subOffset=0){\n\t\t// resize font\n\t\t$subFontSizeold = $this->FontSizePt;\n\t\t$this->SetFontSize($subFontSize);\n\t\t\n\t\t// reposition y\n\t\t$subOffset = ((($subFontSize - $subFontSizeold) / $this->k) * 0.3) + ($subOffset / $this->k);\n\t\t$subX = $this->x;\n\t\t$subY = $this->y;\n\t\t$this->SetXY($subX, $subY - $subOffset);\n\n\t\t//Output text\n\t\t$this->Write($h, $txt, $link);\n\n\t\t// restore y position\n\t\t$subX = $this->x;\n\t\t$subY = $this->y;\n\t\t$this->SetXY($subX, $subY + $subOffset);\n\n\t\t// restore font size\n\t\t$this->SetFontSize($subFontSizeold);\n\t}" ]
[ "0.625468", "0.6119661", "0.60499084", "0.58596385", "0.5695841", "0.56725997", "0.5637599", "0.5576045", "0.5564694", "0.5549563", "0.5519742", "0.5501276", "0.5466034", "0.5432984", "0.5429372", "0.5407655", "0.5387293", "0.5349953", "0.5346931", "0.53123045", "0.529699", "0.52808636", "0.5196804", "0.5196088", "0.51957506", "0.51886207", "0.51758003", "0.5170365", "0.5160103", "0.5158617", "0.5139735", "0.5125347", "0.5119014", "0.510576", "0.5103618", "0.5100086", "0.5080625", "0.5079774", "0.5041245", "0.50398153", "0.50183433", "0.49982816", "0.49793825", "0.49493346", "0.49478617", "0.49464917", "0.4944277", "0.49398306", "0.49366236", "0.49251276", "0.49237895", "0.49231187", "0.4920325", "0.49114442", "0.49090034", "0.49077687", "0.49003762", "0.48887077", "0.48887077", "0.48850814", "0.48831028", "0.48831028", "0.48825058", "0.48809388", "0.48794413", "0.48634443", "0.48595646", "0.48544085", "0.484994", "0.4835118", "0.48325163", "0.48309305", "0.48286164", "0.48276868", "0.4814857", "0.48137385", "0.48040164", "0.47987062", "0.4797705", "0.47940838", "0.47870514", "0.47827655", "0.4782076", "0.478116", "0.47773907", "0.47771555", "0.47718495", "0.47711414", "0.4771134", "0.4760534", "0.47562388", "0.47560883", "0.47541147", "0.47494066", "0.47445846", "0.47420728", "0.47342888", "0.47316352", "0.47316352", "0.47174954" ]
0.6525794
0
Add line to current page
public function addLine($startPoint = ADD_LINE_POINT_DEFAULT, $endPoint = ADD_LINE_POINT_DEFAULT) { $this->pdf->setlinewidth(1); $this->pdf->setcolor("stroke", "rgb", 0, 0, 0, 0); if ($startPoint && $endPoint) { $this->pdf->moveto($startPoint["x"], $startPoint["y"]); $this->pdf->lineto($endPoint["x"], $endPoint["y"]); } else { $this->cursorX = $this->minX; $this->cursorY -= $this->margin['top']; $this->pdf->moveto($this->cursorX, $this->cursorY); $this->cursorX = $this->maxX; $this->pdf->lineto($this->cursorX, $this->cursorY); } $this->pdf->stroke(); $this->pdf->fit_textline("", 0, 0, "fillcolor={black}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function new_line()\n {\n }", "private function traceLine() {\n $this->lineJump();\n $this->currentPage->rectangle(self::HMARGIN + $this->hOffset, $this->PAGE_HEIGHT - self::VMARGIN - $this->vOffset, $this->PAGE_WIDTH - 2*$this->hOffset - 2*self::HMARGIN, 1);\n $this->currentPage->stroke();\n }", "function newPage($pdf) {\r\n global $OrderId, $currentRow, $itemRowStart;\r\n\r\n $currentRow = $itemRowStart;\r\n\r\n $pdf->Addpage();\r\n $pdf->SetFont('Helvetica', 'B', 16);\r\n $pdf->Image('blissLogo.png');\r\n $pdf->Text(20, 43, \"OrderId:\");\r\n $pdf->Text(43, 43, $OrderId);\r\n $pdf->SetFont('Arial', 'I', 10);\r\n $pdf->SetY(266.5);\r\n $pdf->Cell(0, 10, 'Page ' . $pdf->PageNo(), 0, 0, 'C');\r\n $pdf->line( 12,245,190,245);\r\n$pdf->line( 12,267,190,267);\r\n\r\n \r\n}", "public function add( $text ) {\n\t\t$this->page->append( $text );\n\t}", "private function add_new_line() {\n\n\t\t$this->fields[] = array( 'newline' => true );\n\n\t}", "protected function addLine($line)\n {\n $this->lines[] = $line;\n }", "function NewPage()\n {\n $ypos = $this->GetY();\n if ($ypos > 230){\n $this->AddPage();\n }\n }", "function appendPage($pageName, $newPageBody)\n{\n $newPageBody = trim($newPageBody);\n $sFile = getPagePath($pageName);\n if($newPageBody != \"\")\n {\n $f = fopen($sFile, \"at\");\n fwrite($f, \"\\n\\n\\n\\n\");\n fwrite($f, $newPageBody);\n fclose($f);\n }\n else\n {\n @unlink($sFile);\n }\n}", "public function newLine() {\n\t\t$this->_section=0;\n\t\t$this->_lineNumber++;\n\t\t$this->_text[$this->_lineNumber]=array();\n\t\t$this->_text[$this->_lineNumber][0]['text']='';\n\t\t$this->_text[$this->_lineNumber][0]['encoding']='';\n\t\t$this->_text[$this->_lineNumber][0]['font']=$this->_font;\n\t\t$this->_text[$this->_lineNumber][0]['fontSize']=$this->_fontSize;\n\t\t$this->_text[$this->_lineNumber][0]['width']=0;\n\n\t\t\n\t\t$this->_initializeLine();\n\t\t\n\t\t$this->_text[$this->_lineNumber]['alignment']=$this->_text[$this->_lineNumber-1]['alignment'];\n\t\t//add the last cell's height to the auto height if we have an auto-height box.\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_autoHeight+=$this->_text[$this->_lineNumber-1]['height'];\n\t\t}\n\t}", "private function nextPage() {\n $this->lastPage = array(\n \"vOffset\" => $this->vOffset,\n \"hOffset\" => $this->hOffset,\n );\n $footerToAppend = false;\n $this->currentPageNumber++;\n if (isset($this->pages[$this->currentPageNumber])) {\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = 0;\n } else {\n $this->pages[$this->currentPageNumber] = $this->haruDoc->addPage();\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->currentPage->setTextRenderingMode(\\HaruPage::FILL);\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = ($this->hOffset ? $this->hOffset : 0);\n $footerToAppend = true;\n }\n if ($this->currentFont && $this->currentFontSize && $this->currentFontColor) {\n $this->currentPage->setFontAndSize($this->currentFont, $this->currentFontSize);\n $this->setColor($this->currentFontColor[0], $this->currentFontColor[1], $this->currentFontColor[2]);\n }\n if ($footerToAppend && $this->currentPageNumber > 1) {\n $this->currentPage->beginText();\n $this->setFont(self::FONT_NORMAL, 12, array(0,0,0));\n $this->currentPage->textOut($this->PAGE_WIDTH - self::HMARGIN - $this->currentPage->getTextWidth($this->currentPageNumber),\n self::VMARGIN - 30, $this->currentPageNumber);\n $this->revertFont();\n $this->setFont(self::FONT_BOLD, 12, array(0,0,0));\n $this->currentPage->textOut(self::HMARGIN,\n self::VMARGIN - 30, $this->currentBookName);\n $this->revertFont();\n $this->currentPage->endText();\n\n }\n\n }", "public function addOutputLine($line);", "static public function addHeadLine($line) {\n\t\tself::$_headLine[] = $line;\n\t}", "function add_line_return($file_path)\n {\n file_put_contents($file_path, \"\\n\", FILE_APPEND);\n }", "function newPage()\n {\n $this->lastPageNumber ++;\n if ($this->lastPageNumber != 1)\n $this->documentBuffer .= \"<br clear=\\\"all\\\" style=\\\"page-break-before: always;\\\">\";\n return $this->lastPageNumber;\n }", "function pushOffset() {\n log::trace(\"Path offset pushed\");\n $this->sectionOffset++;\n $this->pageOffset++;\n }", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "function addPage()\n {\n // Reuse the atkAddHandler for the addPage.\n $handler = atknew(\"atk.handlers.atkaddhandler\");\n $handler->setNode($this->m_node);\n return $handler->invoke(\"addPage\");\n }", "public function addPageBreak() {\n\t\t$this->_elementCollection[] = new PHPWord_Section_PageBreak();\n\t}", "public function appendOneLine($text) {\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n $this->currentPage->beginText();\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->currentPage->endText();\n return $text;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed)\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n\n return ($isLastLine ? null : $text);\n }", "private function markCurrentPage() {\n $this->pageReloadMarker = $this->randomMachineName();\n $this->getSession()->executeScript('document.body.appendChild(document.createTextNode(\"' . $this->pageReloadMarker . '\"));');\n }", "protected function echoLine(&$addto, $text = \"\")\r\n\t{\r\n\t\t$addto .= $text . \"\\r\\n\";\r\n\t}", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "function addContent($content)\n {\n $this->page .= $content;\n }", "private function add_next_line($content) {\r\n\t\treturn $content . \"\\n\";\r\n\t}", "public function add($line) {\r\n if(is_string($line)) $line .= \"\\n\";\r\n $this->body[]=$line;\r\n }", "public function drawPage()\n\t\t{\n\t\t}", "function pushHeadline ($text) {\n\t\t$this->_roof[\"cuerpo\"][] = $text;\n\t}", "protected function addToOutput($line, $content)\n {\n if (isset($this->output[$line])) {\n $this->output[$line] .= $content;\n } else {\n $this->output[$line] = $content;\n }\n }", "private function next() {\n if ($this->currentPage < $this->totalPage) {\n print '<li><a href=\"' . $this->url . '&page=' . ($this->currentPage + 1) . '\">&gt;</a></li>';\n }\n }", "function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_host_add_list', array('content' => $content));\n }", "public function addLine(Line $line): void\n {\n $this->lines[] = $line;\n }", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollection_add_list', array('content' => $content));\n }", "private function addLine($line)\n {\n $slugs = explode(\"\\\\\", $line);\n foreach ($slugs as $key => $slug) {\n if ($slug) {\n $parent = $this->addSlug($slug, $parent ?? null);\n }\n }\n }", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollectionitem_add_list', array('content' => $content));\n }", "private function add_line($text = \"\", $should_wordwrap = true)\n {\n $text = $should_wordwrap ? wordwrap($text, $this->printer_width) : $text;\n $this->printer->text($text . \"\\n\");\n }", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "function setNumPageLinePol(&$fp, $numLine) {\n\n fwrite($fp, chr(27).\"C\".chr($numLine));\n }", "public function addedLine($line, $colspan=0)\n\t{\n\t\treturn $this->wrapLine('+', 'diff-addedline', $line, $colspan);\n\t}", "public function appendLine($value = \"\")\r\n {\r\n $this->addElement($value.PHP_EOL);\r\n }", "private function appendLineToRewrites($line){\n\t\t$this->rewrites .= \"\\n\" . $line;\n\t}", "public function newLinesWritten();", "protected function lineToPdf(): void\n {\n $this->pdf->SetDrawColor($this->color['r'], $this->color['g'], $this->color['b']);\n $this->Line($this->x1, $this->y1, $this->x2, $this->y2);\n }", "function add($row) {\n\t\t//$y = 0.25 + $this->y * 1.5;\n\t\tif ($this->curLabel == 0) $this->blockOut('page');\n\t\t\n\t\t$this->blockOut('label');\n\t\t\t\n\t\t$short = new slURLShortener();\n\t\t\n\t\t$short->create(WWW_ROOT.\"/item/\".$this->ref.\"/\".$row[\"_KEY\"]);\n\t\t\n\t\t$url = $short->getShortenedURL();\n\n\t\t$qrFile = $this->file.\"-\".($this->imNum++).\".png\";\n\t\t\n\t\t$this->blockOutEnd(array($page, $label, $row));\n\t\t\n\t\t$this->curLabel ++;\n\t\tif ($this->curLabel > $this->labelConfig[\"labels-per-page\"]) {\n\t\t\t$this->blockOutEnd();\n\t\t\t$this->curLabel = 0;\n\t\t\t$this->curPage ++;\n\t\t}\n\t\t\n\t\t//QRcode::png($short->getTinyID(), $qrFile, 'L', 6, 2);\n\t\t\n\t\t//fputs($this->fp,$qrFile.\"\\n\");\n\t\t\n\t\t//$this->pdf->Image($qrFile, $x, $y, 1.5, 1.5, \"PNG\", $url);\n\t\t\t\t\n\t\t//$this->pdf->SetXY(1.5 + $x, $y + 0.1);\n\t\t\n\t\t/*$this->addText($row[\"_NAME\"]);\n\t\tif (isset($row[\"_UNIQUE\"]) && $row[\"_UNIQUE\"] && safeName($row[\"_UNIQUE\"]) != safeName($row[\"_NAME\"])) $this->addText($row[\"_UNIQUE\"]);\n\t\t$this->addText(\"REF: \".$GLOBALS[\"slCore\"]->db->refToNumber(str_replace(\"/\",\".\",$this->ref)).\".\".$row[\"_KEY\"]);\n\t\t$this->addText(WWW_ROOT.\"/sl/tiny?\".$short->id,8);\n\t\t\n\t\t$this->x ++;\n\t\tif ($this->x == 2) {\n\t\t\t$this->x = 0;\n\t\t\t$this->y ++;\n\t\t\tif ($this->y == 7) {\n\t\t\t\t$this->y = 0;\n\t\t\t\t$this->pdf->AddPage();\n\t\t\t}\n\t\t}*/\n\t}", "private function add_line($text = \"\", $should_wordwrap = true)\n {\n $text = $should_wordwrap ? wordwrap($text, $this->printer_width) : $text;\n $this->printer->text($text.\"\\n\");\n }", "private function setNewLine() {\n $extension = pathinfo($this->path, PATHINFO_EXTENSION);\n if ($extension === Lexer::LINUX_FILE_EXTENSION) {\n $this->newLine = \"\\n\";\n } else {\n $this->newLine = \"\\r\\n\";\n }\n }", "public function addLines($lines)\n {\n $this->lines += $lines;\n }", "function _tag_holding_add($name, $line)\n\t{\n\t\t$this->_tag_holding[] = array('name' => $name, 'line' => $line);\n\t}", "function add_info($page, $add) {\r\n \r\n $this->db->insert($page, $add);\r\n }", "public function addLine($line) {\n\t\t$this->children[] = $line;\n\t\treturn $this;\n\t}", "function addTag($line)\n{\n\t$elem = $this->parser->parseLine($line);\n\n\tif (isset($elem['after'])) {\n\t\t$this->elements = $this->insertAfter($this->elements, \n\t\t\tarray($elem['id'] => $elem), $elem['after']\n\t\t);\n\t}\n\telse {\n\t\t$this->elements[$elem['id']] = $elem;\n\t}\n}", "function page_add_page($pagerec) {\n return page_edit_page($pagerec, 0, null, null);\n}", "public function addPage() {\n $colors = Colors::find();\n $this->putItem(\"colors\", $colors->toArray());\n return parent::addPage();\n }", "public function _added($lines)\n\t{\n\t\tforeach ($lines as $line)\n\t\t{\n\t\t\t$this->i++;\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->emptyLine() . $this->addedLine(htmlspecialchars ($line), 3);\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t}", "function addHeaderLine($name, $value) {\n\t\t$this->headerLines [$name] = $value;\n\t}", "public function addFooter(){\n\n$this->page .= <<<EOD\n<pre>\n$this->title\n</pre>\n</body>\n</html>\nEOD;\n}", "public function writeLine($text);", "public function moveToStartOfNextLine() {}", "public function moveToStartOfNextLine() {}", "public function getPageAndRootline() {}", "function addPageBegin($item) {\r\n global $_CMDEVEL;\r\n $_CMDEVEL['page']['pag_begin'][] = $item;\r\n }", "public function add(WebPage $page);", "public function addPage(Page $page): void\n {\n if (null === ($breadcrumb = $this->getPageBreadcrumb($page))) {\n return;\n }\n\n $nbEntries = count($breadcrumb);\n $parentEntry = $this;\n\n // Summary order\n $summaryOrder = $page->getMeta('summary-order', '');\n !is_array($summaryOrder) && $summaryOrder = explode(';', (string)$summaryOrder);\n array_walk($summaryOrder, fn(&$value) => $value = (int)trim($value));\n array_walk($summaryOrder, fn(&$value) => $value = empty($value) ? null : $value);\n $summaryOrder = array_pad($summaryOrder, 0 - $nbEntries, null);\n $summaryOrder = array_slice($summaryOrder, 0, $nbEntries);\n\n for ($i = 0; $i < $nbEntries; $i++) {\n $entry = $parentEntry->getEntryByTitle($breadcrumb[$i]);\n\n // Create if not exists or it's the last of list\n if (null === $entry) {\n $entry = new Entry($breadcrumb[$i]);\n $parentEntry->addEntry($entry);\n }\n\n // Define url and order if it's last element\n if ($i + 1 == $nbEntries) {\n $entryVisible = (bool)$page->getMeta('summary-visible', true);\n $entry->setPath($page->getPath());\n $entry->setVisible($entryVisible, $entryVisible);\n }\n\n if (isset($summaryOrder[$i])) {\n $entry->setOrder($summaryOrder[$i]);\n }\n\n $parentEntry = $entry;\n }\n\n $this->orderEntries();\n }", "public function newLine()\n {\n\n $stock = $this->getStock();\n $randomIndexStock = mt_rand(0, (count($stock)-1));\n $this->line = array_values(array_slice($stock, $randomIndexStock, 1, true));\n unset($stock[$randomIndexStock]);\n $this->stock = array_values($stock);\n }", "public function append($pages) {}", "private function beginAdmonition() {\n array_push($this->old, $this->current);\n\n $this->setFont(self::FONT_BOLD, 12);\n $this->lineJump();\n // If no space for admonition title + interleave + admonition first line on this page, then creates a new one\n if (($this->PAGE_HEIGHT - 2*self::VMARGIN - $this->vOffset) < (3*$this->currentFontSize + 3*self::LINE_SPACING))\n $this->nextPage();\n $this->current[\"vOffset\"] = $this->vOffset;\n $this->lineJump();\n $this->permanentLeftSpacing += self::INDENT_SPACING;\n $this->permanentRightSpacing += self::INDENT_SPACING;\n $this->current[\"pages\"] = array();\n }", "public function startNewPage()\n {\n }", "public function doTocLine( $anchor, $tocline, $level ) {\n\t\t\t\t//if a base url is set, anchor links will only work, if the\n\t\t\t\t//full request is prepended\n\t\t\t$url = t3lib_div::getIndpEnv('REQUEST_URI');\n\t\t\t$link = '<a href=\"' . $url . '#'.$anchor . '\">' . $tocline . '</a><br />';\n\t\t\tif($level) {\n\t\t\t\t\treturn $link.\"\\n\";\n\t\t\t} else {\n\t\t\t\t\treturn '<div class=\"tocline\">'.$link.\"</div>\\n\";\n\t\t\t}\n\t}", "public function insertAdditionnal($page, $order)\n {\n }", "function addPage($pdf,$font='freesans'){\n $pdf->AddPage();\n $pdf->SetXY(110,10);\n $pdf->SetFont($font, '', 20);\n $pdf->writeHTML('Relação de Vendas');\n $pdf->SetXY(10,24);\n $pdf->SetFont($font, 'B', 11);\n $pdf->writeHTMLCell(15, 0, $pdf->GetX(), $pdf->GetY(), '<b>Pedido</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>NF</b>');\n $pdf->writeHTMLCell(50, 0, $pdf->GetX(), $pdf->GetY(), '<b>Loja</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>Vendedor</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>Cliente</b>');\n $pdf->writeHTMLCell(25, 0, $pdf->GetX(), $pdf->GetY(), '<b>Data</b>');\n $pdf->writeHTMLCell(20, 0, $pdf->GetX(), $pdf->GetY(), '<b>Arred.</b>');\n $pdf->writeHTMLCell(25, 0, $pdf->GetX(), $pdf->GetY(), '<b>Desconto</b>');\n $pdf->writeHTMLCell(30, 0, $pdf->GetX(), $pdf->GetY(), '<b>Valor</b>');\n $pdf->Ln();\n $pdf->SetY($pdf->GetY()+2);\n $pdf->Line(10, $pdf->GetY(), 285, $pdf->GetY()); // Desenha uma linha\n $pdf->SetY($pdf->GetY()+2);\n }", "public function addPage() {\r\n\t\t// add a page (required with recent versions of tcpdf)\r\n\t\t$this->tcpdf->AddPage();\r\n\t\treturn $this;\r\n\t}", "function linebreak() {\n $this->doc .= '<br/>'.DOKU_LF;\n }", "function addPOSEntry()\n{\n\n}", "function out_line($f) {\n\tglobal $line_no, $executor_file;\n\n\tfputs($f,\"#line \".($line_no+1).\" \\\"\".$executor_file.\"\\\"\\n\");\n\t++$line_no;\n}", "function displayLine($a_dbc, $a_lineCount)\n\t{\n\t\tif($this->lineID)\n\t\t\techo \"<textarea>{$this->text}</textarea>\\n\";\n\t\telse\n\t\t \techo \"<textarea class='newLine'>{$this->text}</textarea>\\n\";\n\n\t\treturn null;\n\t}", "private function appendUrlAnnotation($text, $url) {\n $this->appendText(\" \");\n $fromHOffset = $this->hOffset;\n\n // If more than one text line to append\n while ($text = $this->appendOneLine($text)) {\n // Trace the underline\n $this->currentPage->setLineWidth(1.0);\n $this->currentPage->setDash(null, 0);\n $this->currentPage->moveTo(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->lineTo(self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->stroke();\n\n // Create link\n $annotationArea = array(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n $this->currentPage->createURLAnnotation($annotationArea, $url)->setBorderStyle(0, 0, 0);\n\n // Prepare the next line\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n $fromHOffset = $this->hOffset;\n }\n\n // Trace the underline\n $this->currentPage->setLineWidth(1.0);\n $this->currentPage->setDash(null, 0);\n $this->currentPage->moveTo(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->lineTo(self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING));\n $this->currentPage->stroke();\n\n // Create link\n $annotationArea = array(self::HMARGIN + $this->permanentLeftSpacing + $fromHOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset + self::LINE_SPACING),\n self::HMARGIN + $this->permanentLeftSpacing + $this->hOffset,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset - $this->currentFontSize));\n $this->currentPage->createURLAnnotation($annotationArea, $url)->setBorderStyle(0, 0, 0);\n\n }", "function print_A_Line( $AText )\r\n\t{\r\n\t\tstatic $iCount = 1;\r\n\t\r\n\t\techo \"<h1>\" . $iCount . \".\" . $AText .\"</h1>\\n\";\r\n\t\t$iCount ++;\r\n\t}", "public function setLine($line);", "public function line($message)\n {\n if (!$this->output) {\n return;\n }\n\n $this->output->writeln('<comment>'.$message.'</comment>');\n }", "private function AddNewPage(){\n try{\n // Updated Time\n $this -> _data['UpdatedTime'] = $GLOBALS['_NOW_'] -> clockDateTime;\n // Encrypt Password\n if (!empty($this -> _data['password'])){\n if ($this -> _data['password'] == \"^Delete\"){\n $this -> _data['password'] = \"\";\n }else{\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashKey($this -> _data['password']);\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashEncryptedWithSalt($this -> _data['password']);\n }\n }\n $this -> db -> Insert('Function', $this -> _data, \"SELECT `FunctionName` FROM `Function` WHERE (`PageUrl` = :pageUrl OR `PageUrl` = :PageUrlIndex)\", \n array(\n \":pageUrl\" => $this -> _data['pageUrl'],\n \":PageUrlIndex\" => $this -> _data['pageUrl'].'/index'\n )\n );\n\n $lastId = $this -> db -> lastInsertId();\n\n $this -> db -> CreateObjectAcl('Function', $lastId, Cores\\_Session::Get('loggedUser') -> id);\n return true;\n }catch (\\Exception $e){\n return $e -> getMessage();\n }\n \n }", "private function outputLine($line) {\n\t\t\techo $line . \"\\n\";\n\t\t}", "public function moveToNextLine($x, $y, $setLeading = false) {}", "public function moveToNextLine($x, $y, $setLeading = false) {}", "public function addGoto($url){\n \t\t// it will jump to next url\n\t\t\t$goto =$this->doc->createElement(\"gotourl\",$url);\n\t\t\t$this->response->appendChild($goto);\n\t\t}", "public function ln()\n {\n $this->entries[] = '';\n }", "public function injectAtCurrentScope( $asLineNumber, $line ) {\n $line = str_repeat( \" \", $this->context->Scope->WhitespaceDepth ) . $line;\n $this->internalParse( $asLineNumber, $line );\n }", "function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "public function addRevision()\n {\n $this->check_sess($this->session->user_logged);\n\t\t$this->load->view('head');\n\t\t$this->load->view('sclerk_sidebar');\n\n\t\t$this->load->view('search_officer', $this->response);\n\t\t$this->load->view('footer');\n }", "public function writeLn(\n string $line,\n string $color = '',\n bool $addBreak = true\n ) {\n self::write($line, $color, $addBreak);\n }", "public function appendText($text) {\n// if ($this->vOffset > $this->current[\"charOffset\"] + 3*LINE_SPACING + 3*$this->currentFontSize)\n// $this->vOffset = $this->current[\"charOffset\"] + 3*LINE_SPACING + 3*$this->currentFontSize;\n if ($this->appendToBuffer) {\n array_push($this->buffer, array(\n \"text\" => $text,\n \"font\" => $this->currentFont,\n \"size\" => $this->currentFontSize,\n \"color\" => $this->currentFontColor\n ));\n return;\n }\n\n $this->currentPage->beginText();\n do {\n // Clear the whitespace if it begins the line or if last char is a special char\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n // Number of chars allowed in the current line\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n $isLastLine = false;\n continue;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed) with align\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n if ($this->current[\"align\"] == \"center\") {\n $spacing = $this->PAGE_WIDTH - 2*self::HMARGIN -\n $this->permanentLeftSpacing - $this->permanentRightSpacing - $this->currentPage->getTextWidth($textToAppend);\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing + $spacing/2,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n } elseif ($this->current[\"align\"] == \"right\") {\n $spacing = $this->PAGE_WIDTH - 2*self::HMARGIN -\n $this->permanentLeftSpacing - $this->permanentRightSpacing - $this->currentPage->getTextWidth($textToAppend);\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing + $spacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n } else { // left\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n }\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n // Offsets for next line\n if (!$isLastLine) {\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n } else {\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n }\n\n }\n while(!$isLastLine); // While it remains chars to append\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n }", "function AddPage($orientation=''){\n\t\t\tif($this->state==0) $this->Open();\n\t\t\t$family=$this->FontFamily;\n\t\t\t$style=$this->FontStyle.($this->underline ? 'U' : '');\n\t\t\t$size=$this->FontSizePt;\n\t\t\t$lw=$this->LineWidth;\n\t\t\t$dc=$this->DrawColor;\n\t\t\t$fc=$this->FillColor;\n\t\t\t$tc=$this->TextColor;\n\t\t\t$cf=$this->ColorFlag;\n\t\t\tif($this->page>0)\n\t\t\t{\n\t\t\t\t//Page footer\n\t\t\t\t$this->InFooter=true;\n\t\t\t\t$this->Footer();\n\t\t\t\t$this->InFooter=false;\n\t\t\t\t//Close page\n\t\t\t\t$this->_endpage();\n\t\t\t}\n\t\t\t//Start new page\n\t\t\t$this->_beginpage($orientation);\n\t\t\t//Set line cap style to square\n\t\t\t$this->_out('2 J');\n\t\t\t//Set line width\n\t\t\t$this->LineWidth=$lw;\n\t\t\t$this->_out(sprintf('%.2f w',$lw*$this->k));\n\t\t\t//Set font\n\t\t\tif($family)\t$this->SetFont($family,$style,$size);\n\t\t\t//Set colors\n\t\t\t$this->DrawColor=$dc;\n\t\t\tif($dc!='0 G') $this->_out($dc);\n\t\t\t$this->FillColor=$fc;\n\t\t\tif($fc!='0 g') $this->_out($fc);\n\t\t\t$this->TextColor=$tc;\n\t\t\t$this->ColorFlag=$cf;\n\t\t\t//Page header\n\t\t\t$this->Header();\n\t\t\t//Restore line width\n\t\t\tif($this->LineWidth!=$lw)\n\t\t\t{\n\t\t\t\t$this->LineWidth=$lw;\n\t\t\t\t$this->_out(sprintf('%.2f w',$lw*$this->k));\n\t\t\t}\n\t\t\t//Restore font\n\t\t\tif($family)\t$this->SetFont($family,$style,$size);\n\t\t\t//Restore colors\n\t\t\tif($this->DrawColor!=$dc)\n\t\t\t{\n\t\t\t\t$this->DrawColor=$dc;\n\t\t\t\t$this->_out($dc);\n\t\t\t}\n\t\t\tif($this->FillColor!=$fc)\n\t\t\t{\n\t\t\t\t$this->FillColor=$fc;\n\t\t\t\t$this->_out($fc);\n\t\t\t}\n\t\t\t$this->TextColor=$tc;\n\t\t\t$this->ColorFlag=$cf;\n\t\t}", "function addPageContent(& $page, & $parentElement) {\n\t\t$element = $parentElement->appendChild(\n\t\t\t$this->_document->createElement('pageContent'));\n\t\t\n\t\t$this->addCommonProporties($page, $element);\n\t\t\n\t\t$textElement = $element->appendChild($this->_document->createElement('text'));\n\t\t$textElement->appendChild(\n\t\t\t$this->_document->createCDATASection(urldecode($page->getField('text'))));\n\t\t\n\t\tif ($page->getField('location') == 'right')\n\t\t\t$element->setAttribute('location', 'right');\n\t\telse\n\t\t\t$element->setAttribute('location', 'left');\n\t}", "function writePage($text) {\n //TODO: Write the text to the page.\n return 1;\n }", "public function add()\n\t{\n\t\tif (!parent::add())\n\t\t{\n\t\t\t// Redirect to the return page.\n\t\t\t$this->setRedirect($this->getReturnPage());\n\t\t}\n\t}", "public function add()\n\t{\n\t\tif (!parent::add())\n\t\t{\n\t\t\t// Redirect to the return page.\n\t\t\t$this->setRedirect($this->getReturnPage());\n\t\t}\n\t}", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "public function writeLine($line);", "public function writePage()\n\t{\n\t\t$this->SetHeaderMargin(5);\n\t\t$this->SetFooterMargin(30);\n if($this->PageNo() > 1) {\n } else {\n }\n\t\t$this->AddPage('','',true);\n// $t = $this->getCellMargins();\n// var_dump($t);\n $this->setCellPaddings(0,0,0,0);\n\n\t\t$this->writeHTML($this->content, true, false, true, false, '');\n\t}", "protected function append(Page $page)\n {\n if ($this->prev) {\n $this->prev->setNext($page);\n $page->setPrev($this->prev);\n }\n $this->pages[] = $page;\n $this->prev = $page;\n return $page;\n }", "protected function trackAdd($item, $key) {\n\t\t/** @var RepeaterPage $item */\n\t\t$item->traversalPages($this);\n\t\tparent::trackAdd($item, $key);\n\t}", "public static function append($append)\n {\n // Append to the page title\n self::$data['append'] = $append;\n }" ]
[ "0.67480016", "0.67099845", "0.6513701", "0.62673956", "0.62431216", "0.61871535", "0.607903", "0.60530794", "0.60368985", "0.60331565", "0.60175365", "0.5978346", "0.59646463", "0.59609336", "0.59402853", "0.5939511", "0.5909863", "0.58958447", "0.58713484", "0.58607984", "0.5858549", "0.5834831", "0.58025074", "0.5798547", "0.5783859", "0.57805556", "0.5753413", "0.5716934", "0.566506", "0.5658588", "0.56527907", "0.5636631", "0.5627186", "0.561757", "0.55978644", "0.55878156", "0.5582468", "0.55594313", "0.5537108", "0.5536545", "0.5533619", "0.55321634", "0.55300575", "0.55290735", "0.55286694", "0.55024886", "0.5485143", "0.5473729", "0.5472978", "0.5472295", "0.54692477", "0.545933", "0.54466903", "0.54453146", "0.5442447", "0.5442047", "0.5434714", "0.5421497", "0.5421497", "0.54158914", "0.5413965", "0.541119", "0.54075766", "0.5396123", "0.53932387", "0.53909534", "0.53872484", "0.53592986", "0.53504664", "0.53421885", "0.53374267", "0.533151", "0.5311304", "0.53047734", "0.52977705", "0.52958125", "0.5295106", "0.5288871", "0.52801746", "0.5274962", "0.5260359", "0.52536654", "0.52536654", "0.524244", "0.5242089", "0.523546", "0.5221695", "0.52204746", "0.52164406", "0.52093", "0.52047676", "0.5199982", "0.51966345", "0.51947564", "0.51947564", "0.5181139", "0.51736736", "0.5169659", "0.51548135", "0.51540226", "0.5153822" ]
0.0
-1
Add table to current page and return it's last row coordinates. Auto create page if table overflowing on current page.
public function addTable($opts = ADD_TBL_OPTS_DEFAULT, $data = ADD_TBL_DATA_DEFAULT) { /* Init table */ $tbl = 0; $headerHeight = $opts["headerHeight"] ?? LINE_HEIGHT; $rowHeight = LINE_HEIGHT; /* Load font */ $headerFont = $this->pdf->load_font("NotoSansCJKjp-Bold", "unicode", ""); $bodyFont = $this->pdf->load_font("NotoSansCJKjp-Regular", "unicode", ""); /* Get data row number */ $rowNum = $opts["rowNum"] ?? count($data); /* Add table header */ $col = 1; $row = 1; while ($col <= $opts["colNum"]) { $colWidth = $opts["colWidth"]["header"][$col - 1] ?? "10%"; $colSpanSettings = $opts["colSpan"]["header"][$col - 1] ?? 1; $rowSpanSettings = $opts["rowSpan"]["header"][$col - 1] ?? $row; if (is_array($colSpanSettings)) { $maxColSpan = 0; foreach ($colSpanSettings as $rowIndex => $rowValue) { foreach ($rowValue as $colIndex => $colValue) { $tf = $this->pdf->add_textflow(0, $data[0][$col - 1][$rowIndex][$colIndex], FONT_BOLD_10 . " leading=120% alignment=center"); $colSpan = $colValue; $rowSpan = $opts["rowSpan"]["header"][$col - 1][$rowIndex][$colIndex] ?? 1; $colOpt = "fittextline={font=$headerFont fontsize=10 position=center} colspan=$colSpan rowspan=$rowSpan colwidth=$colWidth rowheight=$headerHeight textflow=$tf"; $maxColSpan = $colSpan > $maxColSpan ? $colSpan : $maxColSpan; $row = $rowSpan > $row ? $rowSpan : $row; $tbl = $this->pdf->add_table_cell($tbl, $col + $colIndex, $rowIndex + 1, "", $colOpt); } } $col += $maxColSpan; } else { $tf = $this->pdf->add_textflow(0, $data[0][$col - 1], FONT_BOLD_10 . " leading=120% alignment=center"); $colOpt = "fittextline={font=$headerFont fontsize=10 position=center} colspan=$colSpanSettings rowspan=$rowSpanSettings colwidth=$colWidth rowheight=$headerHeight textflow=$tf"; $tbl = $this->pdf->add_table_cell($tbl, $col, 1, "", $colOpt); $col += $colSpanSettings; $row = $rowSpanSettings > $row ? $rowSpanSettings : $row; } } /* Add table body */ for ($row = $row + 1; $row <= $rowNum; $row++) { for ($col = 1; $col <= $opts["colNum"]; $col++) { $colWidth = $opts["colWidth"]["body"][$col - 1] ?? $opts["colWidth"]["header"][$col - 1] ?? "10%"; $tf = $this->pdf->add_textflow(0, $data[$row - 1][$col - 1], FONT_REGULAR_10 . " leading=100% alignment=center"); $colOpt = "fittextline={font=$bodyFont fontsize=10} textflow=$tf"; $tbl = $this->pdf->add_table_cell($tbl, $col, $row, "", $colOpt); } } $marginLeft = $opts["marginLeft"] ?? $this->minX + $this->margin['left']; $marginLeft = $marginLeft > $this->minX ? $marginLeft : $this->minX; $marginTop = $opts["marginTop"] ?? $this->margin['top']; $marginTop = $this->cursorY - $marginTop < $this->maxY ? $marginTop : $this->margin['top']; $width = $opts["width"] ?? $this->maxWidth; $width = $width < $this->maxX ? $width : $this->maxX; /* Fit table to page */ $tblOpt = "header=0 rowheightdefault=$rowHeight " . "fill={{area=rowodd fillcolor={white}}} " . "stroke={{line=other}} "; /* Try fitting table to current page */ if ($this->cursorY - $this->margin['top'] - $this->minY < $rowHeight) { $this->endPage(); $this->createPage(); /* Fit table to top of new page */ $result = $this->pdf->fit_table($tbl, $marginLeft, $this->minY, $width, $this->maxY - $marginTop, $tblOpt); } else { $result = $this->pdf->fit_table($tbl, $marginLeft, $this->minY, $width, $this->cursorY - $marginTop, $tblOpt); } /* Close current page and create new one if table overflowing */ while ($result == "_boxfull") { $this->endPage(); $this->createPage(); /* Fit table to top of new page */ $result = $this->pdf->fit_table($tbl, $marginLeft, $this->minY, $width, $this->cursorY - $this->margin['top'], $tblOpt); } $this->cursorX = $this->pdf->info_table($tbl, "xvertline{$opts['colNum']}"); $this->cursorY = $this->pdf->info_table($tbl, "yhorline$rowNum"); /* This will also delete Textflow handler used in the table */ $this->pdf->delete_table($tbl, ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function\tpunchTable( $_lastLine=false) {\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTDataIT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t}\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n\t\t$remHeight\t=\t$frm->remHeight() ;\n\t\tif ( $remHeight < mmToPt( $this->saveZone) && !$_lastLine) {\n\t\t\t$this->tableFoot() ;\n\t\t\t$this->myDoc->newPage() ;\n\t\t\t$this->tableHead() ;\n\t\t}\n\t}", "function\tendTable() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterTE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t$this->myTable->currVerPos ;\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\n\t\t/**\n\t\t * if there's less than 20 mm on this page\n\t\t *\tgoto next page\n\t\t */\n//\t\t$remHeight\t=\t$frm->skipLine(\t$this->myTablePar) ;\n//\t\tif ( $remHeight < mmToPt( $this->saveZone)) {\n//\t\t\t$this->tableFoot() ;\n//\t\t\t$this->myDoc->newPage() ;\n//\t\t\t$this->tableHead() ;\n//\t\t}\n\t}", "function morepagestable($datas,$lineheight=8) {\n $l = $this->lMargin;\n $startheight = $h = $this->GetY();\n $startpage = $currpage = $this->page;\n // calculate the whole width\n foreach($this->tablewidths AS $width) {\n $fullwidth += $width;\n }\n $this->SetFont('Arial','',6);\n // Now let's start to write the table\n foreach($datas AS $row => $data) {\n $this->page = $currpage;\n // write the horizontal borders\n $this->Line($l,$h,$fullwidth+$l,$h);\n // write the content and remember the height of the highest col\n $posicion = 0;\n $fil=0;\n foreach($data AS $col => $txt) {\n \tif($posicion == 0 AND strpos($txt,\".\")===false){\n \t\t$fil=1;\n \t}\n \t\n \t$posicion++;\n \t$this->SetFillColor(60,100,200);\n \t$this->SetTextColor(0,0,0);\n $this->page = $currpage;\n $this->SetXY($l,$h);\n $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,1,$fil);\n $l += $this->tablewidths[$col];\n\t\t\t$this->SetFillColor(0,0,0);\n if($tmpheight[$row.'-'.$this->page] < $this->GetY()) {\n $tmpheight[$row.'-'.$this->page] = $this->GetY();\n }\n if($this->page > $maxpage)\n $maxpage = $this->page;\n }\n\n // get the height we were in the last used page\n $h = $tmpheight[$row.'-'.$maxpage];\n // set the \"pointer\" to the left margin\n $l = $this->lMargin;\n // set the $currpage to the last page\n $currpage = $maxpage;\n }\n // draw the borders\n // we start adding a horizontal line on the last page\n $this->page = $maxpage;\n $this->Line($l,$h,$fullwidth+$l,$h);\n // now we start at the top of the document and walk down\n for($i = $startpage; $i <= $maxpage; $i++) {\n $this->page = $i;\n $l = $this->lMargin;\n $t = ($i == $startpage) ? $startheight : $this->tMargin+140;\n $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin;\n $this->Line($l,$t,$l,$lh);\n foreach($this->tablewidths AS $width) {\n $l += $width;\n $this->Line($l,$t,$l,$lh);\n }\n }\n // set it to the last page, if not it'll cause some problems\n $this->page = $maxpage;\n}", "function\taddTable( $_par, $_table) {\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\t$this->myTablePar\t=\t$_par ;\n\t\t$this->myTable\t=\t$_table ;\n\t\t$this->inTable\t=\tFALSE ;\n\t\t$this->cellFrame\t=\tnew BFrame( $this->myDoc, \"CellFrame\", \"\", 0.0, 0.0, 0.0, 0.0) ;\n\t\t//\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTHeaderTS) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t\t$this->tableHead() ;\n\t\t$this->inTable\t=\tTRUE ;\n\t}", "public function newPage(array $settings = [])\n {\n /* Add new table head */\n $page = $this->_getPdf()->newPage(\\Zend_Pdf_Page::SIZE_A4);\n $this->_getPdf()->pages[] = $page;\n $this->y = 800;\n if (!empty($settings['table_header'])) {\n $this->_drawHeader($page);\n }\n return $page;\n }", "public function newPage(array $settings = array())\r\n {\r\n /* Add new table head */\r\n $page = $this->_getPdf()->newPage(Zend_Pdf_Page::SIZE_A4);\r\n $this->_getPdf()->pages[] = $page;\r\n $this->y = 800;\r\n if (!empty($settings['table_header'])) {\r\n $this->_drawHeader($page);\r\n }\r\n return $page;\r\n }", "public function newPage(array $settings = array())\n {\n /* Add new table head */\n $page = $this->_getPdf()->newPage(Zend_Pdf_Page::SIZE_LETTER);\n $this->_getPdf()->pages[] = $page;\n $this->y = self::DEFAULT_PAGE_TOP_NEW;\n\n if (!empty($settings['table_header'])) {\n $this->_setFontRegular($page);\n $page->setFillColor(new Zend_Pdf_Color_Rgb(0.93, 0.92, 0.92));\n $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));\n $page->setLineWidth(0.5);\n $page->drawRectangle(self::DEFAULT_PAGE_MARGIN_LEFT, $this->y, self::DEFAULT_PAGE_MARGIN_RIGHT, $this->y - self::DEFAULT_LINE_HEIGHT - self::DEFAULT_BOX_PAD);\n $this->y -= self::DEFAULT_LINE_HEIGHT;\n\n $page->setFillColor(new Zend_Pdf_Color_Rgb(0.4, 0.4, 0.4));\n $this->_drawHeader($page);\n\n $page->setFillColor(new Zend_Pdf_Color_GrayScale(0));\n $this->y -= 2 * self::DEFAULT_LINE_HEIGHT;\n }\n\n return $page;\n }", "function &addTable($alignment = 'left') {\t \r\n\r\n\t}", "public function addTableFooter() {\n\t\t// auto width\n\t\tforeach ($this->tableParams['auto_width'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getColumnDimensionByColumn($col)->setAutoSize(true);\n\t\t// filter (has to be set for whole range)\n\t\tif (count($this->tableParams['filter']))\n\t\t\t$this->xls->getActiveSheet()->setAutoFilter(PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][0]).($this->tableParams['header_row']).':'.PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][count($this->tableParams['filter']) - 1]).($this->tableParams['header_row'] + $this->tableParams['row_count']));\n\t\t// wrap\n\t\tforeach ($this->tableParams['wrap'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + 1).':'.PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + $this->tableParams['row_count']))->getAlignment()->setWrapText(true);\n\t}", "public function addTable($colCount) {\n array_push($this->old, $this->current);\n $this->current[\"leftSpacing\"] = $this->permanentLeftSpacing;\n $this->current[\"rightSpacing\"] = $this->permanentRightSpacing;\n // First horizontal line\n $this->currentPage->moveTo(self::HMARGIN + $this->current[\"leftSpacing\"], $this->PAGE_HEIGHT - self::VMARGIN - $this->vOffset);\n $this->currentPage->lineTo($this->PAGE_WIDTH - self::HMARGIN - $this->current[\"rightSpacing\"], $this->PAGE_HEIGHT - self::VMARGIN - $this->vOffset);\n $this->currentPage->stroke();\n }", "function newPage($pdf) {\r\n global $OrderId, $currentRow, $itemRowStart;\r\n\r\n $currentRow = $itemRowStart;\r\n\r\n $pdf->Addpage();\r\n $pdf->SetFont('Helvetica', 'B', 16);\r\n $pdf->Image('blissLogo.png');\r\n $pdf->Text(20, 43, \"OrderId:\");\r\n $pdf->Text(43, 43, $OrderId);\r\n $pdf->SetFont('Arial', 'I', 10);\r\n $pdf->SetY(266.5);\r\n $pdf->Cell(0, 10, 'Page ' . $pdf->PageNo(), 0, 0, 'C');\r\n $pdf->line( 12,245,190,245);\r\n$pdf->line( 12,267,190,267);\r\n\r\n \r\n}", "private function AddNewPage(){\n try{\n // Updated Time\n $this -> _data['UpdatedTime'] = $GLOBALS['_NOW_'] -> clockDateTime;\n // Encrypt Password\n if (!empty($this -> _data['password'])){\n if ($this -> _data['password'] == \"^Delete\"){\n $this -> _data['password'] = \"\";\n }else{\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashKey($this -> _data['password']);\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashEncryptedWithSalt($this -> _data['password']);\n }\n }\n $this -> db -> Insert('Function', $this -> _data, \"SELECT `FunctionName` FROM `Function` WHERE (`PageUrl` = :pageUrl OR `PageUrl` = :PageUrlIndex)\", \n array(\n \":pageUrl\" => $this -> _data['pageUrl'],\n \":PageUrlIndex\" => $this -> _data['pageUrl'].'/index'\n )\n );\n\n $lastId = $this -> db -> lastInsertId();\n\n $this -> db -> CreateObjectAcl('Function', $lastId, Cores\\_Session::Get('loggedUser') -> id);\n return true;\n }catch (\\Exception $e){\n return $e -> getMessage();\n }\n \n }", "function build_html_table_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t</table>';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "function verifyCreateTable(){\n $WIKI_TABLE_ROW = 2;\n $WIKI_TABLE_COL = \"5\";\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_ADDTABLE);\n $this->click(CHK_SORT);\n $this->type(TEXT_ROW, $WIKI_TABLE_ROW);\n $this->type(TEXT_COL, $WIKI_TABLE_COL);\n $this->click(BUTTON_INSERTABLE);\n $this->click(CHK_SORT);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;\n $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER .\n TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .\n TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .\n TEXT_VALIDATE_TABLE_PART3 ));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "protected function addPageIdsToTable()\n {\n $pageIdsNames = [\n 'detailPid',\n 'listPid',\n 'yearPid',\n 'monthPid',\n 'weekPid',\n 'dayPid',\n 'bookingPid',\n ];\n foreach ($pageIdsNames as $pageIdName) {\n $pageId = (int)$this->flexFormService->get('settings.' . $pageIdName, 'pages');\n $pageRow = BackendUtility::getRecord('pages', $pageId);\n if ($pageRow) {\n $this->layoutService->addRow(\n TranslateUtility::get($pageIdName),\n $pageRow['title'] . ' (' . $pageId . ')'\n );\n }\n }\n }", "public function addTableFooter() {\n // auto width\n foreach ($this->_tableParams['auto_width'] as $col)\n $this->_xls->getActiveSheet()->getColumnDimensionByColumn($col)->setAutoSize(true);\n\n // filter (has to be set for whole range)\n if (count($this->_tableParams['filter']))\n $this->_xls->getActiveSheet()->setAutoFilter(PHPExcel_Cell::stringFromColumnIndex($this->_tableParams['filter'][0]) . ($this->_tableParams['header_row']) . ':' . PHPExcel_Cell::stringFromColumnIndex($this->_tableParams['filter'][count($this->_tableParams['filter']) - 1]) . ($this->_tableParams['header_row'] + $this->_tableParams['row_count']));\n\n // wrap\n foreach ($this->_tableParams['wrap'] as $col)\n $this->_xls->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($col) . ($this->_tableParams['header_row'] + 1) . ':' . PHPExcel_Cell::stringFromColumnIndex($col) . ($this->_tableParams['header_row'] + $this->_tableParams['row_count']))->getAlignment()->setWrapText(true);\n\n return $this;\n }", "public function newPage(array $settings = array()) {\n\t\t$page = $this -> _getPdf() -> newPage(Zend_Pdf_Page::SIZE_A4);\n\t\t$this -> _getPdf() -> pages[] = $page;\n\t\t\n\t\t//\"move cursor\" to top of the page\n\t\t$this -> y = $page->getHeight();\n\n\t\t//insert background image\n\t\t$this -> insertBackgroundImage($page);\n\t\t\n\t\t//output table header if needed\n\t\tif (!empty($settings['table_header']))\n\t\t{\n\t\t\t$this->y -= 12;\n\t\t\t$this -> _drawHeader($page);\n\t\t}\n\n\t\treturn $page;\n\t}", "public function generateNewCrossReferenceTableEntry(): CrossReferenceTableEntry\n {\n // Neue Nummer am \"Ende\" der CrossReferenceTable\n $objectNumber = $this->trailerDictionary->getObject(\"Size\")->getValue();\n $this->trailerDictionary->setObject(\"Size\", new PdfNumber($objectNumber + 1));\n\n $entry = new CrossReferenceTableEntry($objectNumber, 0, false, 0);\n $this->crossReferenceTable->setEntry($entry);\n return $entry;\n }", "protected function addTable($table, $isRoot = true)\n {\n $table = new Table($table, $isRoot);\n $snap = $this->checkTable($table);\n if(is_object($snap)) return $snap;\n if($snap){\n if(strpos($table->alias, '_') === 0) $table->setAlias($table->alias . $snap, false);\n else $table->setAlias($snap);\n }\n array_push($this->tables, $table);\n return $table;\n }", "function getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t// make sure we have a header row, else skip\n\t\t\t/*\n\t\t\t$headerSize = count($tableHeadings);\n\t\t\tif($headerSize > 0){\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach ($tableHeadings as $h){\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<th class = \"headerCell\">' . $h . '</th>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 0;\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"odd\">';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$page = $page . '<td class = \"even\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "function endTable()\n {\n if (! $this->tableIsOpen)\n die('ERROR: TABLE IS NOT STARTED');\n \n $this->documentBuffer .= \"</table>\\n\";\n \n $this->tableIsOpen = false;\n $this->tableLastRow = 0;\n }", "function newPage()\n {\n $this->lastPageNumber ++;\n if ($this->lastPageNumber != 1)\n $this->documentBuffer .= \"<br clear=\\\"all\\\" style=\\\"page-break-before: always;\\\">\";\n return $this->lastPageNumber;\n }", "public function addTable($style = null) {\n\t\t$table = new PHPWord_Section_Table('section', $this->_sectionCount, $style);\n\t\t$this->_elementCollection[] = $table;\n\t\treturn $table;\n\t}", "private function newRow(){\n\t\t$r = new HtmlBox('tr');\n\t\tfor($i=0;$i<$this->col;$i++)\n\t\t\t$r->add(new HtmlBox('td')) ;\n\t\t$this->row++;\n\t\t$this->add($r);\n\t\treturn $this;\n\t}", "private function nextPage() {\n $this->lastPage = array(\n \"vOffset\" => $this->vOffset,\n \"hOffset\" => $this->hOffset,\n );\n $footerToAppend = false;\n $this->currentPageNumber++;\n if (isset($this->pages[$this->currentPageNumber])) {\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = 0;\n } else {\n $this->pages[$this->currentPageNumber] = $this->haruDoc->addPage();\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->currentPage->setTextRenderingMode(\\HaruPage::FILL);\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = ($this->hOffset ? $this->hOffset : 0);\n $footerToAppend = true;\n }\n if ($this->currentFont && $this->currentFontSize && $this->currentFontColor) {\n $this->currentPage->setFontAndSize($this->currentFont, $this->currentFontSize);\n $this->setColor($this->currentFontColor[0], $this->currentFontColor[1], $this->currentFontColor[2]);\n }\n if ($footerToAppend && $this->currentPageNumber > 1) {\n $this->currentPage->beginText();\n $this->setFont(self::FONT_NORMAL, 12, array(0,0,0));\n $this->currentPage->textOut($this->PAGE_WIDTH - self::HMARGIN - $this->currentPage->getTextWidth($this->currentPageNumber),\n self::VMARGIN - 30, $this->currentPageNumber);\n $this->revertFont();\n $this->setFont(self::FONT_BOLD, 12, array(0,0,0));\n $this->currentPage->textOut(self::HMARGIN,\n self::VMARGIN - 30, $this->currentBookName);\n $this->revertFont();\n $this->currentPage->endText();\n\n }\n\n }", "public function getLastPage();", "function getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings, $idName, $URL;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t$page = $page . '<td class = \"headerCell\"></td>';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 1;\n\t\t\t\t$view = '<td class = \"even\">\n\t\t\t\t<a href=\"' . $URL . '?id=' . $tableContent[$i][$idName] . '\">\n\t\t\t\tVIEW</a></td>';\n\t\t\t\t$page = $page . $view;\n\t\t\t\t\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"even\">';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$page = $page . '<td class = \"odd\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "public function getTableOfContents();", "function startTable(){\n\t?>\t\n\t<div class=\"secondCol\">\n\t\t<table class=\"medTable\">\n\t\t\t<tr>\n\t<?php\n}", "function extra_tablenav( $which ) {\n //if ( $which == \"bottom\" ){\n // //The code that goes after the table is there\n // echo\"Hi, I'm after the table\";\n //}\n }", "function table_end(){\n\techo '</table>';\n}", "function end_table() {\n if ($this->_cellopen) {\n $this->end_cell();\n }\n // Close any open table rows\n if ($this->_rowopen) {\n $this->end_row();\n }\n ?></table><?php\n echo \"\\n\";\n\n $this->reset_table();\n }", "function verifyCreateTableWithHeadRow(){\n $WIKI_TABLE_ROW = 3;\n $WIKI_TABLE_COL = \"4\";\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_ADDTABLE);\n $this->click(CHK_BOARDER);\n $this->type(TEXT_ROW, $WIKI_TABLE_ROW);\n $this->type(TEXT_COL, $WIKI_TABLE_COL);\n $this->click(BUTTON_INSERTABLE);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;\n $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER .\n TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .\n TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .\n TEXT_VALIDATE_TABLE_PART3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "protected function makeEntries()\n {\n $this->setY($this->getY() + $this->layout['entriesPaddingTop']);\n $widths = $this->layout['entriesColumnWidths'];\n $alignment = $this->layout['entriesColumnAlignment'];\n\n $makeHeader = function ($widths, $alignment) {\n $header = [\n $this->t('quantity'),\n $this->t('item'),\n $this->t('price'),\n $this->t('total'),\n ];\n $this->setFont('', 'b');\n foreach ($widths as $index => $width) {\n $this->cell($width, $this->layout['titleCellHeight'], utf8_decode($header[$index]), 'BT', 0, $alignment[$index]);\n }\n $this->setFont('', '');\n $this->ln();\n };\n\n $makeHeader($widths, $alignment);\n $currentY = 0;\n $nextY = $this->getY();\n\n foreach ($this->entries as $entry) {\n $this->setY($nextY);\n if ($this->needsNewPage()) {\n $this->newPage();\n $makeHeader($widths, $alignment);\n $nextY = $this->getY();\n }\n $currentY = $nextY;\n $this->cell($widths[0], $this->layout['contentCellHeight'], $this->numberFormat($entry['quantity']), '', 0, $alignment[0]);\n $this->multiCell($widths[1], $this->layout['contentCellHeight'], utf8_decode($entry['description']), 0, $alignment[1]);\n $nextY = max($nextY, $this->getY());\n $this->setXY($this->layout['pagePaddingLeft'] + $widths[0] + $widths[1], $currentY);\n $this->cell($widths[2], $this->layout['contentCellHeight'], $this->numberFormat($entry['price']), '', 0, $alignment[2]);\n $total = $entry['quantity'] * $entry['price'];\n $this->cell($widths[3], $this->layout['contentCellHeight'], $this->numberFormat($total), '', 1, $alignment[3]);\n }\n\n $this->setY($nextY);\n $this->setFont('', 'b');\n $this->cell($widths[0], $this->layout['contentCellHeight'], '', 'BT');\n $this->cell($widths[1], $this->layout['contentCellHeight'], '', 'BT');\n $this->cell($widths[2], $this->layout['contentCellHeight'], '', 'BT');\n $this->cell($widths[3], $this->layout['contentCellHeight'], $this->variables['total'], 'BT', 0, $alignment[3]);\n $this->setFont('', '');\n }", "private function createTableFooter() {\n\t\treturn \"</table>\\n\";\n\t}", "function addPage()\n {\n // Reuse the atkAddHandler for the addPage.\n $handler = atknew(\"atk.handlers.atkaddhandler\");\n $handler->setNode($this->m_node);\n return $handler->invoke(\"addPage\");\n }", "function\ttableFoot() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $this->myDoc->pageNr >= 1) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterCT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everything we have output'\n\t\t}\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterPE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t}", "public function addRows()\n {\n }", "function addition(){\n\t\techo \"<p>The \" . $_POST[\"rows\"] . \" x \" . $_POST[\"columns\"] . \" addition table.</p>\\n\";\n\t\techo \"<table border = 1>\\n\";\n\t\t//Goes through each row\n\t\tfor($row = 0; $row <= $_POST[\"rows\"]; $row++){\n\t\t\techo \"\\t<tr>\\n\";\n\t\t\t//Goes through each column of each row\n\t\t\tfor($column = 0; $column <= $_POST[\"columns\"]; $column++){\n\t\t\t\t//If the table box is not a top or left hand border, adds the numbers together unbolded\n\t\t\t\tif($row != 0 && $column != 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'>\" . ($row + $column) . \"</td>\\n\";\n\t\t\t\t//If it is a column header, prints the column number in bold\n\t\t\t\telseif($row == 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'><strong>\" . $column . \"</strong></td>\\n\";\n\t\t\t\t//If it is a row header, prints the row number in bold\n\t\t\t\telseif($column == 0)\n\t\t\t\t\techo \"\\t\\t<td align='center'><strong>\" . $row . \"</strong></td>\\n\";\n\t\t\t}\n\t\t\techo \"\\t</tr>\\n\";\n\t\t}\n\t\techo \"</table>\\n\";\n\t}", "function verifyCreateTableWithBorders(){\n $WIKI_TABLE_ROW = \"4\";\n $WIKI_TABLE_COL = \"6\";\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_ADDTABLE);\n $this->click(CHK_HEADER);\n $this->type(TEXT_ROW,$WIKI_TABLE_ROW);\n $this->type(TEXT_COL,$WIKI_TABLE_COL);\n $this->click(BUTTON_INSERTABLE);\n $this->click(CHK_HEADER);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertTrue($this->isElementPresent(TEXT_TABLEID_OTHER . \n TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .\n TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .\n TEXT_VALIDATE_TABLE_PART3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "function closePreviousTable()\n{\n echo \"</tbody>\";\n echo \"</table>\";\n}", "public function add (){\n // receives $_GET['id'] to redirect to page showing same page\n\n $columns = array('curriculum_id', 'timetable_period_id', 'start_time_id', 'end_time_id', 'weekday_id', 'classroom_id');\n $table = new simple_table_ops();\n $table->set_table_name('timetables');\n $table->set_table_column_names($columns);\n\n $table->add();\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=timetable&action=show&submit=yes&timetable_period_id={$_POST['timetable_period_id']}\");\n }", "public final function newRow($table) \n {\n return AutoRecord::loadRow($this, $table, null);\n }", "public static function maybe_create_table() {\n\t\tif ( ! function_exists( 'get_current_screen' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isset( get_current_screen()->id ) && false === strpos( get_current_screen()->id, 'page_smush' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::directory_smush_table();\n\t}", "public function makeTableur()\n {\n return $this->setDocumentPropertiesWithMetas(new Spreadsheet());\n }", "function WriteTable($tcolums)\n {\n for ($i = 0; $i < sizeof($tcolums); $i++)\n {\n $current_col = $tcolums[$i];\n $height = 0;\n \n // get max height of current col\n $nb=0;\n for($b = 0; $b < sizeof($current_col); $b++)\n {\n // set style\n $this->SetFont($current_col[$b]['font_name'], $current_col[$b]['font_style'], $current_col[$b]['font_size']);\n $color = explode(\",\", $current_col[$b]['fillcolor']);\n $this->SetFillColor($color[0], $color[1], $color[2]);\n $color = explode(\",\", $current_col[$b]['textcolor']);\n $this->SetTextColor($color[0], $color[1], $color[2]); \n $color = explode(\",\", $current_col[$b]['drawcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n $this->SetLineWidth($current_col[$b]['linewidth']);\n \n $nb = max($nb, $this->NbLines($current_col[$b]['width'], $current_col[$b]['text'])); \n $height = $current_col[$b]['height'];\n } \n $h=$height*$nb;\n \n \n // Issue a page break first if needed\n $this->CheckPageBreak($h);\n \n // Draw the cells of the row\n for($b = 0; $b < sizeof($current_col); $b++)\n {\n $w = $current_col[$b]['width'];\n $a = $current_col[$b]['align'];\n \n // Save the current position\n $x=$this->GetX();\n $y=$this->GetY();\n \n // set style\n $this->SetFont($current_col[$b]['font_name'], $current_col[$b]['font_style'], $current_col[$b]['font_size']);\n $color = explode(\",\", $current_col[$b]['fillcolor']);\n $this->SetFillColor($color[0], $color[1], $color[2]);\n $color = explode(\",\", $current_col[$b]['textcolor']);\n $this->SetTextColor($color[0], $color[1], $color[2]); \n $color = explode(\",\", $current_col[$b]['drawcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n $this->SetLineWidth($current_col[$b]['linewidth']);\n \n $color = explode(\",\", $current_col[$b]['fillcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n \n \n // Draw Cell Background\n $this->Rect($x, $y, $w, $h, 'FD');\n \n $color = explode(\",\", $current_col[$b]['drawcolor']); \n $this->SetDrawColor($color[0], $color[1], $color[2]);\n \n // Draw Cell Border\n if (substr_count($current_col[$b]['linearea'], \"T\") > 0)\n {\n $this->Line($x, $y, $x+$w, $y);\n } \n \n if (substr_count($current_col[$b]['linearea'], \"B\") > 0)\n {\n $this->Line($x, $y+$h, $x+$w, $y+$h);\n } \n \n if (substr_count($current_col[$b]['linearea'], \"L\") > 0)\n {\n $this->Line($x, $y, $x, $y+$h);\n }\n \n if (substr_count($current_col[$b]['linearea'], \"R\") > 0)\n {\n $this->Line($x+$w, $y, $x+$w, $y+$h);\n }\n \n \n // Print the text\n $this->MultiCell($w, $current_col[$b]['height'], $current_col[$b]['text'], 0, $a, 0);\n \n // Put the position to the right of the cell\n $this->SetXY($x+$w, $y); \n }\n \n // Go to the next line\n $this->Ln($h); \n } \n }", "function entete_table($position_entete) {\n global $pdf;\n $pdf->SetDrawColor(183); // Couleur du fond RVB\n $pdf->setFillColor(89,133,255); // Couleur des filets RVB\n $pdf->SetTextColor(0); // Couleur du texte noir\n $pdf->SetY($position_entete);\n // position de colonne 1 (10mm à gauche)\n $pdf->SetX(5);\n $pdf->Cell(40,8,'Prestation',1,0,'C',1); // 60 >largeur colonne, 8 >hauteur colonne\n // position de la colonne 2 (70 = 10+60)\n $pdf->SetX(45);\n $pdf->Cell(40,8,'Date',1,0,'C',1);\n $pdf->SetX(85);\n $pdf->Cell(40,8,'Prix HT',1,0,'C',1);\n $pdf->SetX(125);\n $pdf->Cell(40,8,'Tva',1,0,'C',1);\n $pdf->SetX(165);\n $pdf->Cell(40,8,iconv(\"UTF-8\", \"CP1250//TRANSLIT\", \"Quantité/Durée\"),1,0,'C',1);\n\n // position de la colonne 3 (130 = 70+60)\n\n\n $pdf->Ln(); // Retour à la ligne\n}", "function tabletbody_open() {\n $this->doc .= DOKU_TAB.'<tbody>'.DOKU_LF;\n }", "protected function startTable() {}", "public function getLastPage() {}", "function tabletbody_close() {\n $this->doc .= DOKU_TAB.'</tbody>'.DOKU_LF;\n }", "protected function _createRowContainer()\n\t{\n\t\tif ($this->_tbody == null) {\n\t\t\t$this->_tbody = new HtmlElement('tbody');\n\t\t\t$this->addElement($this->_tbody);\t\t\t\n\t\t}\t\t\n\t}", "function addTableRow($cells, $aligns = NULL, $vAligns = NULL, $inlineStyle = NULL, $classesName = NULL)\n {\n if (! $this->tableIsOpen)\n die('ERROR: TABLE IS NOT STARTED');\n \n if (is_array($classesName) && count($classesName) != count($cells))\n die('ERROR: COUNT OF CLASSES IS DIFERENT OF COUNT OF CELLS');\n if (is_array($aligns) && count($aligns) != count($cells))\n die('ERROR: COUNT OF ALIGNS IS DIFERENT OF COUNT OF CELLS');\n if (is_array($vAligns) && count($vAligns) != count($cells))\n die('ERROR: COUNT OF VALIGNS IS DIFERENT OF COUNT OF CELLS');\n \n $style = '';\n if (is_array($inlineStyle)) {\n foreach ($inlineStyle as $key => $value)\n $style .= \"$key: $value;\";\n }\n \n $tableWidth = $this->atualPageWidth; // - ($this->leftMargin * One_Cent + $this->rightMargin * One_Cent);\n // $tableWidth -= (BORDER_ALT*2 + PADDING_ALT_RIGHT + PADDING_ALT_LEFT + BORDER_INSIDEH*2 + BORDER_INSIDEV*2);\n $cellWidth = floor($tableWidth / count($cells));\n \n $this->documentBuffer .= \"<tr style=\\\"mso-yfti-irow: $this->tableLastRow\\\">\\n\";\n for ($i = 0; $i < count($cells); $i ++) {\n $align = is_array($aligns) ? $aligns[$i] : 'left';\n $vAlign = is_array($vAligns) ? $vAligns[$i] : 'top';\n $classAttr = is_array($classesName) ? \" class=\\\"$classesName[$i]\\\"\" : '';\n \n $this->documentBuffer .= \"<td width=\\\"$cellWidth\\\" align=\\\"$align\\\" valign=\\\"$vAlign\\\" style=\\\"$style\\\"{$classAttr}>$cells[$i]</td>\\n\";\n }\n $this->documentBuffer .= \"</tr>\\n\";\n \n $this->tableLastRow ++;\n return $this->tableLastRow;\n }", "private function Write_Balance_Table() {\n\t\t$top = 12 + self::VERT_MARGIN;\n\t\t$row_height = 8.5;\n\t\t$number_of_rows = 19;\n\t\t$labels_width = 80;\n\t\t$labels_left_1 = self::HORZ_MARGIN;\n\t\t$labels_left_2 = $labels_left_1 + $labels_width;\n\t\t$labels_left_3 = $labels_left_2 + $labels_width;\n\t\t\n\t\t$table_left = self::HORZ_MARGIN + 432;\n\t\t$table_column_width = 54;\n\t\t$table_left_column2 = $table_left + $table_column_width;\n\t\t\n\t\t$this->pdf->setlinewidth(0.40);\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t\n\t\t/**\n\t\t * Build the table first\n\t\t * $this->pdf->rect($x, $y, $w, $h);\n\t\t */\n\t\t\n\t\t//Define the height positions of elements in the table, so we can go adding and removing elements all willy nilly\n\t\t$label_heights = array(\n\t\t\n\t\t\t'BEGINNING CHECKING BALANCE'\t=> 2,\n\t\t\t'DEPOSITS'\t\t\t\t\t \t=> 4,\n\t\t\t'TOTAL RECEIPTS'\t\t\t\t=> 11,\n\t\t\t'DISBURSEMENTS'\t\t\t\t\t=> 12,\n\t\t\t'TOTAL DISBURSED'\t\t\t\t=> 16,\n\t\t\t'ENDING CHECKING BALANCE'\t\t=> 18,\n\t\t\t'OPERATING ACCOUNT'\t\t\t\t=> 2,\n\t\t\t'RETURNS'\t\t\t\t\t\t=> 2,\n\t\t\t'CREDIT CARD PAYMENTS'\t\t\t=> 5,\n\t\t\t'CHARGEBACKS'\t\t\t\t\t=> 6,\n\t\t\t//'WESTERN UNION PAYMENTS'\t\t=> 7,\n\t\t\t'MONEY ORDER'\t\t\t\t\t=> 7,\n\t\t\t//'QUICK CHECK DEPOSIT'\t\t\t=> 9,\n\t\t\t//'MONEYGRAM'\t\t\t\t\t\t=> 10,\n\t\t\t//'CRSI RECOVERY'\t\t\t\t\t=> 11,\n\t\t\t//'RECOVERY'\t\t\t\t\t\t=> 12,\n\t\t\t//'FINAL COLLECTIONS'\t\t\t\t=> 13,\n\t\t\t'DEBIT RETURNS'\t\t\t\t\t=> 8,\n\t\t\t'CREDIT RETURNS'\t\t\t\t=> 9,\n\t\t\t'LOANS'\t\t\t\t\t\t\t=> 12,\n\t\t//\t'CARD LOANS'\t\t\t\t\t=> 19,\n\t\t\t'DEBIT RETURNS DISBURSE'\t\t\t\t\t=> 13,\n\t\t\t'CREDIT RETURNS DISBURSE'\t\t\t\t=> 14,\n\t\t\t'INTERCEPT_RESERVE'\t\t\t\t=> 2,\n\t\t\t'TOTAL DEBITED'\t\t\t\t\t=> 4,\n\t\t\t\n\t\t\t);\n\t\t\n\t\t\n\t\t\n\t\t/**\n\t\t * fill table header\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $table_column_width * 2, $row_height * $label_heights['BEGINNING CHECKING BALANCE']);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * fill highlighted rows\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n\t\t$this->Rect_TL($table_left_column2, $top + ($row_height * $label_heights['TOTAL RECEIPTS']), $table_column_width, $row_height);\n\t\t$this->Rect_TL($table_left_column2, $top + ($row_height * $label_heights['DEBIT RETURNS DISBURSE']), $table_column_width, $row_height);\n\t\t$this->Rect_TL($table_left_column2, $top + ($row_height * $label_heights['CREDIT RETURNS DISBURSE']), $table_column_width, $row_height);\n\t\t$this->Rect_TL($table_left, $top + ($row_height * $label_heights['TOTAL DISBURSED']), $table_column_width * 2, $row_height);\n\t\t$this->Rect_TL($table_left_column2, $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']), $table_column_width, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * fill the cute little background at the bottom.\n\t\t */\n//\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n//\t\t$this->Rect_TL($table_left, $top + ($row_height * 24) - 1, $table_column_width * 2, 1);\n//\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Add strokes to the table\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $table_column_width * 2, $row_height * $number_of_rows);\n\t\t\n\t\t$this->Line_TL($table_left + $table_column_width, $top,\n\t\t\t\t\t $table_left + $table_column_width, $top + ($row_height * $number_of_rows));\n\t\t\n\t\t$this->Line_TL($table_left, $top + ($row_height * $label_heights['BEGINNING CHECKING BALANCE']),\n\t\t\t\t\t $table_left + ($table_column_width * 2), $top + ($row_height * $label_heights['BEGINNING CHECKING BALANCE']));\n\t\t\n\t\t$this->Line_TL($table_left, $top + ($row_height * $label_heights['TOTAL DISBURSED']),\n\t\t\t\t\t $table_left + ($table_column_width * 2), $top + ($row_height * $label_heights['TOTAL DISBURSED']));\n\t\t\n\t\t$this->Line_TL($table_left, $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']),\n\t\t\t\t\t $table_left + ($table_column_width * 2), $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']));\n\t\t\t\t\t \n\t\t$this->Line_TL($table_left, $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']) - 1,\n\t\t\t\t\t $table_left + ($table_column_width * 2), $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']) - 1);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t/**\n\t\t * Build Label Backgrounds\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($labels_left_1, $top + ($row_height * $label_heights['BEGINNING CHECKING BALANCE']), $labels_width * 3, $row_height);\n\t\t$this->Rect_TL($labels_left_1, $top + ($row_height * $label_heights['DEPOSITS']), $labels_width, $row_height);\n\t\t$this->Rect_TL($labels_left_2, $top + ($row_height * $label_heights['TOTAL RECEIPTS']), $labels_width * 2, $row_height);\n\t\t$this->Rect_TL($labels_left_1, $top + ($row_height * $label_heights['DISBURSEMENTS']), $labels_width, $row_height);\n\t\t$this->Rect_TL($labels_left_2, $top + ($row_height * $label_heights['TOTAL DISBURSED']), $labels_width * 2, $row_height);\n\t\t$this->Rect_TL($labels_left_1, $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']), $labels_width * 2, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Build Labels\n\t\t */\n\t\t$this->Text_TL(\"BEGINNING CHECKING BALANCE\", \n\t\t\t$labels_left_1, $top + ($row_height * $label_heights['BEGINNING CHECKING BALANCE']) - 1, \n\t\t\t$labels_width * 3, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['UNDERLINE']} {$this->formats['ITALICS']}\");\n\n\t\t$this->Text_TL(\"DEPOSITS\", \n\t\t\t$labels_left_1, $top + ($row_height * $label_heights['DEPOSITS']) - 1, \n\t\t\t$labels_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['UNDERLINE']} {$this->formats['ITALICS']}\");\n\n\t\t$this->Text_TL(\"TOTAL RECEIPTS\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['TOTAL RECEIPTS']) - 1,\n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['UNDERLINE']} {$this->formats['ITALICS']}\");\n\n\t\t$this->Text_TL(\"DISBURSEMENTS\", \n\t\t\t$labels_left_1, $top + ($row_height * $label_heights['DISBURSEMENTS']) - 1,\n\t\t\t$labels_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['UNDERLINE']} {$this->formats['ITALICS']}\");\n\n\t\t$this->Text_TL(\"TOTAL DISBURSED\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['TOTAL DISBURSED']) - 1,\n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['UNDERLINE']} {$this->formats['ITALICS']}\");\n\n\t\t$this->Text_TL(\"ENDING CHECKING BALANCE\", \n\t\t\t$labels_left_1, $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']) - 1,\n\t\t\t$labels_width * 3, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['UNDERLINE']} {$this->formats['ITALICS']}\");\n\n\t\t$this->Text_TL(\"OPERATING ACCOUNT\", \n\t\t\t$table_left, $top, \n\t\t\t$table_column_width, $row_height * $label_heights['OPERATING ACCOUNT'],\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['CENTER']} {$this->formats['ITALICS']}\");\n\n\t\t$this->Text_TL(\"RETURNS<avoidbreak=false>\",\n\t\t\t$table_left_column2, $top, \n\t\t\t$table_column_width, $row_height * $label_heights['RETURNS'],\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['CENTER']} {$this->formats['ITALICS']} adjustmethod=spread\");\n\t\t//Let's use variable and increment/decrement to define the locations of the\n\t\t\n\t\t$this->Text_TL(\"DEPOSITS\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['DEPOSITS']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"CREDIT CARD PAYMENTS\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['CREDIT CARD PAYMENTS']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"CHARGEBACKS\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['CHARGEBACKS']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t/*$this->Text_TL(\"WESTERN UNION PAYMENTS\", \n\t\t\t$labels_left_2, $top + ($row_height * 7), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n*/\n\t\t$this->Text_TL(\"MONEY ORDERS\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['MONEY ORDER']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n/*\t\t$this->Text_TL(\"QUICK CHECK DEPOSIT\", \n\t\t\t$labels_left_2, $top + ($row_height * 9), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"MONEYGRAM\", \n\t\t\t$labels_left_2, $top + ($row_height * 10), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"CRSI RECOVERY\", \n\t\t\t$labels_left_2, $top + ($row_height * 11), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"RECOVERY\", \n\t\t\t$labels_left_2, $top + ($row_height * 12), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n*/\n\t\t/*$this->Text_TL(\"FINAL COLLECTIONS\", \n\t\t\t$labels_left_2, $top + ($row_height * 13), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n*/\n\t\t$this->Text_TL(\"DEBIT RETURNS\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['DEBIT RETURNS']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"CREDIT RETURNS\",\n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['CREDIT RETURNS']),\n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"LOANS\", \n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['LOANS']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n/*\t\t$this->Text_TL(\"CARD LOANS\",\n\t\t\t$labels_left_2, $top + ($row_height * 19),\n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n*/\n\t\t$this->Text_TL(\"DEBIT RETURNS\",\n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['DEBIT RETURNS DISBURSE']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\n\t\t$this->Text_TL(\"CREDIT RETURNS\",\n\t\t\t$labels_left_2, $top + ($row_height * $label_heights['CREDIT RETURNS DISBURSE']), \n\t\t\t$labels_width * 2, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']}\");\n\t\t\t\n\t\t/**\n\t\t * Set Values\n\t\t */\n\t\t$this->Text_TL(number_format($this->data['intercept_reserve'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['INTERCEPT_RESERVE']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\n\t\t$this->Text_TL(number_format($this->data['period']['total debited']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['TOTAL DEBITED']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['credit card payments']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['CREDIT CARD PAYMENTS']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\n\t\t$this->Text_TL(number_format($this->data['period']['chargebacks']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['CHARGEBACKS']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\n/*\t\t$this->Text_TL(number_format($this->data['period']['western union deposit']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['WESTERN UNION DEPOSIT']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['money order deposit']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['MONEY ORDER']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t/*$this->Text_TL(number_format($this->data['period']['quick check deposit']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['QUICK CHECK DEPOSIT']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['moneygram deposit']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['MONEYGRAM DEPOSIT']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\n/*\t\t$this->Text_TL(number_format($this->data['period']['crsi recovery']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['CRSI RECOVERY']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\n\t/*\t$this->Text_TL(number_format($this->data['period']['recovery']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['RECOVERY']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\n/*\t\t$this->Text_TL(number_format($this->data['period']['final collections']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['FINAL COLLECTIONS']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['debit returns']['span'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['DEBIT RETURNS']),\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['credit returns']['span'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['CREDIT RETURNS']),\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['debit returns']['span'] + $this->data['period']['credit returns']['span'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['TOTAL RECEIPTS']),\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['loan disbursement']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['DISBURSEMENTS']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n/*\t\t$this->Text_TL(number_format($this->data['card_loan_disbursement'], 2),\n\t\t\t$table_left, $top + ($row_height * 19),\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n*/\n\t\t$this->Text_TL(number_format($this->data['period']['debit returns']['span'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['DEBIT RETURNS DISBURSE']),\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\n\t\t$this->Text_TL(number_format($this->data['period']['credit returns']['span'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['CREDIT RETURNS DISBURSE']),\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\n\t\t$this->Text_TL(number_format($this->data['period']['loan disbursement']['span'], 2),\n\t\t\t$table_left, $top + ($row_height * $label_heights['TOTAL DISBURSED']), \n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['period']['debit returns']['span'] + $this->data['period']['credit returns']['span'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['TOTAL DISBURSED']),\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['intercept_reserve'], 2),\n\t\t\t$table_left_column2, $top + ($row_height * $label_heights['ENDING CHECKING BALANCE']) - 1,\n\t\t\t$table_column_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t}", "public function getLastPage(): int;", "function CreateCommon(TabularPdf $pdf, Jurnal $rs, $counter, $subPage, $totalPage) {\n if ($counter % 2 == 0) {\n $pdf->AddPage();\n } else {\n $pdf->SetY(140);\n }\n\n\t$widths = $pdf->GetColumnWidths();\n\t$sumWidths = array_sum($widths);\n\n $pdf->SetFont(\"Tahoma\", \"\", 14);\n if (!in_array($rs->EntityId, array(3, 4, 5))) {\n $pdf->Cell(100, 5, \"CV. SUMA TIRTA KENCANA\", 0, 0, \"L\");\n } else {\n $pdf->Cell(100, 5, \"CV. SUMA TIRTA KENCANA\", 0, 0, \"L\");\n }\n\n $pdf->Ln(7);\n\n $pdf->SetFont(\"Tahoma\", \"\", 14);\n $pdf->Cell($pdf->GetPaperWidth(), 5, strtoupper($rs->VoucherTypes->VoucherDesc), 0, 0, \"C\");\n $pdf->SetFont(\"Tahoma\", \"\", 10);\n\t$pdf->SetX(-55, true);\n $pdf->Cell(15, 5, \"No.Bukti\", 0, 0, \"L\");\n $pdf->Cell(3, 5, \":\", 0, 0, \"C\");\n $pdf->Cell(50, 5, $rs->NoVoucher, 0, 0, \"L\");\n $pdf->Ln();\n\n $x = $pdf->GetX();\n $y = $pdf->GetY();\n\n $pdf->SetX(-55, true);\n $pdf->Cell(15, 5, \"Tanggal\", 0, 0, \"L\");\n $pdf->Cell(3, 5, \":\", 0, 0, \"C\");\n $pdf->Cell(50, 5, long_date(date(\"Y-m-d\", $rs->TglVoucher)), 0, 0, \"L\");\n $pdf->Ln(7);\n\n $pdf->Line(5, $pdf->GetY(), $sumWidths + 5, $pdf->GetY()); //top\n $pdf->Line(5, $pdf->GetY(), 5, 22 + $pdf->GetY()); //left\n $pdf->Line(140, ($pdf->GetY()), 140, (22 + $pdf->GetY())); //center vertikal\n $pdf->Line($sumWidths + 5, $pdf->GetY(), $sumWidths + 5, 22 + $pdf->GetY()); //right\n\n $pdf->SetY($pdf->GetY() + 2);\n $pdf->Cell(30, 5, \"Dibayar Kepada\", 0, 0, \"L\");\n $pdf->Cell(3, 5, \":\", 0, 0, \"C\");\n $pdf->SetX(140);\n $pdf->Cell(28, 5, \"Rekening Bank\", 0, 0, \"L\");\n $pdf->Cell(3, 5, \":\", 0, 0, \"L\");\n $pdf->Ln(8);\n\n $pdf->Cell(30, 5, \"Terbilang\", 0, 0, \"L\");\n $pdf->Cell(3, 5, \":\", 0, 0, \"C\");\n\n $x1 = $pdf->GetX();\n $y1 = $pdf->GetY();\n\n $pdf->SetX(140);\n $pdf->Cell(28, 5, \"No. Chq/Giro/Trf\", 0, 0, \"L\");\n $pdf->Cell(3, 5, \":\", 0, 0, \"L\");\n $pdf->Ln();\n\n $pdf->SetY($pdf->GetY() + 7);\n $pdf->SetFont(\"Tahoma\", \"\", 10);\n\t$pdf->RowHeader(5, array('TRBL', 'TRB', 'TRB', 'TRB'), null, array('C', 'C', 'C', 'C'));\n\n $pdf->Line(5, $pdf->GetY(), 5, (45 + $pdf->GetY()));\n $pdf->Line(5 + $widths[0], $pdf->GetY(), 5 + $widths[0], (45 + $pdf->GetY()));\n $pdf->Line(5 + $widths[0] + $widths[1], $pdf->GetY(), 5 + $widths[0] + $widths[1], (45 + $pdf->GetY()));\n $pdf->Line(5 + $widths[0] + $widths[1] + $widths[2], $pdf->GetY(), 5 + $widths[0] + $widths[1] + $widths[2], (45 + $pdf->GetY()));\n $pdf->Line(5 + $sumWidths, $pdf->GetY(), 5 + $sumWidths, (45 + $pdf->GetY()));\n $y3 = 45 + $pdf->GetY();\n\n $subTotal = 0;\n $coa = null;\n $coaHeader = array();\n //foreach ($rs->Details as $row) {\n $start = ($subPage - 1) * 9;\n $end = min($start + 9, count($rs->Details));\n for ($i = $start; $i < $end; $i++) {\n $row = $rs->Details[$i];\n\n $subTotal += $row->Jumlah;\n $coaDetail = null;\n\n if ($rs->VoucherTypes->Id == 1 || $rs->VoucherTypes->Id == 3) {\n $coaDetail = $row->AcKreditNo;\n\n if (!in_array($row->AcDebetNo, $coaHeader)) {\n $coaHeader[] = $row->AcDebetNo;\n }\n } elseif ($rs->VoucherTypes->Id == 2 || $rs->VoucherTypes->Id == 6) {\n $coaDetail = $row->AcDebetNo;\n\n if (!in_array($row->AcKreditNo, $coaHeader)) {\n $coaHeader[] = $row->AcKreditNo;\n }\n }\n\n $pdf->RowData(array($coaDetail, \"\", $row->Uraian, \"Rp. \" . number_format($row->Jumlah, 2,\",\",\".\")),\n 5, null, 0, array(\"L\", \"L\", \"L\", \"R\"));\n }\n\n $header = implode(\",\", $coaHeader);\n\n $pdf->SetX($x);\n $pdf->SetY($y);\n $pdf->Cell($sumWidths, 5,\"(\".$header.\")\", 0, 0, \"C\");\n\n $pdf->SetFont(\"Tahoma\", \"\", 10);\n $pdf->SetY($y3);\n $pdf->Cell($widths[0] + $widths[1] + $widths[2], 5, 'SUB TOTAL', 'LTR', 0, 'R');\n $pdf->Cell($widths[3], 5, \"Rp. \" . number_format($subTotal, 2,\",\",\".\"), 'BTR', 0, 'R');\n $pdf->Ln();\n\n if ($subPage == $totalPage) {\n $grandTotal = 0;\n foreach ($rs->Details as $detail) {\n $grandTotal += $detail->Jumlah;\n }\n\n $pdf->Cell($widths[0] + $widths[1] + $widths[2], 5, 'GRAND TOTAL', 'LTR', 0, 'R');\n $pdf->Cell($widths[3], 5, \"Rp. \" . number_format($grandTotal, 2,\",\",\".\"), 'BTR', 0, 'R');\n $pdf->Ln();\n\n $pdf->SetXY($x1, $y1);\n $pdf->SetFont(\"Tahoma\", \"\", 10);\n $pdf->MultiCell(90, 5, \"#\" . terbilang($grandTotal) . \" #\");\n\n $pdf->SetY($y3);\n $pdf->Ln(10);\n }\n\n\t$cellWidth1 = floor($sumWidths / 5);\n\t$cellWidth2 = $sumWidths - (4 * $cellWidth1);\n //$pdf->SetY(100 + $coordinat);\n $pdf->SetFont(\"Tahoma\", \"\", 10);\n $pdf->Cell($cellWidth1, 5, 'Dibayar', 'LRBT', 0, 'C');\n $pdf->Cell($cellWidth1, 5, 'Diperiksa', 'BTR', 0, 'C');\n $pdf->Cell($cellWidth1, 5, 'Dibukukan', 'BTR', 0, 'C');\n $pdf->Cell($cellWidth1, 5, 'Disetujui', 'BTR', 0, 'C');\n $pdf->Cell($cellWidth2, 5, 'Diterima', 'BTR', 0, 'C');\n $pdf->Ln();\n $pdf->Cell($cellWidth1, 15, '', 'LRBT', 0, 'C');\n $pdf->Cell($cellWidth1, 15, '', 'BTR', 0, 'C');\n $pdf->Cell($cellWidth1, 15, '', 'BTR', 0, 'C');\n $pdf->Cell($cellWidth1, 15, '', 'BTR', 0, 'C');\n $pdf->Cell($cellWidth2, 15, '', 'BTR', 0, 'C');\n $pdf->Ln();\n\n $pdf->SetY($pdf->GetY() - 5);\n $pdf->Cell($cellWidth1, 5, '(Nama Jelas)', 0, 0, 'C');\n $pdf->Cell($cellWidth1, 5, '(Nama Jelas)', 0, 0, 'C');\n $pdf->Cell($cellWidth1, 5, '(Nama Jelas)', 0, 0, 'C');\n $pdf->Cell($cellWidth1, 5, '(Nama Jelas)', 0, 0, 'C');\n $pdf->Cell($cellWidth2, 5, '(Nama Jelas)', 0, 0, 'C');\n $pdf->Ln();\n if ($totalPage > 1) {\n $pdf->SetFont(\"Tahoma\", \"\", 8);\n $pdf->Cell(-100, 5, sprintf(\"%s Halaman: %s dari %d\", $rs->DocumentNo, $subPage, $totalPage), \"\", 0, \"R\");\n }\n}", "function postCreateTable(){\n\t}", "public function addRow(TableRow $row);", "public function create()\n {\n parent::create();\n\n $sheet = $this->add_sheet();\n\n $this->add_table($sheet, $this->database, $this->generate_table());\n }", "public static function add_new_inner_pager ( $page=null ) \n {\n $inner = null; \n\n if( ! is_null( $page ) ) : switch( $page ) :\n \n case 'notification' :\n $inner .= self::notification_center();\n break; \n\n case 'confirmation' :\n $inner .= self::confirmation_center();\n break; \n\n case 'entries' :\n $inner .= self::entries_center();\n break; \n\n case 'review' :\n $inner .= self::review_center();\n break; \n\n endswitch; else :\n\n $inner = self::add_new_inner_center();\n\n endif;\n\n return $inner;\n }", "public function addTable(array &$form, FormStateInterface $form_state) {\n $num_table = $form_state->get('num_table') + 1;\n $form_state->set('num_table', $num_table);\n $form_state->setRebuild();\n }", "public static function create_table() {\r\n global $wpdb;\r\n $charset_collate = $wpdb->get_charset_collate();\r\n // myhome_locations store locations. It helps when filtering properties by locations (lat/lng)\r\n $table_name = $wpdb->prefix . 'myhome_locations';\r\n\r\n $query = \"CREATE TABLE $table_name (\r\n\t\t\tid bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n\t\t\tpost_id bigint(20) UNSIGNED NOT NULL,\r\n\t\t\tlat decimal(10, 8) NOT NULL,\r\n\t\t\tlng decimal(11, 8) NOT NULL,\r\n\t\t\tPRIMARY KEY (id)\r\n\t\t\t) $charset_collate;\";\r\n\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n dbDelta( $query );\r\n }", "function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "function Row($data) {\n $nb = 0;\n for ($i = 0; $i < count($data); $i++)\n $nb = max($nb, $this->NbLines($this->widths[$i], $data[$i]));\n $h = 4 * $nb;\n //Issue a page break first if needed\n $this->CheckPageBreak($h);\n\n //Se pone para que depues de insertar una pagina establezca la posicion en X = 5\n $this->SetX(5);\n\n //Draw the cells of the row\n for ($i = 0; $i < count($data); $i++) {\n $w = $this->widths[$i];\n $a = isset($this->aligns[$i]) ? $this->aligns[$i] : 'L';\n\n //Save the current position\n $x = $this->GetX();\n $y = $this->GetY();\n //Draw the border\n $this->Rect($x, $y, $w, $h);\n //Print the text\n $this->MultiCell($w, 4, $data[$i], 0, $a);\n //Put the position to the right of the cell\n $this->SetXY($x + $w, $y);\n }\n //Go to the next line\n $this->Ln($h);\n }", "public function getPageAndRootline() {}", "function verifyCreateTableWithAllSpecialEffects(){\n $WIKI_TABLE_ROW = 6;\n $WIKI_TABLE_COL = \"2\";\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_ADDTABLE);\n $this->click(CHK_SORT);\n $this->type(TEXT_ROW, $WIKI_TABLE_ROW);\n $this->type(TEXT_COL, $WIKI_TABLE_COL);\n $this->click(BUTTON_INSERTABLE);\n $this->click(CHK_SORT);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1;\n $this->assertTrue($this->isElementPresent(TEXT_TABLEID_WITHALLFEATURES . \n TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW .\n TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL .\n TEXT_VALIDATE_TABLE_PART3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "function\temptyTableRow ( $_height) {\n\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm->currVerPos\t+=\tmmToPt( $_height) ;\t\t// now add the height of everythign we have output'\n\t}", "public function getMainTable(): Table\n {\n return $this->mainTable;\n }", "function helper_pdf_add_cell($pdf, $largura, $altura, $texto, $bordas, $pula_linha, $alinhamento){\n\t$pdf->Cell($largura, $altura, $texto, $bordas, $pula_linha, $alinhamento);\n}", "public function getTableContent() {\n\t\treturn \"<tr><td>\" . $this -> getWorldId() . \"</td><td>\" . $this -> getPlayers() . \"</td><td>\" . $this -> getIp() .\"</td><td>\" . Utils::time_elapsed_string(strtotime($this -> getLastResponse())) . \" ago</tr>\";\t\n\t}", "function extra_tablenav( $which ) {\r\n if ( $which == \"top\" ){\r\n //The code that goes before the table is here\r\n }\r\n if ( $which == \"bottom\" ){\r\n //The code that goes after the table is there\r\n }\r\n }", "function populate_table()\n\t{\n\t\t$this->table = array();\n\n\t\t$prev_row = array();\n\t\tfor ($i = -1; $i < $this->data_new_len; $i++)\n\t\t{\n\t\t\t$prev_row[$i] = 0;\n\t\t}\n\n\t\tfor ($i = 0; $i < $this->data_old_len; $i++)\n\t\t{\n\t\t\t$this_row = array('-1' => 0);\n\t\t\t$data_old_value = $this->data_old[$i];\n\n\t\t\tfor ($j = 0; $j < $this->data_new_len; $j++)\n\t\t\t{\n\t\t\t\tif ($data_old_value == $this->data_new[$j])\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $prev_row[$j - 1] + 1;\n\t\t\t\t}\n\t\t\t\telse if ($this_row[$j - 1] > $prev_row[$j])\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $this_row[$j - 1];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this_row[$j] = $prev_row[$j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->table[$i - 1] = $this->compress_row($prev_row);\n\t\t\t$prev_row = $this_row;\n\t\t}\n\t\tunset($prev_row);\n\t\t$this->table[$this->data_old_len - 1] = $this->compress_row($this_row);\n\t}", "private function writeTable() {\n\t\trequire_once $GLOBALS[\"DIR_PRINT\"] . \"pdftable.php\";\n\t\t\n\t\t// create table with data and sum\n\t\t$table = new PDFTable($this->data);\n\t\t\n\t\t// set columns\n\t\t$table->setColumnWidth(1, 30);\n\t\t$table->setColumnWidth(2, 25);\n\t\t$table->setColumnWidth(3, 25);\n\t\t$table->setColumnWidth(5, 25);\n\t\t$table->setColumnWidth(6, 25);\n\t\t$table->setColumnWidth(7, 30);\n\t\t$table->setColumnWidth(13, 35);\n\t\t$table->setColumnWidth(14, 30);\n\t\t$table->setColumnWidth(15, 15);\n\t\t$table->setColumnWidth(16, 24);\n\t\t\n\t\t$table->changeColumnLabel(1, \"Nachname\");\n\t\t$table->changeColumnLabel(2, \"Vorname\");\n\t\t$table->changeColumnLabel(3, \"Privat\");\n\t\t$table->changeColumnLabel(5, \"Mobil\");\n\t\t$table->changeColumnLabel(6, \"Berufl.\");\n\t\t$table->changeColumnLabel(7, \"E-Mail\");\n\t\t$table->changeColumnLabel(13, \"Straße\");\n\t\t$table->changeColumnLabel(14, \"Ort\");\n\t\t$table->changeColumnLabel(15, \"PLZ\");\n\t\t$table->changeColumnLabel(16, \"Instrument\");\n\t\t\n\t\t$table->setColumnType(3, FieldType::CHAR);\n\t\t$table->setColumnType(5, FieldType::CHAR);\n\t\t$table->setColumnType(6, FieldType::CHAR);\n\t\t$table->setColumnType(15, FieldType::CHAR);\n\t\t\n\t\t$table->setCellBorder(\"T\");\n\t\t$table->setVerticalSpacing(1);\n\t\t\n\t\t// write the document\n\t\t$table->write($this->pdf);\n\t}", "public function addNewSheetAndMakeItCurrent();", "public function tableWizard() {}", "public function eventPageCreate($pageTable, $contentTable) {\n $db = $this->getDb();\n $page_id = $db->select()\n ->from($pageTable, 'page_id')\n ->where('name = ?', \"siteevent_index_create\")\n ->limit(1)\n ->query()\n ->fetchColumn();\n if (empty($page_id)) {\n\n $containerCount = 0;\n\n //CREATE PAGE\n $db->insert($pageTable, array(\n 'name' => \"siteevent_index_create\",\n 'displayname' => 'Advanced Events - Event Create Page',\n 'title' => 'Advanced Event Create Page',\n 'description' => 'This page allows users to create events.',\n 'custom' => 0,\n ));\n $page_id = $db->lastInsertId();\n\n $db->insert($contentTable, array(\n 'type' => 'container',\n 'name' => 'top',\n 'page_id' => $page_id,\n 'order' => $containerCount++,\n ));\n $top_container_id = $db->lastInsertId();\n\n //MAIN CONTAINER\n $db->insert($contentTable, array(\n 'type' => 'container',\n 'name' => 'main',\n 'page_id' => $page_id,\n 'order' => $containerCount++,\n ));\n $main_container_id = $db->lastInsertId();\n\n //INSERT TOP-MIDDLE\n $db->insert($contentTable, array(\n 'type' => 'container',\n 'name' => 'middle',\n 'page_id' => $page_id,\n 'parent_content_id' => $top_container_id,\n 'order' => $containerCount++,\n ));\n $top_middle_id = $db->lastInsertId();\n\n //MAIN-MIDDLE CONTAINER\n $db->insert($contentTable, array(\n 'type' => 'container',\n 'name' => 'middle',\n 'page_id' => $page_id,\n 'parent_content_id' => $main_container_id,\n 'order' => $containerCount++,\n ));\n $main_middle_id = $db->lastInsertId();\n\n $db->insert($contentTable, array(\n 'page_id' => $page_id,\n 'type' => 'widget',\n 'name' => 'siteevent.navigation-siteevent',\n 'parent_content_id' => $top_middle_id,\n 'params' => '',\n ));\n\n $db->insert($contentTable, array(\n 'type' => 'widget',\n 'name' => 'core.content',\n 'page_id' => $page_id,\n 'parent_content_id' => $main_middle_id,\n 'order' => 1,\n ));\n }\n }", "public static function createTables()\n\t{\n\t\treturn (self::createContentTable());\n\t}", "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "public function getCurrentTable() {}", "function customcert_add_page($data) {\n global $DB;\n\n // Set the page number to 1 to begin with.\n $pagenumber = 1;\n // Get the max page number.\n $sql = \"SELECT MAX(pagenumber) as maxpage\n FROM {customcert_pages} cp\n WHERE cp.customcertid = :customcertid\";\n if ($maxpage = $DB->get_record_sql($sql, array('customcertid' => $data->id))) {\n $pagenumber = $maxpage->maxpage + 1;\n }\n\n // Store time in a variable.\n $time = time();\n\n // New page creation.\n $page = new stdClass();\n $page->customcertid = $data->id;\n $page->width = '210';\n $page->height = '297';\n $page->pagenumber = $pagenumber;\n $page->timecreated = $time;\n $page->timemodified = $time;\n\n // Insert the page.\n $DB->insert_record('customcert_pages', $page);\n}", "function refreshTable(){\n\t\t$this->table = array();\n\n\t\t//set the column headers\n\t\t$this->table[0] = $this->getColumnHeaders();\n\n\t\t//add a row for each user\n\t\tforeach ($this->users as $name => $schedule) {\n\t\t\t$row = array();\n\n\t\t\t//if this user is being edited\n\t\t\tif($this->currentEdit == $name) $row = $this->userEditRow($name, $schedule, $this->table[0]);\n\t\t\telse $row = $this->userDisplayRow($name, $schedule, $this->table[0]);\n\t\t\t\n\t\t\tarray_push($this->table, $row);\n\t\t}\n\n\t\tarray_push($this->table, $this->genSubmitRow());\n\n\t\tarray_push($this->table, $this->genTotalRow());\n\n\t\t$this->logMsg(SUCCESS, 'internal table constructed');\n\t}", "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "public function addRow() {\n if ($this->linesCount >= 0)\n $this->addContent('</div>');\n $this->linesCount ++;\n $this->colunsCount = 0;\n $this->addContent('<div class=\"row\" >');\n }", "public function getTable($download=false){\n $this->getWorksheet($this->fileName, $download);\n // print_r ($this->worksheet);\n // $nr = count(array_filter($this->worksheet)); //number of rows\n // echo $nr.'Opps'. $this->totalRow;\n $html_tb ='';\n $html_tb .='<table class=\"table\" style=\"font-size:10px;\" border=\"1\"><tr><th>SN</th><th>'. implode('</th><th>', $this->unfilteredWorksheet[1]) .'</th></tr>';\n // $html_tb .='<table class=\"table\" style=\"font-size:10px;\" border=\"1\">';\n $startNum = ($this->currentPage == 1?$startNum = 2:$this->minPageNum);\n for($i=$startNum; $i<=$this->maxPageNum; $i++){\n if ($i > $this->totalRow){\n break;\n }\n $html_tb .='<tr><td>'.$i.'</td><td>'. implode('</td><td>', $this->worksheet[$i]) .'</td></tr>';\n }\n $html_tb .='</table>';\n\n return $html_tb;\n }", "function install_main_table() {\n global $wpdb;\n\n $charset_collate = '';\n if ( ! empty($wpdb->charset) )\n $charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n if ( ! empty($wpdb->collate) )\n $charset_collate .= \" COLLATE $wpdb->collate\";\t\n $table_name = $wpdb->prefix . \"store_locator\";\n $sql = \"CREATE TABLE $table_name (\n sl_id mediumint(8) unsigned NOT NULL auto_increment,\n sl_store varchar(255) NULL,\n sl_address varchar(255) NULL,\n sl_address2 varchar(255) NULL,\n sl_city varchar(255) NULL,\n sl_state varchar(255) NULL,\n sl_zip varchar(255) NULL,\n sl_country varchar(255) NULL,\n sl_latitude varchar(255) NULL,\n sl_longitude varchar(255) NULL,\n sl_tags mediumtext NULL,\n sl_description text NULL,\n sl_email varchar(255) NULL,\n sl_url varchar(255) NULL,\n sl_hours varchar(255) NULL,\n sl_phone varchar(255) NULL,\n sl_fax varchar(255) NULL,\n sl_image varchar(255) NULL,\n sl_private varchar(1) NULL,\n sl_neat_title varchar(255) NULL,\n sl_linked_postid int NULL,\n sl_pages_url varchar(255) NULL,\n sl_pages_on varchar(1) NULL,\n sl_option_value longtext NULL,\n sl_lastupdated timestamp NOT NULL default current_timestamp,\t\t\t\n PRIMARY KEY (sl_id),\n KEY (sl_store(255)),\n KEY (sl_longitude(255)),\n KEY (sl_latitude(255))\n ) \n $charset_collate\n \";\n\n // If we updated an existing DB, do some mods to the data\n //\n if ($this->dbupdater($sql,$table_name) === 'updated') {\n // We are upgrading from something less than 2.0\n //\n if (floatval($this->db_version_on_start) < 2.0) {\n dbDelta(\"UPDATE $table_name SET sl_lastupdated=current_timestamp \" . \n \"WHERE sl_lastupdated < '2011-06-01'\"\n );\n } \n if (floatval($this->db_version_on_start) < 2.2) {\n dbDelta(\"ALTER $table_name MODIFY sl_description text \");\n }\n } \n\n //set up google maps v3\n $old_option = get_option('sl_map_type');\n $new_option = 'roadmap';\n switch ($old_option) {\n case 'G_NORMAL_MAP':\n $new_option = 'roadmap';\n break;\n case 'G_SATELLITE_MAP':\n $new_option = 'satellite';\n break;\n case 'G_HYBRID_MAP':\n $new_option = 'hybrid';\n break;\n case 'G_PHYSICAL_MAP':\n $new_option = 'terrain';\n break;\n default:\n $new_option = 'roadmap';\n break;\n }\n update_option('sl_map_type', $new_option);\n }", "public function lastRow() {\n\t}", "function CreateTable (){\r\n\t\t$conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n\t\t// Check connection\r\n\t\tif ($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\r\n\t\t} \r\n\r\n\t\t// sql to create table\r\n\t\t$sql = \"CREATE TABLE tbldmlmapcontent (\r\n\t\tCntID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, \r\n\t\tCntUsrCtrlID INT(6) NOT NULL,\r\n\t\tCntLink TEXT NOT NULL,\r\n\t\tCntField1 TEXT,\r\n\t\tCntField2 TEXT,\r\n\t\tCntField3 TEXT,\r\n\t\tCntField4 VARCHAR(200),\r\n\t\tCntField5 VARCHAR(200),\r\n\t\tCntField6 VARCHAR(200),\r\n\t\tCntField7 MEDIUMTEXT,\r\n\t\tCntField8 VARCHAR(200),\r\n\t\tCntField9 VARCHAR(200),\r\n\t\tCntField10 VARCHAR(200)\r\n\t\t)\";\r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n\t\t\t// There are no available data for current page. So, shows API panel.\r\n\t\t\techo \"1\";\r\n\t\t} else {\r\n\t\t\techo \"0\";\r\n\t\t}\r\n\r\n\t\t$conn->close();\r\n\t}", "public function addDbRows(ITable $table) {\n\t\t$this->addRows($table->getRows());\n\t}", "function page_add_page($pagerec) {\n return page_edit_page($pagerec, 0, null, null);\n}", "function getTable($array, $firstLineHeader = true, $lastLineFooter = true, $withTableStructure = true)\n{\n\t$ret = '';\n\n\t$rows = count($array);\n\t$cols = isset($array[0]) ? count($array[0]) : 0;\n\t$i = 0;\n\n\tif($firstLineHeader)\n\t{\n\t\t$ret .= '<tr class=\"tableHeaderRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellR\">';\n\t\t\telse if($j == 0)\n\t\t\t\t$ret .= '<td class=\"tableHeaderCellL\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableHeaderCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\n\t\t$i++;\n\t}\n\n\tfor(; $i < $rows; $i++)\n\t{\n\t\t$ret .= '<tr class=\"tableRow\">';\n\t\tfor($j = 0; $j < $cols; $j++)\n\t\t{\n\t\t\tif($j == ($cols - 1))\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBR\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTR\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellR\">';\n\t\t\t}\n\t\t\telse if($j == 0)\n\t\t\t{\n\t\t\t\tif($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t\t$ret .= '<td class=\"tableCellBL\">';\n\t\t\t\telse if($i == 0)\n\t\t\t\t\t$ret .= '<td class=\"tableCellTL\">';\n\t\t\t\telse\n\t\t\t\t\t$ret .= '<td class=\"tableCellL\">';\n\t\t\t}\n\t\t\telse if($i == ($rows - 1) && $lastLineFooter)\n\t\t\t\t$ret .= '<td class=\"tableCellB\">';\n\t\t\telse if($i == 0)\n\t\t\t\t$ret .= '<td class=\"tableCellT\">';\n\t\t\telse\n\t\t\t\t$ret .= '<td class=\"tableCell\">';\n\n\t\t\t$ret .= $array[$i][$j] . '</td>' . \"\\n\";\n\t\t}\n\t\t$ret .= '</tr>' . \"\\n\";\n\t}\n\n\tif($withTableStructure)\n\t\t$ret = '<p/><table class=\"tableMain\">' . $ret . '</table>';\n\n\treturn $ret;\n}", "function\ttableHead() {\n\t\t//\n\t\t//\t\tfpdf_set_active_font( $this->myfpdf, $this->fontId, mmToPt(3), false, false );\n\t\t//\t\tfpdf_set_fill_color( $this->myfpdf, ul_color_from_rgb( 0.1, 0.1, 0.1 ) );\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\t$frm->currVerPos\t+=\t3.5 ;\t\t// now add some additional room for readability\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTHeaderPS) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t}\n\t\t}\n//\t\t$this->frmContent->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t\tif ( $this->inTable) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTHeaderCF) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t\t}\n\t}", "private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }", "function get(){\n\t$temp = $this->page;\n\t$this->addFooter();\n\t//restore the page for next call for\n\t$page= $this->page;\n\t$this->page = $temp;\n\n return $this->page;\n}", "private function _createTables()\r\n {\r\n return true;\r\n }", "function mkYearFoot(){\nreturn \"</table>\\n\";\n}", "private function Write_Monthly_Table() {\n\t\t$top = 445 + self::VERT_MARGIN;\n\t\t$left = self::HORZ_MARGIN;\n\t\t$label_width = 160;\n\t\t$table_left = $left + $label_width;\n\t\t$cell_width = 55;\n\t\t$row_height = 8.5;\n\t\t\n\t\t/**\n\t\t * Build label backgrounds\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top, $label_width + ($cell_width * 1), $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t/**\n\t\t * Add the strokes\n\t\t */\n\t\t$this->Rect_TL($table_left, $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 1), $top, $cell_width, $row_height);\n\t//\t$this->Rect_TL($table_left + ($cell_width * 2), $top, $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t/**\n\t\t * Add the labels\n\t\t */\n\t\t$this->Text_TL(\"CURRENT PERIOD\",\n\t\t\t$left, $top, \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['LEFT']}\");\n\t\t\n\t\t$this->Text_TL(\"PERIOD\",\n\t\t\t$table_left, $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t/*$this->Text_TL(\"WEEK\",\n\t\t\t$table_left + ($cell_width * 1), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");\n\t\t\n\t\t$this->Text_TL(\"MONTH\",\n\t\t\t$table_left + ($cell_width * 2), $top, \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['CENTER']}\");*/\n\t\t\t\n\t\t$current_row = 1;\n\t\t$totals = array(\n\t\t\t'weekly' => 0,\n\t\t\t'biweekly' => 0,\n\t\t\t'semimonthly' => 0,\n\t\t\t'monthly' => 0,\n\t\t);\n\t\tforeach ($this->data['period'] as $label => $values) {\n\t\t\t/**\n\t\t\t * Special processing\n\t\t\t */\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'nsf$':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tcase 'debit returns':\n//\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n//\t\t\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t\t\t$this->pdf->stroke();\n\t\t\t\t\t/*$percentage = $values['month']? number_format($values['month'] / $this->data['monthly']['total debited']['month'] * 100, 1):0;\n\t\t\t\t\t$this->Text_TL($percentage.'%',\n\t\t\t\t\t\t$table_left + ($cell_width * 3), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['CENTER']}\");*/\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'net cash collected':\n\t\t\t\t\t$this->pdf->setcolor('fill', 'rgb', 1, 1, 176/255, 0);\n\t\t\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t//$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t\t\t$this->pdf->fill();\n\t\t\t\t\t\n\t\t\t\t\t//$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['debit returns']['span'], 2),\n\t\t\t\t\t$this->Text_TL(number_format($this->data['period']['total debited']['span'] - $this->data['period']['nsf$']['span'], 2),\n\t\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t\t\n\t\t\t\t\t/*$this->Text_TL(number_format($this->data['monthly']['total debited']['week'] - $this->data['monthly']['debit returns']['week'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\t$this->Text_TL(number_format($this->data['monthly']['total debited']['month'] - $this->data['monthly']['debit returns']['month'], 2),\n\t\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t\t\tbreak;\n\t\t\t\t//FORBIDDEN ROWS!\n\t\t\t\tcase 'moneygram deposit':\n\t\t\t\t//case 'credit card payments':\n\t\t\t\t\tcontinue 2;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t\t$format_decimals = 0;\n\t\t\tswitch ($label) {\n\t\t\t\tcase 'new customers':\n\t\t\t\tcase 'card reactivations':\n\t\t\t\tcase 'reactivated customers':\n\t\t\t\tcase 'refunded customers':\n\t\t\t\tcase 'resend customers':\n\t\t\t\tcase 'cancelled customers':\n\t\t\t\tcase 'paid out customers (ach)':\n\t\t\t\tcase 'paid out customers (non-ach)':\n\t\t\t\t\t$format_decimals = 0;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$format_decimals = 2;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t\t$this->pdf->fill();\n\t\t\t\n\t\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 1), $top + ($row_height * $current_row), $cell_width, $row_height);\n//\t\t\t$this->Rect_TL($table_left + ($cell_width * 2), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t\t$this->pdf->stroke();\n\t\t\t\n\t\t\t$this->Text_TL(strtoupper($label),\n\t\t\t\t$left + $label_indent, $top + ($row_height * $current_row), \n\t\t\t\t$label_width - $label_indent, $row_height,\n\t\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\t\n\t\t\tif ($label != 'net cash collected') {\n\t\t\t\t$this->Text_TL(number_format($values['span'], $format_decimals),\n\t\t\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t/*$this->Text_TL(number_format($values['week'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 1), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\t\t\n\t\t\t\t$this->Text_TL(number_format($values['month'], $format_decimals),\n\t\t\t\t\t$table_left + ($cell_width * 2), $top + ($row_height * $current_row), \n\t\t\t\t\t$cell_width, $row_height,\n\t\t\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");*/\n\t\t\t}\n\t\t\t\n\t\t\t$current_row++;\n\t\t}\n\t\t\n\t\t/**\n\t\t * Advances in Collection\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($left, $top + ($row_height * $current_row), $label_width, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left, $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ADVANCES IN COLLECTION\",\n\t\t\t$left, $top + ($row_height * $current_row), \n\t\t\t$label_width, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_collections'], 2),\n\t\t\t$table_left, $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t/**\n\t\t * Advances in Active\n\t\t */\n\t\t$this->pdf->setcolor('fill', 'gray', 0.75, 0, 0, 0);\n\t\t$this->Rect_TL($table_left + ($cell_width * 4), $top + ($row_height * $current_row), $cell_width * 2, $row_height);\n\t\t$this->pdf->fill();\n\t\t\n\t\t$this->Rect_TL($table_left + ($cell_width * 6), $top + ($row_height * $current_row), $cell_width, $row_height);\n\t\t$this->pdf->stroke();\n\t\t\n\t\t$this->Text_TL(\"ACTIVE ADVANCES OUT\",\n\t\t\t$table_left + ($cell_width * 4), $top + ($row_height * $current_row), \n\t\t\t$cell_width * 2, $row_height,\n\t\t\t\"{$this->formats['BOLD_FONT']} {$this->formats['ITALICS']} {$this->formats['RIGHT']}\");\n\t\t\n\t\t$this->Text_TL(number_format($this->data['advances_active'], 2),\n\t\t\t$table_left + ($cell_width * 6), $top + ($row_height * $current_row), \n\t\t\t$cell_width, $row_height,\n\t\t\t\"{$this->formats['NORMAL_FONT']} {$this->formats['RIGHT']}\");\n\t\t\n\t}", "function\tpunchTableRow ( $_myRow) {\n\t\t$maxHeight\t=\t0.0 ;\n\t\t$myHeight\t=\t0.0 ;\n\n\t\t/**\n\t\t * Alle Spalten-Inhalte der Tabelle ausgeben\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\t$remHeight\t=\t$frm->remHeight() ;\n\t\tfor ( $actCol=$this->myTable->getFirstCol() ;\n\t\t\t$actCol !== FALSE ;\n\t\t\t$actCol=$this->myTable->getNextCol()) {\n\t\t\t$colNdx\t=\t$this->myTable->getColNdx() ;\n\t\t\t$actCell\t=\t$_myRow->getCellAt( $colNdx) ;\n\t\t\tif ( $actCell !== FALSE) {\n\t\t\t\t$actData\t=\t$actCell->getData() ;\n\t\t\t\tif ( is_string( $actData)) {\n\t\t\t\t\t$altBuf\t=\tsprintf( \"%s\", $actData) ;\n\t\t\t\t\t$actBuf\t=\tstr_replace( \"%np%\", $this->myDoc->pageNr + 1, $altBuf) ;\n\t\t\t\t\t$altBuf\t=\t$actBuf ;\n\t\t\t\t\t$actBuf\t=\tstr_replace( \"%pp%\", $this->myDoc->pageNr - 1, $altBuf) ;\n\t\t\t\t} else if ( is_int( $actData)) {\n\t\t\t\t\t$actBuf\t=\tsprintf( \"%d\", $actData) ;\n\t\t\t\t} else if ( is_float( $actData)) {\n\t\t\t\t\t$actBuf\t=\tsprintf( \"%9.2f\", $actData) ;\n\t\t\t\t}\n\t\t\t\tif ( mb_check_encoding( $actBuf, \"UTF-8\")) {\n\t\t\t\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"()\", \"UTF-8 to latin1 encoding required\") ;\n\t\t\t\t\t$myBuffer\t=\tmb_convert_encoding( $actBuf, \"latin1\") ;\n\t\t\t\t\t$actBuf\t=\t$myBuffer ;\n\t\t\t\t}\n\t\t\t\t$textWidth\t=\t$this->textWidth( $actBuf) ;\n\t\t\t\t$this->cellFrame->horOffs\t=\t$frm->horOffs + mmToPt( $actCol->getHorPos()) ;\n\t\t\t\t$this->cellFrame->verOffs\t=\t$frm->verOffs + $frm->currVerPos ;\n\t\t\t\t$this->cellFrame->width\t=\tmmToPt( $actCol->getWidth()) ;\n\t\t\t\t$this->cellFrame->height\t=\t30 ;\n\t\t\t\t$this->cellFrame->currHorPos\t=\t0.0 ;\n\t\t\t\t$this->cellFrame->currVerPos\t=\t0.0 ;\n\n\t\t\t\t$this->addCellText( $this->cellFrame, $actCell->getParFmt(), $actBuf) ;\n\n\t\t\t\tif ( $this->cellFrame->currVerPos > $maxHeight) {\n\t\t\t\t\t$maxHeight\t=\t$this->cellFrame->currVerPos ;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Alle Spalten-Rahmen der Tabelle ausgeben\n\t\t */\n\t\tfor ( $actCol=$this->myTable->getFirstCol() ;\n\t\t$actCol !== FALSE ;\n\t\t$actCol=$this->myTable->getNextCol()) {\n\t\t\t$colNdx\t=\t$this->myTable->getColNdx() ;\n\t\t\t$actCell\t=\t$_myRow->getCellAt( $colNdx) ;\n\t\t\tif ( $actCell !== FALSE) {\n\t\t\t\t$this->cellFrame->horOffs\t=\t$actCol->getHorPos() ;\n\t\t\t\t$this->cellFrame->verOffs\t=\t$this->myTable->currVerPos ;\n\t\t\t\t$this->cellFrame->width\t=\t$actCol->getWidth() ;\n\t\t\t\t$this->cellFrame->height\t=\t30 ;\n\t\t\t\t$this->cellFrame->currHorPos\t=\t0.0 ;\n\t\t\t\t$this->cellFrame->currVerPos\t=\t0.0 ;\n\t\t\t\tif ( $actCell->getBorder() == BCell::BTFull) {\n\t\t\t\t\t//\t\t\t\t\tfpdf_new_path( $this->myfpdf) ;\n\t\t\t\t\t//\t\t\t\t\tfpdf_moveto( $this->myfpdf,\n\t\t\t\t\t//\t\t\t\t\t\tmmToPt( $this->frmContentAct->horOffs + $this->cellFrame->horOffs),\n\t\t\t\t\t//\t\t\t\t\t\tmmToPt( $this->frmContentAct->verOffs + $this->frmContentAct->currVerPos + $this->myTablePar->getCharFmt()->getCharSize())) ;\n\t\t\t\t\t//\t\t\t\t\tfpdf_lineto( $this->myfpdf,\n\t\t\t\t\t//\t\t\t\t\t\tmmToPt( $this->frmContentAct->horOffs + $this->cellFrame->horOffs + $this->cellFrame->width),\n\t\t\t\t\t//\t\t\t\t\t\tmmToPt( $this->frmContentAct->verOffs + $this->frmContentAct->currVerPos + $this->myTablePar->getCharFmt()->getCharSize())) ;\n\t\t\t\t\t//\t\t\t\t\tfpdf_close_path( $this->myfpdf) ;\n\t\t\t\t\t//\t\t\t\t\tfpdf_stroke( $this->myfpdf) ;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$frm->currVerPos\t+=\t$maxHeight ;\t\t// now add the height of everythign we have output'\n\t\tFDbg::trace( 1, FDbg::mdTrcInfo1, basename( __FILE__), __CLASS__, __METHOD__.\"()\", \"currVerPos=\" . $this->myTable->currVerPos) ;\n\t\treturn 0 ;\n\t}", "function writePageTree() {\n if (count($pages) == 0)\n throw new IOException(\"The document has no pages.\");\n $leaf = 1;\n $tParents = parents;\n $tPages = pages;\n $nextParents = array();\n while (TRUE) {\n $leaf *= $leafSize;\n $stdCount = $leafSize;\n $rightCount = count($tPages) % $leafSize;\n if ($rightCount == 0)\n $rightCount = $leafSize;\n for ($p = 0; $p < count($tParents); ++$p) {\n $count = 0;\n $thisLeaf = $leaf;\n if ($p == count($tParents) - 1) {\n $count = $rightCount;\n $thisLeaf = count($pages) % $leaf;\n if ($thisLeaf == 0)\n $thisLeaf = $leaf;\n }\n else\n $count = $stdCount;\n $top = new PdfDictionary(PdfName::$PAGES);\n $top->put(PdfName::COUNT, new PdfNumber($thisLeaf));\n $kids = new PdfArray();\n $internal = $kids->getArrayList();\n $arraySublist = array();\n for ($k = $p * $stdCount; $k <= $p * $stdCount + $count; $k++)\n {\n array_push($arraySublist, $tPages[$k]);\n }\n $internal = array_merge($internal, $arraySublist);\n $top->put(PdfName::$KIDS, $kids);\n if (count($tParents) > 1) {\n if (($p % $leafSize) == 0)\n array_push($nextParents, $writer->getPdfIndirectReference());\n $top->put(PdfName::$PARENT, $nextParents[$p / $leafSize]);\n }\n $writer->addToBody($top, $tParents[$p]);\n }\n if (count($tParents) == 1) {\n $topParent = $tParents[0];\n return $topParent;\n }\n $tPages = $tParents;\n $tParents = $nextParents;\n $nextParents = array();\n }\n }", "public function addFileToLastHeading(TableOfContents\\File $file)\n {\n $this->last_heading->addChild($file);\n $file->setParent($this->last_heading);\n }", "function addPage($pdf,$font='freesans'){\n $pdf->AddPage();\n $pdf->SetXY(110,10);\n $pdf->SetFont($font, '', 20);\n $pdf->writeHTML('Relação de Vendas');\n $pdf->SetXY(10,24);\n $pdf->SetFont($font, 'B', 11);\n $pdf->writeHTMLCell(15, 0, $pdf->GetX(), $pdf->GetY(), '<b>Pedido</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>NF</b>');\n $pdf->writeHTMLCell(50, 0, $pdf->GetX(), $pdf->GetY(), '<b>Loja</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>Vendedor</b>');\n $pdf->writeHTMLCell(40, 0, $pdf->GetX(), $pdf->GetY(), '<b>Cliente</b>');\n $pdf->writeHTMLCell(25, 0, $pdf->GetX(), $pdf->GetY(), '<b>Data</b>');\n $pdf->writeHTMLCell(20, 0, $pdf->GetX(), $pdf->GetY(), '<b>Arred.</b>');\n $pdf->writeHTMLCell(25, 0, $pdf->GetX(), $pdf->GetY(), '<b>Desconto</b>');\n $pdf->writeHTMLCell(30, 0, $pdf->GetX(), $pdf->GetY(), '<b>Valor</b>');\n $pdf->Ln();\n $pdf->SetY($pdf->GetY()+2);\n $pdf->Line(10, $pdf->GetY(), 285, $pdf->GetY()); // Desenha uma linha\n $pdf->SetY($pdf->GetY()+2);\n }" ]
[ "0.6235825", "0.6150602", "0.60108995", "0.5907983", "0.56557983", "0.55360067", "0.55288434", "0.55246586", "0.5397679", "0.53792953", "0.5317545", "0.5288229", "0.52809834", "0.5226208", "0.5210564", "0.52063644", "0.5168653", "0.5162987", "0.51365715", "0.5130533", "0.5119671", "0.5116618", "0.5057797", "0.5037182", "0.49935952", "0.49890718", "0.49751642", "0.49722815", "0.4959231", "0.49571168", "0.49571052", "0.49526992", "0.49350423", "0.48888084", "0.48803276", "0.48752204", "0.48686984", "0.48601952", "0.4852798", "0.48283947", "0.48202682", "0.4806502", "0.48002803", "0.47908148", "0.47645178", "0.4762805", "0.47622228", "0.4758324", "0.4746006", "0.47334766", "0.4723169", "0.47228497", "0.47154224", "0.4711402", "0.47023842", "0.46995628", "0.46966964", "0.46861017", "0.46855417", "0.46849883", "0.46639004", "0.46609855", "0.46528664", "0.4652511", "0.46420738", "0.46339247", "0.46255124", "0.46139225", "0.4603049", "0.45954633", "0.4582792", "0.45715714", "0.45665565", "0.4563901", "0.45600504", "0.45591265", "0.4559124", "0.45461953", "0.45449194", "0.45363945", "0.45361927", "0.45356756", "0.45325333", "0.4530545", "0.45293358", "0.45278043", "0.45270827", "0.45245475", "0.45226774", "0.45211917", "0.4517646", "0.4512086", "0.45071387", "0.44964927", "0.44871116", "0.4484122", "0.4482177", "0.44736454", "0.44680515", "0.44677413" ]
0.49660677
28
Add text flow to current page Create new page if needed
public function addTextFlow($text = '', $width, $opts = array()) { $width = $width ?? $this->maxWidth; $opts = $opts ?? config_item('p'); $height = $opts['height'] ?? config_item('p')['height']; $font = $opts['font'] ?? config_item('p')['font']; $opts['row'] = $opts['row'] ?? config_item('p')['row']; $this->autoMargin($height, $opts); [$width, $height] = $this->autoResize($width, $height); if (array_key_exists('alignment', $opts)) { $crOpts = $font . " leading=120% alignment=" . $opts['alignment']; } else { $crOpts = $font . " leading=120% alignment=left"; } $tf = $this->pdf->create_textflow($text, $crOpts); if (array_key_exists('showborder', $opts)) { $fitOpts = $opts['showborder'] ? "showborder verticalalign=center firstlinedist=capheight lastlinedist=descender" : "verticalalign=center firstlinedist=capheight lastlinedist=descender"; } else { $fitOpts = "verticalalign=center firstlinedist=capheight lastlinedist=descender"; } if ($this->initBorder) { array_push($this->borderContent, array( 'text' => $text, 'opts' => $opts, 'width' => $width, 'height' => $height, 'tf' => $tf, 'fitOpts' => $fitOpts, 'x' => $this->cursorX, 'y' => $this->cursorY, )); } else { $this->pdf->fit_textflow($tf, $this->cursorX, $this->cursorY, ($this->cursorX + $width), ($this->cursorY + $height), $fitOpts); } $this->cursorX += $width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newPage()\n {\n $this->addPage();\n $this->variables['page'] = $this->pageNo();\n if ($this->templatePages > 0) {\n $templateIndex = $this->importPage(min($this->pageNo(), $this->templatePages));\n $this->useImportedPage($templateIndex);\n }\n\n $this->setXY($this->layout['pageNoX'], $this->layout['pageNoY']);\n $this->write(5, $this->t('page'));\n $this->setY($this->layout['contentMarginTopPX']);\n }", "public function add( $text ) {\n\t\t$this->page->append( $text );\n\t}", "public function prePageContent();", "function NewPage()\n {\n $ypos = $this->GetY();\n if ($ypos > 230){\n $this->AddPage();\n }\n }", "function insertPage()\n\t{\n\t\tglobal $ilCtrl, $lng;\n\t\t\n\t\tinclude_once(\"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php\");\n\t\t\n\t\t$num = ilChapterHierarchyFormGUI::getPostMulti();\n\t\t$node_id = ilChapterHierarchyFormGUI::getPostNodeId();\n\t\t\n\t\tif (!ilChapterHierarchyFormGUI::getPostFirstChild())\t// insert after node id\n\t\t{\n\t\t\t$parent_id = $this->tree->getParentId($node_id);\n\t\t\t$target = $node_id;\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t\t\t\t\t\t// insert as first child\n\t\t{\n\t\t\t$parent_id = $node_id;\n\t\t\t$target = IL_FIRST_NODE;\n\t\t}\n\n\t\tfor ($i = 1; $i <= $num; $i++)\n\t\t{\n\t\t\t$page = new ilLMPageObject($this->content_object);\n\t\t\t$page->setType(\"pg\");\n\t\t\t$page->setTitle($lng->txt(\"cont_new_page\"));\n\t\t\t$page->setLMId($this->content_object->getId());\n\t\t\t$page->create();\n\t\t\tilLMObject::putInTree($page, $parent_id, $target);\n\t\t}\n\n\t\t$ilCtrl->redirect($this, \"showHierarchy\");\n\t}", "function writePage($text) {\n //TODO: Write the text to the page.\n return 1;\n }", "function CreatePage($text)\n{\n\tglobal\t$FM_VERS;\n\n\techo \"<html>\";\n\techo \"<head>\";\n\techo \"</head>\";\n\techo \"<body>\";\n\techo nl2br($text);\n\techo \"<p><p><small>Your form submission was processed by formmail.php ($FM_VERS), available from <a href=\\\"http://www.tectite.com/\\\">www.tectite.com</a></small>\";\n\techo \"</body>\";\n\techo \"</html>\";\n}", "public function startNewPage()\n {\n }", "public function addPage()\n {\n $placements = array(\n array('id' => 'ads.leftbar.banner', 'name' => $this->translate->translate('Left Side')),\n array('id' => 'ads.rightbar.banner', 'name' => $this->translate->translate('Right Side'))\n );\n $this->putitem(\"placements\", $placements);\n\n $view_types = array(\n array('id' => 'serial', 'name' => 'Serial'),\n array('id' => 'carrousel', 'name' => 'Carroussel')\n );\n $this->putitem(\"view_types\", $view_types);\n\n parent::addPage();\n }", "function createPage();", "public function createContentAndCopyLivePage() {}", "private function content() {\n $this->checkPost();\n\n if (isset($_SESSION['CREATE'])) {\n\n switch ($_SESSION['CREATE']['page']) {\n case 0:\n $this->pageAgreement();\n break;\n case 1:\n $this->pageNameIntro();\n break;\n case 2:\n $this->pageMark();\n break;\n case 3:\n $this->pageFinal();\n break;\n default:\n echo '<h1>Error: Page Invalid<h1>';\n break;\n }\n\n }else\n echo '<h1>Error: Session invalid</h1>';\n }", "abstract protected function view_generatePageContent();", "function addPage()\n {\n // Reuse the atkAddHandler for the addPage.\n $handler = atknew(\"atk.handlers.atkaddhandler\");\n $handler->setNode($this->m_node);\n return $handler->invoke(\"addPage\");\n }", "function newPage()\n {\n $this->lastPageNumber ++;\n if ($this->lastPageNumber != 1)\n $this->documentBuffer .= \"<br clear=\\\"all\\\" style=\\\"page-break-before: always;\\\">\";\n return $this->lastPageNumber;\n }", "public function createPageAndCopyLiveParentPage() {}", "public function addTextflow($textflow, $title, $optlist = null);", "public function create()\n {\n //for the PAGE on which to create\n }", "private function nextPage() {\n $this->lastPage = array(\n \"vOffset\" => $this->vOffset,\n \"hOffset\" => $this->hOffset,\n );\n $footerToAppend = false;\n $this->currentPageNumber++;\n if (isset($this->pages[$this->currentPageNumber])) {\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = 0;\n } else {\n $this->pages[$this->currentPageNumber] = $this->haruDoc->addPage();\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->currentPage->setTextRenderingMode(\\HaruPage::FILL);\n $this->vOffset = $this->currentFontSize;\n $this->hOffset = ($this->hOffset ? $this->hOffset : 0);\n $footerToAppend = true;\n }\n if ($this->currentFont && $this->currentFontSize && $this->currentFontColor) {\n $this->currentPage->setFontAndSize($this->currentFont, $this->currentFontSize);\n $this->setColor($this->currentFontColor[0], $this->currentFontColor[1], $this->currentFontColor[2]);\n }\n if ($footerToAppend && $this->currentPageNumber > 1) {\n $this->currentPage->beginText();\n $this->setFont(self::FONT_NORMAL, 12, array(0,0,0));\n $this->currentPage->textOut($this->PAGE_WIDTH - self::HMARGIN - $this->currentPage->getTextWidth($this->currentPageNumber),\n self::VMARGIN - 30, $this->currentPageNumber);\n $this->revertFont();\n $this->setFont(self::FONT_BOLD, 12, array(0,0,0));\n $this->currentPage->textOut(self::HMARGIN,\n self::VMARGIN - 30, $this->currentBookName);\n $this->revertFont();\n $this->currentPage->endText();\n\n }\n\n }", "public function main()\n {\n $lang = $this->getLanguageService();\n // Access check...\n // The page will show only if there is a valid page and if this page may be viewed by the user\n $access = is_array($this->pageinfo) ? 1 : 0;\n // Content\n $content = '';\n if ($this->id && $access) {\n // Initialize permission settings:\n $this->CALC_PERMS = $this->getBackendUser()->calcPerms($this->pageinfo);\n $this->EDIT_CONTENT = $this->contentIsNotLockedForEditors();\n\n $this->moduleTemplate->getDocHeaderComponent()->setMetaInformation($this->pageinfo);\n\n // override the default jumpToUrl\n $this->moduleTemplate->addJavaScriptCode('jumpToUrl', '\n function jumpToUrl(URL,formEl) {\n if (document.editform && TBE_EDITOR.isFormChanged) { // Check if the function exists... (works in all browsers?)\n if (!TBE_EDITOR.isFormChanged()) {\n window.location.href = URL;\n } else if (formEl) {\n if (formEl.type==\"checkbox\") formEl.checked = formEl.checked ? 0 : 1;\n }\n } else {\n window.location.href = URL;\n }\n }\n ');\n $this->moduleTemplate->addJavaScriptCode('mainJsFunctions', '\n if (top.fsMod) {\n top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';\n top.fsMod.navFrameHighlightedID[\"web\"] = \"pages' . (int)$this->id . '_\"+top.fsMod.currentBank; ' . (int)$this->id . ';\n }\n ' . ($this->popView ? BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id)) : '') . '\n function deleteRecord(table,id,url) { //\n window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('tce_db') . '&cmd[')\n . ' + table + \"][\" + id + \"][delete]=1&redirect=\" + encodeURIComponent(url) + \"&prErr=1&uPT=1\";\n return false;\n }\n ');\n\n // Find backend layout / columns\n $backendLayout = GeneralUtility::callUserFunction(BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);\n if (!empty($backendLayout['__colPosList'])) {\n $this->colPosList = implode(',', $backendLayout['__colPosList']);\n }\n // Removing duplicates, if any\n $this->colPosList = array_unique(GeneralUtility::intExplode(',', $this->colPosList));\n // Accessible columns\n if (isset($this->modSharedTSconfig['properties']['colPos_list']) && trim($this->modSharedTSconfig['properties']['colPos_list']) !== '') {\n $this->activeColPosList = array_unique(GeneralUtility::intExplode(',', trim($this->modSharedTSconfig['properties']['colPos_list'])));\n // Match with the list which is present in the colPosList for the current page\n if (!empty($this->colPosList) && !empty($this->activeColPosList)) {\n $this->activeColPosList = array_unique(array_intersect(\n $this->activeColPosList,\n $this->colPosList\n ));\n }\n } else {\n $this->activeColPosList = $this->colPosList;\n }\n $this->activeColPosList = implode(',', $this->activeColPosList);\n $this->colPosList = implode(',', $this->colPosList);\n\n $content .= $this->getHeaderFlashMessagesForCurrentPid();\n\n // Render the primary module content:\n if ($this->MOD_SETTINGS['function'] == 1 || $this->MOD_SETTINGS['function'] == 2) {\n $content .= '<form action=\"' . htmlspecialchars(BackendUtility::getModuleUrl($this->moduleName, ['id' => $this->id, 'imagemode' => $this->imagemode])) . '\" id=\"PageLayoutController\" method=\"post\">';\n // Page title\n $content .= '<h1 class=\"t3js-title-inlineedit\">' . htmlspecialchars($this->getLocalizedPageTitle()) . '</h1>';\n // All other listings\n $content .= $this->renderContent();\n }\n $content .= '</form>';\n $content .= $this->searchContent;\n // Setting up the buttons for the docheader\n $this->makeButtons();\n // @internal: This is an internal hook for compatibility7 only, this hook will be removed without further notice\n if ($this->MOD_SETTINGS['function'] != 1 && $this->MOD_SETTINGS['function'] != 2) {\n $renderActionHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::class]['renderActionHook'];\n if (is_array($renderActionHook)) {\n foreach ($renderActionHook as $hook) {\n $params = [\n 'deleteButton' => $this->deleteButton,\n ''\n ];\n $content .= GeneralUtility::callUserFunction($hook, $params, $this);\n }\n }\n }\n // Create LanguageMenu\n $this->makeLanguageMenu();\n } else {\n $this->moduleTemplate->addJavaScriptCode(\n 'mainJsFunctions',\n 'if (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . (int)$this->id . ';'\n );\n $content .= '<h1>' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '</h1>';\n $view = GeneralUtility::makeInstance(StandaloneView::class);\n $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/InfoBox.html'));\n $view->assignMultiple([\n 'title' => $lang->getLL('clickAPage_header'),\n 'message' => $lang->getLL('clickAPage_content'),\n 'state' => InfoboxViewHelper::STATE_INFO\n ]);\n $content .= $view->render();\n }\n // Set content\n $this->moduleTemplate->setContent($content);\n }", "public function addPage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\n\t\t// Validation of $_POST. URL, title and template must exist and != false.\n\t\tif ($url && ($Page = $this->Automad->getPage($url))) {\n\t\n\t\t\t$subpage = Request::post('subpage');\n\n\t\t\tif (is_array($subpage) && !empty($subpage['title'])) {\n\t\t\n\t\t\t\t// Check if the current page's directory is writable.\n\t\t\t\tif (is_writable(dirname($this->getPageFilePath($Page)))) {\n\t\n\t\t\t\t\tCore\\Debug::log($Page->url, 'page');\n\t\t\t\t\tCore\\Debug::log($subpage, 'new subpage');\n\t\n\t\t\t\t\t// The new page's properties.\n\t\t\t\t\t$title = $subpage['title'];\n\t\t\t\t\t$themeTemplate = $this->getTemplateNameFromArray($subpage, 'theme_template');\n\t\t\t\t\t$theme = dirname($themeTemplate);\n\t\t\t\t\t$template = basename($themeTemplate);\n\t\t\t\t\t\n\t\t\t\t\t// Save new subpage below the current page's path.\t\t\n\t\t\t\t\t$subdir = Core\\Str::sanitize($title, true, AM_DIRNAME_MAX_LEN);\n\t\t\t\t\t\n\t\t\t\t\t// If $subdir is an empty string after sanitizing, set it to 'untitled'.\n\t\t\t\t\tif (!$subdir) {\n\t\t\t\t\t\t$subdir = 'untitled';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Add trailing slash.\n\t\t\t\t\t$subdir .= '/';\n\t\t\t\t\t\n\t\t\t\t\t// Build path.\n\t\t\t\t\t$newPagePath = $Page->path . $subdir;\n\t\t\t\t\t$suffix = FileSystem::uniquePathSuffix($newPagePath);\n\t\t\t\t\t$newPagePath = FileSystem::appendSuffixToPath($newPagePath, $suffix); \n\t\t\t\t\t\n\t\t\t\t\t// Data. Also directly append possibly existing suffix to title here.\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\tAM_KEY_TITLE => $title . ucwords(str_replace('-', ' ', $suffix)),\n\t\t\t\t\t\tAM_KEY_PRIVATE => (!empty($subpage['private']))\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tif ($theme != '.') {\n\t\t\t\t\t\t$data[AM_KEY_THEME] = $theme;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set date.\n\t\t\t\t\t$data[AM_KEY_DATE] = date('Y-m-d H:i:s');\n\t\t\t\t\t\n\t\t\t\t\t// Build the file name and save the txt file. \n\t\t\t\t\t$file = FileSystem::fullPagePath($newPagePath) . str_replace('.php', '', $template) . '.' . AM_FILE_EXT_DATA;\n\t\t\t\t\tFileSystem::writeData($data, $file);\n\t\t\t\t\t\n\t\t\t\t\t$output['redirect'] = $this->contextUrlByPath($newPagePath);\n\t\t\t\t\t\n\t\t\t\t\t$this->clearCache();\n\t\t\n\t\t\t\t} else {\n\t\t\t\n\t\t\t\t\t$output['error'] = Text::get('error_permission') . '<p>' . dirname($this->getPageFilePath($Page)) . '</p>';\n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t\t} else {\n\t\n\t\t\t\t$output['error'] = Text::get('error_page_title');\n\t\n\t\t\t}\t\n\t\n\t\t} else {\n\t\n\t\t\t$output['error'] = Text::get('error_no_destination');\n\t\n\t\t}\t\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "function add_page()\n\t{\n\t\tglobal $errors, $Cl_root_path, $basic_gui;\n\t\t\n\t\t// main check\n\t\tif ( !isset( $_POST[ 'submit_page' ] ) )\n\t\t{\n\t\t\t$errors->report_error( $this->lang[ 'Wrong_form' ], CRITICAL_ERROR );\n\t\t}\n\t\t\n\t\t// get data\n\t\t$title = ( isset( $_POST[ 'title' ] ) ) ? strval( $_POST[ 'title' ] ) : '';\n\t\t$lang = ( isset( $_POST[ 'language' ] ) ) ? strval( $_POST[ 'language' ] ) : '';\n\t\t$text = str_replace( '&nbsp;', ' ', $basic_gui->gennuline( ( isset( $_POST[ 'editor1' ] ) ) ? strval( $_POST[ 'editor1' ] ) : '' ) );\n\t\t$auth = ( isset( $_POST[ 'auth' ] ) ) ? intval( $_POST[ 'auth' ] ) : GUEST;\n\t\t\n// \t\t$text = str_replace( \"\\n\", '<br />', $text );\n\t\t\n\t\tif ( empty( $title ) || empty( $text ) )\n\t\t{ // need these\n\t\t\t$errors->report_error( $this->lang[ 'No_data' ], GENERAL_ERROR );\n\t\t}\n\t\t\n\t\t// save to the array\n\t\t$pag = array( 'content' => $text, 'auth' => $auth );\n\t\tif ( !is_array( $this->pages_array[ $lang ] ) )\n\t\t{ // make it an array, just to be sure\n\t\t\t$this->pages_array[ $lang ] = array();\n\t\t}\n\t\t$this->pages_array[ $lang ][ $title ] = $pag;\n\t\t\n\t\t// now write it\n\t\t$this->save_pages();\n\t\t\n\t\t$errors->report_error( $this->lang[ 'Added' ], MESSAGE );\n\t}", "public function createPage()\n {\n echo $this->output;\n }", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollection_add_list', array('content' => $content));\n }", "function createPage($name) {\n //Keep track of the new page's location.\n $location = $_SERVER['DOCUMENT_ROOT'] . \"/pages/\" . $name . \".php\";\n //Check to make sure the file doesn't already exist.\n if(file_exists($location)) {\n //If it does exist, just load into that page.\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }\n //Create a new php page in the pages folder.\n $newPage = fopen($location, \"w\");\n //Ensure that the user can write, and that anyone can read it.\n //If need be, put this in an \"if\" statement in case it throws an error.\n chmod($location, 0644);\n //Add the default stuff like header.php\n $defaultText = '<?php\n include ($_SERVER[\\'DOCUMENT_ROOT\\'] . \"/php/header.php\");\n?>\n<head>\n</head>\n<body id=\"body\" class=\"nested\">\n</body>';\n //Write the default text into the new page.\n fwrite($newPage, $defaultText);\n //Close editing\n fclose($newPage);\n //Load the new page\n header('Refresh: 0; URL = /pages/' . $name . '.php');\n }", "function createSpace()\t{\n\n\t\t// Change title on this\n\t\t$newTitle = trim(t3lib_div::_GP('title'));\n\t\tif($newTitle != \"\") {\n\n\t\t\t// Use the TCEmain for copying the template\n\t\t\t$tce = t3lib_div::makeInstance('t3lib_TCEmain');\n\t\t\t$tce->stripslashes_values = 0;\n\t\t\t$tce->copyTree = 4;\n\t\t\t$tce->copyWhichTables = \"*\";\n\t\t\t$cmd['pages'][$this->templateUid]['copy'] = -1 * $this->templateUid;\n\t\t\t$tce->start(array(), $cmd);\n\t\t\t$tce->process_cmdmap();\n\n\t\t\t// This is our new page\n\t\t\t$newPage = $tce->copyMappingArray_merged['pages'][$this->templateUid];\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery(\"pages\", \"uid='\" . $newPage . \"'\", array('title' => $newTitle, 'hidden' => 0));\n\t\t\t\n\t\t\tt3lib_BEfunc::getSetUpdateSignal('updatePageTree');\n\t\t\t\n\t\t\t// Redirect to edit mode\n\t\t\t$goTo = $this->doc->backPath . 'alt_doc.php?returnUrl=' . rawurlencode(t3lib_div::getIndpEnv(\"REQUEST_URI\"));\n\t\t\t$goTo .= '&edit[pages][' . $newPage . ']=edit';\n\n\t\t\t// All good: redirect to edit page\n\t\t\theader('Location: ' . $goTo);\n\t\t\texit();\n\t\t\t\n\t\t} else {\n\t\t\t $this->error[] = $GLOBALS['LANG']->getLL('titleError');\n\t\t\treturn false;\t\n\t\t}\n\n\t\t\n\t\t\n\t\treturn true;\n\t}", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollectionitem_add_list', array('content' => $content));\n }", "function appendPage($pageName, $newPageBody)\n{\n $newPageBody = trim($newPageBody);\n $sFile = getPagePath($pageName);\n if($newPageBody != \"\")\n {\n $f = fopen($sFile, \"at\");\n fwrite($f, \"\\n\\n\\n\\n\");\n fwrite($f, $newPageBody);\n fclose($f);\n }\n else\n {\n @unlink($sFile);\n }\n}", "private function AddNewPage(){\n try{\n // Updated Time\n $this -> _data['UpdatedTime'] = $GLOBALS['_NOW_'] -> clockDateTime;\n // Encrypt Password\n if (!empty($this -> _data['password'])){\n if ($this -> _data['password'] == \"^Delete\"){\n $this -> _data['password'] = \"\";\n }else{\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashKey($this -> _data['password']);\n $this -> _data['password'] = $GLOBALS['_Security'] -> HashEncryptedWithSalt($this -> _data['password']);\n }\n }\n $this -> db -> Insert('Function', $this -> _data, \"SELECT `FunctionName` FROM `Function` WHERE (`PageUrl` = :pageUrl OR `PageUrl` = :PageUrlIndex)\", \n array(\n \":pageUrl\" => $this -> _data['pageUrl'],\n \":PageUrlIndex\" => $this -> _data['pageUrl'].'/index'\n )\n );\n\n $lastId = $this -> db -> lastInsertId();\n\n $this -> db -> CreateObjectAcl('Function', $lastId, Cores\\_Session::Get('loggedUser') -> id);\n return true;\n }catch (\\Exception $e){\n return $e -> getMessage();\n }\n \n }", "public function hl_first_step()\n {\n $this->_hl_form_xoopsheadline();\n }", "public function createPage($fullText) {\n\n $fullTextWrap = wordwrap($fullText, 2200, '----', false);\n $pages = explode('----', $fullTextWrap); \n\n return $pages;\n }", "public function displayAction() {\r\n\r\n //GET THE TEXT STRING\r\n $text = $this->_getParam('text_string');\r\n\r\n //GET PAGE ID\r\n $page_id = $this->_getParam('page_id');\r\n\r\n $writesTable = Engine_Api::_()->getDbtable('writes', 'sitepage')->setWriteContent($page_id, $text);\r\n exit();\r\n }", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\n\t\n\t\t\t// Draw the header.\n\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t$this->doc->backPath = $BACK_PATH;\n\t\t$this->doc->form='<form action=\"\" method=\"POST\">';\n\n\t\t\t// JavaScript\n\t\t$this->doc->JScode = '\n\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\tscript_ended = 0;\n\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\tdocument.location = URL;\n\t\t\t\t}\n\t\t\t</script>\n\t\t';\n\t\t$this->doc->postCode='\n\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\tscript_ended = 1;\n\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t</script>\n\t\t';\n\n\t\t$headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.$LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path').': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50);\n\n\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t$this->content.=$this->doc->divider(5);\n\n\t\t// Render content:\n\t\t$this->moduleContent();\n\n\t\t// ShortCut\n\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));\n\t\t}\n\n\t\t$this->content.=$this->doc->spacer(10);\n\n\t}", "public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_host_add_list', array('content' => $content));\n }", "public function createContentAndCopyDraftPage() {}", "protected function setupPage() {}", "public function run()\n {\n PageContent::factory()->aboutUs()->state([\n 'content' => 'D\\'more Event Planner is an Event Planning Software is cutting-edge tool which will allow the client all the resources and visual aids for their event planning. They will be able to play with decoration themes, listen to theme music, design invitations, thank-you cards, and RSVP cards, use the interactive planning calendar, and much more. This software will bring your event into the millennium with cutting edge technology that is designed to save time and money.'\n ])->create();\n PageContent::factory()->aboutUs()->state([\n 'content' => 'We also provide a Step-by-Step Guide in preparation to your event which include a calendar to map out the event, a step-by-step guide on what is needed for and how to put together a successful, worry-free event, resource information, popular refreshments with recipes, games, and tips to put their event in the record books. The events available include birthdays for all ages, meetings, retreats, parties, vacations, and special occasion celebrations such as graduations, holidays, showers, weddings, and receptions.'\n ])->create();\n }", "public function createPageAndCopyDraftParentPage() {}", "public function addPage() {\r\n\t\t// add a page (required with recent versions of tcpdf)\r\n\t\t$this->tcpdf->AddPage();\r\n\t\treturn $this;\r\n\t}", "abstract protected function render_page_content(): void;", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\n\t\tif (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id))\t{\n\n\t\t\t// Draw the header.\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t$this->doc->form = '<form action=\"\" method=\"post\">';\n\n\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL) {\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = ' . intval($this->id) . ';\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br>\".$LANG->sL(\"LLL:EXT:lang/locallang_core.php:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n\t\t\t$this->content .= $this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content .= $this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section(\"\",$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,\"SET[function]\",$this->MOD_SETTINGS[\"function\"],$this->MOD_MENU[\"function\"])));\n\t\t\t$this->content .= $this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content .= $this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n\t\t\t}\n\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t} else {\n\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\t}", "public function addNewPage($data) \n {\n // Create new Page entity.\n $page = new Page();\n $page->setTitle($data['title']);\n $page->setContent($data['content']);\n $page->setStatus($data['status']);\n $currentDate = date('Y-m-d H:i:s');\n $page->setDateCreated($currentDate); \n \n // Add the entity to entity manager.\n $this->entityManager->persist($page);\n \n // Add tags to page\n $this->addTagsToPage($data['tags'], $page);\n \n // Apply changes to database.\n $this->entityManager->flush();\n }", "function displayPage()\n {\n $this->getState()->template = 'transition-page';\n }", "public function main()\n {\n // Produce browse-tree:\n $tree = $this->pagetree->getBrowsableTree();\n // Outputting page tree:\n $this->content .= $tree;\n\n $docHeaderButtons = $this->getButtons();\n\n $markers = array(\n 'IMG_RESET' => '',\n 'WORKSPACEINFO' => '',\n 'CONTENT' => $this->content,\n );\n\n // Build the <body> for the module\n $this->content = $this->doc->startPage(\n $this->getLanguageService()->sl(\n 'LLL:EXT:commerce/Resources/Private/Language/locallang_be.xml:mod_orders.navigation_title'\n )\n );\n\n $subparts = array();\n // Build the <body> for the module\n $this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markers, $subparts);\n $this->content .= $this->doc->endPage();\n $this->content = $this->doc->insertStylesAndJS($this->content);\n }", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t\t// Draw the header.\n\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t$this->doc->backPath = $BACK_PATH;\n\t\t$this->doc->form='<form action=\"\" method=\"POST\">';\n\n\t\t\t// JavaScript\n\t\t$this->doc->JScode = '\n\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\tscript_ended = 0;\n\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\tdocument.location = URL;\n\t\t\t\t}\n\t\t\t</script>\n\t\t';\n\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\t\tif (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))\t{\n\t\t\tif ($BE_USER->user['admin'] && !$this->id)\t{\n\t\t\t\t$this->pageinfo=array('title' => '[root-level]','uid'=>0,'pid'=>0);\n\t\t\t}\n\n\t\t\t$headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br>'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50);\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));\n\t\t\t$this->content.=$this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));\n\t\t\t}\n\t\t}\n\t\t$this->content.=$this->doc->spacer(10);\n\t}", "function main()\n {\n $this->page_id = 113;\n $this->get_text();\n $this->body .= \"<table cellpadding=5 cellspacing=1 border=0 width=\\\"100%\\\">\\n\";\n if (strlen(trim($this->messages[500021])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_title\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500021] . \"</td>\\n</tr>\\n\";\n }\n if (strlen(trim($this->messages[500022])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_message\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500022] . \"</td>\\n</tr>\\n\";\n }\n $this->body .= \"<tr>\\n\\t<td valign=top>\\n\\t\";\n if (!$this->browse_main()) {\n $this->browse_error();\n }\n $this->body .= \"</td>\\n</tr>\\n\";\n $this->body .= \"</table>\\n\";\n $this->display_page();\n return true;\n }", "function thumbwhere_contentcollection_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollection');\n return $controller->addPage();\n}", "public function addPage()\n\t{\n\t\tglobal $cfg;\n\t\t$data = $cfg['data'];\n\n\t\t// Load the content model\n\t\t$content = $this->load_model('Content');\n\n\t\t// Get all the available pages from database\n\t\t$pages[0] = '- New Page -'; \n\t\tforeach ($content->get_pages() as $key) \n\t\t{\n\t\t\t$pages[$key['id']] = $key['name'];\n\t\t}\n\n\t\t// Get all the available regions from the database\n\t\tforeach ($content->get_regions() as $key) {\n\t\t\t$regions[$key['id']] .= $key;\n\t\t}\n\n\t\t$form = new Form();\n\n\t\t$form->set_validate_rules(\"page\", \"Page name\", \"required\");\n\n\t\tif($form->validate())\n\t\t{\n\t\t\t$content = $this->load_model(\"Content\");\n\n\t\t\tif($_POST['page_id'] == 0)\n\t\t\t\t$content->insertPage();\n\t\t\telse\n\t\t\t\t$content->updatePage();\n\n\t\t\tredirect(\"content\");\n\t\t}\n\n\t\t$data['content']['main'] = \"<fieldset class='clearfix inline-block'><legend>New page</legend>\";\n\t\t$data['content']['main'] .= $form->start();\n\t\t$data['content']['main'] .= \"<lable>Parent page</lable>\";\n\t\t$data['content']['main'] .= $form->select($pages, array('style' => 'width:100%', 'name' => 'page_id'));\n\t\t$data['content']['main'] .= \"<lable>Page name</lable>\";\n\t\t$data['content']['main'] .= $form->input('text', array('style' => 'width:100%', 'name' => 'page'));\n\t\t$data['content']['main'] .= $form->input('submit', array('value' => 'Save', 'style' => 'width:100%'));\n\t\t$data['content']['main'] .= \"</form></fieldset>\";\n\t\t$data['content']['main'] .= $form->validate_error();\n\n\t\t$this->load_view('default', $data);\n\t}", "function pushHeadline ($text) {\n\t\t$this->_roof[\"cuerpo\"][] = $text;\n\t}", "public function process()\n\t{\n\t\t$this->_init();\n\t\tif ($this->_flow != PAGE_FLOW_NORMAL) {$this->process_flow(); return;}\n\n\t\t$this->_handle_forms();\n\t\tif ($this->_flow != PAGE_FLOW_NORMAL) {$this->process_flow(); return;}\n\n\t\t$this->_pre_render();\n\t\tif ($this->_flow != PAGE_FLOW_NORMAL) {$this->process_flow(); return;}\n\n\t\t$this->render();\n\t}", "public function createPage()\n {\n $this->currentPage++;\n $this->currentIndex++;\n $this->resetProps();\n /* Create page */\n if ($this->landscape) {\n // A4 format in Landscape orientation\n $this->pdf->begin_page_ext(0, 0, \"width=a4.height height=a4.width\");\n } else {\n // A4 format in Portrait orientation3.\n $this->pdf->begin_page_ext(0, 0, \"width=a4.width height=a4.height\");\n }\n empty($this->createPageTrigger) || call_user_func_array($this->createPageTrigger, $this->createPageTriggerArgs);\n }", "public function run()\n {\n StaticPage::create([\n \"label\" => StaticPageLabels::TERMS,\n 'en' => ['title' => 'Terms & Conditions', \"content\" => \"Content of the page is right here.\"],\n 'ar' => ['title' => 'الشروط والأحكام', \"content\" => \"محتوى صفحة الشروط هنا بالظبط.\"],\n ]);\n\n StaticPage::create([\n \"label\" => StaticPageLabels::PRIVACY,\n 'en' => ['title' => 'Privacy Policy', \"content\" => \"Content of the page is right here.\"],\n 'ar' => ['title' => 'سياسة الخصوصية', \"content\" => \"محتوى صفحة الخصوصية هنا بالظبط.\"],\n ]);\n\n }", "public function pageWithText($page, $text)\n {\n return '';\n }", "protected function getActivePageWrapper($text)\n {\n return '<li class=\"current\"><a>'.$text.'</a></li>';\n }", "public function appendOneLine($text) {\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n $this->currentPage->beginText();\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->currentPage->endText();\n return $text;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed)\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n\n return ($isLastLine ? null : $text);\n }", "public function main()\n {\n $records = array();\n\n $this->pObj->arrReport[] = '\n <h2>\n ' . $this->pObj->pi_getLL('ts_create_header') . '\n </h2>';\n\n $records = $this->page();\n $this->sqlInsert($records);\n }", "function AddPage($orientation=''){\n\t\t\tif($this->state==0) $this->Open();\n\t\t\t$family=$this->FontFamily;\n\t\t\t$style=$this->FontStyle.($this->underline ? 'U' : '');\n\t\t\t$size=$this->FontSizePt;\n\t\t\t$lw=$this->LineWidth;\n\t\t\t$dc=$this->DrawColor;\n\t\t\t$fc=$this->FillColor;\n\t\t\t$tc=$this->TextColor;\n\t\t\t$cf=$this->ColorFlag;\n\t\t\tif($this->page>0)\n\t\t\t{\n\t\t\t\t//Page footer\n\t\t\t\t$this->InFooter=true;\n\t\t\t\t$this->Footer();\n\t\t\t\t$this->InFooter=false;\n\t\t\t\t//Close page\n\t\t\t\t$this->_endpage();\n\t\t\t}\n\t\t\t//Start new page\n\t\t\t$this->_beginpage($orientation);\n\t\t\t//Set line cap style to square\n\t\t\t$this->_out('2 J');\n\t\t\t//Set line width\n\t\t\t$this->LineWidth=$lw;\n\t\t\t$this->_out(sprintf('%.2f w',$lw*$this->k));\n\t\t\t//Set font\n\t\t\tif($family)\t$this->SetFont($family,$style,$size);\n\t\t\t//Set colors\n\t\t\t$this->DrawColor=$dc;\n\t\t\tif($dc!='0 G') $this->_out($dc);\n\t\t\t$this->FillColor=$fc;\n\t\t\tif($fc!='0 g') $this->_out($fc);\n\t\t\t$this->TextColor=$tc;\n\t\t\t$this->ColorFlag=$cf;\n\t\t\t//Page header\n\t\t\t$this->Header();\n\t\t\t//Restore line width\n\t\t\tif($this->LineWidth!=$lw)\n\t\t\t{\n\t\t\t\t$this->LineWidth=$lw;\n\t\t\t\t$this->_out(sprintf('%.2f w',$lw*$this->k));\n\t\t\t}\n\t\t\t//Restore font\n\t\t\tif($family)\t$this->SetFont($family,$style,$size);\n\t\t\t//Restore colors\n\t\t\tif($this->DrawColor!=$dc)\n\t\t\t{\n\t\t\t\t$this->DrawColor=$dc;\n\t\t\t\t$this->_out($dc);\n\t\t\t}\n\t\t\tif($this->FillColor!=$fc)\n\t\t\t{\n\t\t\t\t$this->FillColor=$fc;\n\t\t\t\t$this->_out($fc);\n\t\t\t}\n\t\t\t$this->TextColor=$tc;\n\t\t\t$this->ColorFlag=$cf;\n\t\t}", "function lb_show_make_page() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'make_page',\n\t\t\t'pages' => lb_get_all_pages_from_pages(),\n\t\t)\n\t);\n}", "function main()\t{\n\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\n\t\tif (($this->id && $access) || ($BE_USER->user[\"admin\"] && !$this->id))\t{\n\n\t\t\t\t// Draw the header.\n\t\t\t$this->doc = t3lib_div::makeInstance(\"bigDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t$this->doc->form='<form action=\"index.php?id='.$this->id.'\" method=\"POST\">';\n\n\t\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode='\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader(\"pages\",$this->pageinfo,$this->pageinfo[\"_thePath\"]).\"<br />\".$LANG->sL(\"LLL:EXT:lang/locallang_core.xml:labels.path\").\": \".t3lib_div::fixed_lgd_pre($this->pageinfo[\"_thePath\"],50);\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\t\n\t\t\texec('hostname',$ret);\n\t\t\t$ret=implode(\"\",$ret);\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\") .\" on: $ret\");\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->section(\"\",$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,\"SET[function]\",$this->MOD_SETTINGS[\"function\"],$this->MOD_MENU[\"function\"])));\n\t\t\t$this->content.=$this->doc->divider(5);\n\n\n\t\t\t// Render content:\n\t\t\t$this->moduleContent();\n\n\n\t\t\t// ShortCut\n\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section(\"\",$this->doc->makeShortcutIcon(\"id\",implode(\",\",array_keys($this->MOD_MENU)),$this->MCONF[\"name\"]));\n\t\t\t}\n\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t} else {\n\t\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc = t3lib_div::makeInstance(\"mediumDoc\");\n\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t$this->content.=$this->doc->startPage($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->header($LANG->getLL(\"title\"));\n\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t}\n\t}", "function do_text_text_content($textid, $only_body=true): void\n{\n // Text settings\n $record = get_text_data($textid);\n $title = $record['TxTitle'];\n $langid = (int)$record['TxLgID'];\n $ann = $record['TxAnnotatedText'];\n $pos = $record['TxPosition'];\n \n // Language settings\n $record = get_language_settings($langid);\n $wb1 = isset($record['LgDict1URI']) ? $record['LgDict1URI'] : \"\";\n $wb2 = isset($record['LgDict2URI']) ? $record['LgDict2URI'] : \"\";\n $wb3 = isset($record['LgGoogleTranslateURI']) ? $record['LgGoogleTranslateURI'] : \"\";\n $textsize = $record['LgTextSize'];\n $removeSpaces = $record['LgRemoveSpaces'];\n $rtlScript = (bool)$record['LgRightToLeft'];\n \n // User settings\n $showAll = getSettingZeroOrOne('showallwords', 1);\n $showLearning = getSettingZeroOrOne('showlearningtranslations', 1);\n \n /**\n * @var int $mode_trans \n * Annotation position between 0 and 4\n */\n $mode_trans = (int) getSettingWithDefault('set-text-frame-annotation-position');\n /**\n * @var bool $ruby \n * Ruby annotations\n */\n $ruby = $mode_trans==2 || $mode_trans==4;\n\n if (!$only_body) {\n // Start the page with a HEAD and opens a BODY tag \n pagestart_nobody($title);\n }\n ?>\n <script type=\"text/javascript\" src=\"js/jquery.hoverIntent.js\" charset=\"utf-8\"></script>\n <?php \n $visit_status = getSettingWithDefault('set-text-visit-statuses-via-key');\n if ($visit_status == '') {\n $visit_status = '0';\n }\n $var_array = array(\n // Change globals from jQuery hover\n 'ANN_ARRAY' => json_decode(annotation_to_json($ann)),\n 'DELIMITER' => tohtml(\n str_replace(\n array('\\\\',']','-','^'), \n array('\\\\\\\\','\\\\]','\\\\-','\\\\^'), \n getSettingWithDefault('set-term-translation-delimiters')\n )\n ),\n 'WBLINK1' => $wb1,\n 'WBLINK2' => $wb2,\n 'WBLINK3' => $wb3,\n 'RTL' => $rtlScript,\n 'TID' => $textid,\n 'ADDFILTER' => makeStatusClassFilter((int)$visit_status),\n 'JQ_TOOLTIP' => getSettingWithDefault('set-tooltip-mode') == 2 ? 1 : 0,\n // Add new globals\n 'ANNOTATIONS_MODE' => $mode_trans,\n 'POS' => $pos\n );\n do_text_text_javascript($var_array);\n do_text_text_style($showLearning, $mode_trans, $textsize, strlen($ann) > 0);\n ?>\n\n <div id=\"thetext\" <?php echo ($rtlScript ? 'dir=\"rtl\"' : '') ?>>\n <p style=\"margin-bottom: 10px;\n <?php echo $removeSpaces ? 'word-break:break-all;' : ''; ?>\n font-size: <?php echo $textsize; ?>%; \n line-height: <?php echo $ruby?'1':'1.4'; ?>;\"\n >\n <!-- Start displaying words -->\n <?php main_word_loop($textid, $showAll); ?></span>\n </p>\n <p style=\"font-size:<?php echo $textsize; ?>%;line-height: 1.4; margin-bottom: 300px;\">&nbsp;</p>\n </div>\n <?php \n if (!$only_body) { \n pageend(); \n }\n flush();\n}", "function main()\t{\n\t\t\t\t\tglobal $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t\t\t\t// Access check!\n\t\t\t\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t\t\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);\n\t\t\t\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\t\t\t\t\n\t\t\t\t\tif (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id))\t{\n\n\t\t\t\t\t\t\t// Draw the header.\n\t\t\t\t\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t\t\t\t\t$this->doc->backPath = $BACK_PATH;\n\t\t\t\t\t\t$this->doc->form='<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\n\n\t\t\t\t\t\t\t// JavaScript\n\t\t\t\t\t\t$this->doc->JScode = '\n\t\t\t\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfunction confirmURL(text,URL){\n\t\t\t\t\t\t\t\t\tvar agree=confirm(text);\n\t\t\t\t\t\t\t\t\tif (agree) {\n\t\t\t\t\t\t\t\t\t\tjumpToUrl(URL);\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</script>\n\t\t\t\t\t\t';\n\t\t\t\t\t\t$this->doc->postCode='\n\t\t\t\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t';\n\n\t\t\t\t\t\t$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />'\n\t\t\t\t\t\t\t. $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);\n\n\t\t\t\t\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t\t\t\t$this->content.=$this->doc->section('',$this->doc->funcMenu($headerSection,t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'])));\n\t\t\t\t\t\t$this->content.=$this->doc->divider(5);\n\n\n\t\t\t\t\t\t// Render content:\n\t\t\t\t\t\t$this->moduleContent();\n\n\n\t\t\t\t\t\t// ShortCut\n\t\t\t\t\t\tif ($BE_USER->mayMakeShortcut())\t{\n\t\t\t\t\t\t\t$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// If no access or if ID == zero\n\n\t\t\t\t\t\t$this->doc = t3lib_div::makeInstance('mediumDoc');\n\t\t\t\t\t\t$this->doc->backPath = $BACK_PATH;\n\n\t\t\t\t\t\t$this->content.=$this->doc->startPage($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->header($LANG->getLL('title'));\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(5);\n\t\t\t\t\t\t$this->content.=$this->doc->spacer(10);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}", "function mongo_node_add_page() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('admin_block_content', array('content' => $content));\n}", "function newPage($pdf) {\r\n global $OrderId, $currentRow, $itemRowStart;\r\n\r\n $currentRow = $itemRowStart;\r\n\r\n $pdf->Addpage();\r\n $pdf->SetFont('Helvetica', 'B', 16);\r\n $pdf->Image('blissLogo.png');\r\n $pdf->Text(20, 43, \"OrderId:\");\r\n $pdf->Text(43, 43, $OrderId);\r\n $pdf->SetFont('Arial', 'I', 10);\r\n $pdf->SetY(266.5);\r\n $pdf->Cell(0, 10, 'Page ' . $pdf->PageNo(), 0, 0, 'C');\r\n $pdf->line( 12,245,190,245);\r\n$pdf->line( 12,267,190,267);\r\n\r\n \r\n}", "function showPage() \n\t{\n\t\t$this->xt->display($this->templatefile);\n\t}", "public function StartReport(){\n $this->AliasNbPages();\n $this->AddPage();\n $this->SetAutoPageBreak(true, 11);\n $this->SetTextColor(0);\n }", "function create(&$a_pg_obj, $a_hier_id, $a_pc_id = \"\")\n\t{\n\t\t$this->node = $this->createPageContentNode();\n\t\t$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);\n\t\t$this->tabs_node =& $this->dom->create_element(\"Tabs\");\n\t\t$this->tabs_node =& $this->node->append_child($this->tabs_node);\n\t}", "public function main(){\n $pdf = new PDF();\n $pdf->AliasNbPages();\n $pdf->AddPage();\n $pdf->SetFont('Times','',12);\n for($i=1;$i<=40;$i++){\n $pdf->Cell(0,10,'Printing line number '.$i,0,1);\n }\n\n // First page\n $html = 'You can now<np> easily print text mixing different styles: <b>bold</b>, <i>italic</i>,\n <u>underlined</u>, or <b><i><u>all at once</u></i></b>!<br><br>You can also insert links on\n text, such as <a href=\"http://www.fpdf.org\">www.fpdf.org</a>, or on an image: click on the logo.';\n\n $pdf->AddPage();\n $pdf->SetFont('Arial','',20);\n // $pdf->Write(5,\"To find out what's new in this tutorial, click \");\n // $pdf->SetFont('','U');\n // $link = $pdf->AddLink();\n // $pdf->Write(5,'here',$link);\n // $pdf->SetFont('');\n // // Second page\n // $pdf->AddPage();\n // $pdf->SetLink($link);\n // $pdf->Image('logo.png',10,12,30,0,'','http://www.fpdf.org');\n $pdf->SetLeftMargin(15);\n $pdf->SetFontSize(14);\n $pdf->WriteHTML($html);\n\n $pdf->Output();\n\n }", "public function addPage($app)\n\t{\n\t\t// check if te same title with dashes exists\n\t\t// if exists append 1 or 2 or whatever\n\t\t// the title added should be added as alias\n\t\t// the route should also be same as the title.\n\t\t// the content of the page should be added to a new file. if no content then just create a file\n\t\t// save draft only save the page \n\t\t// publish would display the page also\n\t\t\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\n\t\t$app->get('POST')['title'] = strtolower(str_replace(' ','-',$app->get('POST')['title']));\n\n\t\tif(!($cms_page->findIf(\"title = '{$app->get('POST')['title']}'\"))) {\n\n\t\t// \t$values = array_merge( $app->get('POST'), \n\t\t// \t\tarray(\n\t\t// \t\t\t'filename' => md5($app->get('POST')['title']),\n\t\t// \t\t\t'route' => '/'.strtolower($app->get('POST')['title'])\n\t\t// \t\t\t)\n\t\t// \t\t);\n\t\t\n\t\t// \t$added = $cms_page->addNew($values);\n\t\t\t\n\t\t// \tif($added) {\n\t\t// \t\tif(!file_exists($app->get('UI').\"website/\".$values['filename'].\".html\"))\n\t\t// \t\t\t$file = fopen($app->get('UI').\"website/\".$values['filename'].\".html\",\"w\");\n\t\t// \t\telse\n\t\t// \t\t\techo \"The File already exists\";\n\t\t// \t}\n\t\t// \tfclose($file);\n\t\t// }\n\t}\n\tpublic function showEditForm($app)\n\t{\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\t\t$cms_pages = $cms_page->getById($app->get('PARAMS.id'));\n\t\t$app->set('DATA',$cms_pages[0]);\n\n\t\t$app->set('CMS_PAGE',\\View::instance()->render('website/'.$app->get('DATA')['filename'].\".html\"));\n\n\t\t//echo $app->get('CMS_PAGE');\n\n\t\techo \\Template::instance()->render('admin/cms/editPage.html');\n\t}\n\tpublic function editPage($app)\n\t{\n\t// \t$cms_page = new CMS_PAGE($app->get('DB'));\n\t// \t$app->post\t\n\t}\n\tpublic function deletePage()\n\t{\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\t\t$cms_page->delete();\n\t}\n\tpublic function updatePage($app)\n\t{\n\t\t$cms_page = new CMS_PAGE($app->get('DB'));\n\t\t$updated = $cms_page->updateStatus($app->get('PARAMS'));\n\n\t\tif($updated)\n\t\t\t$app->reroute('@admin_cms');\n\t}\n\tpublic function __toString()\n\t{\n\t\treturn __CLASS__;\n\t}\n}", "public function run()\n {\n\n \t$login_page = new Content();\n \t$login_page->page = \"Login Page\";\n $login_page->value = '<h3 style=\"box-sizing: border-box; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; color: #8c0001; margin-top: 20px; margin-bottom: 10px; font-size: 14pt;\"><span style=\"font-family: verdana, geneva, sans-serif;\"><strong style=\"box-sizing: border-box;\">Vision</strong></span></h3>\n <p style=\"box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: Times New Roman; font-size: 14.6667px;\"><span style=\"font-family: verdana, geneva, sans-serif;\">An internationally accredited university dedicated to innovation and excellence in the service of God and country.</span></p>\n <h3 style=\"box-sizing: border-box; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; color: #8c0001; margin-top: 20px; margin-bottom: 10px; font-size: 14pt;\"><span style=\"font-family: verdana, geneva, sans-serif;\"><strong style=\"box-sizing: border-box;\">Mission</strong></span></h3>\n <p style=\"box-sizing: border-box; margin: 0px 0px 10px; color: #333333; font-family: Times New Roman; font-size: 14.6667px;\"><span style=\"font-family: verdana, geneva, sans-serif;\">The Lyceum of the Philippines University - Cavite, espousing the ideals of Jose P. Laurel, is committed to the following mission:</span></p>\n <ol style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; color: #333333; font-family: Times New Roman; font-size: 14.6667px;\">\n <li style=\"box-sizing: border-box;\"><span style=\"font-family: verdana, geneva, sans-serif;\">Advance and preserve knowledge by undertaking research and disseminating and utilizing the results. -&nbsp;<strong style=\"box-sizing: border-box;\">RESEARCH</strong></span></li>\n <li style=\"box-sizing: border-box;\"><span style=\"font-family: verdana, geneva, sans-serif;\">Provide equitable access to learning through relevant, innovative, industry-based and environment-conscious programs and services in the context of nationalism and internationalism. -&nbsp;<strong style=\"box-sizing: border-box;\">INSTRUCTION</strong>&nbsp;and&nbsp;<strong style=\"box-sizing: border-box;\">QUALITY SERVICES</strong></span></li>\n <li style=\"box-sizing: border-box;\"><span style=\"font-family: verdana, geneva, sans-serif;\">Provide necessary knowledge and skills to meet entrepreneurial development and the managerial requirements of the industry. -&nbsp;<strong style=\"box-sizing: border-box;\">INSTRUCTION</strong></span></li>\n <li style=\"box-sizing: border-box;\"><span style=\"font-family: verdana, geneva, sans-serif;\">Establish local and international linkages that will be the source of learning and growth of the members of academic community. -&nbsp;<strong style=\"box-sizing: border-box;\">INSTRUCTION</strong>&nbsp;and&nbsp;<strong style=\"box-sizing: border-box;\">INSTITUTIONAL</strong><strong style=\"box-sizing: border-box;\">DEVELOPMENT</strong></span></li>\n <li style=\"box-sizing: border-box;\"><span style=\"font-family: verdana, geneva, sans-serif;\">Support a sustainable community extension program and be a catalyst for social transformation and custodian of Filipino culture and heritage. -&nbsp;<strong style=\"box-sizing: border-box;\">COMMUNITY EXTENSION</strong></span></li>\n <li style=\"box-sizing: border-box;\"><span style=\"font-family: verdana, geneva, sans-serif;\">Build a community of God-centered, nationalistic, environment conscious, and globally competitive professionals with wholesome values and attitudes. -&nbsp;<strong style=\"box-sizing: border-box;\">PROFESSIONALISM</strong>&nbsp;and&nbsp;<strong style=\"box-sizing: border-box;\">VALUES</strong></span></li>\n </ol>';\n $login_page->save();\n\n\n\n\n $home_page = new Content();\n $home_page->page = \"Home\";\n $home_page->value = \"Welcome to Student Affairs Office Home Page!\";\n $home_page->save();\n\n\n\n\n $error_401 = new Content();\n $error_401->page = \"401\"; \n $error_401->value = '<div class=\"middle-box text-center animated fadeInDown\">\n <h1 style=\"box-sizing: border-box; margin: 20px 0px 10px; font-size: 170px; font-family: open sans, Helvetica Neue, Helvetica, Arial, sans-serif; font-weight: 100; line-height: 1.1; color: #676a6c; text-align: center; background-color: #f3f3f4;\">401</h1>\n <h3 class=\"font-bold\" style=\"box-sizing: border-box; font-family: open sans, Helvetica Neue, Helvetica, Arial, sans-serif; line-height: 1.1; color: #676a6c; margin-top: 5px; margin-bottom: 10px; font-size: 16px; text-align: center; background-color: #f3f3f4;\">401 - Unauthorized: Access Denied!</h3>\n <div class=\"error-desc\" style=\"box-sizing: border-box; color: #676a6c; font-family: open sans, Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; text-align: center; background-color: #f3f3f4;\">You do not have permission to view this directory or page!</div>\n </div>';\n\n $error_401->save();\n\n\n $error_404 = new Content();\n $error_404->page = \"404\"; \n $error_404->value = '<div class=\"middle-box text-center animated fadeInDown\">\n <h1 style=\"box-sizing: border-box; margin: 20px 0px 10px; font-size: 170px; font-family: open sans, Helvetica Neue, Helvetica, Arial, sans-serif; font-weight: 100; line-height: 1.1; color: #676a6c; text-align: center; background-color: #f3f3f4;\">404</h1>\n <h3 class=\"font-bold\" style=\"box-sizing: border-box; font-family: open sans, Helvetica Neue, Helvetica, Arial, sans-serif; line-height: 1.1; color: #676a6c; margin-top: 5px; margin-bottom: 10px; font-size: 16px; text-align: center; background-color: #f3f3f4;\">Page Not Found</h3>\n <div class=\"error-desc\" style=\"box-sizing: border-box; color: #676a6c; font-family: open sans, Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px; font-weight: normal; text-align: center; background-color: #f3f3f4;\">Sorry, but the page you are looking for has not been found. Try checking the URL for errors, then hit the refresh button on your browser.</div>\n</div>';\n$error_404->save();\n}", "private function markCurrentPage() {\n $this->pageReloadMarker = $this->randomMachineName();\n $this->getSession()->executeScript('document.body.appendChild(document.createTextNode(\"' . $this->pageReloadMarker . '\"));');\n }", "public function run()\n {\n \tStaticPage::truncate();\n\t\tStaticPage::create([\n\t\t\t'page_name' => 'About Us',\n\t\t\t'status' => '1'\n\t\t]);\t\n \t\n StaticPage::create([\n 'page_name' => 'T&C',\n 'status' => '1'\n ]);\n }", "public function render()\n {\n if ('FE' === TYPO3_MODE) {\n $content = $this->renderChildren();\n if (!empty($content)) {\n $content = trim($content);\n if ($this->getTypoScriptFrontendController() !== null) {\n $this->getTypoScriptFrontendController()->indexedDocTitle = $content;\n $this->getTypoScriptFrontendController()->page['title'] = $content;\n $this->getTypoScriptFrontendController()->altPageTitle = $content;\n }\n }\n }\n }", "public function tab(string $text)\n {\n $this->minkContext->assertPageContainsText($text);\n }", "public function run()\n {\n Page::create([\n 'title' => 'Front Page',\n 'content' => '\n <p>Platanus is an established hotel in Barrio Barretto that offers leisure and recreation\n within the hustle of Barretto, Olongapo City. Only 10 minutes away from the bars and\n restaurants that offer a broad selection of diverse cuisines from all over the world. </p>\n\n <p>The hotel ensures guests comfort and gives them the quality service. With 9 spacious air-conditioned rooms,\n among the amenities offered are complimentary Wi-Fi access, non-smoking rooms, cable TV, air-conditioned rooms,\n private bathroom with hot and cold water, some rooms have access to a balcony.</p>\n\n <p>Take a breather in the hotel\\'s incredible facilities like an outdoor swimming pool, fitness center, massage, and garden area where you can sit back and laze.</p>\n <p>Hotel Platanus is an excellent choice for quality accommodation in Barretto for daily and long term stay.</p>',\n ]);\n\n Page::create([\n 'title' => 'Side Description',\n 'content' => '<p>Set in Clark, 32 km from Mount Pinatubo, Platanus Hotel features an outdoor swimming pool.\n Featuring a restaurant, the property also has a garden. The property offers a 24-hour front desk. </p>',\n ]);\n }", "public function intro_tour() {\n\t\tglobal $pagenow;\n\n\t\t$page = preg_replace( '/^(formidable[-]?)/', '', filter_input( INPUT_GET, 'page' ) );\n\n\t\tif ( 'admin.php' === $pagenow && array_key_exists( $page, $this->admin_pages ) ) {\n\t\t\t$this->do_page_pointer( $page );\n\t\t} else {\n\t\t\t$this->start_tour_pointer();\n\t\t}\n\t}", "function ins_pagebreak()\n\t{\n\t\t// Create the view\n\t\t$view = & $this->getView( 'article', 'html' );\n\n\t\t// Set the layout\n\t\t$view->setLayout( 'pagebreak' );\n\n\t\t// Display the view\n\t\t$view->display();\n\n\t}", "public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}", "public function createNestedPagesAndCopyLiveParentPage() {}", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->fixHTML5();\n $output .= $this->registerCustomResources();\n $output .= '</head><body>';\n echo $output;\n }", "public function createPage(string $text, ?EditInfo $editInfo = null): bool\n {\n if (!empty($this->page->getRevisions()->getLatest())) {\n throw new Exception('That page already exists');\n }\n\n $newContent = new Content($text);\n // $identifier = $this->page->getPageIdentifier()\n $title = new Title($this->title);\n $identifier = new PageIdentifier($title);\n $revision = new Revision($newContent, $identifier);\n\n return $this->wiki->newRevisionSaver()->save($revision, $editInfo);\n }", "public function indexTypo3PageContent() {}", "function addPageContent(& $page, & $parentElement) {\n\t\t$element = $parentElement->appendChild(\n\t\t\t$this->_document->createElement('pageContent'));\n\t\t\n\t\t$this->addCommonProporties($page, $element);\n\t\t\n\t\t$textElement = $element->appendChild($this->_document->createElement('text'));\n\t\t$textElement->appendChild(\n\t\t\t$this->_document->createCDATASection(urldecode($page->getField('text'))));\n\t\t\n\t\tif ($page->getField('location') == 'right')\n\t\t\t$element->setAttribute('location', 'right');\n\t\telse\n\t\t\t$element->setAttribute('location', 'left');\n\t}", "public function initializePage()\n {\n // Set the font.\n $this->AddFont('MTCORSVA', '', 'MTCORSVA.php');\n $this->SetFont('MTCORSVA', '', 18);\n\n // Line break.\n $this->Ln(9);\n\n $this->Cell(259, 30, 'This certificate is presented to', 0, 0, 'C');\n\n // Set the font.\n $this->AddFont('BebasNeue-Regular', '', 'BebasNeue-Regular.php');\n $this->SetFont('BebasNeue-Regular', '', 30);\n\n // Line break.\n $this->Ln(10);\n\n // Set page header title.\n $this->Cell(259, 35, $this->aScheduleDetails['studentName'], 0, 0, 'C');\n\n // Line break.\n $this->Ln(1);\n\n $this->Cell(259, 35, '____________________________________', 0, 0, 'C');\n }", "private function setupPage ()\n {\n $output = '<!DOCTYPE html><html lang=\"en\"><head>';\n $output .= $this->setCharacterEncoding();\n $output .= $this->setPageTitle();\n $output .= $this->setBasePath();\n $output .= $this->registerResource('css', $this->cssResource);\n $output .= $this->registerResource('js', $this->jsResource);\n $output .= $this->fixHTML5();\n $output .= '</head><body>';\n echo $output;\n }", "public function drawPage()\n\t\t{\n\t\t}", "function page_generatePage($page_id=0,$offset=0,$extravars=array()) {\n\tglobal $Auth,$input_language,$previewMode;\n\n\t## prepare the multiclient support\n\t$client_id = $Auth->auth[\"client_id\"];\t\n\n\t## get the page info- and the homepage if we don't have a page\n\t$pageInfo = frontend_getPageInfo($page_id,$client_id);\n\t$page_id \t\t= intval($pageInfo[\"page_id\"]);\n\t$menu_id \t\t= isset($pageInfo[\"id\"]) ? $pageInfo[\"id\"] : 0;\t\t\n\t$template_id\t= $pageInfo[\"template_id\"];\n\n\t## try to fetch the cached scaffold page\n\t$cached_scaffold = pagecache_getCacheFile($page_id);\n\n\t## check if we have a scaffold\n\tif($cached_scaffold === false) {\n\t\t## we need to create a new scaffold file\n\t\t$cached_scaffold = page_generateScaffold($pageInfo,$offset,$extravars);\n\t}\n\t\t\t\n\t$dbConnection = new DB_Sql();\n\t\t\t\t\n\t## grab the information for this page\n\t$select_query = \"SELECT basename FROM \".PAGE_TEMPLATE.\" WHERE template_id='$template_id' AND client_id='$client_id'\";\n\t$result_pointer = $dbConnection->query($select_query);\n\t\n\tif($dbConnection->next_record()) {\n\t\t$filename = $dbConnection->Record[\"basename\"];\n\t\t$xmlFile = $filename.\".xml\";\n\t\t$filename = $filename.\".tpl\";\n\t} else {\n\t\t## maybe we can come with some good default behavior\n\t\texit();\n\t}\n\n\t## for the body we need to examine the xml file- to find out \n\t## what type of form elements we need to position\n\t$wt = new xmlparser(HTML_DIR.$xmlFile);\n\t$wt->parse();\n\t\n\t## okay we scanned in the xml file- so we now loop through all the elements\n\t$elements = $wt->getCacheElements();\t\n\t$objects = $wt->getCacheObjects();\t\n\t\n\t## we should get the page content\n\t$page_record = page_getPage($page_id,$objects);\n\t\n\t$counter = 0;\n\t$num_elements = count($elements);\n\t\n\twhile($counter < $num_elements) {\n\t\t## okay first we try to find out what type we have\n\t\t## we wrap this up in a switch statemnt- this way we can extend it more easily\n\t\t$element_type = $elements[$counter]['TYPE'];\n\t\t$element_name = $elements[$counter]['NAME'];\t\n\t\tswitch($element_type) {\n\t\t\tcase 'TEXT':\n\t\t\tcase 'COPYTEXT':\n\t\t\tcase 'DATE': \n\t\t\tcase 'LINK' :\n\t\t\tcase 'FILE':\n\t\t\tcase 'IMAGE': \n\t\t\tcase 'LINKLIST': \n\t\t\tcase 'BOX':\n\t\t\t\t## get the data and set the var in the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\teval(\"\\$element = output_\".$target.\"(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,$page_id);\");\t\n\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\n\t\t\tcase 'INCLUDE' : {\n\t\t\t\t## basically we need to call the function output_\"element_type\"\n\t\t\t\t## and the output the results to the template\n\t\t\t\t$target = strtolower($element_type); \n\t\t\t\t\n\t\t\t\teval(\"\\$element = output_\".$target.\"('',\\$elements[\\$counter],$menu_id,$page_id);\");\n\t\t\t\t\n\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t$varvals = array();\n\t\t\t\t\n\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t}\t\t\t\t\n\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t} else {\n\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t$varvals[$element_name] = $element; \t\t\t\t\n\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\t\t\t\n\t\t\tdefault: {\n\t\t\t\t## we need to check if we have a module for this datatype\n\t\t\t\t$target = strtolower($element_type);\n\t\t\t\t\n\t\t\t\t## first we try to include the apropriate file \n\t\t\t\t@include_once(\"datatypes/extra_\".$target.\"/\".$target.\".php\");\n\t\t\t\t## now we check if the function exists\n\t\t\t\t\n\t\t\t\tif(function_exists($target.\"_output\")) {\n\t\t\t\t\t## no we call the function\n\t\t\t\t\t## check if the page_record entry is defined\n\t\t\t\t\t## if not we need to pass the whole record\n\t\t\t\t\tif(isset($page_record[$element_name])) {\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record[\\$element_name],\\$elements[\\$counter],$menu_id,\\$page_id);\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t##var_dump(eval();\n\t\t\t\t\t\teval(\"\\$element = \".$target.\"_output(\\$page_record,\\$elements[\\$counter],\\$layout_template,\\$menu_id,\\$page_id);\");\n\t\t\t\t\t}\t\n\t\t\t\n\t\t\t\t\tif(is_array($element)) {\n\t\t\t\t\t\t$varkeys = array();\n\t\t\t\t\t\t$varvals = array();\n\t\t\t\t\t\n\t\t\t\t\t\tforeach ($element as $varname => $value) {\t\t\n\t\t\t\t\t\t\t$varkeys[$varname] = \"{\".$varname.\"}\";\n\t\t\t\t\t\t\t$varvals[$varname] = $value; \n\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$varkeys[$element_name] = \"{\".$element_name.\"}\";\n\t\t\t\t\t\t$varvals[$element_name] = $element; \t\n\t\t\n\t\t\t\t\t\t$cached_scaffold = @str_replace($varkeys, $varvals, $cached_scaffold);\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$counter++;\n\t}\n\n\t## finally strip all empty tags\n\t$cached_scaffold = preg_replace('/{[^ \\t\\r\\n}]+}/', \"\", $cached_scaffold); \n\n\t## this is it- so we will flush the template here\t\t\n\treturn $cached_scaffold;\n}", "public function writePage()\n\t{\n\t\t$this->SetHeaderMargin(5);\n\t\t$this->SetFooterMargin(30);\n if($this->PageNo() > 1) {\n } else {\n }\n\t\t$this->AddPage('','',true);\n// $t = $this->getCellMargins();\n// var_dump($t);\n $this->setCellPaddings(0,0,0,0);\n\n\t\t$this->writeHTML($this->content, true, false, true, false, '');\n\t}", "function renderHtmlAdd($page = null)\n {\n $themeConfig = $this->getTheme()->getConfig($this->config('loader.base_dir'));\n if (!$page) {\n $page = new Contener_Node();\n }\n \n if ($template = $page->template) {\n if (isset($themeConfig['templates']) && isset($themeConfig['templates'][$template]) && isset($themeConfig['templates'][$template]['slots'])) {\n $slots = $themeConfig['templates'][$template]['slots'];\n if (isset($themeConfig['templates'][$template]['is_open']) && $themeConfig['templates'][$template]['is_open']) {\n $page->getSlotManager()->addSlots($slots);\n } else {\n $page->getSlotManager()->setSlots($slots);\n }\n }\n }\n \n $theme = $this->getTheme();\n \n $this->context->area('right')->addModule('', $this->getService('view')->render(\n 'page_edit_publish', \n array('context' => $page, 'theme' => $theme, 'show_template' => false))\n );\n \n return $this->getService('view')->render(\n 'page_add',\n array('context' => $this, 'page' => $page, 'list' => $this->repository->listAll('flat'), 'theme' => $theme)\n );\n }", "function thumbwhere_contentcollectionitem_add_page() {\n $controller = entity_ui_controller('thumbwhere_contentcollectionitem');\n return $controller->addPage();\n}", "function tpl_add_content()\n\t{\n\t\treturn true;\n\t}", "public function perform()\n {\n // init template array to fill with node data\n $this->viewVar['title'] = '';\n // Init template form field values\n $this->viewVar['error'] = array();\n\n $this->viewVar['htmlTitle'] .= ' Add new simple text';\n\n $addtext = $this->httpRequest->getParameter('addtext', 'post', 'alnum');\n $cancel = $this->httpRequest->getParameter('cancel', 'post', 'alpha');\n\n if(false !== $cancel)\n {\n $this->router->redirect($this->viewVar['adminWebController'].'/mod/default/cntr/advancedMain');\n }\n\n\n // add node\n if( !empty($addtext) )\n {\n if(false !== ($id_text = $this->addText()))\n {\n $this->router->redirect($this->viewVar['adminWebController'].'/mod/misc/cntr/editText/id_text/'.$id_text);\n }\n }\n }", "protected function runtimeProcessTemplate()\n\t{\n\t// Here we grab the theme to get the javascript and css include file.\n\t\t$theme = new Theme($this->theme);\n\t\t$this->addJSInclude($theme->getUrl('js'));\n\t\t$this->addCssInclude($theme->getUrl('css'));\n\n\t\t$this->preStartupJs[] = 'var baseUrl = ' . json_encode(ActiveSite::getLink()) . ';';\n\n\t\tif(isset($this->menuObjects))\n\t\t\tforeach($this->menuObjects as $name => $menuDisplay)\n\t\t{\n\t\t\t$this->addRegion($name, $menuDisplay->makeDisplay());\n\t\t}\n\n\t// This line ensures that any additional content we add below that requires a fully-functional system doesn't\n\t// choke the installer.\n\t\tif(defined('INSTALLMODE') && INSTALLMODE) return true;\n\n\t// Add the messages to the page.\n\t\tif(count($this->messages) > 0)\n\t\t{\n\t\t\t$outputMessage = new HtmlObject('div');\n\t\t\t$outputMessage->addClass('messageContainer');\n\n\t\t\tforeach($this->messages as $message)\n\t\t\t{\n\t\t\t\t$outputMessage->insertNewHtmlObject('div')->wrapAround($message);\n\t\t\t}\n\t\t\t$this->addRegion('messages', (string) $outputMessage);\n\t\t}\n\t}", "public function moveContentAndCopyLivePage() {}", "protected function makePage() {\n // \n // get the user's constituency\n // \n // get the candidates for this election in this constituency\n // \n // make the page output\n }", "function myText(){\n\t\n\n\techo '<h1>before subForums</h1>';\n\t\n\n}", "function training_page_html() {\n return t('This is the landing page of the Training module');\n}", "public function createParsePage()\n {\n add_submenu_page(\n null,\n __('Import events', 'hbg-event-importer'),\n __('Import events', 'hbg-event-importer'),\n 'edit_posts',\n 'import-events',\n function () {\n new \\HbgEventImporter\\Parser\\Xcap('http://kulturkortet.se/calendar/listEvents.action?month=&date=&categoryPermaLink=&q=&p=&feedType=ICAL_XML');\n echo '<script>location.href = \"' . admin_url('edit.php?post_type=event&msg=import-complete') . '\";</script>';\n }\n );\n }", "public function start_display ()\n {\n $this->display_doc_type ();\n\n $opts = $this->page->template_options;\n if ($opts->css_class)\n {\n?>\n<html class=\"<?php echo $opts->css_class; ?>\" lang=\"<?php echo $opts->language; ?>\">\n<?php\n }\n else\n {\n?>\n<html lang=\"<?php echo $opts->language; ?>\">\n<?php\n }\n?>\n <head>\n <?php\n $this->display_head ();\n ?>\n </head>\n <body>\n<?php\n\n $this->_start_body ();\n }", "function menuFlow() {\n\t\tincludeFile('templates/mainmenu');\n\t\techo PHP_EOL;\n\t}", "public function main() {\r\n // Access check!\r\n // The page will show only if there is a valid page and if this page may be viewed by the user\r\n $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);\r\n $access = is_array($this->pageinfo) ? 1 : 0;\r\n\r\n if (($this->id && $access) || ($GLOBALS['BE_USER']->user['admin'] && !$this->id)) {\r\n\r\n // Draw the header.\r\n $this->doc = t3lib_div::makeInstance('bigDoc');\r\n $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('medbootstraptools').'res/css/bemodul.css'); \r\n $this->doc->getPageRenderer()->addCssFile(t3lib_extMgm::extRelPath('medbootstraptools').'res/bootstrap/css/bootstrap.min.css'); \r\n $this->doc->backPath = $GLOBALS['BACK_PATH'];\r\n $this->doc->form = '<form action=\"\" method=\"post\" enctype=\"multipart/form-data\">';\r\n\r\n // JavaScript\r\n $this->doc->JScode = '\r\n <script src=\"../typo3conf/ext/medbootstraptools/res/js/jquery-1.8.3.min.js\"></script>\r\n <script src=\"../typo3conf/ext/medbootstraptools/res/js/functions.js\"></script>\r\n <script language=\"javascript\" type=\"text/javascript\">\r\n script_ended = 0;\r\n function jumpToUrl(URL) {\r\n document.location = URL;\r\n }\r\n </script>\r\n ';\r\n $this->doc->postCode = '\r\n <script language=\"javascript\" type=\"text/javascript\">\r\n script_ended = 1;\r\n if (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\r\n </script>\r\n ';\r\n\r\n $headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />'\r\n . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);\r\n\r\n $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));\r\n //$this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));\r\n //$this->content .= $this->doc->spacer(5);\r\n //$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));\r\n //$this->content .= $this->doc->divider(5);\r\n // Render content:\r\n $this->moduleContent();\r\n\r\n // Shortcut\r\n if ($GLOBALS['BE_USER']->mayMakeShortcut()) {\r\n $this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));\r\n }\r\n\r\n $this->content .= $this->doc->spacer(10);\r\n } else {\r\n // If no access or if ID == zero\r\n\r\n $this->doc = t3lib_div::makeInstance('bigDoc');\r\n $this->doc->backPath = $GLOBALS['BACK_PATH'];\r\n\r\n $this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));\r\n $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));\r\n $this->content .= $this->doc->spacer(5);\r\n $this->content .= $this->doc->spacer(10);\r\n }\r\n }", "private function buildIntroBlock(): void\n {\n //====================================================================//\n // Into Text Block\n $this->blocksFactory()\n ->addTextBlock(\"This is a Demo Text Block!!\".\"You can repeat me as much as you want!\");\n }" ]
[ "0.6709253", "0.6454611", "0.6330416", "0.63057053", "0.62497276", "0.6245879", "0.61651427", "0.61018074", "0.6052998", "0.6025047", "0.59374166", "0.59257764", "0.59197474", "0.5911379", "0.58823156", "0.58658105", "0.5863373", "0.584339", "0.5829333", "0.5827263", "0.5824385", "0.58217883", "0.5792172", "0.57529306", "0.5730828", "0.56881887", "0.5670507", "0.5638782", "0.5637522", "0.5635088", "0.5634095", "0.5626695", "0.5620749", "0.56017274", "0.55723464", "0.55548024", "0.55515796", "0.55005777", "0.5494396", "0.54790205", "0.54774046", "0.54696286", "0.5460553", "0.5451891", "0.5438328", "0.54348004", "0.5423219", "0.5418612", "0.5414535", "0.5404024", "0.54010516", "0.53967327", "0.5393444", "0.5385851", "0.53821325", "0.5377106", "0.536234", "0.53579015", "0.5356862", "0.5349435", "0.5348978", "0.53477687", "0.5341258", "0.53396636", "0.5331107", "0.53206664", "0.5313913", "0.5305984", "0.5301466", "0.5298835", "0.5298313", "0.52948195", "0.52915585", "0.5286866", "0.52777666", "0.5275947", "0.5270507", "0.5269201", "0.5268787", "0.5267695", "0.52667946", "0.52598494", "0.5257634", "0.5242824", "0.5237476", "0.52358246", "0.5234414", "0.5222276", "0.5218149", "0.5217282", "0.5214895", "0.52126455", "0.52044517", "0.52031046", "0.5202325", "0.51939553", "0.51911616", "0.5185822", "0.5184725", "0.5179106", "0.51789975" ]
0.0
-1